Clean chapter commands
This commit is contained in:
@@ -32,6 +32,31 @@
|
||||
|
||||
\setcounter{secnumdepth}{3} % Number subsubsections
|
||||
|
||||
% Parts and chapters
|
||||
\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
|
||||
}%
|
||||
\addcontentsline{lof}{chapter}{\thechapter.\ #3} % Add to the list of figures
|
||||
\addcontentsline{lot}{chapter}{\thechapter.\ #3} % Add to the list of tables
|
||||
}%
|
||||
}
|
||||
|
||||
\newcommand{\importchapter}[2]{% Load a chapter (#2) in a path (#1)
|
||||
\glsresetall% Reset the acronyms
|
||||
\graphicspath{{#1/figures/}}% Enable relative paths for images
|
||||
|
||||
\cleardoublepage% Start on a right page
|
||||
\includefrom{#1}{#2}% Include with relative paths \input in the chapter
|
||||
}
|
||||
|
||||
% Headers
|
||||
\usepackage{emptypage} % Remove headers and footers on empty pages
|
||||
\usepackage{etoolbox} % Patching commands
|
||||
|
||||
Reference in New Issue
Block a user