Next: Command formats Up: A Simple Example Previous: A Simple Example

General structure of a document

A document has a structure which is somewhat like that of a program written in a block-structured language such as Pascal. The general form is as follows:

Style Declarations.
These commands inform about the way that the document is to be formatted and laid out on the page. The very first command must be a \documentstyle command which identifies which of the general document forms this is to be, namely article, report, letter or book.

(You should note that all commands begin with a backslash `\' character to distinguish them. Some are placed on separate lines, others may be embedded in the text.)

Other style declarations are optional, and may be used to determine such forms as page numbering (arabic, roman, large roman etc), and to modify the values of particular parameters used by to format the output, such as line spacing.

These are optional, and are generally used to format a document title block.

Document Body.
This is the main body of the document, and is delimited by the commands \begin{document} and \end{document}. These effectively determine the scope of the commands.

The main body of the document can have quite complex internal structures. In particular, it can be segmented into chapters (not for article), sections, subsections-all of which will be automatically numbered. (The numbering mechanism can be easily suppressed if required by appending an asterisk to the end of the section command.) Paragraphs are separated by an empty line in the source text. provides a number of list-making structures for bulleted lists, numbered lists and highlighted lists, as well as the means of creating one's own forms! There are also font-changing commands that can be used to embolden or italicise words and phrases. Fuller descriptions of these features are given in Chapter .

Next: Command formats Up: A Simple Example Previous: A Simple Example