Sections are numbered by default. Use \section{Title} in an article, report, or book document, and LaTeX adds the number for you. If your sections show no numbers, one of three things is usually the cause: you used the starred form \section*, the numbering depth is set too low, or a template has redefined how headings look.
Use \section for numbered headings
\documentclass{article}
\begin{document}
\section{Introduction} % numbered: 1 Introduction
\subsection{Background} % numbered: 1.1 Background
\section*{Acknowledgements} % not numbered, and not in the table of contents
\end{document}
The starred form \section* turns numbering off for that heading only. Use the plain form when you want a number.
Why a section may not be numbered
Check these three causes in order:
- The starred form is in use.
\section*{...}is never numbered. Replace it with\section{...}if you want a number. - The numbering depth is set too low. LaTeX numbers only the levels up to
secnumdepth. A lower value stops numbering at a higher level. - A template changes the heading. Some templates redefine
\sectionor call a package such astitlesecwith a label that leaves out the number. See the fix below.
Check the numbering depth
Each heading level has a number. In article, the levels are:
| Level | Heading |
|---|---|
| 1 | \section |
| 2 | \subsection |
| 3 | \subsubsection |
| 4 | \paragraph |
secnumdepth sets the deepest level that gets a number. The default in article is 3, so subsubsections are numbered. In book and report, the default is 2, so \subsubsection headings are not numbered. To number down to subsections in any class, use:
\setcounter{secnumdepth}{2}
Fix headings in a custom template
Heading layout is set with titlesec, through the \titleformat command. The third and fourth arguments are the label and the title text. The label is where the number goes, so leave it out and the number disappears:
\usepackage{titlesec}
\titleformat{\section}[hang]
{\normalfont\Large\bfseries} % font for the heading
{\thesection} % the number; remove this and the number is lost
{1em} % gap between the number and the title
{} % code to run before the title
If a template you did not write has a custom \titleformat, check that its label argument includes \thesection.
Chapter numbers in section numbers
In book and report, section numbers include the chapter number, such as 2.1. This comes from the default definition of \thesection. To drop the chapter number, redefine \thesection:
\renewcommand{\thesection}{\arabic{section}}
For chapter titles and styling, see chapters in LaTeX. For the sections a typical paper uses, see how to write a research paper in LaTeX.
Refer to a numbered section
Add a \label after the heading, then use \ref to print its number:
\section{Methods}\label{sec:methods}
...
The procedure is described in Section~\ref{sec:methods}.
The \ref command prints the number, such as 2, and the tilde keeps the word and the number on the same line.
Numbered sections in the table of contents
Numbered headings appear in the table of contents with their numbers, as long as tocdepth covers their level. Unnumbered headings are left out unless you add them by hand. For the details, see table of contents, lists and nomenclature in LaTeX.