Style chapter toc

This commit is contained in:
2024-09-24 11:28:15 +02:00
parent 348f8b4b49
commit bff91656bf

View File

@@ -5,12 +5,32 @@
\includefrom{#1}{#2}% and relative paths \input in the chapter \includefrom{#1}{#2}% and relative paths \input in the chapter
} }
\usepackage{titletoc} % Local table of contents
\titlecontents{section}
[0pt] % left margin
{\bfseries} % formatting
{\thecontentslabel\quad} % label format
{} % before code
{\titlerule*[.8pc]{.}\hspace{0.2em}\contentspage} % dots and page
\titlecontents{subsection}
[2.4em] % left margin
{} % formatting
{\thecontentslabel\quad} % label format
{} % before code
{\titlerule*[.8pc]{.}\hspace{0.2em}\contentspage} % dots and page
\newcommand{\chaptertoc}{% Print the table of contents for the chapter \newcommand{\chaptertoc}{% Print the table of contents for the chapter
\vspace*{-1cm}% \hypersetup{linkcolor=black}%
\vspace{-1em}%
\horizontalrule% \horizontalrule%
\vspace*{-0.5cm}% \vspace{-1.5em}%
\localtableofcontents% \section*{Contents}% Add a section title
\vspace{-0.5em}%
\startcontents% Start referencing the contents
\printcontents{}{1}{}% Print the contents
\horizontalrule% \horizontalrule%
\vspace{2em}%
} }
% Add chapter label as prefix to all other sub-labels % Add chapter label as prefix to all other sub-labels