Warning, /office/kile/doc/index.docbook is written in an unsupported language. File is not indexed.
0001 <?xml version="1.0" ?> 0002 <!DOCTYPE book PUBLIC "-//KDE//DTD DocBook XML V4.5-Based Variant V1.1//EN" "dtd/kdedbx45.dtd" [ 0003 <!ENTITY kile "<application>Kile</application>"> 0004 <!ENTITY latex "L<superscript>A</superscript>T<subscript>E</subscript>X"> 0005 <!ENTITY pdflatex "PDFL<superscript>A</superscript>T<subscript>E</subscript>X"> 0006 <!ENTITY tex "T<subscript>E</subscript>X"> 0007 <!ENTITY tetex "<application>teT<subscript>E</subscript>X</application>"> 0008 <!ENTITY texlive "<application>TeX Live</application>"> 0009 <!ENTITY bibtex "BibT<subscript>E</subscript>X"> 0010 <!ENTITY makeindex "makeindex"> 0011 <!ENTITY kbibtex "KBibT<subscript>E</subscript>X"> 0012 <!ENTITY kbib "KBib"> 0013 <!ENTITY asymptote "Asymptote"> 0014 <!ENTITY imagemagick "<application>ImageMagick</application>"> 0015 <!ENTITY dvipng "<application>dvipng</application>"> 0016 <!ENTITY makeidx "<application>makeidx</application>"> 0017 <!ENTITY cjk "<abbrev>CJK</abbrev>"> 0018 <!ENTITY ucs "<abbrev>ucs</abbrev>"> 0019 <!ENTITY % addindex "IGNORE"> 0020 <!ENTITY % English "INCLUDE"> 0021 <!ENTITY javascript "<application>JavaScript</application>"> 0022 <!ENTITY include-section-scripting SYSTEM "scripting.docbook"> 0023 <!ENTITY include-section-usermenu SYSTEM "usermenu.docbook"> 0024 ]> 0025 0026 <book id="kile" lang="&language;"> 0027 0028 <bookinfo> 0029 <title>The &kile; Handbook</title> 0030 0031 <authorgroup> 0032 <author><firstname>Jonathan</firstname><surname>Pechta</surname></author> 0033 <author><firstname>Federico</firstname><surname>Zenith</surname> 0034 <affiliation><address><email>federico.zenith@member.fsf.org</email></address></affiliation></author> 0035 <author><firstname>Holger</firstname><surname>Danielsson</surname> 0036 <affiliation><address><email>holger.danielsson@versanet.de</email></address></affiliation></author> 0037 <author><firstname>Thomas</firstname><surname>Braun</surname></author> 0038 <author><firstname>Michel</firstname><surname>Ludwig</surname> 0039 <affiliation><address><email>michel.ludwig@kdemail.net</email></address></affiliation></author> 0040 <author><firstname>Felix</firstname><surname>Mauch</surname> 0041 <affiliation><address><email>felix_mauch@web.de</email></address></affiliation></author> 0042 <!-- TRANS:ROLES_OF_TRANSLATORS --> 0043 </authorgroup> 0044 0045 <copyright> 0046 <year>2003</year> 0047 <holder>Jonathan Pechta</holder> 0048 </copyright> 0049 0050 <copyright> 0051 <year>2003</year><year>2005</year><year>2006</year> 0052 <holder>Federico Zenith</holder> 0053 </copyright> 0054 0055 <copyright> 0056 <year>2005</year><year>2006</year><year>2012</year> 0057 <holder>Holger Danielsson</holder> 0058 </copyright> 0059 0060 <copyright> 0061 <year>2007</year> 0062 <holder>Thomas Braun</holder> 0063 </copyright> 0064 0065 <copyright> 0066 <year>2007</year><year>2011</year> 0067 <holder>Michel Ludwig</holder> 0068 </copyright> 0069 0070 <copyright> 0071 <year>2011</year> 0072 <holder>Felix Mauch</holder> 0073 </copyright> 0074 0075 <date>2011-05-22</date> 0076 <releaseinfo>2.1</releaseinfo> 0077 0078 <legalnotice> 0079 &FDLNotice; 0080 </legalnotice> 0081 0082 <abstract> 0083 <para> 0084 &kile; is a &tex; and &latex; source editor and shell. 0085 </para> 0086 </abstract> 0087 0088 <keywordset> 0089 <keyword>KDE</keyword> 0090 <keyword>kdenonbeta</keyword> 0091 <keyword>Kile</keyword> 0092 <keyword>LaTeX</keyword> 0093 <keyword>TeX</keyword> 0094 </keywordset> 0095 0096 </bookinfo> 0097 0098 <chapter id="preface"> 0099 0100 <title>Preface</title> 0101 0102 <sect1 id="preface_sect"> 0103 0104 <title>Requirements</title> 0105 0106 <para>To run &kile;, you need to have the following components 0107 installed on your system:</para> 0108 0109 <itemizedlist> 0110 <listitem><para><ulink url="http://www.kde.org/">K Desktop environment (&kde;)</ulink>: 0111 &kde; is a popular open-source desktop environment.</para></listitem> 0112 <listitem><para><ulink url="https://qt.io/">&Qt;</ulink>: &Qt; is a C++ 0113 &GUI; and network library needed to compile &kile;.</para></listitem> 0114 <listitem><para><ulink url="http://www.ctan.org/">&latex;</ulink>: high-quality document 0115 typesetting program. Most likely you want the &texlive; (or on older systems the &tetex;) package, if you are on a 0116 &UNIX;-like system.</para></listitem> 0117 </itemizedlist> 0118 0119 <para>Most of these items might be included in your &Linux; distribution; please refer to your 0120 distribution documentation, or refer to your installation &CD; or DVD, for adding these 0121 packages to your computer.</para> 0122 0123 <para>&kile; might also be available as a pre-compiled package for your &Linux; distribution already. Please check with the 0124 package manager of your distribution.</para> 0125 0126 </sect1> 0127 0128 <sect1 id="preface_audience"> 0129 0130 <title>Intended Audience</title> 0131 0132 <para>This manual is intended for any individual, regardless of her or his experience with 0133 &latex;, &kde;, &kile; or &Linux;.</para> 0134 0135 <para>Advanced users are not likely to read this manual, but all suggestions on 0136 documentation will be considered. If you would like to contribute to this project or the 0137 documentation, please consult the <ulink url="http://kile.sourceforge.net/">&kile; web page</ulink>.</para> 0138 0139 <para>Do you need answers about &kile;? Are you stuck with the compilation process? Do you want to see a new 0140 feature implemented? The preferred way to ask technical questions or to start a discussion is to 0141 use our mailing list: <email>kile-devel@lists.sourceforge.net</email>.</para> 0142 0143 </sect1> 0144 0145 </chapter> 0146 0147 <chapter id="introduction"> 0148 0149 <title>Introduction</title> 0150 0151 <sect1 id="intro_about"> 0152 0153 <title>Basic facts</title> 0154 0155 <sect2> 0156 0157 <title>About &kile;</title> 0158 0159 <para>&kile; is an integrated &latex; environment for the &kde; desktop. &kile; gives you the 0160 ability to use all the functionality of &latex; in a graphical interface, giving you easy, 0161 immediate, and customized access to all programs for &latex; code-completion, compiling, postprocessing, 0162 debugging, conversion and viewing tools; you also get very handy wizards, a &latex; 0163 reference and a powerful project manager.</para> 0164 0165 </sect2> 0166 0167 <sect2> 0168 0169 <title>&kile; and the &kate; Editor Component</title> 0170 0171 <para>&kile; is based on the &kate; editor component, &ie; a lot of its editing capabilities stem from the &kate; 0172 editor component itself. &kile; extends these capabilities with features to edit &latex; documents. To learn more 0173 about the &kate; editor component and its capabilities, see the <ulink url="http://kate-editor.org">&kate; 0174 webpage</ulink>.</para> 0175 0176 </sect2> 0177 0178 <sect2> 0179 0180 <title>What is &latex;?</title> 0181 0182 <para>&latex; is a text-processing system derived from &tex;, a program developed originally in 0183 1977 by Donald Knuth to help layout text in a professional way and obtain a layout quality that 0184 is on a par with the work of a professional typesetter. 0185 &latex; was created by Leslie Lamport to give authors an automatic typesetter, especially to ease 0186 the expensive and painstaking process of typesetting of mathematical formulas and expressions, 0187 which are enclosed within dollar signs in &latex; <emphasis>for a reason</emphasis>. 0188 Today, word-processing programs let any user act as typesetter, but what is often needed 0189 is a document that simply looks good without having to spend hours to bring it into shape. 0190 &latex; takes that burden on its shoulders, and lets you concentrate on the document instead of on the layout. 0191 And yes, it <emphasis>will</emphasis> look good!</para> 0192 0193 </sect2> 0194 0195 <sect2> 0196 0197 <title>How do you pronounce it? Why that strange typesetting?</title> 0198 0199 <para>There is a funny tradition of &tex;-related packages to have the strangest pronunciation 0200 and typesetting possible. &tex; was supposed to be brought in from the Greek <emphasis>τεχ</emphasis>, 0201 in Latin letters <emphasis>tech</emphasis>. There are a lot of explanations why, but most likely it is because 0202 &tex; was originally conceived for technical reports, and indeed its foremost ability was the correct and 0203 easy typesetting of mathematical formulae, then an extremely expensive, time-consuming and 0204 frustrating business.</para> 0205 <para>The pronunciation is supposed to be as follows: <emphasis>T</emphasis> as you would expect, 0206 <emphasis>E</emphasis> as in <emphasis>get</emphasis>, and <emphasis>X</emphasis> as in the 0207 German i<emphasis>ch</emphasis>. If you do not know what <emphasis>ch</emphasis> sounds like, 0208 it is more or less like the sound a hissing cat produces; the IPA symbol is /ç/. Many people report a different pronunciation 0209 of <emphasis>ach</emphasis> (IPA symbol /x/), but according to some Greeks, the first version is indeed correct. 0210 You should be aware that a lot of people mispronounce &tex; as /teks/ or /tek/.</para> 0211 <para>Last, in &latex; the first L<superscript>A</superscript> is pronounced as 0212 <emphasis>lay</emphasis>: the idea being, while raw &tex; is difficult, even a <emphasis>lay</emphasis>man 0213 can use &latex; macros. A less inspiring, but more realistic explanation is that it stems from the surname of 0214 Leslie Lamport, the creator of &latex;. Now you know!</para> 0215 0216 </sect2> 0217 0218 </sect1> 0219 0220 <sect1 id="intro_latexbasics"> 0221 0222 <title>&latex; 101</title> 0223 0224 <para>The &latex; typesetting system is similar to other markup languages such as &XML;, which is used in 0225 many types of documents (including the one you are reading), or &HTML;, which is used for web 0226 pages. The general idea behind markup languages is to have special keywords, called <emphasis> 0227 tags</emphasis>, that tell a program (a word processor, a web browser, or the &latex; 0228 compiler) how the text enclosed within the tags is to be interpreted. &kile; offers a number of such tags in the 0229 <guimenu>LaTeX</guimenu> menu in the menu bar.</para> 0230 0231 <para>While we will try to give you a good idea of what &latex; is, this document is, of course, not The Definitive 0232 Book on &latex;. If you want to learn &latex; in depth, you may want to borrow a specialized book from your local library.</para> 0233 0234 <para>As with any other markup language, &latex; documents contain a <emphasis>preamble</emphasis>, which 0235 defines global properties, such as paper size, page numbering, dimensions of the text on the page, 0236 and a document <emphasis>body</emphasis>, which contains the text of the document. The preamble is composed 0237 at least of the <userinput>\documentclass</userinput> command. It precedes the document body, which 0238 starts with the command <userinput>\begin{document}</userinput> and is concluded with the command 0239 <userinput>\end{document}</userinput>.</para> 0240 0241 </sect1> 0242 0243 <sect1 id="intro_mainfeat"> 0244 0245 <title>&kile;'s Main Features</title> 0246 0247 <sect2 id="intro_docwizard"> 0248 0249 <title>QuickStart Wizard</title> 0250 0251 <para>The QuickStart wizard built into &kile; is a useful feature to quickly start creating documents 0252 in &kile;. Choosing the wizard from the menubar gives you several choices 0253 for the creation of your document. 0254 You can also specify some options related to the document right away.</para> 0255 0256 <para>Class options:</para> 0257 0258 <itemizedlist> 0259 <listitem><para><guilabel>Document Class</guilabel>: choose the type of document you want to create: 0260 article, book, letter, report, scrartcl, scrreprt, scrbook, prosper, beamer or other 0261 custom-defined.</para></listitem> 0262 <listitem><para><guilabel>Typeface Size</guilabel>: tell &kile; what point size (pt) 0263 you want to use.</para></listitem> 0264 <listitem><para><guilabel>Paper Size</guilabel>: choose the size or style of sheets.</para></listitem> 0265 <listitem><para><guilabel>Encoding</guilabel>: In general it is a good idea to use your system's standard 0266 encoding. Modern systems now move more and more to UTF-8 as the standard encoding. 0267 If you can, use utf8 or utf8x (which is indeed the correct spelling for &latex; documents). 0268 </para></listitem> 0269 <listitem><para><guilabel>Other options</guilabel>: this allows you to set further options such as printing, 0270 draft, and others.</para></listitem> 0271 </itemizedlist> 0272 0273 <para>Packages</para> 0274 <para>This lists some of the most common additional packages used in &latex;. Select the check box to include it.</para> 0275 0276 <para>Document Properties:</para> 0277 <itemizedlist> 0278 <listitem><para><guilabel>Author</guilabel>: put your name here.</para></listitem> 0279 <listitem><para><guilabel>Title</guilabel>: add the document title here.</para></listitem> 0280 <listitem><para><guilabel>Date</guilabel>: specify the date.</para></listitem> 0281 </itemizedlist> 0282 0283 </sect2> 0284 0285 <sect2 id="intro_templates"> 0286 0287 <title>Predefined Templates</title> 0288 0289 <para>The predefined templates in &kile; are:</para> 0290 0291 <itemizedlist> 0292 <listitem><para>Empty document: real freaks start from scratch!</para></listitem> 0293 <listitem><para>Article: sets the article format, for a document short enough not to 0294 be broken down to chapters.</para></listitem> 0295 <listitem><para>Report: sets the report format, for a middle-sized document, with, for 0296 example, page numbering on the page's outer edge.</para></listitem> 0297 <listitem><para>Book: sets the book format, a full-fledged flavor, so powerful that 0298 it is used to write many university textbooks.</para></listitem> 0299 <listitem><para>Letter: sets the letter format.</para></listitem> 0300 <listitem><para>Beamer, HA-Prosper: create nice presentations in PDF with a superior look and all 0301 &latex; power.</para></listitem> 0302 <listitem><para>Powerdot: Powerdot is the follower of the packages <userinput>seminar</userinput> 0303 and <userinput>HA-Prosper</userinput>. It does not have as many options as Beamer, 0304 but it is easy to use and it can create really nice presentations in PDF.</para></listitem> 0305 <listitem><para>Scrartcl, Scrbook, Scrreprt, Scrlttr2: the KOMA-Script document classes, 0306 especially adapted to German typography. Use them whenever you write German 0307 texts.</para></listitem> 0308 <listitem><para>Xelatex: a modified <userinput>Article</userinput> template to use with 0309 <userinput>XeLaTeX</userinput>.</para></listitem> 0310 </itemizedlist> 0311 0312 <para>Note that all of these templates can be adjusted to the user's requirements.</para> 0313 0314 <para>New users need not worry: this list is just a brief description of the available features, 0315 and a more detailed description can be found in <xref linkend="quickstart" role="select: title pageabbrv"/>.</para> 0316 0317 </sect2> 0318 0319 <sect2 id="intro_highlight"> 0320 0321 <title>Syntax Highlighting</title> 0322 0323 <para>&kile; is similar to other programs that deal with source code and editing, and will 0324 automatically highlight commands, options and items that are used (and abused). 0325 &kile; makes it possible to easily spot problematic areas: for example, if you see major 0326 areas of text turn green, it is likely that you forgot to close a math environment somewhere.</para> 0327 0328 </sect2> 0329 0330 <sect2 id="intro_autocoml"> 0331 0332 <title>Auto-Completion of Environments</title> 0333 0334 <para>The auto-completion of environments means that, when you begin a new environment by typing 0335 <userinput>\begin{environment}</userinput>, &kile; will automatically insert a matching 0336 <userinput>\end{environment}</userinput> command, with a line in between them 0337 for your text. You can of course deactivate it if you want in 0338 <menuchoice><guimenu>Settings</guimenu><guisubmenu>Configure Kile...</guisubmenu> 0339 <guimenuitem>LaTeX</guimenuitem><guilabel>Environments</guilabel></menuchoice>.</para> 0340 0341 </sect2> 0342 0343 <sect2 id="intro_jump"> 0344 0345 <title>Jump to Structure Element</title> 0346 0347 <para>All documents are normally structured in a hierarchy of some type. 0348 &latex; allows you to break up documents into the following hierarchy 0349 (part being highest in the hierarchy, and subparagraph being lowest):</para> 0350 0351 <itemizedlist> 0352 <listitem><para>\part</para></listitem> 0353 <listitem><para>\chapter</para></listitem> 0354 <listitem><para>\section</para></listitem> 0355 <listitem><para>\subsection</para></listitem> 0356 <listitem><para>\subsubsection</para></listitem> 0357 <listitem><para>\paragraph</para></listitem> 0358 <listitem><para>\subparagraph</para></listitem> 0359 </itemizedlist> 0360 0361 <para>When viewing a document in the <guilabel>Structure</guilabel> view, you can jump 0362 between elements by clicking on the element you would like to view.</para> 0363 0364 </sect2> 0365 0366 <sect2 id="intro_inverse"> 0367 0368 <title>Inverse Search</title> 0369 0370 <para>When creating your own &latex; files, inverse search can be very helpful. Once you 0371 have created a &DVI; file (DeVice Independent File) or PDF file, you can click the left 0372 mouse button while pressing &Shift; in the viewer and &kile; will jump to the corresponding line in the 0373 &latex; source code.</para> 0374 0375 <para>A &DVI; is a type of file containing a 0376 description of a formatted document, along with other 0377 information including character font, and is besides PDF the usual output of 0378 &tex; or &latex;. A number of utilities exist to view, convert and print &DVI; files on 0379 various systems and devices.</para> 0380 0381 </sect2> 0382 0383 <sect2 id="intro_forward"> 0384 0385 <title>Forward Search</title> 0386 0387 <para>When using inverse search, the selection of items in the &DVI; or PDF file is associated with 0388 the editor, so when you click on the &DVI; or PDF file, the main window jumps to the 0389 corresponding section of &latex; code in the editor. Forward search is the exact 0390 opposite of this. Forward search will allow you to click on a specific section of text 0391 in the &latex; code, and jump to the associated position in the viewer window.</para> 0392 0393 </sect2> 0394 0395 </sect1> 0396 0397 <sect1 id="intro_toolbar"> 0398 0399 <title>The Toolbar</title> 0400 0401 <itemizedlist> 0402 <listitem><para><guibutton>New</guibutton>: begin a new document.</para></listitem> 0403 <listitem><para><guibutton>Open</guibutton>: open a new document.</para></listitem> 0404 <listitem><para><guibutton>Close</guibutton>: close your document.</para></listitem> 0405 <!-- following toolbar items are different in default master/2.1--> 0406 <listitem><para><guibutton>Define document as master</guibutton>: this is used when working with multiple files. 0407 Having a master document will let you work more easily with other <literal role="extension">.tex</literal> files included 0408 in your document. If you are using projects, you can also set in <menuchoice><guimenu>Project</guimenu><guisubmenu>Project 0409 Options</guisubmenu></menuchoice> a project-wide master document.</para></listitem> 0410 <listitem><para><guibutton>Quickbuild</guibutton>: compiles your &latex; source code and displays the results 0411 automatically unless there are errors contained in the document.</para></listitem> 0412 <listitem><para><guibutton>Watch file mode</guibutton>: this mode will "watch" the &DVI; file for changes, and 0413 will not launch a new session of &okular; after <guibutton>Quickbuild</guibutton>.</para></listitem> 0414 <listitem><para><guibutton>View logfile</guibutton>: views the <literal role="extension">.log</literal> file, 0415 so you can spot errors.</para></listitem> 0416 <listitem><para><guibutton>Previous error</guibutton>: jumps backward through the 0417 <literal role="extension">.log</literal> file 0418 and highlights errors in the source.</para></listitem> 0419 <listitem><para><guibutton>Next error</guibutton>: jumps forward through the 0420 <literal role="extension">.log</literal> file and 0421 highlights errors in the source.</para></listitem> 0422 <listitem><para><guibutton>Stop</guibutton>: halts current tool.</para></listitem> 0423 <listitem><para><guibutton>LaTeX</guibutton>: runs &latex; on the active document.</para></listitem> 0424 <listitem><para><guibutton>ViewDVI</guibutton>: launches &DVI; viewer.</para></listitem> 0425 <listitem><para><guibutton>DVItoPS</guibutton>: converts a &DVI; to a &PostScript; (PS).</para></listitem> 0426 <listitem><para><guibutton>ViewPS</guibutton>: launches &PostScript; (PS) viewer.</para></listitem> 0427 <listitem><para><guibutton>PDFLaTeX</guibutton>: runs &pdflatex; on the active document.</para></listitem> 0428 <listitem><para><guibutton>ViewPDF</guibutton>: launches the PDF viewer.</para></listitem> 0429 <listitem><para><guibutton>DVItoPDF</guibutton>: converts a &DVI; to a PDF.</para></listitem> 0430 <listitem><para><guibutton>PStoPDF</guibutton>: converts a PS to a PDF.</para></listitem> 0431 <listitem><para><guibutton>ViewHTML</guibutton>: views &HTML; created.</para></listitem> 0432 <listitem><para><guibutton>ForwardDVI</guibutton>: jump to the page of the &DVI; file that corresponds to the current line in the editor.</para></listitem> 0433 <listitem><para><guibutton>ForwardPDF</guibutton>: jump to the page of the PDF file that corresponds to the current line in the editor.</para></listitem> 0434 </itemizedlist> 0435 0436 <para>If you look at the <guilabel>Edit</guilabel> toolbar, you will notice three large 0437 drop-down menus. The drop-down menus were designed for you to be able to quickly add 0438 certain common features into your document. The first drop down box 0439 is used for quickly dividing your document by parts, chapter, sections and so on; the 0440 available commands to add segments to your &latex; source code are:</para> 0441 0442 <itemizedlist> 0443 <listitem><para><guilabel>part</guilabel>: highest level of sectioning for a document.</para></listitem> 0444 <listitem><para><guilabel>chapter</guilabel>: starts a new chapter.</para></listitem> 0445 <listitem><para><guilabel>section</guilabel>: create a new section.</para></listitem> 0446 <listitem><para><guilabel>subsection</guilabel>: create a new subsection.</para></listitem> 0447 <listitem><para><guilabel>subsubsection</guilabel>: a secondary section between subsection and 0448 paragraph.</para></listitem> 0449 <listitem><para><guilabel>paragraph</guilabel>: create a new paragraph.</para></listitem> 0450 <listitem><para><guilabel>subparagraph</guilabel>: create a new subparagraph.</para></listitem> 0451 </itemizedlist> 0452 0453 <para>The drop down box named <guilabel>Other</guilabel> is used to insert items into your document such as 0454 indexes, footnotes, and references; the available commands are:</para> 0455 0456 <itemizedlist> 0457 <listitem><para><guilabel>label</guilabel>: a command that produces a label for a chapter, 0458 a figure or another element.</para></listitem> 0459 <listitem><para><guilabel>index</guilabel>: creates an entry for the index.</para></listitem> 0460 <listitem><para><guilabel>footnote</guilabel>: creates a footnote in your document.</para></listitem> 0461 <listitem><para><guilabel>ref</guilabel>: used to refer to a predefined label, which 0462 you can choose from a drop-down list.</para></listitem> 0463 <listitem><para><guilabel>pageref</guilabel>: just like <guilabel>ref</guilabel>, but refers to 0464 a page instead of a structure element.</para></listitem> 0465 <listitem><para><guilabel>cite</guilabel>: create a reference with data from a bibliography.</para></listitem> 0466 <!-- The next feature is currently disabled (see 'kile.cpp'). --> 0467 <!-- <listitem><para><guilabel>cite from ViewBib</guilabel>: ask the ViewBib tool for all selected references and insert them. 0468 Currently this is only available with <ulink url="http://user.digisurf.com.au/~thachly/kbib/">&kbib;</ulink> as ViewBib tool.</para></listitem>--> 0469 </itemizedlist> 0470 0471 <screenshot> 0472 <screeninfo>The <guilabel>Other</guilabel> drop-down menu</screeninfo> 0473 <mediaobject> 0474 <imageobject> 0475 <imagedata fileref="snap_ref_choose.png" format="PNG" /> 0476 </imageobject> 0477 <textobject> 0478 <phrase>The <guilabel>Other</guilabel> drop-down menu</phrase> 0479 </textobject> 0480 <caption><para>The <guilabel>Other</guilabel> drop-down menu</para></caption> 0481 </mediaobject> 0482 </screenshot> 0483 0484 <screenshot> 0485 <screeninfo>Selecting the label for a reference</screeninfo> 0486 <mediaobject> 0487 <imageobject> 0488 <imagedata fileref="snap_ref_select.png" format="PNG" /> 0489 </imageobject> 0490 <textobject> 0491 <phrase>Selecting the label for a reference</phrase> 0492 </textobject> 0493 <caption><para>Selecting the label for a reference</para></caption> 0494 </mediaobject> 0495 </screenshot> 0496 0497 <para>When using <guilabel>cite</guilabel>, you are presented with a drop-down 0498 list of bibitems, but if you are using &bibtex; this will only work if the file 0499 belongs to a Project. For editing &bibtex; files the usage of specialized editors is recommended. 0500 The author has had good results with &kbibtex;. Of course you can also write the &bibtex; files by hand inside &kile;.</para> 0501 0502 <para>The last drop down box labeled <guilabel>tiny</guilabel> is used to set the size of the text. You can 0503 set the size of the main text, of footnotes, and so on. The available commands are:</para> 0504 0505 <itemizedlist> 0506 <listitem><para><guilabel>tiny</guilabel>: smallest.</para></listitem> 0507 <listitem><para><guilabel>scriptsize</guilabel>: very small.</para></listitem> 0508 <listitem><para><guilabel>footnotesize</guilabel>: smaller.</para></listitem> 0509 <listitem><para><guilabel>small</guilabel>: small.</para></listitem> 0510 <listitem><para><guilabel>normalsize</guilabel>: normal.</para></listitem> 0511 <listitem><para><guilabel>large</guilabel>: large.</para></listitem> 0512 <listitem><para><guilabel>Large</guilabel>: larger.</para></listitem> 0513 <listitem><para><guilabel>LARGE</guilabel>: even larger.</para></listitem> 0514 <listitem><para><guilabel>huge</guilabel>: still larger.</para></listitem> 0515 <listitem><para><guilabel>Huge</guilabel>: largest.</para></listitem> 0516 </itemizedlist> 0517 0518 </sect1> 0519 0520 </chapter> 0521 <chapter id="quickstart"> 0522 0523 <title>Quickstart</title> 0524 0525 <sect1 id="quick_begin"> 0526 0527 <title>Writing a &latex; Document with &kile; for Beginners</title> 0528 0529 <para>Users of &kile; have two choices when starting a new document: they can use the 0530 <guimenu>Wizard</guimenu> to begin a new document, select the type of document they 0531 would like to create and options such as font size, paper size, and so on; otherwise, 0532 they can write the code by hand.</para> 0533 0534 <programlisting>\documentclass[12pt]{article} 0535 \begin{document} 0536 Here is a bunch of text coded in \LaTeX. 0537 \end{document}</programlisting> 0538 0539 <para>Every document in &latex; begins with the command <userinput> 0540 \documentclass[optional argument]{class}</userinput>, where class specifies the document type.</para> 0541 0542 <para>Typing in the code example above from the text box gives you the following output:</para> 0543 0544 <screenshot> 0545 <screeninfo>Compiled text in &DVI; output</screeninfo> 0546 <mediaobject> 0547 <imageobject> 0548 <imagedata fileref="latex_example.png" format="PNG" /> 0549 </imageobject> 0550 <textobject> 0551 <phrase>Compiled text in &DVI; output</phrase> 0552 </textobject> 0553 <caption><para>Compiled text in &DVI; output</para></caption> 0554 </mediaobject> 0555 </screenshot> 0556 0557 <para>The brackets that come after the command <userinput>\documentclass</userinput> 0558 contain the options for the command. The option <userinput>[12pt]</userinput> sets the size 0559 of the font for your article; if you do not set the font size in the beginning, you can set 0560 it later in the text.</para> 0561 0562 <para>Once you have typed in the code example from the box above, you will need to 0563 compile your &latex; source code. The easiest way for you to compile &latex; is to 0564 use the <guimenu>Build</guimenu> menu, or using the <guilabel>Quickbuild</guilabel> button.</para> 0565 0566 <para><keycombo>&Alt;<keycap>2</keycap></keycombo> 0567 is the keyboard shortcut to compile your source code.</para> 0568 0569 <para>You have to save your source code before you can compile; &kile; will do this automatically for you.</para> 0570 0571 <para>If your document did not compile, check the log for errors. When using the <guilabel>Quickbuild</guilabel> 0572 key, the &okular; viewer should be launched automatically; if it does not, look at the log.</para> 0573 0574 </sect1> 0575 0576 <sect1 id="quick_env"> 0577 <title>Environments</title> 0578 0579 <para>An environment is a segment of text that is managed differently 0580 from the rest of the document. For example, you create a report with font size 12, 0581 but you need to change your font size for a few sentences. The commands 0582 <userinput>\begin{environment}</userinput>, <userinput>\huge</userinput> and 0583 <userinput>\end{environment}</userinput> will let you temporarily alter the text inside 0584 the environment commands to be size huge.</para> 0585 0586 <para>Changes are only effective from <userinput>\begin{environment}</userinput> to 0587 <userinput>\end{environment}</userinput>. There are no limits as to how many changes 0588 you can make inside an environment.</para> 0589 0590 <para>There are many features you can add to your document that will make it more 0591 readable and user-friendly. You can add features such as specific fonts, bold, italics, 0592 underline &etc; to your document, and these commands will end with either an 0593 <userinput>\end</userinput> command, or at the end of your environment.</para> 0594 0595 <itemizedlist> 0596 <listitem><para><userinput>\begin{emph}</userinput>: this command makes 0597 text italicized, and is valid until the code comes across a <userinput>\end{emph}</userinput>, 0598 or another environment. To italicize one word in a sentence, you 0599 can use the syntax: this is <userinput>\emph{my}</userinput> sentence.</para></listitem> 0600 <listitem><para><userinput>\textbf{I am making this text inside the brackets bold}</userinput>: this 0601 command makes your text bold.</para></listitem> 0602 <listitem><para><userinput>\quote</userinput>: to create a quote inside your document; begin your quote 0603 with <userinput>\begin{quote}</userinput> and end it with <userinput>\end{quote}</userinput>.</para></listitem> 0604 <listitem><para><userinput>\center</userinput>: centers the text.</para></listitem> 0605 <listitem><para><userinput>\verse</userinput>: creates offset text for poems.</para></listitem> 0606 <listitem><para><userinput>\itemize</userinput>: makes an itemized list.</para></listitem> 0607 </itemizedlist> 0608 0609 </sect1> 0610 0611 <sect1 id="quick_using"> 0612 0613 <title>Using &kile;</title> 0614 0615 <para>Now that we have given you some background about how to write code using the 0616 &latex; markup language, we will show you how to create a document 0617 using &kile; step-by-step.</para> 0618 0619 <procedure> 0620 <step><para>Start &kile;.</para></step> 0621 <step><para>Select <menuchoice><guimenu>Wizard</guimenu><guimenuitem>Quick Start</guimenuitem></menuchoice>, 0622 then choose a format, and set your preferences in the wizard.</para></step> 0623 <step><para>Once the wizard has entered text, do some customization to make the 0624 document more readable, add a minimum of one quote, some bold text, 0625 italics, and a verse to see the difference between the commands.</para></step> 0626 <step><para>Save your file, and give it the name <filename>intro.tex</filename>.</para></step> 0627 <step><para>Build your document using <keycombo>&Alt;<keycap>2</keycap></keycombo>, or the 0628 button labeled <guilabel>LaTeX</guilabel>.</para></step> 0629 <step><para>Select <guibutton>ViewDVI</guibutton>.</para></step> 0630 <step><para>Check out all your new text.</para></step> 0631 <step><para>When you are done viewing your document, click the <guibutton>Editor View</guibutton> 0632 button or press <keycombo>&Ctrl;<keycap>E</keycap></keycombo> 0633 to return to the editor if you are using the embedded 0634 viewer, or close the viewer window if you are using a separate viewer.</para></step> 0635 </procedure> 0636 0637 <para>That's it! You have just created your first &latex; document!</para> 0638 0639 <para>Once you have created your &DVI;, you will be able to print your document, or change 0640 it into a &PostScript; or PDF file if you want. Experiment and have fun!</para> 0641 0642 </sect1> 0643 0644 <sect1 id="quick_dvi"> 0645 0646 <title>&DVI; Files</title> 0647 0648 <para>&DVI; stands for <emphasis>DeVice Independent</emphasis> file. These files are produced 0649 by &tex; or &latex; to be read by a driver of some sort on your computer. There are many different types of output that 0650 a <literal role="extension">.dvi</literal> can be sent to, such as a printer, &PostScript; or PDF file converter, or your computer screen.</para> 0651 0652 <sect2 id="quick_viewdvi"> 0653 0654 <title>Viewing a &DVI;</title> 0655 0656 <para>You have already seen how to view a &DVI; file on the screen by using the <guibutton>ViewDVI</guibutton> button in the toolbar.</para> 0657 0658 </sect2> 0659 0660 <sect2 id="quick_printdvi"> 0661 0662 <title>Printing a &DVI;</title> 0663 0664 <para>To print a &DVI;, you can use the same process that you used to create your 0665 document earlier (see <xref linkend="quick_using" role="select: title pageabbrv"/>). At step 7, after 0666 clicking <guibutton>ViewDVI</guibutton>, select 0667 <menuchoice><guimenu>File</guimenu><guimenuitem>Print</guimenuitem></menuchoice> 0668 in the viewer, and if you have your printer properly configured, you will be able 0669 to print the &DVI;.</para> 0670 0671 </sect2> 0672 0673 <sect2 id="quick_exportdvi"> 0674 0675 <title>Converting &DVI; files</title> 0676 0677 <para>The toolbar gives the options of Converting a &DVI; to other formats. Once you 0678 have created a &DVI; from your &latex; source code, you will be able to export it 0679 to a format of your choice using the toolbar buttons.</para> 0680 0681 </sect2> 0682 0683 </sect1> 0684 0685 <sect1 id="quick_forward"> 0686 0687 <title>Forward Search between &kile; and &okular;</title> 0688 0689 <para>The forward search functions allow you to jump from your 0690 editor directly to the associated position of the &DVI; or PDF 0691 file. </para> 0692 <para>&kile; offers a configuration with this option for all &latex; binaries. 0693 Go to <menuchoice><guimenu>Settings</guimenu><guisubmenu>Configure Kile...</guisubmenu> 0694 <guimenuitem>Tools</guimenuitem><guilabel>Build</guilabel></menuchoice> 0695 and always choose the <guilabel>Modern</guilabel> configuration.</para> 0696 0697 <para>To execute a forward search, position the cursor on a line of source code, and click 0698 <guilabel>Forward Search</guilabel> to jump to the associated position 0699 in the &DVI; or PDF viewer window.</para> 0700 </sect1> 0701 0702 <sect1 id="quick_inverse"> 0703 0704 <title>Inverse Search between &kile; and &okular;</title> 0705 0706 <para>Inverse search is a very useful feature when you are writing 0707 a &latex; document yourself. If everything is set up properly, you can 0708 click into &okular;'s window with the <mousebutton>left</mousebutton> mouse button while pressing &Shift;. After that &kile; loads the &latex; source file and jumps to 0709 the proper paragraph. To use inverse search, you have to compile your &latex; file with the <guilabel>Modern</guilabel> configuration.</para> 0710 0711 <para>Inverse search cannot work unless:</para> 0712 0713 <itemizedlist> 0714 <listitem><para>The source file has been compiled successfully.</para></listitem> 0715 <listitem><para>&okular; knows which editor you would like to use.</para></listitem> 0716 </itemizedlist> 0717 0718 <para>With this feature of &okular;, a left mouse click while pressing &Shift; in the &DVI; or PDF document will 0719 result in &kile; opening the corresponding &latex; document and attempt to go to the 0720 corresponding line. Remember to tell &okular; to use &kile; as a text editor, in &okular;'s 0721 menu item <menuchoice><guimenu>Settings</guimenu><guimenuitem>Configure Okular...</guimenuitem></menuchoice> 0722 (on the page <guimenuitem>Editor</guimenuitem>).</para> 0723 0724 <screenshot> 0725 <screeninfo>Configuring &okular;</screeninfo> 0726 <mediaobject> 0727 <imageobject> 0728 <imagedata fileref="snap_okular_settings.png" format="PNG" /> 0729 </imageobject> 0730 <textobject> 0731 <phrase>Configuring &okular;</phrase> 0732 </textobject> 0733 <caption><para>Configuring &okular;</para></caption> 0734 </mediaobject> 0735 </screenshot> 0736 </sect1> 0737 0738 <sect1 id="quick_errors"> 0739 0740 <title>Resolving Errors</title> 0741 0742 <para>If you are trying to use quickbuild, and the &DVI; viewer does not open, chances are 0743 you have an error. If you have an error, it will be visible in the log file / message area, 0744 and the summary of the error will be given.</para> 0745 0746 <para>The log file will explain the source of the error in your code. In the 0747 editor, you can use the buttons in the toolbar labeled <guibutton>Previous LaTeX Error</guibutton> 0748 and <guibutton>Next LaTeX Error</guibutton> to jump to and from errors. The log file always states 0749 in which line the error occurred. To view the line where an error occurred, click on the error 0750 in the log window, and &kile; will take you to the error's line.</para> 0751 0752 </sect1> 0753 0754 </chapter> 0755 <chapter id="startnew"> 0756 0757 <title>Starting a New Document</title> 0758 0759 <para>When you click the button in the toolbar to begin a new document a dialog appears, 0760 asking which type of template you would like to use to write your document. The 0761 default choices are:</para> 0762 0763 <itemizedlist> 0764 <listitem><para>Empty document</para></listitem> 0765 <listitem><para>Article</para></listitem> 0766 <listitem><para>Beamer</para></listitem> 0767 <listitem><para>Book</para></listitem> 0768 <listitem><para>HA-Prosper</para></listitem> 0769 <listitem><para>Powerdot</para></listitem> 0770 <listitem><para>Letter</para></listitem> 0771 <listitem><para>Report</para></listitem> 0772 <listitem><para>Scrartcl (from the KOMA-Script package)</para></listitem> 0773 <listitem><para>Scrbook (from the KOMA-Script package)</para></listitem> 0774 <listitem><para>Scrlttr2 (from the KOMA-Script package)</para></listitem> 0775 <listitem><para>Scrreprt (from the KOMA-Script package)</para></listitem> 0776 <listitem><para>PDF</para></listitem> 0777 <listitem><para>XeLaTeX</para></listitem> 0778 </itemizedlist> 0779 0780 <para>If you selected an <guilabel>Empty document</guilabel>, you can either start 0781 writing a document from scratch, or you can use the wizard to quickly start a new 0782 document (see <xref linkend="intro_docwizard" role="select: title pageabbrv"/>).</para> 0783 0784 0785 <sect1 id="startnew_templates"> 0786 0787 <title>Templates</title> 0788 0789 <para>Frequent users of &latex; typically use the same preamble for almost every document they use. 0790 Templates can be created, saved and loaded within &kile; to make it easier to start a new document.</para> 0791 0792 0793 <sect2> 0794 <title>Create a New Template</title> 0795 0796 <para>To create a new template, you must first either open a &tex; / &latex; file, or create a file 0797 of your own. &kile; can generate a template from an existing document by opening the desired document and selecting 0798 <menuchoice><guimenu>File</guimenu><guimenuitem>Create Template from Document</guimenuitem></menuchoice>.</para> 0799 0800 </sect2> 0801 0802 <sect2> 0803 0804 <title>Configuring Automatic Substitutions</title> 0805 0806 <para>When creating a new document by selecting a template from 0807 <menuchoice><guimenu>File</guimenu><guimenuitem>New</guimenuitem></menuchoice>, 0808 certain character combinations will be replaced by data such as your name, 0809 or the character encoding you are using. These variables can be configured in 0810 <menuchoice><guimenu>Settings</guimenu><guisubmenu>Configure Kile...</guisubmenu> 0811 <guimenuitem>Settings</guimenuitem><guilabel>General</guilabel></menuchoice>.</para> 0812 0813 <para>When designing your own template, it is useful to know which character 0814 combinations are replaced by which template variables:</para> 0815 0816 <itemizedlist> 0817 <listitem><para><userinput>$$AUTHOR$$</userinput>: This string 0818 will be replaced by the author variable.</para></listitem> 0819 <listitem><para><userinput>$$DOCUMENTCLASSOPTIONS$$</userinput>: This string will be replaced 0820 by the documentclass options variable. Typically this is used as follows: 0821 <userinput>\documentclass[$$DOCUMENTCLASSOPTIONS$$]{article}</userinput>.</para></listitem> 0822 <listitem><para><userinput>$$INPUTENCODING$$</userinput>: If the 0823 inputencoding variable is set to, say, <userinput>latin1</userinput> this string is replaced by 0824 <userinput>\input[latin1]{inputenc}</userinput>.</para></listitem> 0825 </itemizedlist> 0826 0827 </sect2> 0828 0829 <sect2 id="templ_wiz"> 0830 0831 <title>Create a Template from the Wizard</title> 0832 0833 <para>The easiest way to create a new template is to start the wizard, 0834 and then add commands in the editor. Once you have your 0835 document set up the way you like:</para> 0836 0837 <procedure> 0838 <step><para>Save your file;</para></step> 0839 <step><para>Go to <guimenu>File</guimenu>;</para></step> 0840 <step><para>Choose <guimenuitem>Create Template from Document</guimenuitem>;</para></step> 0841 <step><para>Make any corrections necessary to the template;</para></step> 0842 <step><para>Enter a name for your new template;</para></step> 0843 <step><para>Click <guibutton>OK</guibutton> to add your template to the menu.</para></step> 0844 </procedure> 0845 0846 <para>Next time you start up a new document, you will be able to choose 0847 your customized template instead of the default ones.</para> 0848 0849 </sect2> 0850 0851 <sect2> 0852 0853 <title>Creating a Template from any File</title> 0854 0855 <para>A template can be created from any &latex; file. If you are looking for an easy way to 0856 configure a template, go find one you like on the Internet and follow the same steps as 0857 listed in <xref linkend="templ_wiz" role="select: title pageabbrv"/>.</para> 0858 0859 <para>For instance, you may want to create a full-fledged A0 poster. These posters are usually seen 0860 at scientific conferences, and &latex; will help you make an attractive, catchy poster. Remember that you will need the <filename>a0poster</filename> 0861 package, which is normally not included in standard &tex; distributions. Download it from 0862 <ulink url="http://www.ctan.org/tex-archive/macros/latex/contrib/a0poster/">here</ulink> and place it in the same folder as your &latex; file.</para> 0863 </sect2> 0864 0865 <sect2 id="templ_rem"> 0866 0867 <title>Removing a Template</title> 0868 0869 <para>To remove a template from &kile;, do as follows:</para> 0870 0871 <procedure> 0872 <step><para>Go to <menuchoice><guimenu>File</guimenu><guimenuitem>Remove 0873 Template...</guimenuitem></menuchoice>;</para></step> 0874 <step><para>A dialog box will appear with all templates listed: select a template;</para></step> 0875 <step><para>Click <guilabel>OK</guilabel>, and your template will be removed.</para></step> 0876 </procedure> 0877 0878 <para>Templates marked with an asterisk (*) cannot be removed without the proper permission.</para> 0879 0880 </sect2> 0881 0882 </sect1> 0883 0884 </chapter> 0885 <chapter id="editing"> 0886 0887 <title>Editing &latex; Documents</title> 0888 0889 <para>The internal editor that &kile; uses is &kate;. 0890 &kate; is a text editor created for programmers, which incorporates the ability to read 0891 and highlight many different types of text files, among which are &latex; and &bibtex;; you can access 0892 many options for &kate; directly from &kile;'s <guimenu>Tools</guimenu> menu.</para> 0893 0894 <para>To learn more about &kate; and its capabilities, see the <ulink url="help:/kate">&kate; Handbook</ulink>. 0895 &kile; users can start reading from the chapter <quote>Working with the &kate; Editor</quote>.</para> 0896 0897 <sect1 id="editing_sect"> 0898 0899 <title>The &latex; Reference</title> 0900 0901 <para>&kile; features a very practical &latex; tag reference, which you can access 0902 by choosing <menuchoice><guimenu>Help</guimenu><guimenuitem>LaTeX 0903 Reference</guimenuitem></menuchoice>. It contains a thorough description 0904 of almost all the commands that you may use in &latex; and their syntax.</para> 0905 0906 </sect1> 0907 0908 <sect1 id="editing_cursor"> 0909 0910 <title>Cursor Movements</title> 0911 0912 <para>To select text, you have the following options:</para> 0913 0914 <itemizedlist> 0915 <listitem><para>Hold left mouse button, and drag mouse to highlight text.</para></listitem> 0916 <listitem><para>Click once on a word to move the cursor to a new area.</para></listitem> 0917 <listitem><para>Click twice on a word to select the whole word.</para></listitem> 0918 <listitem><para>Click twice on a word and pressing <keycombo>&Ctrl;</keycombo> to select the whole &tex; word. 0919 This means clicking in this way on <userinput>\par</userinput> from <userinput>\par\bigskip</userinput> only select \par.</para></listitem> 0920 <listitem><para>Click three times to select the whole sentence.</para></listitem> 0921 </itemizedlist> 0922 0923 <para>Holding the left mouse button, and dragging the text you want to select, 0924 automatically copies the selected text to the clipboard.</para> 0925 0926 <para>Holding &Shift; and using the arrow keys allows you to select portions of the source 0927 code in the editor window.</para> 0928 0929 </sect1> 0930 0931 <sect1 id="editing_bracket"> 0932 0933 <title>Brackets</title> 0934 0935 <para>Bracket completion is a visual tool that the editor view uses to indicate to you 0936 which bracket matches which. If you open any <literal role="extension">.tex</literal> file, 0937 and select any bracket, whether it be a parenthesis (), square brackets [] or braces {}, the 0938 editor will highlight the bracket and its match in yellow (this default color can be changed). 0939 So, for example, if you position the cursor on the braces in 0940 <userinput>\section{Introduction}</userinput>, you would see 0941 <userinput>\section{Introduction}</userinput> in the default yellow highlight, 0942 showing you the location of the beginning and ending brackets.</para> 0943 0944 </sect1> 0945 0946 <sect1 id="editing_highlight"> 0947 0948 <title>Highlighting</title> 0949 0950 <para>&kile; has the ability to look for and highlight different types of code. For example, &latex; commands 0951 are distinguished from normal text, and math formulas are also highlighted in a different color.</para> 0952 0953 </sect1> 0954 0955 <sect1 id="editing_bullets"> 0956 0957 <title>Bullets</title> 0958 0959 <para>Many wizards can insert optional bullets, a special kind of bookmark within the text. The 0960 menu entries <menuchoice><guimenu>Edit</guimenu><guisubmenu>Bullets</guisubmenu></menuchoice> or 0961 the corresponding keyboard shortcuts will allow you to jump to the next or last bullet. 0962 This will also highlight this bullet so that it will be deleted automatically, 0963 when you enter your first letter.</para> 0964 0965 <screenshot> 0966 <screeninfo>Bullets</screeninfo> 0967 <mediaobject> 0968 <imageobject> 0969 <imagedata fileref="bullets.png" format="PNG" /> 0970 </imageobject> 0971 <textobject> 0972 <phrase>Bullets</phrase> 0973 </textobject> 0974 </mediaobject> 0975 </screenshot> 0976 0977 <variablelist> 0978 0979 <varlistentry><term><menuchoice> 0980 <shortcut><keycombo action="simul">&Ctrl;&Alt;<keycap>Right</keycap></keycombo></shortcut> 0981 <guimenuitem>Next Bullet</guimenuitem></menuchoice></term> 0982 <listitem><para>Jump to the next bullet in the text if there is one.</para></listitem> 0983 </varlistentry> 0984 0985 <varlistentry><term><menuchoice> 0986 <shortcut><keycombo action="simul">&Ctrl;&Alt;<keycap>Left</keycap></keycombo></shortcut> 0987 <guimenuitem>Last Bullet</guimenuitem></menuchoice></term> 0988 <listitem><para>Jump to the previous bullet in the text if there is one.</para></listitem> 0989 </varlistentry> 0990 0991 </variablelist> 0992 0993 </sect1> 0994 0995 <sect1 id="editing_select"> 0996 0997 <title>Select</title> 0998 0999 <para>Editing is of course one of the main aspects when you use a program like &kile;. 1000 Although &kate; already has great capabilities, &kile; adds some important features, 1001 which are especially needed to write &latex; source. &latex; always needs a lot of 1002 environments and groups, so &kile; supports very special commands to select them. 1003 Under <menuchoice><guimenu>Edit</guimenu><guisubmenu>Select</guisubmenu></menuchoice> 1004 you will find the following commands to select text.</para> 1005 1006 <screenshot> 1007 <screeninfo>Edit->Select items</screeninfo> 1008 <mediaobject> 1009 <imageobject> 1010 <imagedata fileref="select.png" format="PNG" /> 1011 </imageobject> 1012 <textobject> 1013 <phrase>Edit->Select items</phrase> 1014 </textobject> 1015 </mediaobject> 1016 </screenshot> 1017 1018 <variablelist> 1019 <varlistentry><term><menuchoice> 1020 <shortcut><keycombo action="simul">&Ctrl;&Alt;<keycap>S</keycap></keycombo> 1021 <keycap>,E</keycap></shortcut> 1022 <guimenuitem>Environment (inside)</guimenuitem></menuchoice></term> 1023 <listitem><para>Select an environment 1024 without the surrounding tags. If this command is called, when an environment 1025 is already selected, &kile; will expand the selection to the next surrounding 1026 environment.</para></listitem> 1027 </varlistentry> 1028 1029 <varlistentry><term><menuchoice> 1030 <shortcut><keycombo action="simul">&Ctrl;&Alt;<keycap>S</keycap></keycombo> 1031 <keycap>,F</keycap></shortcut> 1032 <guimenuitem>Environment (outside)</guimenuitem></menuchoice></term> 1033 <listitem><para>Select an environment 1034 including the surrounding tags. This selection can also be expanded with a 1035 second call of this command. </para></listitem> 1036 </varlistentry> 1037 1038 <varlistentry><term><menuchoice> 1039 <shortcut><keycombo action="simul">&Ctrl;&Alt;<keycap>S</keycap></keycombo> 1040 <keycap>,T</keycap></shortcut> 1041 <guimenuitem>TeX Group (inside)</guimenuitem></menuchoice></term> 1042 <listitem><para>Select a &tex; group 1043 inside the surrounding braces.</para></listitem> 1044 </varlistentry> 1045 1046 <varlistentry><term><menuchoice> 1047 <shortcut><keycombo action="simul">&Ctrl;&Alt;<keycap>S</keycap></keycombo> 1048 <keycap>,U</keycap></shortcut> 1049 <guimenuitem>TeX Group (outside)</guimenuitem></menuchoice></term> 1050 <listitem><para>Select a &tex; group 1051 including the surrounding braces.</para></listitem> 1052 </varlistentry> 1053 1054 <varlistentry><term><menuchoice> 1055 <shortcut><keycombo action="simul">&Ctrl;&Alt;<keycap>S</keycap></keycombo> 1056 <keycap>,M</keycap></shortcut> 1057 <guimenuitem>Math Group</guimenuitem></menuchoice></term> 1058 <listitem><para>Select the current math group including the math commands.</para></listitem> 1059 </varlistentry> 1060 1061 <varlistentry><term><menuchoice> 1062 <shortcut><keycombo action="simul">&Ctrl;&Alt;<keycap>S</keycap></keycombo> 1063 <keycap>,P</keycap></shortcut> 1064 <guimenuitem>Paragraph</guimenuitem></menuchoice></term> 1065 <listitem><para>Select a whole paragraph, 1066 &ie; a group of text lines separated on both sides by empty lines. 1067 A paragraph does not mean just continuous lines of text, as it is 1068 in other text editors. This extended meaning also includes tables, &latex; 1069 commands and all other lines of source. The only important thing for &kile; 1070 is that this kind of paragraph is separated by two empty lines.</para></listitem> 1071 </varlistentry> 1072 1073 <varlistentry><term><menuchoice> 1074 <shortcut><keycombo action="simul">&Ctrl;&Alt;<keycap>S</keycap></keycombo> 1075 <keycap>,L</keycap></shortcut> 1076 <guimenuitem>Line</guimenuitem></menuchoice></term> 1077 <listitem><para>Select the text line of the 1078 current cursor position.</para></listitem> 1079 </varlistentry> 1080 1081 <varlistentry><term><menuchoice> 1082 <shortcut><keycombo action="simul">&Ctrl;&Alt;<keycap>S</keycap></keycombo> 1083 <keycap>,W</keycap></shortcut> 1084 <guimenuitem>TeX Word</guimenuitem></menuchoice></term> 1085 <listitem><para>Select the word under 1086 the current cursor position. This selection has also en extended meaning, 1087 because this command can also select &latex; commands, which begin with a 1088 backslash and may also have an optional star at the 1089 end.</para></listitem> 1090 </varlistentry> 1091 1092 </variablelist> 1093 1094 <sect2 id="editing_select_latex_commands"> 1095 1096 <title>Select &latex; commands</title> 1097 1098 <para>&kile; has an extended feature to select &latex; commands. If you for example 1099 have typed</para> 1100 1101 <programlisting>text \bfseries\itshape more text</programlisting> 1102 1103 <para> and double click on one of the &latex; commands, both will be selected. 1104 But often you only want to select one of two or more commands. This can be done using 1105 the <keycombo>&Ctrl;</keycombo> key. You only have to press the <keycombo>&Ctrl;</keycombo> key 1106 and a double click will only select the desired command.</para> 1107 1108 </sect2> 1109 1110 </sect1> 1111 1112 <sect1 id="editing_delete"> 1113 1114 <title>Delete</title> 1115 1116 <para>To delete some parts of a document you can of course select them, and then 1117 use the <keycombo><keycap>Delete</keycap></keycombo> key. &kate; also offers the command 1118 <keycombo>&Ctrl;<keycap>K</keycap></keycombo> which deletes the whole line. But &kile; offers a 1119 faster way with its own delete commands. 1120 Under <menuchoice><guimenu>Edit</guimenu><guisubmenu>Delete</guisubmenu></menuchoice> 1121 you will find the following commands to delete text.</para> 1122 1123 <screenshot> 1124 <screeninfo>Edit->Delete items</screeninfo> 1125 <mediaobject> 1126 <imageobject> 1127 <imagedata fileref="delete.png" format="PNG" /> 1128 </imageobject> 1129 <textobject> 1130 <phrase>Edit->Delete items</phrase> 1131 </textobject> 1132 </mediaobject> 1133 </screenshot> 1134 1135 <variablelist> 1136 <varlistentry><term><menuchoice> 1137 <shortcut><keycombo action="simul">&Ctrl;&Alt;<keycap>T</keycap></keycombo> 1138 <keycap>,E</keycap></shortcut> 1139 <guimenuitem>Environment (inside)</guimenuitem></menuchoice></term> 1140 <listitem><para>Delete an environment without the surrounding tags.</para></listitem> 1141 </varlistentry> 1142 1143 <varlistentry><term><menuchoice> 1144 <shortcut><keycombo action="simul">&Ctrl;&Alt;<keycap>T</keycap></keycombo> 1145 <keycap>,F</keycap></shortcut> 1146 <guimenuitem>Environment (outside)</guimenuitem></menuchoice></term> 1147 <listitem><para>Delete an environment including the surrounding tags.</para></listitem> 1148 </varlistentry> 1149 1150 <varlistentry><term><menuchoice> 1151 <shortcut><keycombo action="simul">&Ctrl;&Alt;<keycap>T</keycap></keycombo> 1152 <keycap>,T</keycap></shortcut> 1153 <guimenuitem>TeX Group (inside)</guimenuitem></menuchoice></term> 1154 <listitem><para>Delete a &tex; group inside the surrounding braces.</para></listitem> 1155 </varlistentry> 1156 1157 <varlistentry><term><menuchoice> 1158 <shortcut><keycombo action="simul">&Ctrl;&Alt;<keycap>T</keycap></keycombo> 1159 <keycap>,U</keycap></shortcut> 1160 <guimenuitem>TeX Group (outside)</guimenuitem></menuchoice></term> 1161 <listitem><para>Delete a &tex; group including the surrounding braces.</para></listitem> 1162 </varlistentry> 1163 1164 <varlistentry><term><menuchoice> 1165 <shortcut><keycombo action="simul">&Ctrl;&Alt;<keycap>T</keycap></keycombo> 1166 <keycap>,M</keycap></shortcut> 1167 <guimenuitem>Math Group</guimenuitem></menuchoice></term> 1168 <listitem><para>Delete the current math group including the math commands.</para></listitem> 1169 </varlistentry> 1170 1171 <varlistentry><term><menuchoice> 1172 <shortcut><keycombo action="simul">&Ctrl;&Alt;<keycap>T</keycap></keycombo> 1173 <keycap>,P</keycap></shortcut> 1174 <guimenuitem>Paragraph</guimenuitem></menuchoice></term> 1175 <listitem><para>Delete a whole paragraph. Look at the 1176 <menuchoice><guisubmenu>Select</guisubmenu><guimenuitem>Paragraph</guimenuitem></menuchoice> 1177 command, how a paragraph is 1178 defined in &kile;.</para></listitem> 1179 </varlistentry> 1180 1181 1182 <varlistentry><term><menuchoice> 1183 <shortcut><keycombo action="simul">&Ctrl;&Alt;<keycap>T</keycap></keycombo> 1184 <keycap>,I</keycap></shortcut> 1185 <guimenuitem>To End of Line</guimenuitem></menuchoice></term> 1186 <listitem><para>Delete the text from the current cursor position to the end of the line. 1187 </para></listitem> 1188 </varlistentry> 1189 1190 <varlistentry><term><menuchoice> 1191 <shortcut><keycombo action="simul">&Ctrl;&Alt;<keycap>T</keycap></keycombo> 1192 <keycap>,W</keycap></shortcut> 1193 <guimenuitem>TeX Word</guimenuitem></menuchoice></term> 1194 <listitem><para>Delete the word or &latex; 1195 command under the current cursor position.</para></listitem> 1196 </varlistentry> 1197 1198 </variablelist> 1199 1200 </sect1> 1201 1202 <sect1 id="editing_environment"> 1203 1204 <title>Environment</title> 1205 1206 <para>It has already been mentioned that environments are a central point in &latex;. 1207 So &kile; offers five other commands to make the work with &latex; as easy as possible 1208 under submenus <menuchoice><guimenu>Edit</guimenu><guisubmenu>Environment</guisubmenu></menuchoice>.</para> 1209 1210 <screenshot> 1211 <screeninfo>Edit->Environment items</screeninfo> 1212 <mediaobject> 1213 <imageobject> 1214 <imagedata fileref="environment.png" format="PNG" /> 1215 </imageobject> 1216 <textobject> 1217 <phrase>Edit->Environment items</phrase> 1218 </textobject> 1219 </mediaobject> 1220 </screenshot> 1221 1222 <variablelist> 1223 1224 <varlistentry><term><menuchoice> 1225 <shortcut><keycombo action="simul">&Ctrl;&Alt;<keycap>E</keycap></keycombo> 1226 <keycap>,B</keycap></shortcut> 1227 <guimenuitem>Go to Begin</guimenuitem></menuchoice></term> 1228 <listitem><para>This command will jump to the beginning of the current environment, 1229 wherever your current position is. The cursor will be placed directly 1230 in front of the opening environment tag.</para></listitem> 1231 </varlistentry> 1232 1233 <varlistentry><term><menuchoice> 1234 <shortcut><keycombo action="simul">&Ctrl;&Alt;<keycap>E</keycap></keycombo> 1235 <keycap>,E</keycap></shortcut> 1236 <guimenuitem>Go to End</guimenuitem></menuchoice></term> 1237 <listitem><para>This command will jump to the end of the current environment, 1238 wherever your current position is. The cursor will be placed directly 1239 behind the closing environment tag.</para></listitem> 1240 </varlistentry> 1241 1242 <varlistentry><term><menuchoice> 1243 <shortcut><keycombo action="simul">&Ctrl;&Alt;<keycap>E</keycap></keycombo> 1244 <keycap>,M</keycap></shortcut> 1245 <guimenuitem>Match</guimenuitem></menuchoice></term> 1246 <listitem><para>When your cursor is placed in front of or above the 1247 <userinput>\begin{environment}</userinput> tag, it will be moved to the 1248 opposite end of the environment and vice versa.</para></listitem> 1249 </varlistentry> 1250 1251 <varlistentry><term><menuchoice> 1252 <shortcut><keycombo action="simul">&Ctrl;&Alt;<keycap>E</keycap></keycombo> 1253 <keycap>,C</keycap></shortcut> 1254 <guimenuitem>Close</guimenuitem></menuchoice></term> 1255 <listitem><para>Typing a lot of nested environment tags, you may lose 1256 control of all those environments. This command will close the last 1257 opened environment, so that the nested structure of environments 1258 will not be broken.</para></listitem> 1259 </varlistentry> 1260 1261 <varlistentry><term><menuchoice> 1262 <shortcut><keycombo action="simul">&Ctrl;&Alt;<keycap>E</keycap></keycombo> 1263 <keycap>,A</keycap></shortcut> 1264 <guimenuitem>Close All</guimenuitem></menuchoice></term> 1265 <listitem><para>This closes all open environments, not only the last opened environment.</para></listitem> 1266 </varlistentry> 1267 1268 </variablelist> 1269 1270 </sect1> 1271 1272 <sect1 id="editing_texgroup"> 1273 1274 <title>&tex; Group</title> 1275 1276 <para>&kile; also offers some special commands for &latex; groups, 1277 which are determined by braces <userinput>{...}</userinput>. In submenu 1278 <menuchoice><guimenu>Edit</guimenu><guisubmenu>TeX Group</guisubmenu></menuchoice> 1279 you will find some important commands, which correspond to those from 1280 <menuchoice><guimenu>Edit</guimenu><guisubmenu>Environment</guisubmenu></menuchoice>. 1281 </para> 1282 1283 <screenshot> 1284 <screeninfo>Edit->TeX Group</screeninfo> 1285 <mediaobject> 1286 <imageobject> 1287 <imagedata fileref="texgroup.png" format="PNG" /> 1288 </imageobject> 1289 <textobject> 1290 <phrase>Edit->TeX Group</phrase> 1291 </textobject> 1292 </mediaobject> 1293 </screenshot> 1294 1295 <variablelist> 1296 <varlistentry><term><menuchoice> 1297 <shortcut><keycombo action="simul">&Ctrl;&Alt;<keycap>G</keycap></keycombo> 1298 <keycap>,B</keycap></shortcut> 1299 <guimenuitem>Go to Begin</guimenuitem></menuchoice></term> 1300 <listitem><para>This command will jump to the beginning of the current group, 1301 wherever your current position is. The cursor will be placed directly in front 1302 of the opening brace.</para></listitem> 1303 </varlistentry> 1304 1305 <varlistentry><term><menuchoice> 1306 <shortcut><keycombo action="simul">&Ctrl;&Alt;<keycap>G</keycap></keycombo> 1307 <keycap>,E</keycap></shortcut> 1308 <guimenuitem>Go to End</guimenuitem></menuchoice></term> 1309 <listitem><para>This command will jump to the end of the current group, 1310 wherever your current position is. The cursor will be placed directly 1311 behind the closing brace.</para></listitem> 1312 </varlistentry> 1313 1314 <varlistentry><term><menuchoice> 1315 <shortcut><keycombo action="simul">&Ctrl;&Alt;<keycap>G</keycap></keycombo> 1316 <keycap>,M</keycap></shortcut> 1317 <guimenuitem>Match</guimenuitem></menuchoice></term> 1318 <listitem><para>When your cursor is placed in front of or behind an 1319 opening brace of a &tex; group, it will be moved to the opposite end of 1320 the group and vice versa.</para></listitem> 1321 </varlistentry> 1322 1323 <varlistentry><term><menuchoice> 1324 <shortcut><keycombo action="simul">&Ctrl;&Alt;<keycap>G</keycap></keycombo> 1325 <keycap>,C</keycap></shortcut> 1326 <guimenuitem>Close</guimenuitem></menuchoice></term> 1327 <listitem><para>Typing a lot of nested group braces may be hard work. 1328 This command will close the last opened group, so that the nested 1329 structure of &tex; groups will not be broken.</para></listitem> 1330 </varlistentry> 1331 1332 </variablelist> 1333 1334 </sect1> 1335 1336 <sect1 id="editing_dblquotes"> 1337 1338 <title>Double Quotes</title> 1339 1340 <para>In &latex;, two single quotes are used as double quotes. To 1341 help you insert these efficiently, &kile; allows you to press 1342 <keycap>"</keycap> to insert two opening 1343 single quotes. Furthermore, if you want to close a quotation, you also 1344 have to press <keycap>"</keycap>. &kile; will 1345 be smart enough to recognize this situation and inserts two closing quotes 1346 for &latex;.</para> 1347 1348 <para>To get a literal double quote on the other side, press 1349 <keycap>"</keycap> twice.</para> 1350 1351 <para>You can enable or disable this auto insertion of opening and 1352 closing double quotes in section 1353 <menuchoice><guimenu>Settings</guimenu><guisubmenu>Configure 1354 Kile...</guisubmenu><guimenuitem>LaTeX</guimenuitem></menuchoice>.</para> 1355 1356 <screenshot> 1357 <screeninfo>Double Quotes</screeninfo> 1358 <mediaobject> 1359 <imageobject> 1360 <imagedata fileref="config-dblquotes.png" format="PNG" /> 1361 </imageobject> 1362 <textobject> 1363 <phrase>Double Quotes</phrase> 1364 </textobject> 1365 </mediaobject> 1366 </screenshot> 1367 1368 <para>If you also include language-specific options 1369 like <userinput>ngerman</userinput> or <userinput>french</userinput>, 1370 you will also be able to use German or French double quotes. Many more languages are available. 1371 </para> 1372 1373 </sect1> 1374 1375 <sect1 id="editing_smartnewline"> 1376 1377 <title>Smart Newline</title> 1378 1379 <para>If you press <keycombo>&Ctrl;<keycap>Return</keycap></keycombo>, 1380 &kile; inserts an intelligent newline. If your current position 1381 is inside a list environment, like <userinput>enumerate</userinput> 1382 or <userinput>itemize</userinput>, &kile; will not only insert 1383 a newline, but also add a <userinput>\item</userinput> command.</para> 1384 1385 <para>If you are inside a tabular environment, &kile; will finish the 1386 current line with <userinput>\\</userinput>, followed by the newline.</para> 1387 1388 <para>If you are inside a &latex; comment, &kile; will start the next line with a 1389 <userinput>%</userinput>.</para> 1390 1391 <para>Even better, &kile; is smart enough to support predefined &latex; 1392 and user defined environments, which can be added in section 1393 <menuchoice><guimenu>Settings</guimenu><guisubmenu>Configure 1394 Kile...</guisubmenu><guimenuitem>LaTeX</guimenuitem></menuchoice>.</para> 1395 1396 </sect1> 1397 1398 <sect1 id="editing_tabulator"> 1399 1400 <title>Smart Tabulator</title> 1401 1402 <para>Some users like to arrange columns in tabular environments and 1403 put all ampersand characters <keycap>&</keycap> beneath each other. &kile; tries 1404 to support this. If you press <keycombo>&Alt;&Shift;<keycap>&</keycap></keycombo>, 1405 &kile; will look for the next tab in the row above. Although this tab may not be the 1406 corresponding tab, &kile; will add some spaces to adjust the column position with 1407 the current tab.</para> 1408 1409 </sect1> 1410 1411 </chapter> 1412 1413 <chapter id="completion"> 1414 1415 <title>Code Completion</title> 1416 1417 <para>Although &kate; already offers a good completion mode, &kile; extends 1418 code completion to support some special methods especially for &latex;. Five different 1419 modes are integrated. Three of them work on demand, the other two are autocompletion 1420 modes. All modes can be configured to work very differently at 1421 <menuchoice><guimenu>Settings</guimenu><guimenuitem>Configure Kile...</guimenuitem></menuchoice>.</para> 1422 1423 <sect1 id="complete_autoenvironment"> 1424 1425 <title>Automatic Environment Completion</title> 1426 1427 <para>When you begin a new environment, typing <userinput>\begin{environment}</userinput>, 1428 &kile; will automatically add an <userinput>\end{environment}</userinput> command, with a 1429 line in between for your text.</para> 1430 1431 <para>Autocompletion can be turned off in the &latex; section of 1432 <menuchoice><guimenu>Settings</guimenu><guisubmenu>Configure Kile...</guisubmenu> 1433 <guimenuitem>LaTeX</guimenuitem><guilabel>Environments</guilabel></menuchoice>.</para> 1434 1435 <screenshot> 1436 <screeninfo>Completing an Equation Environment</screeninfo> 1437 <mediaobject> 1438 <imageobject> 1439 <imagedata fileref="snap_autocomplete.png" format="PNG" /> 1440 </imageobject> 1441 <textobject> 1442 <phrase>Completing an Equation Environment</phrase> 1443 </textobject> 1444 <caption><para>Completing an Equation Environment</para></caption> 1445 </mediaobject> 1446 </screenshot> 1447 1448 </sect1> 1449 1450 <sect1 id="complete_command"> 1451 1452 <title>&latex; Commands</title> 1453 1454 <para>When you type some letters, you can activate this completion mode for &latex; commands 1455 and normal words with <menuchoice><guimenu>Edit</guimenu><guisubmenu>Complete</guisubmenu><guimenuitem>(La)TeX Command</guimenuitem></menuchoice> or the keyboard shortcut 1456 <keycombo>&Ctrl;&Shift;<keycap>Space</keycap></keycombo>. 1457 &kile; first reads the letters from the current cursor position to the 1458 left and stops at the first non-letter character or a backslash. If this 1459 pattern begins with a backslash, &kile; will enter completion mode for &tex; or &latex; 1460 commands. Otherwise it enters normal dictionary mode, where you will not find any 1461 &latex; commands. Depending on the chosen mode, a completion box will be opened. 1462 You will see all commands or words whose beginning matches the current pattern. 1463 You can navigate with the cursor keys through this list and select one entry with 1464 &Enter; or a double click with the mouse.</para> 1465 1466 <screenshot> 1467 <screeninfo>Completing a LaTeX Command</screeninfo> 1468 <mediaobject> 1469 <imageobject> 1470 <imagedata fileref="complete_cmd1.png" format="PNG" /> 1471 </imageobject> 1472 <textobject> 1473 <phrase>Completing a LaTeX Command</phrase> 1474 </textobject> 1475 </mediaobject> 1476 </screenshot> 1477 1478 <para>When you push the &Backspace; key, the last letter of your 1479 pattern will be deleted, and the completion list may grow. On the other hand, if 1480 you type another letter it will expand the pattern and the 1481 visible word list may shrink.</para> 1482 1483 <para>If you decide not to select any of the suggestions, you can leave this 1484 dialog with &Esc;.</para> 1485 1486 <para>You will see that all commands are written with a short description of 1487 their parameters. These descriptions are of course stripped when you select a command. 1488 Optionally you can let &kile; insert bullets at these places, so that you can easily 1489 jump to these positions with <menuchoice><guimenu>Edit</guimenu><guisubmenu>Bullets</guisubmenu><guimenuitem>Next Bullet</guimenuitem></menuchoice> 1490 and insert the parameter you want.</para> 1491 1492 <screenshot> 1493 <screeninfo>Completing a LaTeX Command</screeninfo> 1494 <mediaobject> 1495 <imageobject> 1496 <imagedata fileref="complete_cmd2.png" format="PNG" /> 1497 </imageobject> 1498 <textobject> 1499 <phrase>Completing a LaTeX Command</phrase> 1500 </textobject> 1501 </mediaobject> 1502 </screenshot> 1503 1504 <para>Go to 1505 <menuchoice><guimenu>Settings</guimenu><guisubmenu>Configure Kile...</guisubmenu> 1506 <guimenuitem>Kile</guimenuitem><guilabel>Complete</guilabel></menuchoice> 1507 to configure one or more of these lists. You can choose different word lists 1508 for &tex; and &latex; commands and dictionary mode for normal words.</para> 1509 1510 <para>If you choose the option <guimenuitem>Show Latex commands</guimenuitem>, 1511 the entries of all chosen compressed word list (cwl) files for &latex; command completion are shown in a 1512 separate view of &kile;'s sidebar. You will see 1513 which commands are available and what parameters and options must or can be 1514 given for a completion. You can also simply select one entry with a mouse click 1515 and it will be inserted into the document, with all named parameters and 1516 options stripped.</para> 1517 1518 <screenshot> 1519 <screeninfo>LaTeX commands in the sidebar</screeninfo> 1520 <mediaobject> 1521 <imageobject> 1522 <imagedata fileref="command-view.png" format="PNG" /> 1523 </imageobject> 1524 <textobject> 1525 <phrase>LaTeX commands in the sidebar</phrase> 1526 </textobject> 1527 </mediaobject> 1528 </screenshot> 1529 1530 <para>As each chosen word list will be shown in a separate view of its own, 1531 there could be too many views, so that &kile;'s main window may be larger 1532 than a small screen allows. As this looks very ugly, &kile; works with a maximum 1533 number of allowed views, which by default is set to 10. If this value is too big 1534 for your screen, you should reduce it.</para> 1535 1536 </sect1> 1537 1538 <sect1 id="complete_environment"> 1539 1540 <title>Environments</title> 1541 1542 <para>The <emphasis>command mode</emphasis> is not useful for code completion of environments. 1543 You always have to type some letters of <userinput>\begin</userinput>, and invoking 1544 the completion mode will result in a huge list of environment tags. On the other 1545 hand, environments are so often used that &kile; offers a special mode for code completion of 1546 environments. Forget the opening tag and write, for example, <userinput>al</userinput>.</para> 1547 1548 <para>When you call the completion mode with 1549 <menuchoice><guimenu>Edit</guimenu><guisubmenu>Complete</guisubmenu><guimenuitem>Environment</guimenuitem></menuchoice> or keyboard shortcut <keycombo>&Alt;&Shift;<keycap>Space</keycap></keycombo>, 1550 the opening tag is automatically added and you will see <userinput>\begin{al}</userinput>. 1551 After this change, the completion list is much less cluttered.</para> 1552 1553 <screenshot> 1554 <screeninfo>Completing a LaTeX Command</screeninfo> 1555 <mediaobject> 1556 <imageobject> 1557 <imagedata fileref="complete_env1.png" format="PNG" /> 1558 </imageobject> 1559 <textobject> 1560 <phrase>Completing a LaTeX Command</phrase> 1561 </textobject> 1562 </mediaobject> 1563 </screenshot> 1564 1565 <para>Now select an environment, and you will see that it is also automatically closed. 1566 Even more, if &kile; recognizes it as a list environment, it will also insert a first 1567 <userinput>\item</userinput> tag.</para> 1568 1569 <screenshot> 1570 <screeninfo>Completing a LaTeX Command</screeninfo> 1571 <mediaobject> 1572 <imageobject> 1573 <imagedata fileref="complete_env2.png" format="PNG" /> 1574 </imageobject> 1575 <textobject> 1576 <phrase>Completing a LaTeX Command</phrase> 1577 </textobject> 1578 </mediaobject> 1579 </screenshot> 1580 1581 <para>Go to 1582 <menuchoice><guimenu>Settings</guimenu><guisubmenu>Configure Kile...</guisubmenu> 1583 <guimenuitem>Kile</guimenuitem><guilabel>Complete</guilabel></menuchoice> 1584 to configure one or more of these lists. This mode uses the same word lists as the 1585 completion mode for &tex; and &latex; commands.</para> 1586 1587 </sect1> 1588 1589 <sect1 id="complete_abbreviation"> 1590 1591 <title>Abbreviations</title> 1592 1593 <para>&kile; supports user defined lists of abbreviations, which are replaced 1594 on demand by longer text strings. Look at 1595 <menuchoice><guimenu>Settings</guimenu><guisubmenu>Configure Kile...</guisubmenu> 1596 <guimenuitem>Kile</guimenuitem><guilabel>Complete</guilabel></menuchoice> 1597 to configure one or more of these lists. For the example given here, the 1598 abbreviation list in <filename>example.cwl</filename> must be chosen. 1599 In this file you will find, for example, the entry <userinput>L=\LaTeX</userinput>.</para> 1600 1601 <para>For example, type only the letter <userinput>L</userinput>. Now invoke 1602 the abbreviation mode of word completion with 1603 <menuchoice><guimenu>Edit</guimenu><guisubmenu>Complete</guisubmenu><guimenuitem>Abbreviation</guimenuitem></menuchoice> or keyboard shortcut <keycombo>&Ctrl;&Alt;<keycap>Space</keycap></keycombo>, 1604 and the letter <userinput>L</userinput> is replaced by the string 1605 <userinput>\LaTeX</userinput>.</para> 1606 1607 <para>Abbreviation completion also supports newline <userinput>%n</userinput> and <userinput>%C</userinput> 1608 to place the cursor, if these characters are present in the expansion text. 1609 So if you have the entry</para> 1610 1611 <programlisting>en1=\begin{enumerate}%n\item %C%n\end{enumerate}%n</programlisting> 1612 1613 <para>in the completion file, and invoke the abbreviation completion, 1614 the expansion looks as below, where <userinput>x</userinput> shows the final cursor position.</para> 1615 1616 <programlisting>\begin{enumerate} 1617 \item x 1618 \end{enumerate}</programlisting> 1619 1620 <sect2 id="complete_abbrev_view"> 1621 1622 <title>Abbreviations</title> 1623 1624 <para>If you choose <guimenuitem>Show abbreviations</guimenuitem>, all possible 1625 abbreviations are shown in a view of the sidebar. So you will have a good survey 1626 of all possible abbreviations.</para> 1627 1628 </sect2> 1629 1630 </sect1> 1631 1632 <sect1 id="complete_auto"> 1633 1634 <title>Autocompletion Modes</title> 1635 1636 <sect2 id="complete_autolatex"> 1637 1638 <title>&latex; Commands</title> 1639 1640 <para>You can also enable an autocompletion mode for &latex; commands. 1641 When a given threshold of letters (default: 3) is entered, a popup window opens 1642 with a list of all matching &latex; commands. You can select one of these commands, 1643 or ignore this window and type further letters. The entries of the completion box 1644 will always change and match your currently typed word.</para> 1645 1646 <para>Go to 1647 <menuchoice><guimenu>Settings</guimenu><guisubmenu>Configure Kile...</guisubmenu> 1648 <guimenuitem>Kile</guimenuitem><guilabel>Complete</guilabel></menuchoice> 1649 to enable or disable this mode or to change the threshold.</para> 1650 1651 <screenshot> 1652 <screeninfo>Completing an Equation Environment</screeninfo> 1653 <mediaobject> 1654 <imageobject> 1655 <imagedata fileref="config-complete.png" format="PNG" /> 1656 </imageobject> 1657 <textobject> 1658 <phrase>Completing an Equation Environment</phrase> 1659 </textobject> 1660 </mediaobject> 1661 </screenshot> 1662 1663 </sect2> 1664 1665 <sect2 id="complete_autotext"> 1666 1667 <title>Document Words</title> 1668 1669 <para>Large dictionaries are not useful in autocompletion mode. But, we have seen 1670 that a lot of words in a document are typed more than once. So &kile; offers a 1671 completion for all words from the document that the user has already typed. 1672 You can manually invoke this completion, if you press 1673 <keycombo>&Ctrl;<keycap>Space</keycap></keycombo>. Note that 1674 this mode is different from the completion mode for &latex; commands.</para> 1675 1676 <para>If you want to turn this mode on or off, go to 1677 <menuchoice><guimenu>Settings</guimenu><guisubmenu>Configure Kile...</guisubmenu> 1678 <guimenuitem>Editor</guimenuitem><guimenuitem>Editing</guimenuitem><guilabel>Auto Completion</guilabel></menuchoice>. 1679 In this dialog you can configure if completion mode for 1680 document words should be enabled. There is also an additional autocompletion mode, 1681 where a completion box pops up, when a certain threshold is reached.</para> 1682 1683 </sect2> 1684 1685 </sect1> 1686 1687 <sect1 id="complete_own_files"> 1688 1689 <title>Writing Own Completion Files</title> 1690 1691 <para>The latest specification of the completion file format can found in the 1692 <ulink url="https://commits.kde.org/kile?path=README.cwl"> 1693 CWL file format specification</ulink>. 1694 </para> 1695 1696 <para> 1697 Completion files can be installed in a user's home folder under the <filename>~/.kde/share/apps/kile/complete/<mode>/</filename> 1698 subdirectory, where <parameter><mode></parameter> either stands for <constant>abbreviation</constant>, <constant>dictionary</constant> or <constant>tex</constant>. 1699 </para> 1700 1701 </sect1> 1702 </chapter> 1703 1704 <chapter id="wizard"> 1705 1706 <title>Wizards and Dialogs</title> 1707 1708 <sect1 id="wizard_quickstart"> 1709 1710 <title>QuickStart Wizard</title> 1711 1712 <para>This wizard has already been described in the section <xref linkend="intro_docwizard" role="select: title pageabbrv"/>.</para> 1713 1714 </sect1> 1715 1716 <sect1 id="wizard_graphics"> 1717 1718 <title>Include Graphics</title> 1719 1720 <para>The <guilabel>Include Graphics</guilabel> dialog makes insertion of 1721 graphics as easy as possible. You can reach it via the menubar with <menuchoice><guimenu>LaTeX</guimenu><guimenuitem>Image 1722 Insertion</guimenuitem></menuchoice>. Please take a look at 1723 <xref linkend="build_graphics" role="select: title pageabbrv"/> and <xref linkend="build_epsgraphics" role="select: title pageabbrv"/> to 1724 get an overview of some basic facts concerning graphic formats.</para> 1725 1726 <screenshot> 1727 <screeninfo>Including a graphics element</screeninfo> 1728 <mediaobject> 1729 <imageobject> 1730 <imagedata fileref="includegraphics.png" format="PNG" /> 1731 </imageobject> 1732 <textobject> 1733 <phrase>Including a graphics element</phrase> 1734 </textobject> 1735 </mediaobject> 1736 </screenshot> 1737 1738 <procedure> 1739 <step><para>Choose a graphics file. This can be a JPEG, PNG, PDF, EPS 1740 or even a zipped or gzipped EPS file. If you have installed 1741 <ulink url="http://www.imagemagick.org/">&imagemagick;</ulink> 1742 and also configured &kile; to use it 1743 (<menuchoice><guimenu>Settings</guimenu><guisubmenu>Configure Kile...</guisubmenu> 1744 <guimenuitem>LaTeX</guimenuitem><guilabel>Graphics</guilabel></menuchoice>), 1745 the width and the height of the graphic is automatically shown. 1746 If &imagemagick; can determine a resolution, the size of the graphics 1747 is also shown in centimeters.</para></step> 1748 1749 <step><para>Decide whether your image shall be centered on the page.</para></step> 1750 1751 <step><para>Choose whether you want the <userinput>\graphicspath</userinput> 1752 notation for your graphics file.</para> 1753 1754 <para>By default graphics files have to be in the same 1755 folder as your master document. However, 1756 it is possible to put them in other folders to make 1757 things tidier. Without a <userinput>\graphicspath</userinput> 1758 command, &kile; would include the path for the graphics file. 1759 But if you use <userinput>\graphicspath</userinput> in your 1760 preamble like this:</para> 1761 1762 <programlisting>\graphicspath{{/path/to/my/graphics}{other/path/to/more/graphics}}</programlisting> 1763 1764 <para>and check this option, &kile; will only use the 1765 base name of the graphics file.</para> 1766 1767 <para>Another example: if you set <userinput>\graphicspath</userinput> 1768 command like:</para> 1769 1770 <programlisting>\graphicspath{{./}{camera/}{images/}}</programlisting> 1771 1772 <para>&latex; will search in the current folder, then in 1773 <filename>camera</filename> and finally in 1774 <filename>images</filename> to find your graphics file.</para></step> 1775 1776 <step><para>If you choose either a width or a height, the whole graphics 1777 will be proportionally scaled. If you set two values for width and height 1778 at the same time, width and height may be scaled with different factors, 1779 and this could not be what you want. See also the information near the top 1780 of the dialog to know the original size of the graphics.</para></step> 1781 1782 <step><para>Insert an angle by which to rotate the graphics counterclockwise.</para></step> 1783 1784 <step><para>The bounding-box information is set automatically 1785 when you choose a graphics file. This information is only needed 1786 when you work with traditional &latex; and bitmapped graphics. 1787 See the discussion of <link linkend="build_epsgraphics">EPS graphics</link>. 1788 </para> 1789 1790 <para>If &latex; needs a bounding box and you do not want to generate a bb file, 1791 &kile; supports this option. On the other hand, &pdflatex; will give a warning 1792 when you want to include a png or jpg graphics with this option. This checkbox 1793 enables or disables the bounding-box option.</para></step> 1794 1795 <step><para>Scale the image by the desired scale factor. ⪚, 0.5 to reduce by half, 1796 or 2 to double. When you use this option, you do not have to set a width or height for 1797 the image.</para></step> 1798 1799 <step><para>In the <guilabel>Trim Image</guilabel> tab you can crop your 1800 image in all four directions.</para></step> 1801 1802 <step> 1803 <para>Finally, you have to specify whether you want to embed this image into a 1804 figure environment. When you want the text to wrap around the figure, use the wrapfigure environment instead. 1805 </para> 1806 <note> 1807 <para>When you choose the wrapfigure environment, you need to include the wrapfig package in your preamble.</para> 1808 </note> 1809 <para>In either case you can insert a 1810 caption and a label for your image. Generally, it is a good idea to add a different prefix to 1811 each kind of label. It is common to use the prefix <userinput>fig:</userinput> for images. 1812 </para> 1813 </step> 1814 1815 <step><para>If you pick the figure environment, you can choose where &latex; should preferably position the figure. 1816 </para></step> 1817 <step> 1818 <para>In the wrapfigure environment you can:</para> 1819 <substeps> 1820 <step><para> 1821 Pick a placement rule for the figure and decide whether the figure should float or not. 1822 In a two-sided document you can define whether the figure should be on the inside or outside edge of the page. 1823 </para></step> 1824 <step><para> 1825 Define how many shortened lines of the text are set alongside the figure. If you leave this empty, &latex; will determine this itself as 1826 well as is possible. 1827 </para></step> 1828 <step><para> 1829 Define an overhang to the chosen side. This is especially useful when you have columns in your document and you want 1830 a figure to span over more than just one column or you want shortened text on both sides of the figure. 1831 </para></step> 1832 <step><para> 1833 Choose a width for the figure. This should be a bit bigger than the actual image width, so there will be some empty 1834 space between the figure and the text. 1835 </para></step> 1836 </substeps> 1837 </step> 1838 </procedure> 1839 1840 </sect1> 1841 1842 <sect1 id="wizard_array"> 1843 1844 <title>Arrays and tabulars</title> 1845 1846 <para>One of the most boring jobs one can do in &latex; is to write a matrix or a 1847 tabular environment. One has to keep track of all the elements, ensure that the environment 1848 is well formed, and that all things are where they are supposed to be. Good indentation helps, 1849 but there is a simpler way: using &kile;'s <menuchoice><guimenu>Wizard</guimenu><guimenuitem>Array</guimenuitem></menuchoice> 1850 or 1851 <menuchoice><guimenu>Wizard</guimenu><guimenuitem>Tabular</guimenuitem></menuchoice> menu entries. 1852 You will then have a matrix-style input form that you can easily fill in with your entries. This dialog also 1853 offers some options to typeset the tabular material.</para> 1854 1855 <screenshot> 1856 <screeninfo>Inserting a tabular environment</screeninfo> 1857 <mediaobject> 1858 <imageobject> 1859 <imagedata fileref="dialog-tabular.png" format="PNG" /> 1860 </imageobject> 1861 <textobject> 1862 <phrase>Inserting a tabular environment</phrase> 1863 </textobject> 1864 </mediaobject> 1865 </screenshot> 1866 1867 <para> 1868 Using the toolbar on top of the dialog you can set the <userinput>align</userinput> of a cell, define a certain <userinput>font style</userinput>, 1869 <userinput>join</userinput> and <userinput>split</userinput> cells, choose a <userinput>border</userinput>, and specify background and font 1870 <userinput>colors</userinput>. 1871 On the extreme right there is a <guilabel>Paste</guilabel> button. With this button you can insert a table 1872 from the clipboard into the dialog, which allows you to copy and paste tables from a spreadsheet program, for example. 1873 </para> 1874 1875 <para> 1876 Below you can choose how many rows and columns you want, and you can tweak some more details about your array: 1877 </para> 1878 1879 <itemizedlist> 1880 <listitem><para> 1881 With the <guilabel>Name</guilabel> option you can select which environment should be used for your array or tabular material. 1882 </para></listitem> 1883 <listitem><para> 1884 You can select the vertical cell alignment with the <guilabel>Parameter</guilabel> option. This is only enabled for 1885 environments which support that feature. 1886 </para></listitem> 1887 <listitem><para> 1888 If it exists for the selected environment, you can select <guilabel>use starred version</guilabel>. When you select this option, 1889 you also have to specify a <guilabel>table width</guilabel>. 1890 </para></listitem> 1891 <listitem><para> 1892 Tables sometimes look nicer when you select the <guilabel>use booktabs package</guilabel> option. 1893 </para></listitem> 1894 <listitem><para> 1895 Of course, you can also <guilabel>Center</guilabel> your whole array. 1896 </para></listitem> 1897 <listitem><para> 1898 <guilabel>Inserting bullets</guilabel> helps you when you want to fill in your content in the editor. With this option 1899 checked, &kile; will insert bullet placeholders for each element of your array. 1900 </para></listitem> 1901 </itemizedlist> 1902 1903 <para>The <menuchoice><guimenu>Wizard</guimenu><guimenuitem>Tabbing</guimenuitem></menuchoice> option will display a simpler 1904 dialog to quickly set up a tabbing environment. It allows you to easily specify the 1905 number of rows or columns and the required spacing.</para> 1906 </sect1> 1907 1908 <sect1 id="wizard_float"> 1909 <title>Inserting floating elements</title> 1910 1911 <para>&kile; helps you with inserting your floating elements. With the 1912 <menuchoice><guimenu>Wizard</guimenu><guimenuitem>Floats</guimenuitem></menuchoice> wizard it is very simple to create 1913 a new figure or table environment. 1914 </para> 1915 1916 <screenshot> 1917 <screeninfo>Inserting a floating element</screeninfo> 1918 <mediaobject> 1919 <imageobject> 1920 <imagedata fileref="dialog-float.png" format="PNG" /> 1921 </imageobject> 1922 <textobject> 1923 <phrase>Inserting a floating element</phrase> 1924 </textobject> 1925 </mediaobject> 1926 </screenshot> 1927 1928 <para> 1929 To insert a new floating environment just follow these steps: 1930 </para> 1931 1932 <procedure> 1933 <step> 1934 <para> 1935 Choose whether you want to insert a figure or a table. 1936 </para> 1937 </step> 1938 <step> 1939 <para> 1940 Select the desired positioning rules. 1941 </para> 1942 </step> 1943 <step> 1944 <para> 1945 Enter a caption for your floating element. 1946 </para> 1947 </step> 1948 <step> 1949 <para> 1950 Type in a label for your new floating element. &kile; will automatically suggest an appropriate prefix , ⪚ "fig:" 1951 for figures and "tab:" for tables. 1952 </para> 1953 </step> 1954 </procedure> 1955 </sect1> 1956 1957 <sect1 id="wizard_math"> 1958 <title>Inserting Math environments</title> 1959 1960 <para>Remembering how all the different math elements work can be really annoying. Of course &kile; can do the 1961 magic for you here: <menuchoice><guimenu>Wizard</guimenu><guimenuitem>Math</guimenuitem></menuchoice></para> 1962 1963 <screenshot> 1964 <screeninfo>Inserting a math element</screeninfo> 1965 <mediaobject> 1966 <imageobject> 1967 <imagedata fileref="dialog-math.png" format="PNG" /> 1968 </imageobject> 1969 <textobject> 1970 <phrase>Inserting a math element</phrase> 1971 </textobject> 1972 </mediaobject> 1973 </screenshot> 1974 1975 <para> 1976 Options: 1977 </para> 1978 <itemizedlist> 1979 <listitem><para><guilabel>Name:</guilabel> Choose the type of math element you want to create.</para></listitem> 1980 <listitem><para><guilabel>Without numbering:</guilabel> This can switch numbering off for numbered 1981 elements like equations or aligns.</para></listitem> 1982 <listitem><para><guilabel>Space command to separate groups:</guilabel> In an environment which supports several 1983 groups like alignat, you can define a space separator when you have more than one group. You can enter any space command here, 1984 which exists in mathmode, ⪚ \quad. </para></listitem> 1985 <listitem><para><guilabel>Standard tabulator:</guilabel> Select the tabulator which should be used. 1986 &kile; should automatically pick the right one for you here.</para></listitem> 1987 <listitem><para><guilabel>Displaymath mode:</guilabel> For environments like matrices or arrays you can 1988 choose which math environment your mathematical text should be displayed with. </para></listitem> 1989 <listitem><para><guilabel>Use bullets:</guilabel> With this option checked, &kile; will insert bullet 1990 placeholders for each element of your mathematical text.</para></listitem> 1991 </itemizedlist> 1992 </sect1> 1993 1994 <sect1 id="wizard_postscript"> 1995 1996 <title>&PostScript; Utilities</title> 1997 1998 <para>PS files are not so popular as PDF files, but are an excellent base 1999 for manipulations and rearrangements of pages. If you need PDF 2000 output, you can rearrange pages with some &PostScript; utilities and then 2001 convert it to PDF with <command>ps2pdf</command>.</para> 2002 2003 <para>The <emphasis>&PostScript; Wizard</emphasis> under <menuchoice><guimenu>Wizard</guimenu><guimenuitem>Postscript 2004 Tools</guimenuitem></menuchoice> will suggest the most 2005 popular rearrangement. The conversion is done 2006 by the programs <command>pstops</command> and <command>psselect</command>, which 2007 can be found in most distributions in the package <userinput>psutils</userinput>. 2008 If one of these programs is not available, the corresponding item will not 2009 be visible.</para> 2010 2011 <screenshot> 2012 <screeninfo>Dialog PSTools</screeninfo> 2013 <mediaobject> 2014 <imageobject> 2015 <imagedata fileref="dialog-pstools.png" format="PNG" /> 2016 </imageobject> 2017 <textobject> 2018 <phrase>Dialog PSTools</phrase> 2019 </textobject> 2020 </mediaobject> 2021 </screenshot> 2022 2023 <para>First choose your input file. If &kile; finds a PS file corresponding to your 2024 current master document, it is already filled in as the input file, but you are also free 2025 to choose another file. Then choose an output file, and select one of the tasks. 2026 Finally, you have to decide whether you want to do the conversion only, or also invoke 2027 &okular; to view the result.</para> 2028 2029 <variablelist> 2030 2031 <varlistentry> 2032 <term>1 A5 page + empty page --> A4</term> 2033 <listitem><para>Combine one A5 page together with one empty page 2034 on one A4 page. Whenever two A5 pages are combined together, 2035 they are rotated 90 degrees and will be arranged 2036 on an A4 page in landscape mode.</para> 2037 <screenshot> 2038 <screeninfo>A5 + empty page</screeninfo> 2039 <mediaobject> 2040 <imageobject> 2041 <imagedata fileref="psutils1.png" format="PNG" /> 2042 </imageobject> 2043 <textobject> 2044 <phrase>A5 + empty page</phrase> 2045 </textobject> 2046 </mediaobject> 2047 </screenshot> 2048 </listitem> 2049 </varlistentry> 2050 2051 <varlistentry> 2052 <term>1 A5 page + duplicate --> A4</term> 2053 <listitem><para>Put one A5 page and a duplicate together 2054 on one A4 page.</para> 2055 <screenshot> 2056 <screeninfo>duplicate A5 pages</screeninfo> 2057 <mediaobject> 2058 <imageobject> 2059 <imagedata fileref="psutils2.png" format="PNG" /> 2060 </imageobject> 2061 <textobject> 2062 <phrase>Duplicate an A5 page</phrase> 2063 </textobject> 2064 </mediaobject> 2065 </screenshot> 2066 </listitem> 2067 </varlistentry> 2068 2069 <varlistentry> 2070 <term>2 A5 pages --> A4</term> 2071 <listitem><para>Put two consecutive A5 pages together 2072 on one A4 page.</para> 2073 <screenshot> 2074 <screeninfo>Combine two A5 pages</screeninfo> 2075 <mediaobject> 2076 <imageobject> 2077 <imagedata fileref="psutils3.png" format="PNG" /> 2078 </imageobject> 2079 <textobject> 2080 <phrase>Combine two A5 pages</phrase> 2081 </textobject> 2082 </mediaobject> 2083 </screenshot> 2084 </listitem> 2085 </varlistentry> 2086 2087 <varlistentry> 2088 <term>2 A5L pages --> A4</term> 2089 <listitem><para>Put two consecutive A5 pages in landscape mode together 2090 on one A4 page.</para></listitem> 2091 </varlistentry> 2092 2093 <varlistentry> 2094 <term>4 A5 pages --> A4</term> 2095 <listitem><para>Combine four consecutive A5 pages together on one 2096 A4 page. The A5 pages have to be scaled with factor 0.7 to fit 2097 on the page.</para> 2098 <screenshot> 2099 <screeninfo>4 A5 pages --> A4</screeninfo> 2100 <mediaobject> 2101 <imageobject> 2102 <imagedata fileref="psutils5.png" format="PNG" /> 2103 </imageobject> 2104 <textobject> 2105 <phrase>4 A5 pages --> A4</phrase> 2106 </textobject> 2107 </mediaobject> 2108 </screenshot> 2109 </listitem> 2110 </varlistentry> 2111 2112 <varlistentry> 2113 <term>1 A4 page + empty page --> A4</term> 2114 <listitem><para>Combine one A4 page together with one empty page 2115 on one A4 page. Whenever two A4 pages are combined together on one 2116 resulting A4 page, they have to be scaled with factor 0.7 and will 2117 be arranged in landscape mode.</para> 2118 <screenshot> 2119 <screeninfo>1 A4 page + empty page --> A4</screeninfo> 2120 <mediaobject> 2121 <imageobject> 2122 <imagedata fileref="psutils6.png" format="PNG" /> 2123 </imageobject> 2124 <textobject> 2125 <phrase>1 A4 page + empty page --> A4</phrase> 2126 </textobject> 2127 </mediaobject> 2128 </screenshot> 2129 </listitem> 2130 </varlistentry> 2131 2132 <varlistentry> 2133 <term>1 A4 page + duplicate --> A4</term> 2134 <listitem><para>Put one A4 page and a duplicate together 2135 on one A4 page.</para> 2136 <screenshot> 2137 <screeninfo>1 A4 page + duplicate --> A4</screeninfo> 2138 <mediaobject> 2139 <imageobject> 2140 <imagedata fileref="psutils7.png" format="PNG" /> 2141 </imageobject> 2142 <textobject> 2143 <phrase>1 A4 page + duplicate --> A4</phrase> 2144 </textobject> 2145 </mediaobject> 2146 </screenshot> 2147 </listitem> 2148 </varlistentry> 2149 2150 <varlistentry> 2151 <term>2 A4 pages --> A4</term> 2152 <listitem><para>Put two consecutive A4 pages together 2153 on one A4 page.</para> 2154 <screenshot> 2155 <screeninfo>Combine two A4 pages</screeninfo> 2156 <mediaobject> 2157 <imageobject> 2158 <imagedata fileref="psutils8.png" format="PNG" /> 2159 </imageobject> 2160 <textobject> 2161 <phrase>Combine two A4 pages</phrase> 2162 </textobject> 2163 </mediaobject> 2164 </screenshot> 2165 </listitem> 2166 </varlistentry> 2167 2168 <varlistentry> 2169 <term>2 A4L pages --> A4</term> 2170 <listitem><para>Put two consecutive A4 pages in landscape mode together 2171 on one A4 page.</para></listitem> 2172 </varlistentry> 2173 2174 <varlistentry> 2175 <term>select even pages</term> 2176 <listitem><para>Select all even pages of a document.</para></listitem> 2177 </varlistentry> 2178 2179 <varlistentry> 2180 <term>select odd pages</term> 2181 <listitem><para>Select all odd pages of a document.</para></listitem> 2182 </varlistentry> 2183 2184 <varlistentry> 2185 <term>select even pages (reverse order)</term> 2186 <listitem><para>Select all even pages of a document and reverse the order.</para></listitem> 2187 </varlistentry> 2188 2189 <varlistentry> 2190 <term>select odd pages (reverse order)</term> 2191 <listitem><para>Select all odd pages of a document and reverse the order.</para></listitem> 2192 </varlistentry> 2193 2194 <varlistentry> 2195 <term>reverse all pages</term> 2196 <listitem><para>Reverse all pages of a document.</para></listitem> 2197 </varlistentry> 2198 2199 <varlistentry> 2200 <term>copy all pages (sorted)</term> 2201 <listitem><para>Copy all pages of a document. You have to 2202 choose the number of sorted copies.</para> 2203 <screenshot> 2204 <screeninfo>Copy all pages (sorted)</screeninfo> 2205 <mediaobject> 2206 <imageobject> 2207 <imagedata fileref="psutils15.png" format="PNG" /> 2208 </imageobject> 2209 <textobject> 2210 <phrase>Copy all pages (sorted)</phrase> 2211 </textobject> 2212 </mediaobject> 2213 </screenshot> 2214 </listitem> 2215 </varlistentry> 2216 2217 <varlistentry> 2218 <term>copy all pages (unsorted)</term> 2219 <listitem><para>Copy all pages of a document. You have to 2220 choose the number of non-sorted copies.</para> 2221 <screenshot> 2222 <screeninfo>Copy all pages (unsorted)</screeninfo> 2223 <mediaobject> 2224 <imageobject> 2225 <imagedata fileref="psutils16.png" format="PNG" /> 2226 </imageobject> 2227 <textobject> 2228 <phrase>Copy all pages (unsorted)</phrase> 2229 </textobject> 2230 </mediaobject> 2231 </screenshot> 2232 </listitem> 2233 </varlistentry> 2234 2235 <varlistentry> 2236 <term>pstops: choose parameter</term> 2237 <listitem><para>There are many options for &PostScript; utilities 2238 <command>pstops</command> and <command>psselect</command>. If you 2239 need a very special one, you can invoke <command>pstops</command> with 2240 an option of your choice. Please read the manual for all possible 2241 options.</para></listitem> 2242 </varlistentry> 2243 2244 <varlistentry> 2245 <term>psselect: choose parameter</term> 2246 <listitem><para>You can invoke <command>psselect</command> with 2247 an option of your choice. Please read the manual for all possible 2248 options.</para></listitem> 2249 </varlistentry> 2250 2251 </variablelist> 2252 2253 </sect1> 2254 2255 <sect1 id="wizard_pdf"> 2256 2257 <title>PDF Utilities</title> 2258 2259 <para>Many people think of PDFs as frozen files, which cannot be modified. But this is not true, as there exist excellent tools</para> 2260 2261 <itemizedlist> 2262 <listitem><para>for manipulations and rearrangements of pages</para></listitem> 2263 <listitem><para>to read and update document info</para></listitem> 2264 <listitem><para>to read, set or change some permissions</para></listitem> 2265 </itemizedlist> 2266 2267 <para>of an existing PDF document.</para> 2268 2269 <para>&kile;'s <emphasis>PDF wizard</emphasis> under <menuchoice><guimenu>Wizard</guimenu><guimenuitem>PDF Tools</guimenuitem></menuchoice> uses two different methods to manipulate and rearrange PDF documents:</para> 2270 2271 <itemizedlist> 2272 <listitem><para>&latex; package <command>pdfpages</command>, which is part of each &latex; distribution. <command>pdfpages</command> doesn't work with encrypted pages.</para></listitem> 2273 <listitem><para><command>pdftk</command>, which is an excellent command line tool for doing everyday things with PDF documents (see <ulink url="http://www.pdflabs.com/tools/pdftk-the-pdf-toolkit">The PDF Toolkit</ulink>).</para></listitem> 2274 </itemizedlist> 2275 2276 <para>If one of these helpers, <command>pdfpages</command> or <command>pdftk</command>, is not present in your system, the corresponding items will not be visible. Furthermore, remember that only <command>pdftk</command> can work with encrypted files.</para> 2277 2278 <sect2 id="pdf_rearrangements"> 2279 2280 <title>Rearrangements</title> 2281 2282 <para>If &kile;'s PDF wizard is called, it starts with the <userinput>Rearrangements</userinput> register card.</para> 2283 2284 <screenshot> 2285 <screeninfo>Dialog PDF Tools</screeninfo> 2286 <mediaobject> 2287 <imageobject> 2288 <imagedata fileref="dialog-pdftools1.png" format="PNG" /> 2289 </imageobject> 2290 <textobject> 2291 <phrase>Dialog PDF Tools</phrase> 2292 </textobject> 2293 </mediaobject> 2294 </screenshot> 2295 2296 <para>First choose your input file. If &kile; finds a PDF file corresponding to your current master document, it will already be filled in as the input file, but you are also free to choose another file. Then choose an output file or overwrite the existing PDF file, and select one of the tasks. Finally, you have to decide whether you want to do the conversion only, or also invoke the viewer (⪚ &okular;) to show the resulting document.</para> 2297 2298 <para>If the PDF file is encrypted, only <command>pdftk</command> will work and you have to give the password of this document to execute tasks.</para> 2299 2300 <variablelist> 2301 2302 <varlistentry> 2303 <term>1 page + empty page --> A4</term> 2304 <listitem><para>Combine one page together with an empty page on one A4 page. Whenever two A5 pages are combined together, they are rotated by 90 degrees and arranged on an A4 page in landscape mode.</para> 2305 <screenshot> 2306 <screeninfo>A5 + empty page</screeninfo> 2307 <mediaobject> 2308 <imageobject> 2309 <imagedata fileref="psutils1.png" format="PNG" /> 2310 </imageobject> 2311 <textobject> 2312 <phrase>A5 + empty page</phrase> 2313 </textobject> 2314 </mediaobject> 2315 </screenshot> 2316 <para>Whenever two A4 pages are combined together, they are scaled, rotated by 90 degrees and arranged on an A4 page in landscape mode.</para> 2317 <screenshot> 2318 <screeninfo>A4 + empty page --> A4</screeninfo> 2319 <mediaobject> 2320 <imageobject> 2321 <imagedata fileref="psutils6.png" format="PNG" /> 2322 </imageobject> 2323 <textobject> 2324 <phrase>A4 + empty page</phrase> 2325 </textobject> 2326 </mediaobject> 2327 </screenshot> 2328 </listitem> 2329 </varlistentry> 2330 2331 <varlistentry> 2332 <term>1 page + duplicate --> A4</term> 2333 <listitem><para>Put one page and a duplicate together on one A4 page.</para> 2334 <screenshot> 2335 <screeninfo>Duplicate a page</screeninfo> 2336 <mediaobject> 2337 <imageobject> 2338 <imagedata fileref="psutils2.png" format="PNG" /> 2339 </imageobject> 2340 <textobject> 2341 <phrase>Duplicate a page</phrase> 2342 </textobject> 2343 </mediaobject> 2344 </screenshot> 2345 <para>If the page to be duplicated has A4 size, it will be scaled to fit on the page.</para> 2346 <screenshot> 2347 <screeninfo>Duplicate a page</screeninfo> 2348 <mediaobject> 2349 <imageobject> 2350 <imagedata fileref="psutils7.png" format="PNG" /> 2351 </imageobject> 2352 <textobject> 2353 <phrase>Duplicate a page</phrase> 2354 </textobject> 2355 </mediaobject> 2356 </screenshot> 2357 </listitem> 2358 </varlistentry> 2359 2360 <varlistentry> 2361 <term>2 pages --> A4</term> 2362 <listitem><para>Combine two consecutive pages together on one A4 page. Whenever two A5 pages are combined together, they are rotated by 90 degrees and arranged on an A4 page in landscape mode.</para> 2363 <screenshot> 2364 <screeninfo>Combine two A5 pages</screeninfo> 2365 <mediaobject> 2366 <imageobject> 2367 <imagedata fileref="psutils3.png" format="PNG" /> 2368 </imageobject> 2369 <textobject> 2370 <phrase>Combine two A5 pages</phrase> 2371 </textobject> 2372 </mediaobject> 2373 </screenshot> 2374 <para>Whenever two A4 pages are combined together, they are scaled, rotated by 90 degrees and arranged on an A4 page in landscape mode.</para> 2375 <screenshot> 2376 <screeninfo>Combine two A4 pages</screeninfo> 2377 <mediaobject> 2378 <imageobject> 2379 <imagedata fileref="psutils8.png" format="PNG" /> 2380 </imageobject> 2381 <textobject> 2382 <phrase>Combine two A4 pages</phrase> 2383 </textobject> 2384 </mediaobject> 2385 </screenshot> 2386 </listitem> 2387 </varlistentry> 2388 2389 <varlistentry> 2390 <term>2 pages (landscape) --> A4</term> 2391 <listitem><para>Put two consecutive pages in landscape mode together on one A4 page.</para> 2392 <screenshot> 2393 <screeninfo>Combine two pages (in landscape mode)</screeninfo> 2394 <mediaobject> 2395 <imageobject> 2396 <imagedata fileref="pdftools1.png" format="PNG" /> 2397 </imageobject> 2398 <textobject> 2399 <phrase>Combine two pages (in landscape mode)</phrase> 2400 </textobject> 2401 </mediaobject> 2402 </screenshot> 2403 </listitem> 2404 </varlistentry> 2405 2406 <varlistentry> 2407 <term>4 pages --> A4</term> 2408 <listitem><para>Combine four consecutive pages together on one 2409 A4 page. The pages have to be scaled to fit on the page.</para> 2410 <screenshot> 2411 <screeninfo>4 pages --> A4</screeninfo> 2412 <mediaobject> 2413 <imageobject> 2414 <imagedata fileref="psutils5.png" format="PNG" /> 2415 </imageobject> 2416 <textobject> 2417 <phrase>4 pages --> A4</phrase> 2418 </textobject> 2419 </mediaobject> 2420 </screenshot> 2421 </listitem> 2422 </varlistentry> 2423 2424 <varlistentry> 2425 <term>4 pages (landscape) --> A4</term> 2426 <listitem><para>Combine four consecutive pages in landscape mode together on one A4 page. The pages have to be scaled to fit on the page.</para> 2427 <screenshot> 2428 <screeninfo>Combine four pages (in landscape mode)</screeninfo> 2429 <mediaobject> 2430 <imageobject> 2431 <imagedata fileref="pdftools2.png" format="PNG" /> 2432 </imageobject> 2433 <textobject> 2434 <phrase>Combine four pages (in landscape mode)</phrase> 2435 </textobject> 2436 </mediaobject> 2437 </screenshot> 2438 </listitem> 2439 </varlistentry> 2440 2441 <varlistentry> 2442 <term>select even pages</term> 2443 <listitem><para>Select all even pages of a document.</para></listitem> 2444 </varlistentry> 2445 2446 <varlistentry> 2447 <term>select odd pages</term> 2448 <listitem><para>Select all odd pages of a document.</para></listitem> 2449 </varlistentry> 2450 2451 <varlistentry> 2452 <term>select even pages (reverse order)</term> 2453 <listitem><para>Select all even pages of a document and reverse the order.</para></listitem> 2454 </varlistentry> 2455 2456 <varlistentry> 2457 <term>select odd pages (reverse order)</term> 2458 <listitem><para>Select all odd pages of a document and reverse the order.</para></listitem> 2459 </varlistentry> 2460 2461 <varlistentry> 2462 <term>reverse all pages</term> 2463 <listitem><para>Reverse all pages of a document.</para></listitem> 2464 </varlistentry> 2465 2466 <varlistentry> 2467 <term>decrypt a file</term> 2468 <listitem><para>If the PDF file is encrypted, you can decrypt it.</para></listitem> 2469 </varlistentry> 2470 2471 <varlistentry> 2472 <term>select pages</term> 2473 <listitem><para>Add a comma separated list of pages or page ranges, ⪚ 1,4-7,9. Only these pages will appear in the resulting PDF file.</para></listitem> 2474 </varlistentry> 2475 2476 <varlistentry> 2477 <term>delete pages</term> 2478 <listitem><para>Add a comma separated list of pages or page ranges, which should be removed from the chosen PDF file.</para></listitem> 2479 </varlistentry> 2480 2481 <varlistentry> 2482 <term>apply a background watermark</term> 2483 <listitem><para>Applies a PDF watermark to the background of a single input PDF. The wizard only uses the first page from the background PDF and applies it to every page of the input PDF. This page is scaled and rotated as needed to fit the input page.</para></listitem> 2484 </varlistentry> 2485 2486 <varlistentry> 2487 <term>apply a background color</term> 2488 <listitem><para>Applies a background color to all pages of the current document. This can only be done once, as the second color will be put behind the first color and will not then be visible.</para></listitem> 2489 </varlistentry> 2490 2491 <varlistentry> 2492 <term>apply a foreground stamp</term> 2493 <listitem><para>Applies a foreground stamp on top of the input PDF document's pages. The wizard uses only the first page from the stamp PDF and applies it to every page of the input PDF. This page is scaled and rotated as needed to fit the input page. This works best if the stamp PDF page has a transparent background.</para></listitem> 2494 </varlistentry> 2495 2496 <varlistentry> 2497 <term>pdftk: choose parameter</term> 2498 <listitem><para>You can invoke <command>pdftk</command> with an option of your choice. Please read the manual for all possible options.</para></listitem> 2499 </varlistentry> 2500 2501 <varlistentry> 2502 <term>pdfpages: choose parameter</term> 2503 <listitem><para>You can invoke <command>pdfpages</command> with an option of your choice. Please read the manual for all possible options.</para></listitem> 2504 </varlistentry> 2505 2506 </variablelist> 2507 2508 </sect2> 2509 2510 <sect2 id="pdf_properties"> 2511 2512 <title>Properties</title> 2513 2514 <para>The setting, changing and removing of properties will only be possible if <command>pdftk</command> is installed and if additionally &kile; was compiled with the <userinput>libpoppler</userinput> library.</para> 2515 2516 <screenshot> 2517 <screeninfo>Dialog PDF Properties</screeninfo> 2518 <mediaobject> 2519 <imageobject> 2520 <imagedata fileref="dialog-pdftools2.png" format="PNG" /> 2521 </imageobject> 2522 <textobject> 2523 <phrase>Dialog PDF Properties</phrase> 2524 </textobject> 2525 </mediaobject> 2526 </screenshot> 2527 2528 <para>Traditional PDF metadata includes the document's title, author, subject, keywords, creator, producer and the dates of creation and last modification.</para> 2529 2530 </sect2> 2531 2532 <sect2 id="pdf_permissions"> 2533 2534 <title>Permissions</title> 2535 2536 <para>Also, the setting, changing and removing of permissions will be only possible if <command>pdftk</command> is installed.</para> 2537 2538 <screenshot> 2539 <screeninfo>Dialog PDF Permissions</screeninfo> 2540 <mediaobject> 2541 <imageobject> 2542 <imagedata fileref="dialog-pdftools3.png" format="PNG" /> 2543 </imageobject> 2544 <textobject> 2545 <phrase>Dialog PDF Permissions</phrase> 2546 </textobject> 2547 </mediaobject> 2548 </screenshot> 2549 2550 <para>A password is necessary to set or change these document settings. Additionally, PDF encryption is done to lock the file's content behind this password or to enforce lighter restrictions imposed by the author. So the author can allow or restrict:</para> 2551 2552 <itemizedlist> 2553 <listitem><para>printing pages</para></listitem> 2554 <listitem><para>modifying pages</para></listitem> 2555 <listitem><para>copying text and graphics from pages</para></listitem> 2556 <listitem><para>changing or adding annotations</para></listitem> 2557 <listitem><para>filling form fields with data.</para></listitem> 2558 </itemizedlist> 2559 2560 <para>Changing permissions always forces encryption associated with 128-bit security of <userinput>Acrobat</userinput> 5 and 6, and also needs a password.</para> 2561 2562 <para>But always remember: encryption and a password do not provide any real PDF security. The content is encrypted, but the key is known. You should see it more as a polite but firm request to respect the author's wishes.</para> 2563 2564 </sect2> 2565 2566 </sect1> 2567 2568 <sect1 id="statistics"> 2569 <title>Document Statistics</title> 2570 2571 <para>The statistics dialog in <menuchoice><guimenu>File</guimenu><guimenuitem>Statistics</guimenuitem></menuchoice> gives you 2572 a statistical overview for a selection, 2573 a document or a whole project. It includes the number of words, &latex; 2574 commands/environments and also includes the number of characters for each type.</para> 2575 2576 <para>The statistics obtained can be copied as text or as a nicely formatted &latex; table 2577 to the clipboard. </para> 2578 <para>When you select a text and open the statistics dialog, you get the statistics for the currently selected text. If 2579 you open the dialog without any text selected, the statistics for all opened files are shown. 2580 If you want to get statistics for the whole project, you can use 2581 <menuchoice><guimenu>Project</guimenu><guisubmenu>Open All Project Files</guisubmenu></menuchoice> 2582 for an easy and quick way to open all source files of your project.</para> 2583 2584 <para>A note of caution has to be sounded about the accuracy of the numbers. 2585 We have included some logic to get a good estimate, ⪚ K\"uhler gives one word and one command, 2586 with six and two characters respectively. But there are other combinations in which parts of commands 2587 are counted as words and vice versa. Please note that the algorithm 2588 was developed and tested for languages similar to English or German. 2589 So don't take the numbers for granted. If you write a report whose length has to be of a certain 2590 numbers of words or characters, please make some tests first in order to check whether &kile;'s accuracy satisfies your needs.</para> 2591 </sect1> 2592 2593 </chapter> 2594 2595 2596 <chapter id="latex"> 2597 2598 <title>Special Tags in &latex;</title> 2599 2600 <sect1 id="latex_library"> 2601 <title>Using the &latex; Tag Library</title> 2602 2603 <para>&latex; has thousands of tags for symbols and special characters. 2604 The easiest way to insert these tags is to use the sidebar menu, 2605 to the left of the editor window.</para> 2606 2607 <screenshot> 2608 <screeninfo>The Sidebar Menu</screeninfo> 2609 <mediaobject> 2610 <imageobject> 2611 <imagedata fileref="snap_sidebarmenu.png" format="PNG" /> 2612 </imageobject> 2613 <textobject> 2614 <phrase>The Sidebar Menu</phrase> 2615 </textobject> 2616 <caption><para>The Sidebar Menu</para></caption> 2617 </mediaobject> 2618 </screenshot> 2619 <para>The following types are available:</para> 2620 2621 <itemizedlist> 2622 <listitem><para>Most Frequently Used</para></listitem> 2623 <listitem><para>Relation</para></listitem> 2624 <listitem><para>Operators</para></listitem> 2625 <listitem><para>Arrows</para></listitem> 2626 <listitem><para>Miscellaneous Math</para></listitem> 2627 <listitem><para>Miscellaneous Text</para></listitem> 2628 <listitem><para>Delimiters</para></listitem> 2629 <listitem><para>Greek</para></listitem> 2630 <listitem><para>Special Characters</para></listitem> 2631 <listitem><para>Cyrillic Characters</para></listitem> 2632 <listitem><para>User Defined</para></listitem> 2633 </itemizedlist> 2634 <para>The tooltips of the icons show the &latex; commands and additionally needed packages.</para> 2635 <para>Pressing <keycombo>&Shift;</keycombo> and clicking a symbol will result in 2636 <userinput>$\symbolcmd$</userinput> being inserted. Similarly, pressing <keycombo>&Ctrl;</keycombo> 2637 inserts it in curly brackets.</para> 2638 <para>If you insert a command which requires a package which is not included in your &latex; document, 2639 you will see a warning message in the logview window.</para> 2640 <para>The first list of symbols holds the <guilabel>Most Frequently Used</guilabel> symbols. Inserted symbols will be 2641 added to this list, for quick and easy reference. The ordering of the symbols will not be changed 2642 upon addition of new symbols, instead a reference counter is incremented. If the number of items 2643 exceeds 30 items, the item with the lowest count is removed.</para> 2644 <para>The <guilabel>User Defined</guilabel> symbol list can hold your own symbols. 2645 To create your own symbols you need the program gesymb and the file <filename>definitions.tex</filename> from the kile source package. 2646 Additionally you need a &latex; compiler (what a surprise) and 2647 <ulink url="http://www.dvipng.sourceforge.net">&dvipng;</ulink> (version 1.7 or later). 2648 The procedure is that you create a &latex; file with <userinput>\input{definitions}</userinput>, 2649 which makes the commands listed below available, and let <userinput>gesymb mysymbols.tex user</userinput> 2650 (which calls &latex; and &dvipng;) create the icons. After copying them to 2651 <userinput>$HOME/.kde/share/apps/kile/mathsymbols/user/</userinput> and restarting kile you can use your own symbols. 2652 </para> 2653 <para> 2654 The following commands are defined in <filename>definitions.tex</filename>: 2655 <itemizedlist> 2656 <listitem> 2657 <para> 2658 <userinput>\command[\optarg]{\symbol}</userinput>: Include the symbol <userinput>\symbol</userinput> in the 2659 symbol list, the optional argument <userinput>\optarg</userinput> specifies the command which kile should insert. 2660 If it is not given the command in the mandatory argument is used. 2661 </para> 2662 </listitem> 2663 <listitem> 2664 <para> 2665 <userinput>\mathcommand[\optarg]{\symbol}</userinput>: Same as above, except that the command in the mandatory 2666 argument is inserted in math mode. 2667 </para> 2668 </listitem> 2669 <listitem> 2670 <para> 2671 <userinput>\pkgs[arg]{pkg}</userinput>: Declare that the command given in this line needs the &latex; package 2672 <userinput>pkg</userinput> with the optional argument <userinput>arg</userinput>. This command has to be in 2673 front of the <userinput>\command</userinput> command and overrides any package specification by the neededpkgs 2674 enviroment. 2675 </para> 2676 </listitem> 2677 <listitem> 2678 <para> 2679 <userinput>\begin{neededpkgs}[pkgs-args]{pkgs} ... \end{neededpkgs}</userinput>: Has the same effect as 2680 above, but for all enclosed commands. 2681 </para> 2682 </listitem> 2683 </itemizedlist> 2684 </para> 2685 <para> 2686 An example for completeness is given here: 2687 <programlisting>\documentclass[a4paper,10pt]{article} 2688 \usepackage{amssymb} 2689 \input{definitions} 2690 % 2691 \begin{document} 2692 \pagestyle{empty} 2693 % 2694 \begin{neededpkgs}{amssymb} 2695 \mathcommand{\surd} 2696 \pkgs{amsmath}\mathcommand[\ddddot{}]{\ddddot{a}} 2697 \mathcommand{\angle} 2698 \end{neededpkgs} 2699 \command{\"A} 2700 \mathcommand{\exists} 2701 \mathcommand[\stackrel{}{}]{\stackrel{abc}{=}} 2702 2703 %\begin{neededpkgs}[russian,koi8-r,T2C,]{babel,inputenc,fontenc,mathtext} 2704 % 2705 % \end{neededpkgs} 2706 % this would need to include the packages 2707 % \usepackage{mathtext} 2708 % \usepackage[T2C]{fontenc} 2709 % \usepackage[russian]{babel} 2710 % \usepackage[koi8-r]{inputenc} 2711 % just to explain the format 2712 \end{document}</programlisting> 2713 </para> 2714 </sect1> 2715 2716 <sect1 id="latex_bib"> 2717 2718 <title>Using Bibitems</title> 2719 2720 <para><userinput>\bibitem</userinput> is a command used to enter a reference in a 2721 <userinput>thebibliography</userinput> environment in your document. The syntax for using 2722 <userinput>\bibitem</userinput> is <userinput>\bibitem[label]{key}</userinput>.</para> 2723 2724 <para>The optional <userinput>[label]</userinput> is for you to add your own 2725 labeling system for the bibliography entry. If no label is set, the entries 2726 will be set in numerical order: [1], [2], [3], &etc;</para> 2727 2728 <para>The argument <userinput>{key}</userinput> is used to reference and link the commands 2729 <userinput>\bibitem</userinput> and <userinput>\cite</userinput> to 2730 each other and the information they contain. The command <userinput>\cite</userinput> contains the 2731 label associated with the intended <userinput>\bibitem</userinput>, which is located inside a 2732 <userinput>thebibliography</userinput> environment, and contains the reference data. 2733 Both corresponding <userinput>\bibitem</userinput> and <userinput>\cite</userinput> must 2734 have the same <userinput>{key}</userinput>; the easiest way to organize keys is by 2735 the author's last name. The secondary braces in the <userinput>thebibliography</userinput> 2736 environment denote the longest bibliography label you expect to have. 2737 So, inserting <userinput>{<replaceable>foo</replaceable>}</userinput> means 2738 you can have any label shorter or as large as the expression 2739 <userinput><replaceable>foo</replaceable></userinput>. Failure to set this parameter correctly 2740 may result in a not so attractive indentation of your bibliography.</para> 2741 2742 <para>The bibliography is a section apart from your main document, and an example of 2743 code for the bibliography would look like the following:</para> 2744 2745 <programlisting>\begin{thebibliography}{50} 2746 \bibitem{Simpson} Homer J. Simpson. \textsl{Mmmmm...donuts}. Evergreen Terrace Printing Co., 2747 Springfield, SomewhereUSA, 1998 2748 \end{thebibliography}</programlisting> 2749 2750 <para>Then, your main source code would contain the location of the information relating to 2751 the <userinput>\bibitem</userinput> using <userinput>\cite</userinput>. That source code would look similar to this:</para> 2752 2753 <programlisting>My thesis, about the philosophy of The Simpsons\copyright comes from my favorite book \cite{Simpson}.</programlisting> 2754 2755 <para>As it is often difficult to remember the exact citation key once you have many 2756 references, &kile; provides an easy way to insert a citation. Using <menuchoice><guimenu>LaTeX 2757 </guimenu><guimenuitem>References</guimenuitem><guimenuitem>Cite</guimenuitem></menuchoice> 2758 a list with all the citation keys pops up. Select the correct 2759 reference and a citation will be inserted into your document. To update the list of keys, 2760 either save the file, or <menuchoice><guimenu>Edit</guimenu><guimenuitem>Refresh 2761 Structure</guimenuitem></menuchoice>, or press <keycap>F12</keycap>. 2762 With code completion enabled, &kile; will show you a list of all the <userinput>bibitem</userinput>-labels 2763 as soon as you open up a <userinput>\cite</userinput> command.</para> 2764 2765 <para>The final result in your document's bibliography would then look like this:</para> 2766 2767 <para><computeroutput>[1] Homer J. Simpson. Mmmmm...donuts. Evergreen Terrace Printing Co., 2768 Springfield, SomewhereUSA, 1998.</computeroutput></para> 2769 2770 <para>&kile; can also work together with &bibtex; editors, 2771 such as &kbibtex; to make it easier to enter citations. When a &bibtex; file is added to the project, 2772 &kile; will help you complete citation commands, just as described above.</para> 2773 2774 </sect1> 2775 2776 </chapter> 2777 2778 &include-section-usermenu; 2779 2780 <chapter id="build"> 2781 2782 <title>The Build Tools</title> 2783 2784 <sect1 id="build_sect"> 2785 2786 <title>Compiling, converting and viewing</title> 2787 2788 <para>To view the result of your work, you first need to compile the source. All the build 2789 tools are grouped closely together in the 2790 <menuchoice><guimenu>Build</guimenu><guisubmenu>Compile</guisubmenu></menuchoice>, 2791 <menuchoice><guimenu>Build</guimenu><guisubmenu>Convert</guisubmenu></menuchoice>, 2792 and <menuchoice><guimenu>Build</guimenu><guisubmenu>View</guisubmenu></menuchoice> 2793 menus.</para> 2794 2795 <para>To compile your source code for screen viewers like &okular; or 2796 further conversion, you can use the shortcut <keycombo>&Alt;<keycap>2</keycap></keycombo>. 2797 Then you can view the &DVI; file using your default viewer with 2798 <keycombo>&Alt;<keycap>3</keycap></keycombo>, convert 2799 the &DVI; to a PS file with <keycombo>&Alt;<keycap>4</keycap></keycombo>, 2800 and view the PS file with <keycombo>&Alt;<keycap>5</keycap></keycombo>.</para> 2801 2802 <sect2> 2803 2804 <title>&bibtex;</title> 2805 2806 <para>If you are using <ulink url="http://www.ecst.csuchico.edu/~jacobsd/bib/formats/bibtex.html">&bibtex;</ulink> 2807 for your bibliography entries, you usually have to follow a special compiling scheme. 2808 This means calling &latex; and then &bibtex; and then &latex; twice again. Fortunately &kile; is clever enough to 2809 detect automatically if it is necessary to call additional tools like &bibtex;, &makeidx; and &asymptote;. 2810 This logic is turned on by default and can be changed in <menuchoice><guimenu>Settings</guimenu><guisubmenu>Configure 2811 Kile...</guisubmenu><guisubmenu>Tools</guisubmenu><guilabel>Build</guilabel></menuchoice> in the <guilabel>General</guilabel> tab in the &latex; and &pdflatex; tools. 2812 </para> 2813 2814 </sect2> 2815 2816 <!-- Already stated in last paragraph 2817 <sect2> 2818 2819 <title>&makeidx;</title> 2820 2821 <para>If you are using the <ulink url="http://ipagwww.med.yale.edu/latex/makeindex.pdf">&makeidx;</ulink> 2822 package to make a final, alphabetical index for your document, you have also to follow a certain 2823 compilation pattern or let &kile; do this for you in the same way as with &bibtex; files.</para> 2824 2825 </sect2> 2826 --> 2827 <sect2> 2828 2829 <title>MetaPost and &asymptote;</title> 2830 2831 <para>If you want to compile your document with <application>MetaPost</application> or <application>&asymptote;</application>, picture drawing programs, you can do it with 2832 <menuchoice><guimenu>Build</guimenu><guisubmenu>Compile</guisubmenu><guimenuitem>Metapost</guimenuitem></menuchoice>, 2833 or <menuchoice><guimenu>Build</guimenu><guisubmenu>Compile</guisubmenu><guimenuitem>&asymptote;</guimenuitem></menuchoice>.</para> 2834 2835 </sect2> 2836 2837 <sect2> 2838 2839 <title>&pdflatex;</title> 2840 2841 <para>There is also another way to compile your document, if you want a PDF: you can run 2842 &pdflatex;, that will compile the source directly into a PDF file, with 2843 <keycombo>&Alt;<keycap>6</keycap></keycombo>: you can then view the compiled 2844 file by pressing <keycombo>&Alt;<keycap>7</keycap></keycombo>.</para> 2845 2846 <para>Alternatively, you can convert a PS into a PDF with 2847 <keycombo>&Alt;<keycap>8</keycap></keycombo>, or a 2848 &DVI; directly into a PDF with <keycombo>&Alt;<keycap>9</keycap></keycombo>.</para> 2849 2850 <para>Using &pdflatex; instead of &latex; may be just a matter of simplicity or habit, 2851 but sometimes the behavior of the two programs can differ.</para> 2852 2853 </sect2> 2854 2855 <sect2> 2856 2857 <title>&latex; to Web</title> 2858 2859 <para>Finally, you may want to publish your work on the web and not just on paper. You may 2860 then use the <application>latex2html</application> program, that can be called from &kile;'s menu 2861 <menuchoice><guimenu>Build</guimenu><guisubmenu>Convert</guisubmenu><guimenuitem>LaTeX 2862 to Web</guimenuitem></menuchoice>. The result will be placed in a subfolder of the work folder, 2863 and you will be able to see the result of the conversion choosing the menu item 2864 <menuchoice><guimenu>Build</guimenu><guisubmenu>View</guisubmenu><guimenuitem>View 2865 &HTML;</guimenuitem></menuchoice>.</para> 2866 2867 </sect2> 2868 2869 <sect2 id="build_cl"> 2870 2871 <title>Passing Command Line Parameters</title> 2872 2873 <para>If you want to pass some specific command line parameters to the compile, convert 2874 or view tools, you can configure their call in <menuchoice><guimenu>Settings</guimenu> 2875 <guisubmenu>Configure Kile...</guisubmenu><guisubmenu>Tools</guisubmenu><guilabel>Build</guilabel></menuchoice>.</para> 2876 2877 </sect2> 2878 2879 </sect1> 2880 2881 <sect1 id="build_preview"> 2882 <title>Quick Preview</title> 2883 2884 <para>You will always need some time to view the result, when working with &latex;. 2885 &latex; has to compile the source and the viewer has to be called. This can be 2886 annoying if you only changed some letters in an equation difficult to typeset. 2887 &kile; offers a <emphasis>Quick Preview</emphasis> mode, where you can compile 2888 only a part of a document and save a lot of time. It supports four different modes, 2889 which can be combined with seven configurations.</para> 2890 2891 <screenshot> 2892 <screeninfo>Quick Preview</screeninfo> 2893 <mediaobject> 2894 <imageobject> 2895 <imagedata fileref="quickpreview.png" format="PNG" /> 2896 </imageobject> 2897 <textobject> 2898 <phrase>Quick Preview</phrase> 2899 </textobject> 2900 </mediaobject> 2901 </screenshot> 2902 2903 <para>All settings must be done in 2904 <menuchoice><guimenu>Settings</guimenu><guisubmenu>Configure Kile...</guisubmenu> 2905 <guimenuitem>Tools</guimenuitem><guilabel>Preview</guilabel></menuchoice>.</para> 2906 2907 <screenshot> 2908 <screeninfo>Quick Preview Configuration</screeninfo> 2909 <mediaobject> 2910 <imageobject> 2911 <imagedata fileref="config-quickpreview.png" format="PNG" /> 2912 </imageobject> 2913 <textobject> 2914 <phrase>Quick Preview Configuration</phrase> 2915 </textobject> 2916 </mediaobject> 2917 </screenshot> 2918 2919 <sect2 id="build_qp_selection"> 2920 2921 <title>Selection Mode</title> 2922 2923 <para>The user has to select a part of the document. Menu entry <menuchoice><guimenu>Build</guimenu><guisubmenu>QuickPreview</guisubmenu><guimenuitem>Selection</guimenuitem></menuchoice> 2924 or the keyboard shortcut <keycombo action="simul">&Ctrl;&Alt;<keycap>P</keycap></keycombo>,<keycap>S</keycap> 2925 will start the selected programs. &kile; takes the preamble of the original text, so that 2926 all packages and user defined commands are included. The user can choose one 2927 of eight predefined configurations:</para> 2928 2929 <itemizedlist> 2930 <listitem><para><application>LaTeX+&DVI; (embedded viewer)</application></para></listitem> 2931 <listitem><para><application>LaTeX+&DVI; (&okular;)</application></para></listitem> 2932 <listitem><para><application>LaTeX+PS (embedded viewer)</application></para></listitem> 2933 <listitem><para><application>LaTeX+PS (&okular;)</application></para></listitem> 2934 <listitem><para><application>PDFLaTeX+PDF (embedded viewer)</application></para></listitem> 2935 <listitem><para><application>PDFLaTeX+PDF (&okular;)</application></para></listitem> 2936 <listitem><para><application>XeLaTeX+PDF (embedded viewer)</application></para></listitem> 2937 <listitem><para><application>XeLaTeX+PDF (&okular;)</application></para></listitem> 2938 </itemizedlist> 2939 2940 <para>This should be sufficient for all situations for which a quick preview is needed.</para> 2941 2942 </sect2> 2943 2944 <sect2 id="build_qp_environment"> 2945 2946 <title>Environment Mode</title> 2947 2948 <para>Very often you want to preview the current environment, and especially mathematical 2949 environments, which sometimes may be difficult to write. &kile; offers a very fast way 2950 to do this. No selection is needed, just choose 2951 <menuchoice><guimenu>Build</guimenu><guisubmenu>QuickPreview</guisubmenu><guimenuitem>Environment</guimenuitem></menuchoice> 2952 or the keyboard shortcut <keycombo action="simul">&Ctrl;&Alt;<keycap>P</keycap></keycombo>,<keycap>E</keycap> 2953 and the current environment will be compiled and shown.</para> 2954 2955 </sect2> 2956 2957 <sect2 id="build_qp_subdocument"> 2958 2959 <title>Subdocument Mode</title> 2960 2961 <para>If you have a large project with a lot of documents, compiling the whole 2962 project is not a great idea, if you have made changes only in one single document. 2963 &kile; is able to compile and show a preview of the current subdocument. It 2964 takes the preamble from the master document and only compiles the current part 2965 when you choose <menuchoice><guimenu>Build</guimenu><guisubmenu>QuickPreview</guisubmenu><guimenuitem>Subdocument</guimenuitem></menuchoice> 2966 or the keyboard shortcut <keycombo action="simul">&Ctrl;&Alt;<keycap>P</keycap></keycombo>,<keycap>D</keycap>.</para> 2967 2968 </sect2> 2969 2970 <sect2 id="build_qp_mathgroup"> 2971 2972 <title>Mathgroup Mode</title> 2973 2974 <para>The mathgroup preview mode allows you to preview the mathgroup you are currently editing. &kile; 2975 takes the preamble from the master document and only compiles the mathgroup the cursor is currently in 2976 when you choose <menuchoice><guimenu>Build</guimenu><guisubmenu>QuickPreview</guisubmenu><guimenuitem>Mathgroup</guimenuitem></menuchoice> 2977 or the keyboard shortcut <keycombo action="simul">&Ctrl;&Alt;<keycap>P</keycap></keycombo>,<keycap>M</keycap>.</para> 2978 2979 </sect2> 2980 2981 <sect2 id="qp_bottombar"> 2982 2983 <title>Quick Preview in Bottom Bar</title> 2984 2985 <para>Instead of showing the preview in a new document &kile; can also be configured to use the bottom bar for preview 2986 compilations. You can activate this feature in the quick preview configuration panel.</para> 2987 2988 </sect2> 2989 2990 </sect1> 2991 2992 <sect1 id="build_graphics"> 2993 2994 <title>Graphic File Formats</title> 2995 2996 <sect2 id="build_graphics_latex"> 2997 2998 <title>&latex; and &pdflatex;</title> 2999 3000 <para>&pdflatex;, when used with <userinput>graphics</userinput> or 3001 <userinput>graphicx</userinput> packages, can correctly compile PNG and JPG files into 3002 &DVI; or PDF, but is not able to handle EPS files. Conversely, the process of compiling 3003 with &latex; to &DVI; and converting to PS and eventually PDF does support EPS, but does 3004 not support PNG and JPG.</para> 3005 3006 <para>A lot of users want to create PDF documents, but also want to use the excellent 3007 <application>Pstricks</application> package to create &PostScript; graphics, or they want 3008 to use the &PostScript; output of mathematical and scientific software like 3009 <application>Mathematica</application>, <application>Maple</application> or <application>MuPAD</application>. 3010 These &latex; users have to compile first in &PostScript;, even if they want to create 3011 PDF documents, because these programs produce &PostScript; code which cannot be managed 3012 by &pdflatex;. However, it is not so hard as it may sound, because &kile; will help.</para> 3013 3014 </sect2> 3015 3016 <sect2 id="build_graphics_conversion"> 3017 3018 <title>Graphics Conversion</title> 3019 3020 <para>To overcome this frustrating loop, when you want to include both &PostScript; code and PNG or JPG files, 3021 you have a number of workarounds:</para> 3022 3023 <itemizedlist> 3024 <listitem><para>If you need a file in PS format, but have JPG or PNG graphics, you can also 3025 simply use &pdflatex; with &DVI; output first, and then run <application>dvips</application> 3026 to create the PS file. You see that &pdflatex; is a very good choice, if your source contains 3027 no &PostScript; code at all.</para></listitem> 3028 3029 <listitem><para>You can convert EPS files to PNG or other formats with utilities as the 3030 <ulink url="http://www.gimp.org/"><application>Gimp</application></ulink> or 3031 <ulink url="http://www.imagemagick.org/">&imagemagick;</ulink> 3032 and use &pdflatex;.</para></listitem> 3033 3034 <listitem><para><anchor id="build_graphics_epstopdf"></anchor>A preferred way 3035 is to convert EPS graphics to PDF graphics with 3036 <command>epstopdf</command>, which comes with every &tex; distribution 3037 and then use &pdflatex;. It produces high quality graphics, 3038 and you can even control the result with some of the following options: 3039 3040 <programlisting> 3041 -dAutoFilterColorImages=false 3042 -dAutoFilterGrayImages=false 3043 -sColorImageFilter=FlateEncode 3044 -sGrayImageFilter=FlateEncode 3045 -dPDFSETTINGS=/prepress 3046 -dUseFlateCompression=true 3047 </programlisting> 3048 </para> 3049 3050 <para>Even better: if your system allows <userinput>shell-escape</userinput>, conversion 3051 can be done on the fly. All you have to do is to include the <application>epstopdf</application> package, 3052 which is part of all &tex; distributions, with the command <userinput>\usepackage{epstopdf}</userinput>. 3053 Assuming that your code is: 3054 3055 <programlisting> 3056 \includegraphics[width=5cm]{test.eps} 3057 </programlisting> 3058 3059 When you call &pdflatex; with option <option>--shell-escape</option>, 3060 graphics <filename>test.eps</filename> is automatically converted into <filename>test.pdf</filename>.</para> 3061 3062 <para>This conversion will take place each time you run &pdflatex;. 3063 If your graphics command is given implicitly: 3064 3065 <programlisting> 3066 \includegraphics[width=5cm]{test} 3067 </programlisting> 3068 3069 <application>epstopdf</application> checks whether <filename>test.pdf</filename> is already 3070 available, so that the conversion step can be skipped.</para></listitem> 3071 3072 <listitem><para>You can convert the other way around, and use &latex; and PS-PDF conversion. 3073 This is not always a good idea, since EPS encapsulation of JPG or PNG can yield larger 3074 files, that in turn yield unnecessarily large documents. This is however <emphasis>highly</emphasis> 3075 dependent on the graphic utility that you use, since EPS can encapsulate other graphics, 3076 but not all applications support this perfectly. Some might actually try to build your JPG image 3077 with vectors and various scripting, which will result in gigantic files. Conversion of 3078 all graphics formats to EPS can be done by 3079 <ulink url="http://www.imagemagick.org/">&imagemagick;</ulink>. 3080 Another simple program that does this process correctly is 3081 <ulink url="http://www.tex.uniyar.ac.ru/win32/tools/jpg2ps/"><application>jpg2ps</application></ulink>. 3082 </para></listitem> 3083 3084 <listitem><para>You can also use an automatic conversion. All graphics files are 3085 converted on the fly to EPS, and inserted into the PS document. This is a comfortable 3086 way, but you have to set up your system properly. This is discussed in the section 3087 <link linkend="build_epsgraphics">EPS Graphics</link>.</para></listitem> 3088 3089 </itemizedlist> 3090 3091 </sect2> 3092 3093 <sect2 id="build_graphics_type"> 3094 3095 <title>Use the right File for the right Graphic</title> 3096 3097 <itemizedlist> 3098 <listitem><para>EPS is sort of a graphic vector scripting language, describing 3099 all the lines and dots the graphic is made of; it looks good even when magnified beyond its 3100 default size, and suits best diagrams and vectorial graphics natively produced in EPS, 3101 which look very clear and sharp while maintaining a very small byte size.</para></listitem> 3102 <listitem><para>PNG (or the deprecated &GIF;) is a <emphasis>non-lossy</emphasis> file format, 3103 with good compression and quality. It is very good for diagrams, scans of drawings, 3104 or anything whose sharpness you do want to retain. It is sometimes overkill 3105 when used for photos.</para></listitem> 3106 <listitem><para>JPG is a <emphasis>lossy</emphasis> format, that compresses files better than PNG 3107 at the price of some loss in the picture detail. This is usually irrelevant for photos, 3108 but may cause bad quality for diagrams, drawings, and may make some thin lines disappear outright; 3109 in those cases use EPS or PNG.</para></listitem> 3110 </itemizedlist> 3111 3112 <para>But always remember: garbage in, garbage out! No conversion will make a bad picture good.</para> 3113 3114 </sect2> 3115 3116 </sect1> 3117 3118 <sect1 id="build_epsgraphics"> 3119 3120 <title>EPS Graphics</title> 3121 3122 <para>EPS graphics files are the traditional way to insert graphics files into 3123 &latex; documents. As mailing lists are full with questions concerning 3124 EPS graphics, we will discuss some important aspects and 3125 demonstrate how &kile; supports them.</para> 3126 3127 <sect2 id="build_graphics_eps"> 3128 3129 <title>&latex; and EPS Graphics</title> 3130 3131 <para>If you decided to use the traditional &latex; to produce 3132 PS or PDF output, you will probably run into some problems 3133 with graphics. You have to use EPS graphics (Encapsulated &PostScript;); 3134 no JPEG or PNG files. This should be no problem, as there are a lot of 3135 <link linkend="build_graphics_conversion">converters</link> like 3136 <command>convert</command> from the excellent 3137 <ulink url="http://www.imagemagick.org/">&imagemagick;</ulink> 3138 package. But, it needs some time of course.</para> 3139 3140 <para>The EPS files are used by both &latex; and the &DVI;-PS converter:</para> 3141 3142 <itemizedlist> 3143 <listitem><para>&latex; scans the EPS file for the bounding-box 3144 line, which tells &latex; how much space to reserve for the 3145 graphics.</para></listitem> 3146 3147 <listitem><para>The &DVI;-PS converter then reads the EPS file and 3148 inserts the graphics in the PS file.</para></listitem> 3149 </itemizedlist> 3150 3151 <para>This has some implications:</para> 3152 3153 <itemizedlist> 3154 <listitem><para>&latex; never reads the EPS file if the bounding-box 3155 parameters are specified in the graphics insertion command.</para></listitem> 3156 3157 <listitem><para>Since &latex; cannot read non-ASCII files, 3158 it cannot read the bounding-box information from compressed or non-EPS 3159 graphics files.</para></listitem> 3160 3161 <listitem><para>The EPS graphics are not included in the &DVI; file. Since the 3162 EPS files must be present when the &DVI; file is converted to 3163 PS, the EPS files must accompany the &DVI; files whenever they are 3164 moved.</para></listitem> 3165 </itemizedlist> 3166 3167 <para>Now you can call &latex;, and a &DVI;-PS converter like <application>dvips</application> 3168 to create your &PostScript; document. If your goal is a PDF document, you should run 3169 <command>dvips</command> with option <option>-Ppdf</option> and then call 3170 <command>ps2pdf</command>. You will find a lot of documents describing this solution.</para> 3171 3172 </sect2> 3173 3174 <sect2 id="build_graphics_epskile"> 3175 3176 <title>The &PostScript; Way of &kile;</title> 3177 3178 <para>&kile; helps you to get the bounding-box information. If you have installed 3179 <ulink url="http://www.imagemagick.org/">&imagemagick;</ulink> 3180 package, &kile; will extract this information from the EPS file and insert it as an 3181 option. This is done automatically when you select the graphics file. 3182 There are two advantages to proceeding like this:</para> 3183 3184 <itemizedlist> 3185 <listitem><para>The information is already scanned in the dialog, and 3186 need not to be done by &latex; later on.</para></listitem> 3187 <listitem><para>Even more important is that the width and height of the picture 3188 can be calculated, when the resolution is known. This information will be shown 3189 near the top of the dialog, and may serve as a clue when you want to scale the 3190 graphics.</para></listitem> 3191 <listitem><para>&kile; can also support zipped or gzipped EPS files, 3192 which are much smaller than uncompressed EPS files. But, this feature can only be used 3193 with a special system setup and a change of your local graphics configuration, 3194 as it is described in the <link linkend="build_graphics_bitmap">Bitmap Graphics</link> 3195 section.</para></listitem> 3196 </itemizedlist> 3197 <!-- FIXME I don't understand the following sentence, tbraun 3198 <para> The <emphasis>&PostScript; Way of &kile;</emphasis> can be turned off or on in 3199 <menuchoice><guimenu>Settings</guimenu><guisubmenu>Configure Kile...</guisubmenu> 3200 <guimenuitem>LaTeX</guimenuitem><guilabel>General</guilabel></menuchoice>.</para> 3201 --> 3202 </sect2> 3203 3204 <sect2 id="build_graphics_bitmap"> 3205 3206 <title>The &PostScript; Way and Bitmap Graphics</title> 3207 3208 <para>If your system allows <userinput>shell-escape</userinput>, &kile; 3209 also supports an easy way to include bitmap graphics, if you set up your &tex; 3210 system properly. There is no need to convert JPEG or PNG graphics, 3211 this can be done automatically when the &DVI; file is converted to PS.</para> 3212 3213 <para>&latex; needs some information about the file suffixes. The package 3214 <userinput>graphicx</userinput> looks for a file <filename>graphics.cfg</filename>, 3215 which must be somewhere in your search path for &latex; documents. Search for 3216 entries like:</para> 3217 3218 <programlisting> 3219 \DeclareGraphicsRule{.pz}{eps}{.bb}{}% 3220 \DeclareGraphicsRule{.eps.Z}{eps}{.eps.bb}{}% 3221 \DeclareGraphicsRule{.ps.Z}{eps}{.ps.bb}{}% 3222 \DeclareGraphicsRule{.ps.gz}{eps}{.ps.bb}{}% 3223 \DeclareGraphicsRule{.eps.gz}{eps}{.eps.bb}{}% 3224 </programlisting> 3225 3226 <para>and replace these lines with:</para> 3227 3228 <programlisting> 3229 \DeclareGraphicsRule{.pz}{eps}{.bb}{}% 3230 \DeclareGraphicsRule{.eps.Z}{eps}{.eps.bb}{}% 3231 \DeclareGraphicsRule{.ps.Z}{eps}{.ps.bb}{}% 3232 \DeclareGraphicsRule{.ps.gz}{eps}{.ps.bb}{}% 3233 % changed or new graphic rules 3234 \DeclareGraphicsRule{.eps.zip}{eps}{.eps.bb}{`unzip -p #1}% zipped EPS 3235 \DeclareGraphicsRule{.eps.gz}{eps}{.eps.bb}{`gunzip -c #1}% gzipped EPS 3236 \DeclareGraphicsRule{.jpg}{eps}{}{`convert #1 eps:-}% JPEG 3237 \DeclareGraphicsRule{.gif}{eps}{.bb}{`convert #1 eps:-}% GIF 3238 \DeclareGraphicsRule{.png}{eps}{.bb}{`convert #1 eps:-}% PNG 3239 \DeclareGraphicsRule{.tif}{eps}{.bb}{`convert #1 eps:-}% TIFF 3240 \DeclareGraphicsRule{.pdf}{eps}{.bb}{`convert #1 eps:-}% PDF-graphics 3241 </programlisting> 3242 3243 <para>You will find this file, for example in Debian, at 3244 <filename>/etc/texmf/latex/graphics.cfg</filename>. The best way to proceed is to copy this 3245 file to your local texpath and then change this copy. See your &tex; distribution manual 3246 to learn how to get a list of your &tex; folders.</para> 3247 3248 <para>With this configuration file you are able to insert bitmap graphics and 3249 zipped or gzipped EPS files in &latex;. The command for conversion 3250 is given by <command>dvips</command>. When you look 3251 at the conversion command you will see that no extra file is created. 3252 The result of the conversion process is directly piped into the PS file. 3253 The only thing &latex; must know is the size of the graphics, and 3254 therefore we need the bounding box, which is provided by &kile;.</para> 3255 3256 <para>Some say that this way is insecure; you have to decide on how to work. 3257 In any case, you need no bounding box, as &kile; will extract this information 3258 from all types of graphics.</para> 3259 3260 </sect2> 3261 3262 <sect2 id="build_graphics_pdflatex"> 3263 3264 <title>&pdflatex; and EPS Graphics</title> 3265 3266 <para>As already stated, &pdflatex; is not able to handle EPS graphic files, 3267 but converters like <link linkend="build_graphics_epstopdf">epstopdf</link> 3268 will help. The best way is to include package <filename>epstopdf</filename>, 3269 which must follow the <userinput>graphicx</userinput> package.</para> 3270 3271 <programlisting> 3272 \usepackage[pdftex]{graphicx} 3273 \usepackage{epstopdf} 3274 </programlisting> 3275 3276 <para>Now you can already include EPS graphics, if you run <command>pdflatex</command> 3277 with option <option>--shell-escape</option>, but we can make it even better 3278 and also handle zipped or gzipped EPS files. Again we have to change 3279 the graphics configuration file <filename>graphics.cfg</filename> as above. 3280 This time we search for:</para> 3281 3282 <programlisting> 3283 % pdfTeX is running in pdf mode 3284 \ExecuteOptions{pdftex}% 3285 </programlisting> 3286 3287 <para>and simply add some lines:</para> 3288 3289 <programlisting> 3290 % pdfTeX is running in pdf mode 3291 \ExecuteOptions{pdftex}% 3292 \AtEndOfPackage{% 3293 \g@addto@macro\Gin@extensions{.eps.gz,.eps.zip}% 3294 \@namedef{Gin@rule@.eps.gz}#1{{pdf}{.pdf}{`gunzip -c #1 | epstopdf -f >\Gin@base.pdf}}% 3295 \@namedef{Gin@rule@.eps.zip}#1{{pdf}{.pdf}{`unzip -p #1 | epstopdf -f >\Gin@base.pdf}}% 3296 }% 3297 </programlisting> 3298 3299 <para>With these lines, &pdflatex; is able to handle EPS files, 3300 and hopefully there should be no more issues concerning graphics.</para> 3301 3302 </sect2> 3303 3304 </sect1> 3305 3306 <sect1 id="build_master"> 3307 3308 <title>Master Document</title> 3309 3310 <para>Defining your document as a master allows you to work with separate files, 3311 which gives you a parent document (or Master document), and child documents that 3312 make up a complete work. After having defined your Master document, with the 3313 corresponding command in the <guimenu>Settings</guimenu> 3314 menu, all the commands of the <guimenu>Tools</guimenu> 3315 menu will apply only to this document, even when you are working on the child 3316 documents. You can even close the Master document.</para> 3317 </sect1> 3318 3319 <sect1 id="build_errorhandling"> 3320 3321 <title>Error Handling</title> 3322 3323 <para>After you have compiled something, &kile; takes a look at the error messages 3324 that were generated. If there are any errors or warnings, they will be briefly reported 3325 in the <guilabel>Log and Messages</guilabel> window. One can take a closer look at the 3326 messages by selecting <menuchoice><guimenu>Build</guimenu><guimenuitem>View Log File</guimenuitem></menuchoice>, 3327 or by using the keyboard shortcut <keycombo>&Alt;<keycap>0</keycap></keycombo>. 3328 The generated log is then displayed in the <guilabel>Log and Messages</guilabel> view; errors and warnings are highlighted.</para> 3329 3330 <screenshot> 3331 <screeninfo>Viewing the log</screeninfo> 3332 <mediaobject> 3333 <imageobject> 3334 <imagedata fileref="snap_compile_error.png" format="PNG" /> 3335 </imageobject> 3336 <textobject> 3337 <phrase>Viewing the log</phrase> 3338 </textobject> 3339 <caption><para>Viewing the log</para></caption> 3340 </mediaobject> 3341 </screenshot> 3342 3343 <para>You can easily jump from one message in the log file to another by using the 3344 <menuchoice><guimenu>Build</guimenu><guimenuitem>Next / Previous 3345 LaTeX Error / Warning</guimenuitem></menuchoice> menu items, or by using 3346 the corresponding toolbar buttons.</para> 3347 3348 <para>To jump to the line in the &latex; source where the error or warning occurred, 3349 click on the error or warning in the <guilabel>Log and Messages</guilabel> view. 3350 &kile; will take you automatically to the offending line.</para> 3351 3352 </sect1> 3353 3354 <sect1 id="build_watch"> 3355 3356 <title>The Watch File Mode</title> 3357 3358 <para>When you launch the <guibutton>Quickbuild</guibutton> command, a viewer of 3359 some sort will normally be called after the compilation. If you are not using an embedded 3360 viewer, a new window will be opened every time.</para> 3361 3362 <para>If you are adjusting the look of your document, you might launch 3363 <guibutton>Quickbuild</guibutton> very often, and have many viewer windows open on 3364 your desktop; to avoid this confusion, you can activate the <guibutton>Watch file</guibutton> 3365 mode, that will prevent <guibutton>Quickbuild</guibutton> from launching a viewer.</para> 3366 3367 <para>This mode is of course useless with the embedded viewers, as you have to close them 3368 anyway to get back to editing the document and recompiling.</para> 3369 3370 </sect1> 3371 3372 </chapter> 3373 3374 <chapter id="navigating"> 3375 3376 <title>Navigating the &latex; Source</title> 3377 3378 <sect1 id="navigating_struct"> 3379 3380 <title>Using the Structure View</title> 3381 3382 <para>The <guilabel>Structure</guilabel> view shows the hierarchy of the document 3383 being created in &kile;, and allows you to quickly navigate it, showing its segmentation. 3384 To navigate around your document, all you need to do is to left click on any label, chapter, 3385 section, subsection, etc., and you will be taken to the beginning of 3386 the corresponding area.</para> 3387 3388 <para>If you included a separate &latex; file in your source using 3389 the <userinput>\input</userinput> or <userinput>\include</userinput> tags, these files will 3390 be referred to in the <guilabel>Structure</guilabel> view; double-clicking on their names 3391 will make &kile; bring up the included file in the editor window.</para> 3392 3393 <para>The hierarchy tree also has a separate branch for labels used in the text.</para> 3394 3395 <!-- <screenshot> 3396 <screeninfo>Using the Structure View</screeninfo> 3397 <mediaobject> 3398 <imageobject> 3399 <imagedata fileref="snap_structview_label.png" format="PNG" /> 3400 </imageobject> 3401 <textobject> 3402 <phrase>Using the Structure View</phrase> 3403 </textobject> 3404 <caption><para>Using the Structure View</para></caption> 3405 </mediaobject> 3406 </screenshot>--> 3407 3408 <sect2 id="navigating_contextmenu"> 3409 3410 <title>Using the Context Menu</title> 3411 3412 <para>Most of the entries in the structure view have a lot of entries in the context menu, 3413 which you can open with a right mouse click. So look at the structure view in the 3414 following picture.</para> 3415 3416 <screenshot> 3417 <screeninfo>Using the Structure View</screeninfo> 3418 <mediaobject> 3419 <imageobject> 3420 <imagedata fileref="structureview.png" format="PNG" /> 3421 </imageobject> 3422 <textobject> 3423 <phrase>Using the Structure View</phrase> 3424 </textobject> 3425 </mediaobject> 3426 </screenshot> 3427 3428 <para>You will find some labels, some sectioning entries, two figure environments and three 3429 pictures. If you right click on one of the sectioning entries, a menu with some useful 3430 commands will popup. All commands like <guibutton>Select</guibutton>, <guibutton>Delete</guibutton> 3431 or <guibutton>Comment</guibutton> will work with all lines, which belong to this section.</para> 3432 3433 <screenshot> 3434 <screeninfo>Context menu for sectioning entries</screeninfo> 3435 <mediaobject> 3436 <imageobject> 3437 <imagedata fileref="structureview-context1.png" format="PNG" /> 3438 </imageobject> 3439 <textobject> 3440 <phrase>Context menu for sectioning entries</phrase> 3441 </textobject> 3442 </mediaobject> 3443 </screenshot> 3444 3445 <para>Clicking on a figure or table entry will offer some actions with respect to references 3446 and a right click on a graphics entry will offer some programs to open the graphics.</para> 3447 3448 <screenshot> 3449 <screeninfo>Context menu for figure/tables and graphics entries</screeninfo> 3450 <mediaobject> 3451 <imageobject> 3452 <imagedata fileref="structureview-context2.png" format="PNG" /> 3453 </imageobject> 3454 <textobject> 3455 <phrase>Context menu for figure/tables and graphics entries</phrase> 3456 </textobject> 3457 </mediaobject> 3458 </screenshot> 3459 3460 </sect2> 3461 3462 <sect2 id="navigating_update"> 3463 3464 <title>Updating the Structure View</title> 3465 3466 <para>To update your structure view you can either go to 3467 <menuchoice><guimenu>Edit</guimenu><guimenuitem>Refresh 3468 Structure</guimenuitem></menuchoice>, hit <keycombo><keycap>F12</keycap></keycombo>, or you can save your document, 3469 which will make &kile; update its <guilabel>Structure</guilabel> view.</para> 3470 3471 </sect2> 3472 3473 </sect1> 3474 3475 <sect1 id="navigating_bookmarks"> 3476 3477 <title>Bookmarks</title> 3478 3479 <para>Bookmarks are your reference to a segment of text or a line inside the &kile; 3480 environment. To use a bookmark, select a specific line of your document 3481 you would like to return to, then press <keycombo>&Ctrl; 3482 <keycap>B</keycap></keycombo>, and &kile; will add a bookmark to this line. 3483 Alternatively, you can also set a bookmark by highlighting a line and choosing 3484 the menu labeled <menuchoice><guimenu>Bookmarks</guimenu><guimenuitem>Set 3485 Bookmark</guimenuitem></menuchoice>.</para> 3486 3487 <para>To remove all your bookmarks, select <menuchoice><guimenu>Bookmarks</guimenu> 3488 <guimenuitem>Clear All Bookmarks</guimenuitem></menuchoice>.</para> 3489 3490 </sect1> 3491 3492 </chapter> 3493 3494 <chapter id="projects"> 3495 3496 <title>Projects</title> 3497 3498 <sect1 id="projects_working"> 3499 3500 <title>Working with Projects</title> 3501 3502 <para>In &kile; you can create and work with <emphasis>projects</emphasis>. A project is a 3503 group of &latex;, graphic, &bibtex;, or other files that contain all the information that is used to build 3504 your complete document. A typical project would be a document consisting of several chapters, 3505 written in different <literal role="extension">.tex</literal> files; all of them could be included in 3506 a project, to make the whole document easier to manage. The specifications of the project are stored in a special file, 3507 with extension <literal role="extension">.kilepr</literal>.</para> 3508 3509 <para>A Project adds the following functionalities:</para> 3510 3511 <itemizedlist> 3512 <listitem><para>You need not set a master document, &kile; does this automatically.</para></listitem> 3513 <listitem><para>Project files can easily be archived together by going to <menuchoice><guimenu>Project</guimenu><guimenuitem>Archive</guimenuitem></menuchoice></para></listitem> 3514 <listitem><para>The <guilabel>Files and Projects</guilabel> view shows which files are included 3515 in the project.</para></listitem> 3516 <listitem><para>After opening a project, any file that was previously opened will be 3517 restored with the original encoding and highlighting.</para></listitem> 3518 <listitem><para> Code completion works across all project files.</para></listitem> 3519 <listitem><para> Reference completion works across all project files.</para></listitem> 3520 <listitem><para> Citation completion works across all project files.</para></listitem> 3521 <listitem><para> Search in all project files.</para></listitem> 3522 <listitem><para> Specify custom quickbuild and &makeidx; command.</para></listitem> 3523 </itemizedlist> 3524 3525 <para>You can find all project related commands in the <guilabel>Project</guilabel>-menu. From there you can open, close and manage your projects.</para> 3526 3527 </sect1> 3528 3529 <sect1 id="projects_creating"> 3530 3531 <title>Creating a Project</title> 3532 3533 <para>To create a project, select <menuchoice><guimenu>Project</guimenu> 3534 <guimenuitem>New Project...</guimenuitem></menuchoice>.</para> 3535 <screenshot> 3536 <screeninfo>Project creation window</screeninfo> 3537 <mediaobject> 3538 <imageobject> 3539 <imagedata fileref="project-creation.png" format="PNG" /> 3540 </imageobject> 3541 <textobject> 3542 <phrase>Project creation window</phrase> 3543 </textobject> 3544 </mediaobject> 3545 </screenshot> 3546 <para>You will be 3547 asked to give the following information to create your project:</para> 3548 <itemizedlist> 3549 <listitem> 3550 <para> 3551 Title of your project (<guilabel>Project title</guilabel> text field). 3552 </para> 3553 <para> 3554 The title of the project will be used to create a name of the project file by transforming to lowercase and adding <filename role="extension">.kilepr</filename> extension. 3555 </para> 3556 </listitem> 3557 <listitem> 3558 <para> 3559 A folder where the project file will be stored (<guilabel>Project folder</guilabel> text field). 3560 </para> 3561 </listitem> 3562 <listitem> 3563 <para> 3564 If you want to create a new main file of the project check the <guilabel>Create a new file and add it to this project</guilabel> item. 3565 </para> 3566 </listitem> 3567 <listitem> 3568 <para> 3569 When you fill out the <guilabel>Filename</guilabel> box, you have to include a relative path from where the <filename role="extension">.kilepr</filename> project file is stored (see the <guilabel>Project folder</guilabel> item). 3570 </para> 3571 </listitem> 3572 <listitem> 3573 <para> 3574 Type of the created file, <guilabel>Empty File</guilabel>, <guilabel>Article</guilabel>, <guilabel>Book</guilabel>, <guilabel>Letter</guilabel>, <guilabel>Report</guilabel>, &etc; can be chosen from a visual list at the bottom of the <guilabel>File</guilabel> panel. 3575 </para> 3576 </listitem> 3577 <listitem> 3578 <para> 3579 Extensions for the default files in the project can be selected using the <guilabel>Extensions</guilabel> panel. Your choice will be used to define the files that should be opened when you choose <menuchoice><guimenu>Project</guimenu><guimenuitem>Open All Project Files</guimenuitem></menuchoice> menu item and in the &kile; wizards. The extensions in the text field should be separated with spaces. 3580 </para> 3581 </listitem> 3582 </itemizedlist> 3583 </sect1> 3584 3585 <sect1 id="projects_view"> 3586 3587 <title>The Files and Projects View</title> 3588 3589 <para>The <guilabel>Files and Projects</guilabel> view is a button of the sidebar menu. 3590 From this view, you can see the structure of your project, its files, 3591 and the name of the <literal role="extension">.kilepr</literal> file that stores the project information. 3592 Adding, removing, or changing options in your project is done via 3593 the <guilabel>Files and Projects</guilabel> view.</para> 3594 3595 <screenshot> 3596 <screeninfo>The Files and Projects View</screeninfo> 3597 <mediaobject> 3598 <imageobject> 3599 <imagedata fileref="snap_projectview.png" format="PNG" /> 3600 </imageobject> 3601 <textobject> 3602 <phrase>The Files and Projects View</phrase> 3603 </textobject> 3604 <caption><para>The Files and Projects View</para></caption> 3605 </mediaobject> 3606 </screenshot> 3607 3608 </sect1> 3609 3610 <sect1 id="projects_adding"> 3611 3612 <title>Adding and Removing Files</title> 3613 3614 <para>To add a file to your project, open any &tex; file, right click on its name in the 3615 <guilabel>Files and Projects</guilabel> view, and select <guilabel>Add to 3616 Project</guilabel>. If you have opened multiple projects, a dialog box will pop up in which 3617 you can specify to which project the file should be added.</para> 3618 <!-- duplicated see next para 3619 <para>If you have multiple files to be added to a project, you can select the 3620 project from the <guilabel>Files and Projects</guilabel> view and right-click then select 3621 <guilabel>Add Files...</guilabel>; you will then be able to select your files in a dialog box.</para> 3622 --> 3623 <para>You can also right-click on the project's name in the <guilabel>Files and 3624 Projects</guilabel> view, and select <guilabel>Add Files...</guilabel> to bring 3625 up a file selection dialog.</para> 3626 3627 <screenshot> 3628 <screeninfo>Adding a file to a project</screeninfo> 3629 <mediaobject> 3630 <imageobject> 3631 <imagedata fileref="snap_projectview_add.png" format="PNG" /> 3632 </imageobject> 3633 <textobject> 3634 <phrase>Adding a file to a project</phrase> 3635 </textobject> 3636 <caption><para>Adding a file to a project</para></caption> 3637 </mediaobject> 3638 </screenshot> 3639 3640 <para>To remove a file from a project, right-click on it and select <guilabel>Remove File</guilabel>. 3641 This does <emphasis>not</emphasis> delete your file (and also does not close it), but only removes it from the list 3642 of files contained in the <literal role="extension">.kilepr</literal> extension.</para> 3643 3644 <sect2 id="projects_archive"> 3645 3646 <title>Archiving your Project</title> 3647 3648 <para>&kile; allows you to easily backup your project by storing all its files 3649 into a single archive (often known as a <emphasis>tarball</emphasis>). To archive your project, 3650 right-click on its name in the <guilabel>Files and Projects</guilabel> view, or select 3651 <menuchoice><guimenu>Project</guimenu><guimenuitem>Archive</guimenuitem></menuchoice>.</para> 3652 3653 <para>By default, all files in a project are added to the archive. If you do not want to include 3654 a certain file in the archive, right-click on it in the <guilabel>Files and Projects</guilabel> 3655 view, and uncheck the <guilabel>Include in Archive</guilabel> option.</para> 3656 3657 <para>The archive operation is currently realized by executing the <command>tar</command> from the project 3658 folder (where the <literal role="extension">.kilepr</literal> file is located).</para> 3659 3660 </sect2> 3661 3662 </sect1> 3663 3664 <sect1 id="projects_options"> 3665 3666 <title>Project Options</title> 3667 3668 <para>&kile; has a few options related to your project that can be set. To change them, 3669 right-click on the title of your project and select <guilabel>Project Options</guilabel>, 3670 and you will have the option of changing:</para> 3671 3672 <itemizedlist> 3673 <listitem><para>The title of your project.</para></listitem> 3674 <listitem><para>Default file extensions.</para></listitem> 3675 <listitem><para>The Master document.</para></listitem> 3676 <listitem><para>The Quickbuild command.</para></listitem> 3677 <listitem><para>The &makeidx; options.</para></listitem> 3678 </itemizedlist> 3679 3680 3681 <!-- FIXME not working in kile, tbraun 11/3/2007 3682 <sect2 id="projects_ext"> 3683 3684 <title>Extensions for Non-Source Files</title> 3685 3686 <para>Non-source files are files such as pictures, PDF or &PostScript; files, etc. that are 3687 to be included in the project, but are not source files with the extension <literal role="extension">.tex</literal>. You have 3688 the option to use your own regular expressions to match non-source files.</para> 3689 </sect2> 3690 --> 3691 3692 </sect1> 3693 3694 <sect1 id="projects_closing"> 3695 3696 <title>Closing a Project</title> 3697 3698 <para>To close a project, select the <guilabel>Files and Projects</guilabel> view from 3699 the vertical toolbar, right click on your project title, and then select <guimenuitem> 3700 Close</guimenuitem>. This will close your project, all the files associated with your project, 3701 and will also add the name of the project you just closed to <guisubmenu>Open Recent 3702 Project...</guisubmenu> in the <guimenu>Project</guimenu> menu.</para> 3703 3704 </sect1> 3705 3706 </chapter> 3707 3708 <chapter id="lang"> 3709 3710 <title>Document Encoding</title> 3711 3712 <para>The &kile; editor allows you to read, convert and save text in the character encoding 3713 your document needs. With this it is possible, for example, to use accented characters, such 3714 as are commonly used in Italian or French, directly in &latex; documents. 3715 Selecting the encoding for your document can be done in two ways:</para> 3716 3717 <itemizedlist> 3718 <listitem><para>One way to set the document encoding is by using the submenu 3719 <menuchoice><guimenu>Settings</guimenu><guisubmenu>Configure 3720 Kile...</guisubmenu><guimenuitem>Editor</guimenuitem></menuchoice>, 3721 where you can set the default character encoding for all files.</para> 3722 <screenshot> 3723 <screeninfo>Set the default character encoding</screeninfo> 3724 <mediaobject> 3725 <imageobject> 3726 <imagedata fileref="config-encoding.png" format="PNG" /> 3727 </imageobject> 3728 <textobject> 3729 <phrase>Set the default character encoding</phrase> 3730 </textobject> 3731 </mediaobject> 3732 </screenshot> 3733 </listitem> 3734 <listitem><para>A second way to set the encoding for a document is to choose the desired encoding 3735 within the wizard to create a new document.</para></listitem> 3736 </itemizedlist> 3737 3738 <para>&latex; itself only understands ASCII, which represents a very limited set of characters. Hence, it is not possible to use 3739 accented characters directly. To use them nevertheless, a special syntax was invented: 3740 such as for example <userinput>\"e</userinput> for <computeroutput>ë</computeroutput>. 3741 The <application>inputenc</application> package is available to help you with this. It is included 3742 in the preamble using <userinput>\usepackage[latin1]{inputenc}</userinput>, where the optional argument 3743 specifies the encoding you would like to use (nowadays in most cases <userinput>utf8</userinput>). This tells &latex; 3744 to translate all of the <userinput>ë</userinput>'s you wrote to <userinput>\"e</userinput>'s before 3745 compiling. Please refer to the <application>inputenc</application> documentation directly for more 3746 information. Last but not least: remember to make sure that your file is <emphasis>actually</emphasis> saved 3747 in the same encoding you specified for the <application>inputenc</application> package!</para> 3748 3749 <para>This multitude of different character coding tables has created numerous problems: for example, 3750 you cannot write a course of Turkish in French without losing one language's special characters. 3751 There is general agreement that, sooner or later, 3752 everybody will switch to <ulink url="http://www.unicode.org">Unicode</ulink>. There 3753 are many implementations of Unicode, and <abbrev>UTF-8</abbrev> is the most 3754 successful in &Linux;; &Windows;® relies instead on the more cumbersome and 3755 less flexible <abbrev>UCS-2</abbrev>. Most distributions have already 3756 begun setting their default encoding to <abbrev>UTF-8</abbrev>, and therefore you 3757 may be very interested in using the <userinput>utf8</userinput> argument to the 3758 <userinput>inputenc</userinput> package.</para> 3759 3760 <sect1 id="ucs"> 3761 3762 <title>The &ucs; Package</title> 3763 <para>If you don't have the &ucs; package installed, you can proceed as follows:</para> 3764 <itemizedlist> 3765 <listitem><para>Get the &ucs; package from 3766 <ulink url="http://www.ctan.org/tex-archive/macros/latex/contrib/unicode/">CTAN</ulink>. 3767 </para></listitem> 3768 <listitem> 3769 <para>To install it, unpack the downloaded file and place it in a folder listed 3770 in your $<envar>TEXINPUTS</envar> environment variable. This can also be set inside &kile;.</para> 3771 </listitem> 3772 </itemizedlist> 3773 3774 <programlisting>\usepackage{ucs} 3775 \usepackage[utf8]{inputenc}</programlisting> 3776 3777 </sect1> 3778 3779 <sect1 id="xelatex"> 3780 3781 <title>XeLaTeX</title> 3782 3783 <para>If you are using <userinput>XeLaTeX</userinput>, you can simply load the 3784 <userinput>xltxtra</userinput> package. It will additionally load all the required packages.</para> 3785 <programlisting>\usepackage{xltxtra}</programlisting> 3786 3787 </sect1> 3788 3789 <sect1 id="cjk"> 3790 3791 <title>&cjk; Support</title> 3792 3793 <para>Adding support for ideographic languages is quite tricky. However, once 3794 you are done with it, it will work quite well. Other than installing packages, 3795 there is some extra configuration work to do.</para> 3796 3797 <tip><para>Your &Linux; distribution might already have a &cjk; (Chinese, Japanese, 3798 Korean) package ready for you, so you might be saved the hassle of manually 3799 installing everything. Do check before going forward!</para></tip> 3800 3801 <para>There is the possibility of using the &ucs; package in order to write 3802 short snippets of &cjk; text, but that option is seriously limited as it does 3803 not handle, among other things, newlines. Instead, we will install the complete 3804 &cjk;-&latex; package and make it work for both &latex; and &pdflatex;. A lot 3805 of this material has been inspired by <ulink url="http://www.ece.uci.edu/~chou/">Pai 3806 H. Chou</ulink>'s <ulink url="http://www.ece.uci.edu/~chou/unicode-tex.html">page 3807 about how to setup &pdflatex;</ulink>.</para> 3808 3809 <orderedlist> 3810 3811 <listitem><para>Download the <ulink 3812 url="http://www.ctan.org/tex-archive/help/Catalogue/entries/cjk.html">&cjk;</ulink> 3813 package. Copy its unpacked files to an appropriate subfolder of 3814 $<envar>TEXMF</envar>, just as you did with the &ucs; package 3815 before (see <xref linkend="ucs" role="select: title pageabbrv"/>). The files will be unpacked in a 3816 <filename>CJK/X_Y.Z</filename> folder; it is not important that you 3817 take them out, though it will probably be tidier and easier for you to 3818 maintain.</para></listitem> 3819 3820 <listitem><para>Now you have to download a font that supports all the &cjk; characters 3821 you need. You can choose any <literal role="extension">*.ttf</literal> file that 3822 covers them, but in this walkthrough we will use <ulink 3823 url="ftp://ftp.wu-wien.ac.at/pub/www/Netscape/communicator/extras/fonts/windows/Cyberbit.ZIP">Cyberbit</ulink>. 3824 Unzip the file and rename <filename>Cyberbit.ttf</filename> to 3825 <filename>cyberbit.ttf</filename>, since uppercase might confuse your system.</para> 3826 <para>Place <filename>cyberbit.ttf</filename> in a folder together with 3827 <ulink url="http://delloye.free.fr/Unicode.sfd"><filename>Unicode.sfd</filename></ulink>, 3828 and generate the <literal role="extension">*.tfm</literal> and 3829 <literal role="extension">*.enc</literal> files with the command 3830 <userinput><command>$ ttf2tfm cyberbit.ttf -w cyberbit@Unicode@</command></userinput>. 3831 For some reason, sometimes this does not produce the hundreds 3832 of files it should. Should that happen in your case, you can download both 3833 <ulink url="http://www.ece.uci.edu/~chou/unicode/cyberbit-tfm.tgz"><literal 3834 role="extension">*.tfm</literal></ulink> and 3835 <ulink url="http://www.ece.uci.edu/~chou/unicode/cyberbit-enc.tgz"><literal 3836 role="extension">*.enc</literal></ulink> files.</para> 3837 <para>Place the <literal role="extension">*.tfm</literal> files in an 3838 appropriate folder, say <filename>$<envar>TEXMF</envar>/fonts/tfm/bitstream/cyberbit/</filename>; 3839 the <literal role="extension">*.enc</literal> files may be installed in 3840 <filename>$<envar>TEXMF</envar>/pdftex/enc/cyberbit/</filename>.</para></listitem> 3841 3842 <listitem><para>Now we need a map file to connect the <literal 3843 role="extension">*.enc</literal> files to the font. Download <ulink 3844 url="http://delloye.free.fr/cyberbit.map"><filename>cyberbit.map</filename></ulink> 3845 and install it in <filename>$<envar>TEXMF</envar>/pdftex/config/</filename>.</para></listitem> 3846 3847 <listitem><para>Download another file, <ulink 3848 url="http://delloye.free.fr/c70cyberbit.fd"><filename>c70cyberbit.fd</filename></ulink>, 3849 and place it in an appropriate folder. You may choose, for example, 3850 <filename>$<envar>TEXMF</envar>/tex/misc/</filename>.</para></listitem> 3851 3852 <listitem><para>The last file we have to generate is a &PostScript; Type 1 3853 font, necessary to read &DVI; files generated with &latex;. Run the command 3854 <userinput><command>$ ttf2pfb cyberbit.ttf -o cyberbit.pfb</command></userinput>, and copy the 3855 resulting <filename>cyberbit.pfb</filename> to a folder such as 3856 <filename>$<envar>TEXMF</envar>/fonts/type1/cyberbit/</filename>.</para></listitem> 3857 3858 <listitem><para>Let's now place <filename>cyberbit.ttf</filename> among the fonts 3859 where &latex; can find it. You could place it in a folder named 3860 <filename>$<envar>TEXMF</envar>/fonts/truetype/</filename>.</para></listitem> 3861 3862 <listitem><para>Check the configuration file you find at 3863 <filename>$<envar>TEXMF</envar>/web2c/texmf.cnf</filename>, and make sure that the 3864 line mentioning <envar>TTFONTS</envar> is uncommented and points to 3865 the folder where you saved <filename>cyberbit.ttf</filename>.</para></listitem> 3866 3867 <listitem><para>To make it possible for &pdflatex; to use your &cjk; 3868 fonts, it is necessary that you add a line in the configuration file 3869 <filename>$<envar>TEXMF</envar>/pdftex/config/pdftex.cfg</filename>. Add 3870 <userinput>map +cyberbit.map</userinput> in the file to complete the 3871 configuration for &pdflatex;.</para></listitem> 3872 3873 <listitem><para>To configure &latex; so that you can produce &DVI; 3874 files with &cjk; characters, you have to add a line in file 3875 <filename>ttfonts.map</filename>. The file might be in a folder named 3876 <filename>$<envar>TEXMF</envar>/ttf2pk/</filename>, but you will probably have to look 3877 for it. Append the line <userinput>cyberbit@Unicode@ cyberbit.ttf</userinput> 3878 to it.</para></listitem> 3879 3880 <listitem><para>Now, you only have to run <userinput><command>texhash</command></userinput> 3881 and the system should be ready.</para></listitem> 3882 3883 </orderedlist> 3884 3885 <para>To test whether your configuration is correct, you can try to compile 3886 <ulink url="http://www.math.nus.edu.sg/aslaksen/cs/sample-utf8.tex">this test 3887 file</ulink>.</para> 3888 3889 <sect2> 3890 <title>&cjk; Troubleshooting</title> 3891 3892 <para>There are many things that can go wrong when adding &cjk; 3893 support manually. If something seems not to work, the following 3894 checklist might help you.</para> 3895 3896 <itemizedlist> 3897 3898 <listitem><para>Obviously, since you run &latex; as a user and 3899 not as root, you must <emphasis>allow</emphasis> ordinary users 3900 to access the new files. Make sure all folders and files are 3901 accessible using the <command>chmod</command> command.</para></listitem> 3902 3903 <listitem><para>If &latex; writes a &DVI; without problems, but you 3904 cannot view it, it is almost certainly because of some problems in the 3905 automatic generation of <literal role="extension">*.pk</literal> 3906 fonts. They are supposed to be generated on the fly when viewing a 3907 &DVI; file, but this might fail for a number of reasons: double-check 3908 <filename>ttfonts.map</filename> for your custom line first. However, 3909 it might happen that your <command>ttf2pk</command> command, which 3910 is usually invoked by the &DVI; viewer, has been compiled 3911 <emphasis>without</emphasis> support for the 3912 <application>kpathsea</application> libraries. If this is the case, 3913 <userinput><command>ttf2pk</command> <option>--version</option></userinput> 3914 will make no mention of <application>kpathsea</application>. As support for 3915 these libraries is necessary, you might have to find a new package, or 3916 recompile <application>FreeType 1</application> yourself.</para></listitem> 3917 3918 </itemizedlist> 3919 3920 </sect2> 3921 3922 3923 <sect2> 3924 3925 <title>How do I input &cjk; in Unicode?</title> 3926 3927 <para>There are a number of different input engines, and the choice can 3928 depend also on personal preference. The author uses <ulink 3929 url="http://www.scim-im.org/projects/skim"><application>Skim</application></ulink>, 3930 a port to &kde; of the <ulink 3931 url="http://www.scim-im.org"><application>Scim</application></ulink> 3932 engine. Refer to your distribution's documentation to learn how to 3933 install these programs. Configuration of such programs can be tricky 3934 too, in the case of <application>Skim</application> you will have to 3935 define an environment variable <userinput><envar>XMODIFIERS</envar>="@im=SCIM"</userinput> 3936 <emphasis>before</emphasis> starting <application>X</application>.</para> 3937 3938 </sect2> 3939 3940 </sect1> 3941 3942 </chapter> 3943 3944 &include-section-scripting; 3945 3946 <chapter id="help"> 3947 3948 <title>Help</title> 3949 3950 <sect1 id="help_documents"> 3951 3952 <title>Help Documents</title> 3953 3954 <para>&latex; is a rather sophisticated system, where basic features 3955 can be expanded by a great variety of additional packages. 3956 &kile; provides numerous different ways to aid the user.</para> 3957 3958 <para> 3959 The <menuchoice><guimenu>Help</guimenu> <guisubmenu>LaTeX Documentation</guisubmenu></menuchoice> submenu includes links on documentation for all the included packages and an additional &latex; 3960 reference. 3961 </para> 3962 3963 <variablelist> 3964 3965 <varlistentry> 3966 <term><guimenu>Documentation Browser</guimenu></term> 3967 <listitem><para>A handy tool to browse all &latex; topics. Please install &latex; help packages for your distribution if you need the full-fledged documentation compendium.</para></listitem> 3968 </varlistentry> 3969 3970 <varlistentry> 3971 <term><guimenu>LaTeX</guimenu></term> 3972 <listitem><para>A full unofficial reference for &tex; and friends. This is not 3973 only a description of all programs, but some important packages are also 3974 mentioned. It also includes a full reference manual of &latex; 3975 commands—ideal for looking up a particular piece of formatting 3976 while writing a document. As this document is really extensive, 3977 it is referenced in &kile; by three bookmarks.</para></listitem> 3978 </varlistentry> 3979 3980 <varlistentry> 3981 <term><guimenu>LaTeX Commands</guimenu></term> 3982 <listitem><para>Another alphabetical index of the most common 3983 &latex; commands.</para></listitem> 3984 </varlistentry> 3985 3986 <varlistentry> 3987 <term><guimenu>LaTeX Environments</guimenu></term> 3988 <listitem><para>An alphabetical index of the most common 3989 &latex; environments.</para></listitem> 3990 </varlistentry> 3991 3992 </variablelist> 3993 3994 </sect1> 3995 3996 <sect1 id="help_contextsentitive"> 3997 3998 <title>Context Sensitive Help</title> 3999 4000 <para>&kile; also supports a context sensitive help, which is called 4001 with <keycombo action="simul">&Ctrl;&Alt;<keycap>H</keycap></keycombo>,<keycap>K</keycap>. 4002 In <menuchoice><guimenu>Settings</guimenu><guisubmenu>Configure Kile...</guisubmenu> 4003 <guimenuitem>Kile</guimenuitem><guilabel>Help</guilabel></menuchoice> 4004 you can choose whether you want to use &kile;'s &latex; reference or the 4005 help system of &tetex;/&texlive;, which is the default setting.</para> 4006 4007 <screenshot> 4008 <screeninfo>Bullets</screeninfo> 4009 <mediaobject> 4010 <imageobject> 4011 <imagedata fileref="config-userhelp.png" format="PNG" /> 4012 </imageobject> 4013 <textobject> 4014 <phrase>Bullets</phrase> 4015 </textobject> 4016 </mediaobject> 4017 </screenshot> 4018 4019 </sect1> 4020 4021 <sect1 id="help_search"> 4022 4023 <title>Searching for Keywords</title> 4024 4025 <para>It is not always easy to find the right document as &tetex;/&texlive; 4026 ships with a huge number of help documents. In order to facilitate this process, &tetex;/&texlive; 4027 provides a tiny program called <application>texdoctk</application>. 4028 It provides a database of all the help documents, for which &kile; offers a user-friendly 4029 interface.</para> 4030 4031 <screenshot> 4032 <screeninfo>Bullets</screeninfo> 4033 <mediaobject> 4034 <imageobject> 4035 <imagedata fileref="dialog-docbrowser1.png" format="PNG" /> 4036 </imageobject> 4037 <textobject> 4038 <phrase>Bullets</phrase> 4039 </textobject> 4040 </mediaobject> 4041 </screenshot> 4042 4043 <para>All the documents are grouped into categories. Additionally, 4044 one can search for package names or keywords. 4045 &kile; will then show only the help documents matching the search string.</para> 4046 4047 <screenshot> 4048 <screeninfo>Bullets</screeninfo> 4049 <mediaobject> 4050 <imageobject> 4051 <imagedata fileref="dialog-docbrowser2.png" format="PNG" /> 4052 </imageobject> 4053 <textobject> 4054 <phrase>Bullets</phrase> 4055 </textobject> 4056 </mediaobject> 4057 </screenshot> 4058 4059 <para>A mouse double-click or the <keycap>Space</keycap> key will start a 4060 viewer for the selected document. This can be an arbitrary document, not only a 4061 &DVI;, PS, PDF or &HTML; document. &kile; takes the &kde; settings into account in order to 4062 start an appropriate viewer.</para> 4063 4064 4065 </sect1> 4066 4067 <sect1 id="help_userdefined"> 4068 4069 <title>User Defined Help</title> 4070 4071 <para>Besides this static &tetex;/&texlive; documentation, &kile; also supports 4072 a more flexible variable way for help documents. In the <guimenu>Help</guimenu> 4073 menu &kile; has a special <guimenu>User help</guimenu> 4074 submenu, where the user can add documents of his or her own choice. 4075 These can be the most important documents of the &tetex;/&texlive; documentation, or even 4076 self-written documents. It is also possible to enter URLs.</para> 4077 4078 <para>Go to 4079 <menuchoice><guimenu>Settings</guimenu><guisubmenu>Configure Kile...</guisubmenu> 4080 <guimenuitem>Kile</guimenuitem><guilabel>Help</guilabel></menuchoice> 4081 and choose the <guibutton>Configure</guibutton> button 4082 to configure this <guimenu>User help</guimenu> menu. You can add, 4083 remove or move menu entries around, and insert separators to optimize 4084 the structure of the menu.</para> 4085 4086 <screenshot> 4087 <screeninfo>Dialog: configure user defined help entries</screeninfo> 4088 <mediaobject> 4089 <imageobject> 4090 <imagedata fileref="dialog-userhelp.png" format="PNG" /> 4091 </imageobject> 4092 <textobject> 4093 <phrase>Dialog: configure user defined help entries</phrase> 4094 </textobject> 4095 </mediaobject> 4096 </screenshot> 4097 4098 <para>Pressing the <guibutton>Add</guibutton> button will open 4099 another dialog, where you can edit the name of the menu entry, 4100 and choose the corresponding file or &URL;. The second button to the right of the text field launches 4101 &konqueror;, which can be used to determine the correct &URL;.</para> 4102 4103 <screenshot> 4104 <screeninfo>Dialog: add a new helpentry</screeninfo> 4105 <mediaobject> 4106 <imageobject> 4107 <imagedata fileref="dialog-addhelp.png" format="PNG" /> 4108 </imageobject> 4109 <textobject> 4110 <phrase>Dialog: add a new helpentry</phrase> 4111 </textobject> 4112 </mediaobject> 4113 </screenshot> 4114 4115 <para>After finishing the configuration, all the entries will appear in the <guimenu>Help</guimenu> 4116 menu of &kile; as a special menu entry <guimenu>User help</guimenu>.</para> 4117 4118 <screenshot> 4119 <screeninfo>Userhelp menu</screeninfo> 4120 <mediaobject> 4121 <imageobject> 4122 <imagedata fileref="menu-userhelp.png" format="PNG" /> 4123 </imageobject> 4124 <textobject> 4125 <phrase>Userhelp menu</phrase> 4126 </textobject> 4127 </mediaobject> 4128 </screenshot> 4129 4130 </sect1> 4131 4132 </chapter> 4133 4134 <chapter id="credits"> 4135 4136 <title>Credits and License</title> 4137 4138 <para>&kile; is an open-source user-friendly &latex; / &tex; source code editor. It runs on systems 4139 that have the &kde; Desktop Environment installed. &kde; is available for several architectures 4140 including &Linux; and other Unix-like systems.</para> 4141 4142 <para>Many thanks are owed to the people who strive to continue the &kile; project and to those 4143 who sacrifice numerous hours of their time to develop tools we can all use under the &GNU; license. 4144 Up-to-date information about contributors can be found in 4145 the <guimenuitem>About &kile;</guimenuitem> dialog from the <guimenu>Help</guimenu> menu. 4146 </para> 4147 4148 <para>Many thanks to all those involved!</para> 4149 4150 <!-- TRANS:CREDIT_FOR_TRANSLATORS --> 4151 4152 &underFDL; <!-- FDL: do not remove --> 4153 &underGPL; <!-- GPL License --> 4154 4155 </chapter> 4156 4157 4158 &documentation.index; 4159 4160 </book> 4161 4162 <!-- 4163 Local Variables: 4164 mode: xml 4165 sgml-minimize-attributes:nil 4166 sgml-general-insert-case:lower 4167 sgml-indent-step:0 4168 sgml-indent-data:nil 4169 End: 4170 4171 vim:tabstop=2:shiftwidth=2:expandtab 4172 -->