Chapter 4. Starting a New Document

When you click the button in the toolbar to begin a new document a dialog appears, asking which type of template you would like to use to write your document. The default choices are:

  • Empty document

  • Article

  • Beamer

  • Book

  • HA-Prosper

  • Powerdot

  • Letter

  • Report

  • Scrartcl (from the KOMA-Script package)

  • Scrbook (from the KOMA-Script package)

  • Scrlttr2 (from the KOMA-Script package)

  • Scrreprt (from the KOMA-Script package)

  • PDF

  • XeLaTeX

If you selected an Empty document, you can either start writing a document from scratch, or you can use the wizard to quickly start a new document (see QuickStart Wizard).

Templates

Frequent users of LATEX typically use the same preamble for almost every document they use. Templates can be created, saved and loaded within Kile to make it easier to start a new document.

Create a New Template

To create a new template, you must first either open a TEX / LATEX file, or create a file of your own. Kile can generate a template from an existing document by opening the desired document and selecting FileCreate Template from Document.

Configuring Automatic Substitutions

When creating a new document by selecting a template from FileNew, certain character combinations will be replaced by data such as your name, or the character encoding you are using. These variables can be configured in SettingsConfigure Kile...Settings+General.

When designing your own template, it is useful to know which character combinations are replaced by which template variables:

  • $$AUTHOR$$: This string will be replaced by the author variable.

  • $$DOCUMENTCLASSOPTIONS$$: This string will be replaced by the documentclass options variable. Typically this is used as follows: \documentclass[$$DOCUMENTCLASSOPTIONS$$]{article}.

  • $$INPUTENCODING$$: If the inputencoding variable is set to, say, latin1 this string is replaced by \input[latin1]{inputenc}.

Create a Template from the Wizard

The easiest way to create a new template is to start the wizard, and then add commands in the editor. Once you have your document set up the way you like:

  1. Save your file;

  2. Go to File;

  3. Choose Create Template from Document;

  4. Make any corrections necessary to the template;

  5. Enter a name for your new template;

  6. Click OK to add your template to the menu.

Next time you start up a new document, you will be able to choose your customized template instead of the default ones.

Creating a Template from any File

A template can be created from any LATEX file. If you are looking for an easy way to configure a template, go find one you like on the Internet and follow the same steps as listed in Create a Template from the Wizard.

For instance, you may want to create a full-fledged A0 poster. These posters are usually seen at scientific conferences, and LATEX will help you make an attractive, catchy poster. You can get a template for A0 posters at Jonathan Marchini's home page, but many more are available. Remember that you will need the a0poster package, which is normally not included in standard TEX distributions. Download it from here and place it in the same folder as your LATEX file.

Removing a Template

To remove a template from Kile, do as follows:

  1. Go to FileRemove Template...;

  2. A dialog box will appear with all templates listed: select a template;

  3. Click OK, and your template will be removed.

Templates marked with an asterisk (*) cannot be removed without the proper permission.