Let
X
Lesson 2 of 8

Document Structure: Titles, Sections, and Table of Contents

~8 min read

By the end of this lesson you can give a document a title block, split it into numbered sections and subsections, add an abstract, and generate a table of contents automatically. LaTeX numbers and lists everything for you — you only mark where each part begins.

Title, author, and date

Declare title metadata in the preamble or top of the body, then print it with \maketitle:

\documentclass{article}
\title{A Study of Collaborative Writing}
\author{Ada Lovelace}
\date{\today}

\begin{document}
\maketitle

Your introduction begins here.
\end{document}

\today inserts the current date automatically. Use \date{} (empty) to omit the date, or write a fixed date like \date{June 2026}.

Sections and subsections

LaTeX provides a hierarchy of sectioning commands. In the article class the main ones are:

CommandLevelNumbered
\section{...}1Yes (1, 2, 3)
\subsection{...}2Yes (1.1, 1.2)
\subsubsection{...}3Yes (1.1.1)
\paragraph{...}4No (run-in heading)
Sectioning in practice
\section{Introduction}
LaTeX numbers this automatically.

\subsection{Background}
A nested subsection.

\section{Method}
The next top-level section.

To add a heading without a number (and keep it out of the table of contents), use the starred form: \section*{Acknowledgements}.

The abstract

\begin{abstract}
This paper presents a fast, collaborative approach
to LaTeX editing in the browser.
\end{abstract}

Table of contents

A single command builds a table of contents from your sections — it updates itself as you add headings (you may need to compile twice so page numbers settle):

\tableofcontents

\section{Introduction}   % appears in the TOC automatically
\section{Method}

Cross-references and the table of contents rely on an auxiliary file written on the previous compile. If numbers show as ?? or the TOC looks stale, compile once more. On LetX the multi-pass build runs for you.

Reports and books

The report and book classes add \chapter{...} above \section. Use them for theses and longer works; article has no chapters.

Frequently asked questions

How do I stop a section from being numbered?

Use the starred version, e.g. \section*{Preface}. It prints the heading without a number and skips the table of contents.

My table of contents is empty or outdated — why?

The TOC is built from the .aux file of the previous run. Compile twice. On LetX this happens automatically when you click Compile.

How do I add chapters?

Switch to the report or book document class, which provide \chapter{...}. The article class does not have chapters.