4 LaTeX Primer

This section is a brief introduction to LaTeX concepts and syntax, to provide authors enough information to author documents productively without having to become ``TeXnicians.'' This does not teach everything needed to know about writing LaTeX for Python documentation; many of the standard ``environments'' are not described here (though you will learn how to mark something as an environment).

Perhaps the most important concept to keep in mind while marking up Python documentation is that while TeX is unstructured, LaTeX was designed as a layer on top of TeX which specifically supports structured markup. The Python-specific markup is intended to extend the structure provided by standard LaTeX document classes to support additional information specific to Python.

LaTeX documents contain two parts: the preamble and the body. The preamble is used to specify certain metadata about the document itself, such as the title, the list of authors, the date, and the class the document belongs to. Additional information used to control index generation and the use of bibliographic databases can also be placed in the preamble. For most authors, the preamble can be most easily created by copying it from an existing document and modifying a few key pieces of information.

The class of a document is used to place a document within a broad category of documents and set some fundamental formatting properties. For Python documentation, two classes are used: the manual class and the howto class. These classes also define the additional markup used to document Python concepts and structures. Specific information about these classes is provided in section 5, ``Document Classes,'' below. The first thing in the preamble is the declaration of the document's class.

After the class declaration, a number of macros are used to provide further information about the document and setup any additional markup that is needed. No output is generated from the preamble; it is an error to include free text in the preamble because it would cause output.

The document body follows the preamble. This contains all the printed components of the document marked up structurally. Generic LaTeX structures include hierarchical sections, numbered and bulleted lists, and special structures for the document abstract and indexes.



Subsections
See About this document... for information on suggesting changes.