Using Kile

This page is intended as a light introduction to the Kile LaTeX editor, and aims only to get you started. In particular, it is not intended to be an introduction to LaTeX: for resources on that, follow this link. Further information on Kile can be found in the Kile handbook, and users are strongly recommended to read through that.

Getting started

Kile is immediately ready to start creating LaTeX documents; however, you should take the time to look over its configuration before you start using it heavily. From the menu, select Settings -> Configure Kile....

One of the first things you should do is enter your name in the Author box in the General tab.

Opening a new document

If you wish, you can treat Kile simply as a text editor, opening up a blank file and beginning from scratch. However, through templates, Kile can reduce much of the workload in creating new tex files, and we shall explore this here.

A new document can be started in a number of ways:

  1. With the new document symbol at the very left of the toolbar: the icon is a blank document with a plus sign over it.
  2. From the menus, by selecting File -> New.
  3. Directly by the keyboard, using the shortcut Ctrl+N.
This opens up the New File Wizard, with a selection of pre-defined templates.

Kile's document wizard
Kile's document wizard.

In addition to the standard document templates that come with Kile, staff will notice that the standard UniS templates have also been provided.

For now, select the Article class. You will see a very simple latex template for an article come up. If you have filled in your name in the settings tab, then the \author command will automatically have your name there.

Compiling LaTeX documents

Compiliation of your document can be started in a number of ways:

  1. Simply hit the latex button: .
  2. Use the keyboard shortcut Alt + 2.
  3. Select it from the Build -> Compile menu.
The latter, while the most involved, will also indicate other keyboard shortcuts. In particular, note that a quick build option exists, either or Alt + 1, which will compile and then preview your document.

If you have not already saved the file, you will be prompted to do so, otherwise, Kile will compile your document, returning a list of errors and warnings that the process may have given rise to.

If the document compiles cleanly (i.e. there are no errors) then you will be able to view the resultant DVI file in the DVI viewer: . To return to the text editor, either:

  1. Hit the Editor View button.
  2. Hit the close window button in the top corner.
  3. Use the keyboard shortcut Alt + F4.
  4. Use the keyboard shortcut Ctrl + Q.

All the programs related to LaTeX document creation are laid out in the tool bar, starting with the latex button. For quick reference, they are listed below:

Create DVI
View DVI file
Convert DVI to PS
View PS file
Create PDF file
View PDF file
Convert DVI to PDF
Convert PS to PDF
Create HTML file
View HTML file
Forward Search in DVI file

Kile's toolbar icons.

Working with multi-part documents

It is often easier to deal with large LaTeX projects by creating multi-part documents where one overall master document calls upon other latex files via /input and /include. Kile is able to deal with these by allowing you to flag which file is a "Master document".

Suppose we have a master file called main.tex which incorporates the contents of section.tex. Opening up main.tex in Kile, we can set this as the master by going to the Settings menu and choosing Define Current Document as "Master Document".

Setting the Master Document
Setting the "Master Document".

If we were to now edit section1.tex and then hit the latex button, Kile knows to run latex not on the currently edited file but on the master document main.tex.

WARNING: Unless you tell it otherwise, Kile will always default to this master document when compiling, so if you start working on a wholly different document, please notify Kile immediately. To do so, go to Settings and choose Normal mode: the current master document will be indicated in parentheses.

Returning to normal mode
Returning to Normal mode.

Forward- and Inverse-searching in Kile

Forward-searching allows a user to highlight a word in a LaTeX document and jump to its place in the associated DVI file at the touch of a button. Kile should automatically be configured to do this, via the forward search button: .

Inverse-searching is the reverse, allowing a user to middle-click on any word in a DVI file and jump straight back to its position in the latex source file. Once again, Kile should automatically be configured to do this. If you find that it does not open up the source files in the Kile editor, then, in the DVI viewer, click on Settings and choose Configure Kile.... A dialog box with only those settings relevant to the DVI viewer should appear. Click on DVI Specials and ensure Kile is chosen in the drop-down box.

Note that the inverse-search facility will also work with multi-part documents.

Creating your own templates

If you tend to work with a standard LaTeX preamble, then you can create your own template in Kile to reflect this.

Let us use the document main.tex as a new template for Kile. Ideally, this document should have nothing but a preamble, which calls upon some useful packages, unless you always include a standard piece of content (such as a disclaimer or license) in your work.

Our example document main.tex is not that empty, but can easily be corrected - simply highlight everything inside the document environment to delete it.

Cleaning up for a template
Cleaning up our template file.

To use this as a template, simply select File -> Create Template From Document....

Kile's template creation dialog
The template creation dialog box.

In the template creation dialog box you can choose both a name for your new template as well as an icon for easier recognition.

Now, whenever you open up the new document wizard, your new template will be listed as one of the options.


Last modified Tuesday, August 23rd, 2005.