Skip to main content
Every LaTeX document follows a specific structure that separates content from formatting. Understanding this structure is essential for creating well-organized documents.

Basic Document Structure

A LaTeX document consists of two main parts:
The preamble (before \begin{document}) contains global settings, package imports, and definitions. The document body (between \begin{document} and \end{document}) contains your actual content.

Document Classes

The document class determines the overall layout and available commands:

Standard Classes

Class Options

Common options for document classes:

Document Organization

Title Information

Abstract

For articles and reports:

Sectioning Commands

LaTeX provides hierarchical sectioning:
Use starred versions for unnumbered sections: \section*{Introduction}

Table of Contents

Page Layout

Margins and Geometry

Using the geometry package:

Headers and Footers

Basic page numbering: Custom headers with fancyhdr:

Multi-file Documents

For large documents, split content into multiple files:

Main File (thesis.tex)

Chapter File (chapters/introduction.tex)

\include vs \input:
  • \include{file} - Starts new page, allows \includeonly
  • \input{file} - Inserts content inline, no page break

Appendices

Front Matter and Back Matter

For books and reports:

Best Practices

Document structure tips:
  1. Use consistent sectioning - Don’t skip levels
  2. Organize with files - One chapter per file for large documents
  3. Comment your preamble - Document package purposes
  4. Use logical labels - \label{sec:intro} not \label{s1}
  5. Keep preamble clean - Move custom commands to separate file

Common Patterns

Academic Article

Technical Report


Next: Explore Text Formatting commands or learn about Math Mode for mathematical content.