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
|
||||
|
||||
@@ -1,30 +1,3 @@
|
||||
% Chapters
|
||||
\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
|
||||
}
|
||||
|
||||
\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}{#3}% Add to the list of figures
|
||||
%\addcontentsline{lot}{chapter}{#3}% Add to the list of tables
|
||||
}%
|
||||
}
|
||||
|
||||
\newcommand{\noindentskip}{\bigskip\noindent} % Skip a line and remove the indent
|
||||
|
||||
% Equations
|
||||
\NewEnvironmentCopy{oldequation}{equation}
|
||||
\RenewDocumentEnvironment{equation}{m}{%
|
||||
@@ -118,6 +91,9 @@
|
||||
\renewcommand{\secref}[2][\labelprefix]{Section~\ref{#1:#2}}
|
||||
\renewcommand{\tabref}[2][\labelprefix]{Table~\ref{#1:tab:#2}}
|
||||
|
||||
% Misc
|
||||
\newcommand{\noindentskip}{\bigskip\noindent} % Skip a line and remove the indent
|
||||
|
||||
% Tables
|
||||
\RenewDocumentEnvironment{tab}{O{htbp} m m O{}}{% #1 = position, #2 = label, #3 = title, #4 = additional caption
|
||||
\begin{table}[#1]%
|
||||
|
||||
Reference in New Issue
Block a user