Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

adding space after section numbers in TOC

Tags:

latex

As can be seen from the sample below, my LaTeX book doesn't leave enough space between double-double-digit section numbers and the section titles in the automatically generated table of contents. I seem to recall that there is a way to add extra space to all entries, but I can't find it online.

Sample table of contents entries

[Edit] In response to the comment below, here's an minimum working example:

\documentclass{book}
\begin{document}
\tableofcontents

\chapter{Chapter}
\chapter{Chapter}

\setcounter{chapter}{10}
\chapter{Chapter}
\section{Section}
\section{Section}

\setcounter{section}{10}
\section{Section}
\section{Section}
\subsection{Subsection}
\subsection{Subsection}

\setcounter{subsection}{10}
\subsection{Subsection}
\subsection{Subsection}

\chapter{Chapter}

\end{document}
like image 691
Grant Petty Avatar asked Sep 17 '25 08:09

Grant Petty


1 Answers

From https://tex.stackexchange.com/questions/13690/extra-space-for-numbered-titles-in-table-of-contents:

Adjust the title margins individually:

\makeatletter
\renewcommand{\l@section}{\@dottedtocline{1}{1.5em}{2.6em}}
\renewcommand{\l@subsection}{\@dottedtocline{2}{4.0em}{3.6em}}
\renewcommand{\l@subsubsection}{\@dottedtocline{3}{7.4em}{4.5em}}
\makeatother
like image 143
Grant Petty Avatar answered Sep 19 '25 14:09

Grant Petty