Fix latex format

This commit is contained in:
2024-09-24 11:27:30 +02:00
parent 8887bd07b9
commit 964681c2ec
8 changed files with 143 additions and 145 deletions

View File

@@ -1,8 +1,8 @@
\newcommand{\importchapter}[2]{% Load a chapter (#2) in a path (#1)
\cleardoublepage% after a clear double page
\graphicspath{{#1/figures/}}% with figures
\glsresetall% reset the acronyms
\includefrom{#1}{#2}% and relative paths \input in the chapter
\cleardoublepage% after a clear double page
\graphicspath{{#1/figures/}}% with figures
\glsresetall% reset the acronyms
\includefrom{#1}{#2}% and relative paths \input in the chapter
}
\newcommand{\chaptertoc}{% Print the table of contents for the chapter
@@ -17,8 +17,8 @@
\NewCommandCopy{\oldlabel}{\label}
\newcommand{\labelprefix}{main}
\newcommand{\mainlabel}[1]{%
\renewcommand{\labelprefix}{#1}%
\oldlabel{\labelprefix}%
\renewcommand{\labelprefix}{#1}%
\oldlabel{\labelprefix}%
}
\renewcommand{\label}[1]{\oldlabel{\labelprefix:#1}}
@@ -32,10 +32,10 @@
\NewEnvironmentCopy{oldequation}{equation}
\RenewDocumentEnvironment{equation}{m}{%
\begin{oldequation}%
\label{\labelprefix:eq:#1}%
}{%
\end{oldequation}%
\begin{oldequation}%
\label{\labelprefix:eq:#1}%
}{%
\end{oldequation}%
}
% Images
@@ -43,12 +43,12 @@
% reference later with: \figref{universe}
% 1 = \linewidth = 150 mm
\RenewDocumentCommand{\fig}{O{1} O{htbp} m m O{}}{% #1 = width, #2 = position, #3 = filename, #4 = caption, #5 = additional caption
\begin{figure}[#2]%
\centering%
\includegraphics[width=#1\linewidth]{#3}%
\caption[#4]{#4#5}
\label{fig:#3}%
\end{figure}%
\begin{figure}[#2]%
\centering%
\includegraphics[width=#1\linewidth]{#3}%
\caption[#4]{#4#5}
\label{fig:#3}%
\end{figure}%
}
% example:
@@ -58,46 +58,46 @@
% \end{subfigs}
% reference later with: \figref{label}
\RenewDocumentEnvironment{subfigs}{O{htbp} m m o}{% #1 = position, #2 = label, #3 = filename, #4 = subfig titles
\begin{figure}[#1]%
\centering%
}{%
\caption[#3]{%
#3%
\IfValueTF{#4}{%
\begin{enumerate*}[label=\textbf{(\alph*)}]%
#4%
\end{enumerate*}%
}%
}%
\label{fig:#2}%
\end{figure}%
\begin{figure}[#1]%
\centering%
}{%
\caption[#3]{%
#3%
\IfValueTF{#4}{%
\begin{enumerate*}[label=\textbf{(\alph*)}]%
#4%
\end{enumerate*}%
}%
}%
\label{fig:#2}%
\end{figure}%
}
\NewDocumentCommand{\subfigsheight}{m}{% Set the height of the subfigures
\setkeys{Gin}{height=#1}%
\setkeys{Gin}{height=#1}%
}
\RenewDocumentCommand{\subfig}{o O{b} m}{% #1 = width, #2 = valign, #3 = filename
\hfill%
\subfloat[\label{fig:#3}]{%
\IfValueTF{#1}{%
\includegraphics[width=#1\linewidth, valign=#2, keepaspectratio]{#3}%
}{%
\includegraphics[valign=#2, keepaspectratio]{#3}%
}%
\hfill%
\subfloat[\label{fig:#3}]{%
\IfValueTF{#1}{%
\includegraphics[width=#1\linewidth, valign=#2, keepaspectratio]{#3}%
}{%
\includegraphics[valign=#2, keepaspectratio]{#3}%
}%
\hfill%
}%
\hfill%
}
\captionsetup{%
labelfont={sf,bf,up}, % sans-serif, bold, upright
labelfont={sf,bf,up}, % sans-serif, bold, upright
}
\RenewDocumentEnvironment{tab}{O{htbp} m m o}{% #1 = position, #2 = label, #3 = title, #4 = additional caption
\begin{table}[#1]%
\centering%
\caption[#3]{#3#4}%
\label{tab:#2}%
}{%
\end{table}%
\RenewDocumentEnvironment{tab}{O{htbp} m m O{}}{% #1 = position, #2 = label, #3 = title, #4 = additional caption
\begin{table}[#1]%
\centering%
\caption[#3]{#3#4}%
\label{tab:#2}%
}{%
\end{table}%
}