LaTeX Guide

LaTeX Section Numbering

Default is automatic. Customize with \setcounter{secnumdepth} for depth and \renewcommand{\thesection} for format.

Default behavior

\section{Introduction}      % 1 Introduction
\subsection{Background}    % 1.1 Background
\subsubsection{Goals}      % 1.1.1 Goals
\section{Methods}          % 2 Methods

Limit numbering depth

% Number only sections, leave subsections plain
\setcounter{secnumdepth}{1}

% Number through subsubsections (default is 2)
\setcounter{secnumdepth}{3}

Change number format

% Roman numerals: I, II, III
\renewcommand{\thesection}{\Roman{section}}

% Letters: A, B, C
\renewcommand{\thesection}{\Alph{section}}

% Lowercase Roman: i, ii, iii (rare)
\renewcommand{\thesection}{\roman{section}}

% Subsections as letters
\renewcommand{\thesubsection}{\alph{subsection})}    % a) b) c)

% Combined: chapter.section.subsection (book class default)
% \thesection = \thechapter.\arabic{section}      e.g., 2.3
% \thesubsection = \thesection.\arabic{subsection} e.g., 2.3.4

Unnumbered sections

% Skip numbering AND TOC
\section*{Acknowledgments}

% Skip numbering, KEEP in TOC
\section*{Preface}
\addcontentsline{toc}{section}{Preface}

% Number but suppress in TOC (rare; manual workaround)
\section{Hidden Section}
\addtocontents{toc}{...}    % hacky, prefer \section* approach

Hierarchy levels

CommandDepthAvailable in
\part-1book, report
\chapter0book, report
\section1all classes
\subsection2all classes
\subsubsection3all classes
\paragraph4all classes
\subparagraph5all classes
Typst section numbering: one set rule
#set heading(numbering: "1.")     // 1, 2, 3
#set heading(numbering: "1.1")    // 1.1, 1.2 hierarchy
#set heading(numbering: "I.")     // Roman numerals
#set heading(numbering: "A.1")    // mixed: A.1, A.2, B.1
Try TypeTeX free

Frequently Asked Questions

How does LaTeX number sections by default?

Standard classes (article, report, book) number sections automatically: 1, 2, 3 for sections; 1.1, 1.2, 2.1 for subsections; 1.1.1 for subsubsections. Numbers come from the \thesection counter format. Default depth (which levels get numbered) goes down to subsubsection (depth=3).

How do I make a section unnumbered?

Use the starred form: \section*{Title}. Skips numbering and the TOC. Common for Acknowledgments, Abstract, References. To keep it in the TOC: \section*{Title} \addcontentsline{toc}{section}{Title}.

How do I limit which levels get numbered?

\setcounter{secnumdepth}{1} numbers only sections (skip subsections). Set to 0 for chapters only (in book class), 2 for subsections (default), 3 for subsubsections. Lower-numbered settings produce a cleaner look in long documents.

How do I change section number format (e.g., Roman)?

\renewcommand{\thesection}{\Roman{section}} for I, II, III. Other options: \Alph (A, B, C), \alph (a, b, c), \arabic (default 1, 2, 3), \roman (i, ii, iii). Place in preamble. \thesubsection works the same way for subsections.

How do I restart section numbering at chapters?

In book/report class, \renewcommand{\thesection}{\thechapter.\arabic{section}} produces 1.1, 1.2, 2.1, 2.2 (chapter.section). \setcounter{section}{0} at \chapter inputs resets — though most book classes do this automatically.

How do I make subsections inherit chapter prefix?

Default in book class: 1.1.1 for chapter 1, section 1, subsection 1. Override with \renewcommand{\thesubsection}{\Alph{subsection}} for A, B, C — flat letters under the section number.

What's the difference between section, subsection, subsubsection?

Hierarchy of headings in article class: \section (level 1, like H2 in HTML), \subsection (H3), \subsubsection (H4), \paragraph (H5), \subparagraph (H6). Book/report class adds \part (H1) and \chapter (also H1-equivalent for major divisions).

How do I skip a section number?

\stepcounter{section}{2} skips the next 2 numbers. Or \setcounter{section}{4} to set the section counter to 4 (so the next \section becomes 5). Useful for matching journal numbering or starting at a specific number.

How do I make a level appear without numbering but still in TOC?

\section*{Title} skips both numbering and TOC. To get TOC inclusion: \section*{Title} \addcontentsline{toc}{section}{Title}. Or use \addsec from the KOMA-Script bundle (scrartcl class) which does both.

More LaTeX guides