CERN Accelerating science

This website is no longer maintained. Its content may be obsolete. Please visit http://home.cern/ for current CERN information.



next up previous
Next: Option processing Up: LaTeXeAn Overview Previous: Preamble commands

Example of document preambles

The following preamble references the article class with the (global) options twocolumn and a4paper, and loads the multicol and babel packages, the latter with the german and french options. Other document parameters (eg. the textheight) can also be specified.

  \documentclass[twocolumn,a4paper]{article}
  \usepackage{multicol}
  \usepackage[german,french]{babel}
  \addtolength{\textheight}{2cm}
  \begin{document}
      ...
  \end{document}

The following shows three equivalent ways of specifying the loading of packages.

  \documentclass[german]{book}
  \usepackage[german]{babel}
  \usepackage[german]{varioref}
  \usepackage{multicol}
  \usepackage{epic}

Somewhat less verbose is:

  \documentclass[german]{book}
  \usepackage[german]{babel,varioref}
  \usepackage{multicol,epic}

With german as global option you can write:

  \documentclass[a4paper,german]{book}
  \usepackage{babel,varioref,multicol,epic}

A complex document might look something like the following:

\NeedsTeXFormat{LaTeX2e}[1994/05/01]
\begin{filecontents}{varioref.sty} 
   ....           % Code for varioref package
\end{filecontents}
\listfiles        % print list of files referenced
\documentclass[a4paper,german]{book} % book class
\usepackage{varioref}
\begin{document}
%--------------------- front matter of document
\maketitle
\section*{...}    % e.g. section named "Preface"
\tableofcontents  % chapter with table of contents
\listoffigures    % chapter with list of figures
\listoftables     % chapter with list of tables
%--------------------- body of the document
\part{...}
\chapter{...}
   \section{...}
\chapter{...}
\part{...}
%--------------------- back matter of document
\appendix         
\chapter{...}     % chapters labelled appendix
\chapter{...}
\begin{thebibliography}  
  ...             % bibliography entries
\end{thebibliography}
\begin{theindex}         
  ...             % index entries
\end{theindex}
\end{document}

Note that, to ensure that the recipient of the document can process the file correctly, the code of the varioref package is shipped with the file inside a filecontents environment.



Janne Saarela
Wed May 17 14:38:58 METDST 1995