Chapter 4. Starting a New Document

Table of Contents

Templates
Create a New Template
Configuring Automatic Substitutions
Create a Template from the Wizard
Creating a Template from any File
Removing a Template

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:

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 the section called “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 File->Create Template from Document.

Configuring Automatic Substitutions

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

When designing your own template, it is useful to known 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 listed in the section called “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 making 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 in standard tex distributions included. Download it from here and place it in the same directory as your LATEX file.

Removing a Template

To remove a template from Kile, do as follows:

  1. Go to File->Remove 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.