From bff91656bf02997b41dfeca613b91b1f9d34aa30 Mon Sep 17 00:00:00 2001 From: Erwan Normand Date: Tue, 24 Sep 2024 11:28:15 +0200 Subject: [PATCH] Style chapter toc --- config/thesis_commands.tex | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/config/thesis_commands.tex b/config/thesis_commands.tex index e5d0020..4fd888e 100644 --- a/config/thesis_commands.tex +++ b/config/thesis_commands.tex @@ -5,12 +5,32 @@ \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 - \vspace*{-1cm}% - \horizontalrule% - \vspace*{-0.5cm}% - \localtableofcontents% - \horizontalrule% + \hypersetup{linkcolor=black}% + \vspace{-1em}% + \horizontalrule% + \vspace{-1.5em}% + \section*{Contents}% Add a section title + \vspace{-0.5em}% + \startcontents% Start referencing the contents + \printcontents{}{1}{}% Print the contents + \horizontalrule% + \vspace{2em}% } % Add chapter label as prefix to all other sub-labels