Skip to Main Content
The University of Massachusetts Amherst

LaTeX

General Document Structure

We can break up a LaTeX Source Document into four parts:

  1. Document Preamble
  2. Beginning of Document Environment
  3. Document Body
  4. Ending of Document Environment

1. Document Preamble

The document preamble provides some general rules for your document. Here, you will:

  1. Set a document class (Using the \documentclass{x} command)
  2. Load necessary packages (Using the \usepackage{x} command)

The photo below shows an example document preamble with these commands. 

 


2. Beginning of Document Environment

The whole document is an example of one large LaTeX environment (see Common Components for more information). As a result, you will need to use the command \begin{document} to open up the document environment.


3. Document Body

Inside the document environment, is the Document Body. The document body is all of the content you want included in the document. This will include all of the text, images, commands, etc. that make up the document itself. See below for an example of a document body and the resulting output. 


4. Ending of Document Environment

As mentioned, the document is one large LaTeX environment. Thus, at the end of the document body, we must use the command \end{document} to close out the document environment.


Full Example

Below is a full example of a complete source document and the resulting output.