docs: pdfdocs: Add space for chapter counts >= 100 in TOC

It turns out that networking.pdf has exceeded 100 chapters and
titles of chapters >= 100 collide with their counts in its table
of contents (TOC).

Increase relevant params by 0.6em in the preamble to avoid such
ugly collisions.

While at it, fix a typo in comment (subsection).

Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
Link: https://lore.kernel.org/r/bdb60ba3-7813-47d0-74f9-7c31dd912d95@gmail.com
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
This commit is contained in:
Akira Yokosawa 2022-05-12 11:54:12 +09:00 committed by Jonathan Corbet
parent e315b831f0
commit b86f46d5ce
1 changed files with 7 additions and 7 deletions

View File

@ -20,13 +20,13 @@
% - Indent of 2 chars is preserved for ease of comparison. % - Indent of 2 chars is preserved for ease of comparison.
% Summary of changes from default params: % Summary of changes from default params:
% Width of page number (\@pnumwidth): 1.55em -> 2.7em % Width of page number (\@pnumwidth): 1.55em -> 2.7em
% Width of chapter number: 1.5em -> 1.8em % Width of chapter number: 1.5em -> 2.4em
% Indent of section number: 1.5em -> 1.8em % Indent of section number: 1.5em -> 2.4em
% Width of section number: 2.6em -> 3.2em % Width of section number: 2.6em -> 3.2em
% Indent of sebsection number: 4.1em -> 5em % Indent of subsection number: 4.1em -> 5.6em
% Width of subsection number: 3.5em -> 4.3em % Width of subsection number: 3.5em -> 4.3em
% %
% These params can have 4 digit page counts, 2 digit chapter counts, % These params can have 4 digit page counts, 3 digit chapter counts,
% section counts of 4 digits + 1 period (e.g., 18.10), and subsection counts % section counts of 4 digits + 1 period (e.g., 18.10), and subsection counts
% of 5 digits + 2 periods (e.g., 18.7.13). % of 5 digits + 2 periods (e.g., 18.7.13).
\makeatletter \makeatletter
@ -37,7 +37,7 @@
\ifnum \c@tocdepth >\m@ne \ifnum \c@tocdepth >\m@ne
\addpenalty{-\@highpenalty}% \addpenalty{-\@highpenalty}%
\vskip 1.0em \@plus\p@ \vskip 1.0em \@plus\p@
\setlength\@tempdima{1.8em}% \setlength\@tempdima{2.4em}%
\begingroup \begingroup
\parindent \z@ \rightskip \@pnumwidth \parindent \z@ \rightskip \@pnumwidth
\parfillskip -\@pnumwidth \parfillskip -\@pnumwidth
@ -51,8 +51,8 @@
\endgroup \endgroup
\fi} \fi}
%% Redefine \l@section and \l@subsection %% Redefine \l@section and \l@subsection
\renewcommand*\l@section{\@dottedtocline{1}{1.8em}{3.2em}} \renewcommand*\l@section{\@dottedtocline{1}{2.4em}{3.2em}}
\renewcommand*\l@subsection{\@dottedtocline{2}{5em}{4.3em}} \renewcommand*\l@subsection{\@dottedtocline{2}{5.6em}{4.3em}}
\makeatother \makeatother
%% Sphinx < 1.8 doesn't have \sphinxtableofcontentshook %% Sphinx < 1.8 doesn't have \sphinxtableofcontentshook
\providecommand{\sphinxtableofcontentshook}{} \providecommand{\sphinxtableofcontentshook}{}