From 1a8d21a8e2b4693e2d279b859a2b7ad5f388aa44 Mon Sep 17 00:00:00 2001
From: Tobias Hamann <tobias.hamann@rwth-aachen.de>
Date: Fri, 21 Feb 2025 09:00:48 +0100
Subject: [PATCH] Start splitting up the cls file into smaller, more
 comprehensible files

---
 format/WZLTemplate.cls                        | 91 +-----------------
 .../SET_DocumentProperties.tex                | 95 +++++++++++++++++++
 .../WZLTemplate_files/SET_UsefulPackages.tex  |  0
 3 files changed, 96 insertions(+), 90 deletions(-)
 create mode 100644 format/WZLTemplate_files/SET_DocumentProperties.tex
 create mode 100644 format/WZLTemplate_files/SET_UsefulPackages.tex

diff --git a/format/WZLTemplate.cls b/format/WZLTemplate.cls
index f04edcb..4a87fdd 100644
--- a/format/WZLTemplate.cls
+++ b/format/WZLTemplate.cls
@@ -131,7 +131,6 @@
     \newcommand{\Autoref}[1]{\capitalisewords{\autoref{#1}}}
 }
 
-
 %%----PROCESSING OPTIONS----
 
 %% Declare, where language specific documents can be found, such as frontmatter etc. The path corresponds to the short name of the language choosen via the language option.
@@ -151,100 +150,12 @@
 \ProcessOptions\relax
 
 
-
 %%----SET DOCUMENT PROPERTIES----
+\input{format/WZLTemplate_files/SET_DocumentProperties.tex}
 
-% Declares the document as a twosided report document
-% The WZL Template is based on the report document template
-\LoadClass{extreport}
-
-% Choose spell check language based on language option
-\RequirePackage[\longlang]{babel}
-
-%% Input encoding (enabling special characters)
-\RequirePackage[utf8]{inputenc}
-
-%% Font encoding (specifically for fonts), makes umlauts (yes this is a real english word) searchable in the final PDF file
-\RequirePackage[T1]{fontenc}
-
-%% Font type: Latin modern
-\RequirePackage{lmodern}
-
-%% Set page geometry
-\ifnum\papersize=5
-    \RequirePackage[
-        % showframe,
-        a5paper,
-        left=2cm,
-        right=2cm,
-        top=2cm,
-        bottom=2cm
-    ]
-    {geometry}
-    %% Adjust line spacing
-    \linespread{1.0} 
-\else
-    \RequirePackage[
-        % showframe,
-        a4paper,
-        left=2.5cm,
-        right=2.5cm,
-        top=2.5cm,
-        bottom=2cm
-    ]
-    {geometry}
-    %% Adjust line spacing
-    \linespread{1.5} 
-\fi
 
 
 
-%% Header configurations:
-%% Odd pages:
-%%     left chapter name; right page number
-%% Even pages:
-%%     left page number; right section name
-%% If no section is defined, the chapter name
-%% is placed on even pages as well with markboth{}
-\RequirePackage{fancyhdr}
-\pagestyle{fancy}
-\fancyheadinit{\normalsize\color{\chaptercolor}}
-\fancyhf{}
-\renewcommand{\chaptermark}[1]{\markboth{\thechapter\ #1}{\thechapter\ #1}}
-\renewcommand{\sectionmark}[1]{\markright{\thesection\ #1}}
-\addtolength{\headheight}{\baselineskip}
-
-\lhead[\fancyplain{}{\bfseries\thepage}]{\fancyplain{}{\bfseries\nouppercase\leftmark}}
-\rhead[\fancyplain{}{\bfseries\nouppercase\rightmark}]{\fancyplain{}{\bfseries\thepage}}
-
-%% To overwrite plain style evoked by chapter to get headers on pages where chapters start
-\RequirePackage{etoolbox}
-
-% TODO: \patchcmd{\chapter}{\thispagestyle{plain}}{\thispagestyle{fancy}}{}{}
-\fancypagestyle{plain}{%
-    \renewcommand{\headrulewidth}{0pt}%
-    \fancyhf{}%
-    \fancyhead[L]{\thepage}%
-}
-%% Adjust spacings and formats of titles, sections, etc:
-%% \titlespacing*{<command>}{<left>}{<before>}{<after>}[<right>]
-\RequirePackage[bf]{titlesec}
-% TODO: \titlespacing*{\chapter}{0pt}{-30pt}{0pt}
-\titlespacing*{\chapter}{0pt}{-20pt}{10pt}
-\titlespacing*{\section}{0pt}{11pt}{0pt}
-\titlespacing*{\subsection}{0pt}{6pt}{0pt}
-\titleformat{\paragraph}{\normalfont\normalsize\bfseries}{\theparagraph}{0em}{}
-\titlespacing*{\paragraph}{0pt}{11pt}{0pt}
-\newcommand\HUGEE{\@setfontsize\Huge{40}{40}}
-\titleformat{\chapter}[display]{
-    \HUGEE\bfseries}{
-        \raggedleft\vspace{-3cm}\colorbox{\chaptercolor}{\color{white}\rule[-0.2\baselineskip]{0pt}{3\baselineskip}\hspace{5pt}\thechapter\hspace{5pt}}}{20pt}{\Huge}
-
-%% TODO: Avoid inserting blank pages for making sure that a new chapter starts on an odd page
-% \renewcommand{\cleardoublepage}{\clearpage}
-
-%% Set distance after paragraph
-\setlength{\parskip}{8pt}
 
 \usepackage[hang,flushmargin,]{footmisc} %% Remove indentation of footnotes
 \usepackage{mfirstuc}
diff --git a/format/WZLTemplate_files/SET_DocumentProperties.tex b/format/WZLTemplate_files/SET_DocumentProperties.tex
new file mode 100644
index 0000000..2579e6d
--- /dev/null
+++ b/format/WZLTemplate_files/SET_DocumentProperties.tex
@@ -0,0 +1,95 @@
+
+% Declares the document as a twosided report document
+% The WZL Template is based on the report document template
+\LoadClass{extreport}
+
+% Choose spell check language based on language option
+\RequirePackage[\longlang]{babel}
+
+%% Input encoding (enabling special characters)
+\RequirePackage[utf8]{inputenc}
+
+%% Font encoding (specifically for fonts), makes umlauts (yes this is a real english word) searchable in the final PDF file
+\RequirePackage[T1]{fontenc}
+
+%% Font type: Latin modern
+\RequirePackage{lmodern}
+
+%% Set page geometry
+\ifnum\papersize=5
+    \RequirePackage[
+        % showframe,
+        a5paper,
+        left=2cm,
+        right=2cm,
+        top=2cm,
+        bottom=2cm
+    ]
+    {geometry}
+    %% Adjust line spacing
+    \linespread{1.0} 
+\else
+    \RequirePackage[
+        % showframe,
+        a4paper,
+        left=2.5cm,
+        right=2.5cm,
+        top=2.5cm,
+        bottom=2cm
+    ]
+    {geometry}
+    %% Adjust line spacing
+    \linespread{1.5} 
+\fi
+
+
+%% Header configurations:
+%% Odd pages:
+%%     left chapter name; right page number
+%% Even pages:
+%%     left page number; right section name
+%% If no section is defined, the chapter name
+%% is placed on even pages as well with markboth{}
+\RequirePackage{fancyhdr}
+\pagestyle{fancy}
+\fancyheadinit{\normalsize\color{\chaptercolor}}
+\fancyhf{}
+\renewcommand{\chaptermark}[1]{\markboth{\thechapter\ #1}{\thechapter\ #1}}
+\renewcommand{\sectionmark}[1]{\markright{\thesection\ #1}}
+\addtolength{\headheight}{\baselineskip}
+
+\lhead[\fancyplain{}{\bfseries\thepage}]{\fancyplain{}{\bfseries\nouppercase\leftmark}}
+\rhead[\fancyplain{}{\bfseries\nouppercase\rightmark}]{\fancyplain{}{\bfseries\thepage}}
+
+%% To overwrite plain style evoked by chapter to get headers on pages where chapters start
+\RequirePackage{etoolbox}
+
+
+
+
+
+% TODO: \patchcmd{\chapter}{\thispagestyle{plain}}{\thispagestyle{fancy}}{}{}
+\fancypagestyle{plain}{%
+    \renewcommand{\headrulewidth}{0pt}%
+    \fancyhf{}%
+    \fancyhead[L]{\thepage}%
+}
+%% Adjust spacings and formats of titles, sections, etc:
+%% \titlespacing*{<command>}{<left>}{<before>}{<after>}[<right>]
+\RequirePackage[bf]{titlesec}
+% TODO: \titlespacing*{\chapter}{0pt}{-30pt}{0pt}
+\titlespacing*{\chapter}{0pt}{-20pt}{10pt}
+\titlespacing*{\section}{0pt}{11pt}{0pt}
+\titlespacing*{\subsection}{0pt}{6pt}{0pt}
+\titleformat{\paragraph}{\normalfont\normalsize\bfseries}{\theparagraph}{0em}{}
+\titlespacing*{\paragraph}{0pt}{11pt}{0pt}
+\newcommand\HUGEE{\@setfontsize\Huge{40}{40}}
+\titleformat{\chapter}[display]{
+    \HUGEE\bfseries}{
+        \raggedleft\vspace{-3cm}\colorbox{\chaptercolor}{\color{white}\rule[-0.2\baselineskip]{0pt}{3\baselineskip}\hspace{5pt}\thechapter\hspace{5pt}}}{20pt}{\Huge}
+
+%% TODO: Avoid inserting blank pages for making sure that a new chapter starts on an odd page
+% \renewcommand{\cleardoublepage}{\clearpage}
+
+%% Set distance after paragraph
+\setlength{\parskip}{8pt}
\ No newline at end of file
diff --git a/format/WZLTemplate_files/SET_UsefulPackages.tex b/format/WZLTemplate_files/SET_UsefulPackages.tex
new file mode 100644
index 0000000..e69de29
-- 
GitLab