Sphinx conf edit so PDF ToC entries w/ subsections >= 100 work

This commit is contained in:
Karl Hammond
2022-10-14 15:28:55 -05:00
parent e3c78b70ed
commit 7550fdc862

View File

@ -288,6 +288,14 @@ latex_elements = {
'preamble': r'''
\setcounter{tocdepth}{2}
\renewcommand{\AA}{\mbox{\textrm{\r{A}}}}
% Make ToC number fields wider to accommodate sections with >= 100 subsections
% or >= 10 subsections with >= 10 subsubsections
\makeatletter
\renewcommand*{\sphinxtableofcontentshook}{%
\renewcommand*\l@section{\@dottedtocline{1}{1.5em}{3.1em}}
\renewcommand*\l@subsection{\@dottedtocline{2}{4.6em}{4.5em}}
}
\makeatother
'''
}