Document Structure

Sectioning commands, the table of contents and cross-references.

Large documents need hierarchy. LaTeX numbers sections for you and keeps the numbers up to date.

Sectioning levels

From the highest level to the lowest:

  • \part (not in article)
  • \chapter (only in report and book)
  • \section
  • \subsection
  • \subsubsection
  • \paragraph

Add a star, as in \section*{Title}, for an unnumbered heading that is also left out of the table of contents.

Table of contents

LaTeX collects your numbered sections automatically. Place these where you want the lists to appear:

\tableofcontents
\listoffigures
\listoftables
\newpage

LaTeX needs two passes to collect headings and then print them, so a new section can take a second compile to appear.

Cross-references

Do not type "see page 5". Put a \label after the thing you want to refer to, then use \ref and \pageref.

\section{Introduction} \label{sec:intro}

As mentioned in Section \ref{sec:intro} on page \pageref{sec:intro}...

In figures and tables, place \label after \caption, otherwise it picks up the section number instead.