Unnumbered sections in LaTeX (section*)

Add a star: \section*{Preface} prints the heading without a number. The same works for \chapter*, \subsection* and the other levels. A starred heading does not appear in the table of contents.

One heading without a number

The star leaves the section counter untouched, so the next \section continues the numbering.

\section*{Preface}
Text of the preface.

\section{Introduction}
This section has the number 1.
Result
The compiled example

Open in the editor

Add it to the table of contents

\addcontentsline{toc}{section}{Preface} after the heading creates the entry. With hyperref, write \phantomsection on the line before \section*, so the link in the table of contents jumps to the heading.

\tableofcontents

\section*{Preface}
\addcontentsline{toc}{section}{Preface}
Text of the preface.

\section{Introduction}
Text of the section.
Result
The compiled example

Open in the editor

No numbers in the whole document

\setcounter{secnumdepth}{0} switches the numbers of all sections off. The headings are written without a star and keep their entries in the table of contents.

This goes into the preamble.

\setcounter{secnumdepth}{0}

Open in the editor

KOMA-Script: \addsec and \addchap

In the KOMA-Script classes, \addsec{Preface} prints an unnumbered section and adds it to the table of contents and the page header. \addchap does the same for a chapter in scrreprt and scrbook.

Complete document:

\documentclass{scrartcl}
\begin{document}
\tableofcontents
\addsec{Preface}
Text of the preface.
\section{Introduction}
Text of the section.
\end{document}
Result
The compiled example

Open in the editor

Pitfalls

Compiled with pdfLaTeX from TeX Live 2023.

Related pages