From df83e76a9c7c198edba0d80bdd48808ed35ff6d7 Mon Sep 17 00:00:00 2001 From: Erwan Normand Date: Thu, 26 Sep 2024 21:07:08 +0200 Subject: [PATCH] Add \chapter* to toc --- 5-back/acronyms.tex | 2 +- 5-back/bibliography.tex | 5 ++++- 5-back/figures.tex | 2 +- 5-back/tables.tex | 2 +- config/thesis_commands.tex | 13 +++++++++++++ 5 files changed, 20 insertions(+), 4 deletions(-) diff --git a/5-back/acronyms.tex b/5-back/acronyms.tex index 42be184..22bf6d3 100644 --- a/5-back/acronyms.tex +++ b/5-back/acronyms.tex @@ -1,4 +1,4 @@ -\chapterstartoc{List of Acronyms} +\chapter*{List of Acronyms} \label{acronyms} \renewcommand{\glossarysection}[2][]{} % Remove the title of the glossary diff --git a/5-back/bibliography.tex b/5-back/bibliography.tex index 0b069ab..b100dbc 100644 --- a/5-back/bibliography.tex +++ b/5-back/bibliography.tex @@ -1 +1,4 @@ -\printbibliography[heading=bibintoc] +\chapter*{Bibliography} +\label{bibliography} + +\printbibliography[heading=none] diff --git a/5-back/figures.tex b/5-back/figures.tex index a30042f..88df9f8 100644 --- a/5-back/figures.tex +++ b/5-back/figures.tex @@ -1,4 +1,4 @@ -\chapterstartoc{List of Figures} +\chapter*{List of Figures} \label{figures} {% Set the link color to black only for the list of figures diff --git a/5-back/tables.tex b/5-back/tables.tex index c59c97a..7f0513b 100644 --- a/5-back/tables.tex +++ b/5-back/tables.tex @@ -1,4 +1,4 @@ -\chapterstartoc{List of Tables} +\chapter*{List of Tables} \label{tables} {% Set the link color to black only for the list of tables diff --git a/config/thesis_commands.tex b/config/thesis_commands.tex index d6cec46..3a891fa 100644 --- a/config/thesis_commands.tex +++ b/config/thesis_commands.tex @@ -6,6 +6,19 @@ \cleardoublepage% Start on a right page \includefrom{#1}{#2}% Include with relative paths \input in the chapter } + +\NewCommandCopy{\oldchapter}{\chapter} +\RenewDocumentCommand{\chapter}{s o m}{% #1 = star (no number), #2 = short title, #3 = title + \IfBooleanTF{#1}{% + \oldchapter*{#3}% Starred chapter + \addcontentsline{toc}{chapter}{#3}% Add to the table of contents + }{% + \IfValueTF{#2}{% + \oldchapter[#2]{#3}% Chapter with short title + }{% + \oldchapter{#3}% Regular chapter + }% + }% } \newcommand{\noindentskip}{\bigskip\noindent} % Skip a line and remove the indent