Chapters are the top-level divisions of a long document. In LaTeX, the \chapter command creates them, but only some document classes provide it. This guide explains which classes support chapters, how they behave, and how to change their look.
LaTeX is still widely used for academic papers, theses, and books, and chapters are one of its main structuring tools.
Which document classes have chapters?
Every LaTeX file starts with \documentclass, which sets the type of document. The class decides which sectioning commands exist.
| Class | Has \chapter |
Common use |
|---|---|---|
article |
No | Papers, short reports, and articles |
report |
Yes | Longer reports and some theses |
book |
Yes | Books and theses |
scrreprt, scrbook (KOMA-Script) |
Yes | Report and book alternatives with extra layout options |
memoir |
Yes | Book-style layouts with many built-in options |
If you use \chapter in an article document, LaTeX stops with an “Undefined control sequence” error. Switch to report or book, or use \section instead.
Set your document class
This short file uses the book class and two chapters:
\documentclass{book}
\begin{document}
\chapter{Introduction}
Text of the first chapter.
\chapter{Methods}
Text of the second chapter.
\end{document}
The \documentclass line must come first, before any other command.
How chapters behave in book and report
Each \chapter starts on a new page. The two main classes differ in what happens next:
- In
book, the default is two-sided printing (thetwosideoption). Chapters start on right-hand, odd-numbered pages, and LaTeX inserts a blank page when needed. Theopenanyoption lets a chapter start on any page. - In
report, the default is one-sided printing, and a chapter starts on the next page.
Chapter numbers also feed into section numbers. In book and report, the first section of chapter 2 is numbered 2.1. For more on section numbers, see how to have numbered sections in LaTeX.
Numbered and unnumbered chapters
A plain \chapter{...} is numbered. For an unnumbered chapter, such as a preface, use the starred form \chapter*{...}. The starred form also leaves the chapter out of the table of contents, so add an entry by hand:
\chapter*{Preface}
\addcontentsline{toc}{chapter}{Preface}
For more about the table of contents, see table of contents, lists and nomenclature in LaTeX.
Change the chapter style with titlesec
The titlesec package controls the layout of headings. The example below prints the word “Chapter” and the chapter number above a large title:
\usepackage{titlesec}
\titleformat{\chapter}[display]
{\normalfont\huge\bfseries} % font for the whole heading
{\chaptertitlename\ \thechapter} % label: the word Chapter and the number
{20pt} % gap between the label and the title
{\Huge} % code that prints the title
\titlespacing*{\chapter}{0pt}{50pt}{40pt} % space before and after
The [display] shape places the label on its own line above the title. The \titlespacing* line sets the space above and below the heading.
To use uppercase Roman numerals for chapters, redefine the chapter number:
\renewcommand{\thechapter}{\Roman{chapter}}
Section numbers pick up this change, so they will show the chapter part in Roman numerals too.
Chapter styles in memoir and KOMA-Script
The memoir class has named chapter styles, selected with \chapterstyle{...}. Its documentation includes a sample document that shows each style, which is useful when you want a ready-made look.
The KOMA-Script classes scrbook and scrreprt have their own heading options. To change the font of chapter titles, use \setkomafont:
\setkomafont{chapter}{\Huge\bfseries}
Refer to chapter titles
Put a \label after the chapter, then use \ref to print the chapter number:
\chapter{Methods}\label{ch:methods}
...
See Chapter~\ref{ch:methods} for the procedure.
To print the chapter title instead of the number, load the nameref package and use \nameref. It works alongside hyperref:
\usepackage{nameref}
...
The procedure is described in ``\nameref{ch:methods}''.
Common chapter errors
- “Undefined control sequence” for
\chapter. The class isarticle, which has no chapters. Usereportorbook. - Headers show the wrong chapter title. Running headers read the chapter title from LaTeX’s marks. See headers, footers and two-sided layouts in LaTeX for how to set them.
- Table of contents or references are out of date. Compile the document again. Chapter entries and references update on the next run.
For title pages in report and book, see what the maketitle command does. To add supporting material after the last chapter, see how to add an appendix in LaTeX.