Commit 88764bc2 authored by Jakub Klinkovský's avatar Jakub Klinkovský
Browse files

table of contents - fixed indentation for sections in appendices

parent 82a3d920
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -94,9 +94,13 @@
\phantomsection
\addcontentsline{toc}{chapter}{\protect\numberline{}\appendixtocname}

% make the appendix chapters appear as sections below the "Appendices" chapter in the ToC
\makeatletter
% make the appendix chapters appear as sections below the "Appendices" chapter in the ToC
\addtocontents{toc}{\let\protect\l@appendix\protect\l@section}
% backup the style for sections in ToC
\addtocontents{toc}{\let\protect\l@normalsection\protect\l@section}
% indent appendix sections in the ToC as if they were subsections
\addtocontents{toc}{\let\protect\l@section\protect\l@subsection}
\makeatother

\begin{appendices}
@@ -105,6 +109,9 @@

% restore the ToC hierarchy
\bookmarksetup{startatroot}
\makeatletter
\addtocontents{toc}{\let\protect\l@section\protect\l@normalsection}
\makeatother

% GOTCHA: \backmatter removes the numbering of chapters, so it must be after the appendix
% see https://comp.text.tex.narkive.com/8t6w8txH/appendix-in-memoir-s-article-class