From d5cb5c71b6c290b3c92d8c752bb3945ffff739cb Mon Sep 17 00:00:00 2001 From: Tobias Hamann <tobias.hamann@rwth-aachen.de> Date: Thu, 27 Feb 2025 14:26:48 +0100 Subject: [PATCH] Further unravel the secrets of this cls file. Until this point, nothing was damaged. Proceed with upmost care. --- format/WZLTemplate.cls | 124 +----------------- .../SET_DocumentProperties.tex | 56 ++++++-- .../SET_FiguresAndTables.tex | 62 +++++++++ format/WZLTemplate_files/SET_Tikz.tex | 5 + .../WZLTemplate_files/SET_UsefulPackages.tex | 58 ++++++++ format/WZLTemplate_files/Unused.tex | 5 + 6 files changed, 182 insertions(+), 128 deletions(-) create mode 100644 format/WZLTemplate_files/SET_FiguresAndTables.tex create mode 100644 format/WZLTemplate_files/SET_Tikz.tex create mode 100644 format/WZLTemplate_files/Unused.tex diff --git a/format/WZLTemplate.cls b/format/WZLTemplate.cls index 4a87fdd..d025b2a 100644 --- a/format/WZLTemplate.cls +++ b/format/WZLTemplate.cls @@ -149,136 +149,22 @@ % Process all given options \ProcessOptions\relax - %%----SET DOCUMENT PROPERTIES---- \input{format/WZLTemplate_files/SET_DocumentProperties.tex} - - - - -\usepackage[hang,flushmargin,]{footmisc} %% Remove indentation of footnotes -\usepackage{mfirstuc} -\RequirePackage[titles]{tocloft} % Placement of table of contents, list of figures and list of tables -\cftsetindents{figure}{0em}{3.5em} -\cftsetindents{table}{0em}{3.5em} -\setlength{\cftsecnumwidth}{3em} -\setlength{\cftsubsecnumwidth}{4em} -\setlength{\cftsubsubsecnumwidth}{4em} -\setlength{\cftbeforechapskip}{3pt} -\setlength{\cftbeforesecskip}{3pt} -\setlength{\cftbeforesubsubsecskip}{2pt} - -\renewcommand{\theHchapter}{\arabic{chapter}\thechapter} - - - %%----IMPORT USEFULL PACKAGES---- +\input{format/WZLTemplate_files/SET_UsefulPackages.tex} -% Setup Colors -\RequirePackage{xcolor} -\input{format/rwthcolors/LaTeX/rwthcolors} - -%% Context sensitive quoting -\RequirePackage{csquotes} +%%----SET UP TIKZ---- +\input{format/WZLTemplate_files/SET_Tikz.tex} -%% Standard math packages -\RequirePackage[intlimits]{amsmath} -\RequirePackage{amsfonts} -\RequirePackage{amssymb} -\RequirePackage{enumitem} -%% Enable bold font within math environments -\RequirePackage{bm} -%% Package for creating listing with \enumerate -\RequirePackage{enumerate} - -\RequirePackage{graphicx} -\renewcommand{\textfraction}{0.10} -\renewcommand{\floatpagefraction}{0.90} - -%% For absolute placement of figures and creation of vector graphics -\RequirePackage{tikz} -\usetikzlibrary{calc} % TODO \RequirePackage{ulem} Probleme ohne [normalem] -%% Strict placement of figures, tables, etc. referring to the tex source code -%% Usage: \begin{figure}[H] -\RequirePackage{float} - -\RequirePackage{wrapfig} - -%% Alternative style of tables -\RequirePackage{booktabs} - -\RequirePackage{tabularray} - -%% Advanced table package for use-defined width definitions -\RequirePackage{tabularx} - -%% Defines a \FloatBarrier command, beyond which floats may not pass; useful, for example, to ensure all floats for a section appear before the next \section command. -\RequirePackage[section]{placeins} - - -%% Placing captions within figure or table environments -%% Usage: \caption{Place your caption here.} -\RequirePackage{caption} -\RequirePackage{subcaption} +%% ----SET UP Unused packages---- +\input{format/WZLTemplate_files/Unused.tex} -% Setting up cations for figures -\captionsetup[figure]{ - labelfont=bf, - % TODO justification=raggedright, - justification=justified, - singlelinecheck=false -} - -%TODO \captionsetup[table]{labelfont=bf} -% Setting up cations for tables -\captionsetup[table]{ - labelfont=bf, - justification=raggedright, - singlelinecheck=false -} - -%% Subliminal refinements towards typographical perfection -\RequirePackage{microtype} - -%% Insert current date and time -\usepackage{datetime} -\newdateformat{verbosedate}{\the\day. \monthname[\THEMONTH] \THEYEAR} - -%% For inserting external PDFs -\RequirePackage{pdfpages} - -%% For inserting tabulator environments -\RequirePackage{Tabbing} - -% Package to create a dummy text with \blindtext -\usepackage{blindtext} - - -%% TODO ----SET UP Unused packages---- -%% Remove indentation of footnotes -\usepackage[ - hang, - flushmargin, - ]{footmisc} - - -%%----SET UP CUSTOM COLORS---- - - - -%%----SET UP TODO COMMANDS---- - -%% Use \todo{} for inline-todo notes -\RequirePackage[color=RWTHBlau25]{todonotes} %% Use \todo{} for inline-todo notes -\RequirePackage{regexpatch} -\makeatletter -\xpatchcmd{\@todo}{\setkeys{todonotes}{#1}}{\setkeys{todonotes}{inline,#1}}{}{} -\makeatother %%----SET UP TABLE OF CONTENTS---- diff --git a/format/WZLTemplate_files/SET_DocumentProperties.tex b/format/WZLTemplate_files/SET_DocumentProperties.tex index 2579e6d..1048fdf 100644 --- a/format/WZLTemplate_files/SET_DocumentProperties.tex +++ b/format/WZLTemplate_files/SET_DocumentProperties.tex @@ -15,8 +15,9 @@ %% Font type: Latin modern \RequirePackage{lmodern} -%% Set page geometry +%% Set page geometry for A5 and A4 \ifnum\papersize=5 + % A5 \RequirePackage[ % showframe, a5paper, @@ -29,6 +30,7 @@ %% Adjust line spacing \linespread{1.0} \else + % A4 \RequirePackage[ % showframe, a4paper, @@ -65,31 +67,67 @@ \RequirePackage{etoolbox} +% TODO: Wird das noch gebraucht? \patchcmd{\chapter}{\thispagestyle{plain}}{\thispagestyle{fancy}}{}{} - - -% TODO: \patchcmd{\chapter}{\thispagestyle{plain}}{\thispagestyle{fancy}}{}{} +% TODO: Was macht das hier? \fancypagestyle{plain}{% \renewcommand{\headrulewidth}{0pt}% \fancyhf{}% \fancyhead[L]{\thepage}% } + + %% Adjust spacings and formats of titles, sections, etc: -%% \titlespacing*{<command>}{<left>}{<before>}{<after>}[<right>] +%% Explanation: \titlespacing*{<command>}{<left>}{<before>}{<after>}[<right>] \RequirePackage[bf]{titlesec} -% TODO: \titlespacing*{\chapter}{0pt}{-30pt}{0pt} +\RequirePackage[titles]{tocloft} % Placement of table of contents, list of figures and list of tables +\usepackage{mfirstuc} + +% Format Chapters \titlespacing*{\chapter}{0pt}{-20pt}{10pt} +% TODO: Bei A4 anders? \titlespacing*{\chapter}{0pt}{-30pt}{0pt} +\setlength{\cftbeforechapskip}{3pt} +\renewcommand{\theHchapter}{\arabic{chapter}\thechapter} + +% Format Sections \titlespacing*{\section}{0pt}{11pt}{0pt} +\setlength{\cftsecnumwidth}{3em} +\setlength{\cftbeforesecskip}{3pt} + +% Format Subsections \titlespacing*{\subsection}{0pt}{6pt}{0pt} +\setlength{\cftsubsecnumwidth}{4em} + +% Format Subsubsections +\setlength{\cftsubsubsecnumwidth}{4em} +\setlength{\cftbeforesubsubsecskip}{2pt} + +% Format Paragrpahs \titleformat{\paragraph}{\normalfont\normalsize\bfseries}{\theparagraph}{0em}{} \titlespacing*{\paragraph}{0pt}{11pt}{0pt} + +%% Set distance after paragraph +\setlength{\parskip}{8pt} + +% Create huge Numbers at the beginning of Chapters \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 + + +%% TODO: Wird das noch gebraucht? 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 +%% FONTS + +%% Subliminal refinements towards typographical perfection +\RequirePackage{microtype} + + +%% FOOTNOTES +\usepackage[hang,flushmargin,]{footmisc} %% Remove indentation of footnotes + +%% FIGURES AND TABLES +\input{format/WZLTemplate_files/SET_FiguresAndTables.tex} diff --git a/format/WZLTemplate_files/SET_FiguresAndTables.tex b/format/WZLTemplate_files/SET_FiguresAndTables.tex new file mode 100644 index 0000000..43199f3 --- /dev/null +++ b/format/WZLTemplate_files/SET_FiguresAndTables.tex @@ -0,0 +1,62 @@ +% Settings for pictures and tables + +%% GENERAL + + %% FLOATS aka Figures, Tables, ToDoNotes and whatsoever + + %% Strict placement of figures, tables, etc. referring to the tex source code + %% Usage: \begin{figure}[H] + \RequirePackage{float} + + % Allow to insert images and tables surrounded by text + \RequirePackage{wrapfig} + + % Allow to integrate graphics or images into LATEX + \RequirePackage{graphicx} + + %% Placing captions within figure or table environments + %% Usage: \caption{Place your caption here.} + \RequirePackage{caption} + \RequirePackage{subcaption} + + %% Defines a \FloatBarrier command, beyond which floats may not pass; useful, for example, to ensure all floats for a section appear before the next \section command. + \RequirePackage[section]{placeins} + + % minimum fraction of page for text + % See: https://robjhyndman.com/hyndsight/latex-floats/ + \renewcommand{\textfraction}{0.10} + + % minimum fraction of floatpage that should have floats + % See: https://robjhyndman.com/hyndsight/latex-floats/ + \renewcommand{\floatpagefraction}{0.90} + + +%% FIGURES + \cftsetindents{figure}{0em}{3.5em} + + % Setting up cations for figures + \captionsetup[figure]{ + labelfont=bf, + % TODO justification=raggedright, + justification=justified, + singlelinecheck=false + } + +%% TABLES + \cftsetindents{table}{0em}{3.5em} + + %% Alternative style of tables + \RequirePackage{booktabs} + + + \RequirePackage{tabularray} + + %% Advanced table package for use-defined width definitions + \RequirePackage{tabularx} + + % Setting up cations for tables + \captionsetup[table]{ + labelfont=bf, + justification=raggedright, + singlelinecheck=false + } \ No newline at end of file diff --git a/format/WZLTemplate_files/SET_Tikz.tex b/format/WZLTemplate_files/SET_Tikz.tex new file mode 100644 index 0000000..28ced76 --- /dev/null +++ b/format/WZLTemplate_files/SET_Tikz.tex @@ -0,0 +1,5 @@ +%% TIKZ + +%% For absolute placement of figures and creation of vector graphics +\RequirePackage{tikz} +\usetikzlibrary{calc} \ No newline at end of file diff --git a/format/WZLTemplate_files/SET_UsefulPackages.tex b/format/WZLTemplate_files/SET_UsefulPackages.tex index e69de29..8cefffa 100644 --- a/format/WZLTemplate_files/SET_UsefulPackages.tex +++ b/format/WZLTemplate_files/SET_UsefulPackages.tex @@ -0,0 +1,58 @@ + + +%% COLORS + + % Setup Colors + \RequirePackage{xcolor} + \input{format/rwthcolors/LaTeX/rwthcolors} + +%% MAFFS + + %% Standard math packages + \RequirePackage[intlimits]{amsmath} + \RequirePackage{amsfonts} + \RequirePackage{amssymb} + \RequirePackage{enumitem} + + + %% Enable bold font within math environments + \RequirePackage{bm} + + %% Listings + + %% Package for creating listing with \enumerate + \RequirePackage{enumerate} + + +%% TODO-Notes + %% Use \todo{} for inline-todo notes + \RequirePackage[color=RWTHBlau25]{todonotes} %% Use \todo{} for inline-todo notes + \RequirePackage{regexpatch} + \makeatletter + \xpatchcmd{\@todo}{\setkeys{todonotes}{#1}}{\setkeys{todonotes}{inline,#1}}{}{} + \makeatother + + +%%% MISC + + %% Context sensitive quoting + \RequirePackage{csquotes} + + %% Insert current date and time + \usepackage{datetime} + \newdateformat{verbosedate}{\the\day. \monthname[\THEMONTH] \THEYEAR} + + % Package to create a dummy text with \blindtext + \usepackage{blindtext} + + %% For inserting external PDFs + \RequirePackage{pdfpages} + + + + + + + + + diff --git a/format/WZLTemplate_files/Unused.tex b/format/WZLTemplate_files/Unused.tex new file mode 100644 index 0000000..fcb8513 --- /dev/null +++ b/format/WZLTemplate_files/Unused.tex @@ -0,0 +1,5 @@ +%% Deletable? + + + %% For inserting tabulator environments + \RequirePackage{Tabbing} \ No newline at end of file -- GitLab