# The &kile; Handbook

Pascal
Brachet
Jeroen
Wijnhout

    wijnhout@science.uva.nl

2002
Pascal Brachet
2003-01-10
1.01.00

&kile; is a LaTeX source editor, TeX shell and GnuPlot frontend.

KDE
kdenonbeta
Kile
LaTeX
TeX

## Introduction

&kile; is a LaTeX source editor, TeX shell and GnuPlot frontend. It is not a WYSIWYG (what you see is what you get) interface for LaTeX; instead, its aim is to simplify the edition of LaTeX source code and the use of the LaTeX-related programs for users who want to retain control over their LaTeX documents.

## Using &kile;

### &kile; Features

In addition to the usual commands of an editor, &kile; provides other commands to assist you in editing your source files.

#### Non-English documents and special characters

If you want to edit or create documents that contain non-standard letters (such as accented letters), you will have to set the encoding for the file. This can be done by selecting the appropriate encoding (iso 8859-2 for most European countries for example) in the drop-down menu at the lower left corner of the file selector window.

Selecting the encoding
Selecting the encoding

Selecting the encoding

#### The Preamble

To define the preamble of the source file, you can:

- Use the Quick start wizard.

  The Quick Start Wizard
  The Quick Start Wizard

  The Quick Start Wizard

- Use a template of a preamble already recorded via the User menu.

  Saved Preamble Templates
  Saved Preamble Templates

  Saved Preamble Templates

- Copy and Paste the preamble from another document.

  Reusing Another Document Preamble
  Reusing Another Document Preamble

  Reusing Another Document Preamble

#### Structure of your Document

With the toolbar or the Latex Sectionning menu, you can insert the title of a section or of a paragraph with a dialog box. The Structure view is automatically updated. While clicking on one item in the Structure view, the cursor is placed on the corresponding line in the editor.

For file names, it is necessary to double click. To work with &kile; all your files must be located in the same directory as your main document.

The Structure View
The Structure View

The Structure View

#### LaTeX Tags and Mathematical Symbols

&kile; enables you to directly insert the most current tags with the Latex and Math menus. With a simple click on a mathematical symbol, &kile; inserts the corresponding code.

Inserting Symbols
Inserting Symbols

Inserting Symbols

In addition to the many standard LaTeX tags you can insert into your document by selecting them in the LaTeX and Math menus, you can also define your own tags. Tags you frequently use for example. The first twelve tags can be accessed via the keyboard shortcuts Shift+F1 to Shift+F12.

If the code saved in the menu is %environment then &kile; will directly insert:

    \begin{environment }
    \end{environment }

A User Menu Entry
A User Menu Entry

A User Menu Entry

To edit the tags choose Edit User Tags from the UserUser Tags menu. To add a tag, select the "Add" radiobutton and enter a short descriptive name for the tag and enter the tag itself. When you're done simply click on the Ok button. To change or remove a tag, select the tag from the drop-down menu and select the "Edit" or "Remove" radiobutton.

For bib files, the Bibliography menu enables you to directly insert the entries corresponding to the standard types of document. Use the Clean command to delete the optional fields.

Selected text can be directly framed by certain environments.

While clicking on the button Bold after having selected the word Hello you will obtain the code:

    \textbf{Hello}

The Tabular, Array and Tabbing wizards are at your disposal via the Wizard menu, to help you insert the code corresponding to these environments.

Spell checking of your document (or of the selected text) is possible via the Edit Spelling... menu item.

### The LaTeX Shell

The commands in the Tools menu enable you to directly launch the standard programs associated with LaTeX. To configure these tools, use the Options Configure Kile menu item.

#### About the Log File

The Next Latex Error and Previous LaTeX Error commands allow to get to the errors detected during compilation. While clicking on the number of a line in the `log` file , the cursor is placed on the corresponding line in the editor.

The Log File
The Log File

The Log File

#### The Quick Build Command

With this command, the compilation and display of the document are automatically launched, unless a LaTeX error is detected in the log file. Only errors will stop the process, warnings are ignored.

#### About Documents Separated in Several Files

After having defined your Master document, with the corresponding command in the Options menu, all the commands of the Tools menu will apply only to this document even when you are working on the children documents. You can even close the Master document.

Master and Children Documents
Master and Children Documents

Master and Children Documents

#### Use of the Watch File mode

Example of use with &kdvi;

1. Launch the Quick Build command.

2. Leave &kdvi; open and select the Watch File mode for this program.

3. Select the Watch File in the Tools menu in &kile;.

4. Each time you launch the Quick Build, the dvi document will be automatically updated, without &kdvi; being started again.

This mode also works with &kghostview;, but will not work with the embedded viewers.

#### Use of the &kdvi; Forward Search Command

With this command, &kdvi; displays the &DVI; document directly in the place corresponding to the position of the cursor in &kile;. This command is not available if a Master document is defined in &kile;. You must also iset the following command into the preamble of your document:

    \usepackage[active]{srcltx }

Finally, you must copy the `srcltx.sty` and `srctex.sty` files (provided with &kdvi;) into the same directory as your document.

#### Use of the &kdvi; Inverse Search with &kile;

With this feature of &kdvi;, a middle mouse click in the &DVI; document will have &kile; open the corresponding tex document and attempt to go to the corresponding line.

For this to work, the tex document must be already compiled, and the &kdvi; Forward Search must be working.

To select &kile; as the default editor in &kdvi; enter the command ``kile` `%f` `--line` `%`` in the &kdvi; dialog reached through Settings DVI Options DVI Specials

The &kdvi; &DVI; Specials dialog The &kdvi; &DVI; Specials dialog

The &kdvi; &DVI; Specials dialog

#### Define your own tools

If the standard tools Kile provides access to (e.g. latex, dvips, etc.) do not satisfy your needs, you can add define your own tools. Editing these tools is essentially the same as editing the user tags (see LaTeX tags and Mathematical Symbols). The shortcuts for the first twelve tools are Alt+Shift+F1 to Alt+Shift+F12.

It is possible to pass the name of the current document to the user tool, this is done via the sequence

    %S

. For example

    lpr %S.ps

would print the file

    test.ps

if the current document was

    test.tex

.

### The &gnuplot; Front End

The &gnuplot; front end provided with &kile; is an adaptation of the Xgfe program created by David Ishee. The use of this tool requires experience of &gnuplot;.

1. Check the Function box and enter `sin(x)` in the corresponding field.

2. Enter `X` in the Variable X field, `-5` in the Start and `5` in the End field.

3. Click on the Plot button to see the graphic.

4. To export the graphic in the Xfig format, select fig in the Terminal menu, then click on the Output File button, and enter the name of the file with the extension `.fig`. Then click the Plot. You may now open this graphic with Xfig to modify it, and export it with the `eps` format before incorporating it into your document.

The &gnuplot; Front End
The &gnuplot; Front End

The &gnuplot; Front End

## Credits and License

&kile;

Program copyright 2003 and currently maintained by Jeroen Wijnhout Jeroen.Wijnhout@kdemail.net

Program copyright 2002-2003 Brachet Pascal

&kile; contains source code from this free (GPL) program Xgfe (X Windows GUI front end to Gnuplot), Copyright © 1998 David Ishee

Documentation Copyright © 2002 Brachet Pascal

&underFDL; &underGPL;

&documentation.index;