diff --git a/format/WZLTemplate.cls b/format/WZLTemplate.cls index 2ad0193a74caf351ee2e2afdcec53e8613cb0eaf..bea292faaf718b0aed5e0b90bbe3a844435071e4 100644 --- a/format/WZLTemplate.cls +++ b/format/WZLTemplate.cls @@ -101,13 +101,13 @@ %% 'sans' option \DeclareOption{sans}{ - \renewcommand{\familydefault}{\sfdefault} + \renewcommand{\familydefault}{\sfdefault} } %% 'de' option \DeclareOption{de}{ - \newcommand{\longlang}{ngerman} - \newcommand{\shortlang}{de} + \newcommand{\longlang}{ngerman} + \newcommand{\shortlang}{de} \newcommand{\tmpacronymname}{Abkürzungsverzeichnis} \newcommand{\tmpreferencename}{Literaturverzeichnis} \newcommand{\tmpsymbolname}{Symbolverzeichnis} @@ -119,8 +119,8 @@ %% 'en' option \DeclareOption{en}{ - \newcommand{\longlang}{english} - \newcommand{\shortlang}{en} + \newcommand{\longlang}{english} + \newcommand{\shortlang}{en} \newcommand{\tmpacronymname}{Table of Acronyms} \newcommand{\tmpreferencename}{References} \newcommand{\tmpsymbolname}{List of Symbols} @@ -149,13 +149,30 @@ \DeclareOption{a4paper}{\def\papersize{4}} %% Pass all unrecognized options to the base class -\DeclareOption*{\PassOptionsToClass{\CurrentOption}{extreport}} +\DeclareOption*{\PassOptionsToClass{\CurrentOption}{report}} % Process all given options \ProcessOptions\relax -\LoadClass{extreport} + + + +%%----SET DOCUMENT PROPERTIES---- + +% Declares the document as a twosided report document +% The WZL Template is based on the report document template +\LoadClass[twoside]{report} + +% Choose spell check language based on language option \RequirePackage[\longlang]{babel} -\RequirePackage[utf8]{inputenc} %% Input encoding (enabling special characters) + +%% 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 @@ -165,7 +182,7 @@ left=2cm, right=2cm, top=2cm, - bottom=2cm + bottom=2cm ] {geometry} \else @@ -175,9 +192,9 @@ left=2.5cm, right=2.5cm, top=2.5cm, - bottom=2cm - ] - {geometry} + bottom=2cm + ] + {geometry} \fi \RequirePackage{xcolor} @@ -189,8 +206,15 @@ \RequirePackage[intlimits]{amsmath} \RequirePackage{amsfonts} \RequirePackage{amssymb} -\RequirePackage{enumitem} -\linespread{1.0} %% Adjust line spacing + +%% Enable bold font within math environments +\RequirePackage{bm} + +%% Package for creating listing with \enumerate +\RequirePackage{enumerate} + +%% Adjust line spacing +\linespread{1.5} %% Header configurations: %% Odd pages: @@ -201,7 +225,6 @@ %% 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}} @@ -212,235 +235,221 @@ %% To overwrite plain style evoked by chapter to get headers on pages where chapters start \RequirePackage{etoolbox} -\fancypagestyle{plain}{% - \renewcommand{\headrulewidth}{0pt}% - \fancyhf{}% - \fancyhead[L]{\thepage}% -} +\patchcmd{\chapter}{\thispagestyle{plain}}{\thispagestyle{fancy}}{}{} + %% Adjust spacings and formats of titles, sections, etc: %% \titlespacing*{<command>}{<left>}{<before>}{<after>}[<right>] \RequirePackage[bf]{titlesec} -\titlespacing*{\chapter}{0pt}{-20pt}{10pt} +\titlespacing*{\chapter}{0pt}{-30pt}{0pt} \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} -\setlength{\parskip}{8pt} %% Set distance after paragraph -\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} +\titleformat{\chapter}{\normalfont\huge\bfseries\raggedright}{\thechapter}{1em}{} + +%% 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} + +%% Remove indentation of footnotes +\usepackage[ + hang, + flushmargin, + ]{footmisc} + +%% Make links, cites, toc, etc. clickable +%% Adjust colors if desired +\RequirePackage[colorlinks=false, +linkcolor=black, +citecolor=black +]{hyperref}\RequirePackage{hyperref} \renewcommand{\theHchapter}{\arabic{chapter}\thechapter} %% Add acronyms %TODO comment nolist \RequirePackage[ - printonlyused, - withpage, - % smaller, - % nohyperlinks, - % nolist -]{acronym} -\usepackage[ - automake=immediate, - symbols, - section=chapter, -] -{glossaries-extra} -% Define a custom dotfill for glossaries -\def\Dotfill{\leavevmode\xleaders\hbox to .8em{\hss.\hss}\hfill\kern0pt} -\makeglossaries -\input{format/symbols} + printonlyused, + % withpage, + % smaller, + nohyperlinks, + % nolist + ]{acronym} + +%%----IMPORT USEFULL PACKAGES---- + +%% Required for including any kind of graphical images \RequirePackage{graphicx} -\renewcommand{\textfraction}{0.10} -\renewcommand{\floatpagefraction}{0.90} + +%% For absolute placement of figures and creation of vector graphics \RequirePackage{tikz} \usetikzlibrary{calc} -% \RequirePackage{ulem} -\RequirePackage{float} %% Strict placement of figures, tables, etc. referring to the tex source code -%% Usage: \begin{figure}[ht] -\RequirePackage{wrapfig} -\RequirePackage{booktabs} %% Alternative style of tables -\RequirePackage{tabularray} + +%% Strict placement of figures, tables, etc. referring to the tex source code +%% Usage: \begin{figure}[H] +\RequirePackage{float} + +%% Alternative style of tables +\RequirePackage{booktabs} + +%% 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} -\RequirePackage{caption} %% Placing captions within figure or table environments -\captionsetup{ - labelfont=bf, - justification=justified, - singlelinecheck=false -} -\RequirePackage{subcaption} + +%% Placing captions within figure or table environments %% Usage: \caption{Place your caption here.} -%TODO \captionsetup[table]{labelfont=bf} -\RequirePackage[color=RWTHBlau25]{todonotes} %% Use \todo{} for inline-todo notes -\RequirePackage{regexpatch} +\RequirePackage{caption} + +% Setting up cations for figures +\captionsetup[figure]{ + labelfont=bf, + justification=raggedright, + singlelinecheck=false +} +%TODO + +% 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} + + + +%%----SET UP CUSTOM COLORS---- + + + +%%----SET UP TODO COMMANDS---- + +%% Use \todo{} for inline-todo notes +\RequirePackage[textwidth=20mm]{todonotes} +% \RequirePackage{regexpatch} % PROBLEM \makeatletter -\xpatchcmd{\@todo}{\setkeys{todonotes}{#1}}{\setkeys{todonotes}{inline,#1}}{}{} +%\regexpatchcmd{\@todo}{\setkeys{todonotes}{#1}}{\setkeys{todonotes}{inline,#1}}{}{} % PROBLEM \makeatother +%%----SET UP TABLE OF CONTENTS---- + +%% Placement of table of contents, list of figures and list of tables +\RequirePackage[titles]{tocloft} \renewcommand{\cfttoctitlefont}{} -\makeatletter -% \pretocmd{\l@subsubsection}{\vspace{5pt}}{}{} % Increase space after subsubsections -\makeatother -\RequirePackage{microtype} %% Subliminal refinements towards typographical perfection +%% Style for tableofcontents +\setlength{\cftbeforesecskip}{5pt} + + + +%%----SET UP BIBLIOGRAPHY---- %% bibliography for defining macros in .tex-documents -%% processing backend: biber +%% processing backend: bibtex %% further explanations: https://tex.stackexchange.com/a/299286 \RequirePackage[ - backend=biber, - style=alphabetic, - maxalphanames=1, - isbn=true, - url=true, - urldate=iso, - giveninits=true, - maxnames=10, - date=iso, - seconds=true, - %firstinits=true -]{biblatex} + backend=biber, + style=alphabetic, + maxalphanames=1, + isbn=true, + url=false, + giveninits=true, + maxnames=10, + %firstinits=true + ]{biblatex} %% WZL citation style: 4 capital letters & short year \DeclareLabelalphaTemplate{ - \labelelement{ - \field[final]{shorthand} - \field{label} - \field[strwidth=4,strside=left,uppercase=true]{labelname} - } - \labelelement{ - \field[strwidth=2,strside=right]{year} - } + \labelelement{ + \field[final]{shorthand} + \field{label} + \field[strwidth=4,strside=left,uppercase=true]{labelname} + } + \labelelement{ + \field[strwidth=2,strside=right]{year} + } } -\setlength{\biblabelsep}{2pt} -% \RequirePackage{pdfcomment} -% % Redefine \cite to include tooltips -% \let\oldcite\cite -% \renewcommand{\cite}[1]{ -% \pdftooltip{\oldcite{#1}}{\fullcite{#1}} -% % \oldcite{#1} -% } - -\renewcommand*{\labelalphaothers}{} %% Bibliograph tweak: remove "+"-sign as an abbrevation for et. al -\emergencystretch=1em %% Avoid overfull hbox in bibliography -\setlength{\parindent}{0pt} %% No identation when a new paragraph starts -\RequirePackage{datetime} %% Insert current date and time -\newdateformat{verbosedate}{\the\day. \monthname[\THEMONTH] \THEYEAR} -\RequirePackage{pdfpages} %% For inserting external PDFs -\RequirePackage{Tabbing} %% For inserting tabulator environments - -\setlength{\skip\footins}{1cm} % footnote margin -\renewcommand{\footnoterule} -{{\color{\chaptercolor} - \noindent\rule[3pt]{\textwidth}{0.4pt} - } + +%% Bibliograph tweak: remove "+"-sign as an abbrevation for et. al +\renewcommand*{\labelalphaothers}{} + +%% Avoid overfull hbox in bibliography +\emergencystretch=1em + +%% No identation when a new paragraph starts +\setlength{\parindent}{0pt} + +%% Sans serif font (comparable with Arial) +%\renewcommand{\familydefault}{\sfdefault} + + +%% @deprecated (reason=idx files not used) +% \makeindex + + + +%%----SET UP TABLE OF CONTENTS---- + + +%%----SET UP LIST OF FIGURES & LIST OF TABLES---- + +%% LOFLOT - List of figures & list of tables +\newcommand{\loflot}{ + %% List of figures + \stepcounter{romancounter} + \let\tmplistfigurename\listfigurename + \renewcommand{\listfigurename}{\Roman{romancounter}\hspace{1em}\tmplistfigurename} + \cleardoublepage\phantomsection\addcontentsline{toc}{chapter}{\listfigurename} + \listoffigures + \newpage + %% List of tables + \stepcounter{romancounter} + \let\tmplisttablename\listtablename + \renewcommand{\listtablename}{\Roman{romancounter}\hspace{1em}\tmplisttablename} + \cleardoublepage\phantomsection\addcontentsline{toc}{chapter}{\listtablename} + \listoftables + \newpage + + %% Start of main text + \pagenumbering{arabic} + \setcounter{page}{1} + \setcounter{chapter}{0} + \renewcommand{\thechapter}{\arabic{chapter}} + } + +%%----MISCELLANEOUS---- + %% Reduce error messages for horz. & vert. overstretching of text \hbadness=10001 \vbadness=10001 -\widowpenalty=10000 -\clubpenalty=10000 -\brokenpenalty=10000 -\predisplaypenalty=10000 -\postdisplaypenalty=10000 -\displaywidowpenalty=10000 -\raggedbottom - -\RequirePackage{blindtext} -\RequirePackage{url} -\RequirePackage{booktabs} -\RequirePackage{chronosys} -\setupchronology{color=RWTHBlau25,dates=false, height=20pt} -\setupchronoperiode{color=RWTHBlau100, textstyle=\footnotesize,dates=false,datestyle=\footnotesize\centering} -\setupchronoevent{textstyle=\footnotesize,datestyle=\footnotesize\centering, textwidth=20ex, colorbox=white} - -\setcounter{MaxMatrixCols}{32} -% \RequirePackage[autoplay,loop,controls=true]{animate} -\RequirePackage{fontspec} -\newfontfamily\arialfont[NFSSFamily=arial]{Arial} -\RequirePackage[inkscapelatex=false, inkscapepath=svgsubdir, pretex=\fontfamily{arial}\selectfont]{svg} -\RequirePackage{adjustbox} % For limiting table width -\RequirePackage{tcolorbox} -\setlength{\fboxsep}{1pt} -\RequirePackage{anyfontsize} - -\RequirePackage{unicode-math} -\ifnum\usefiramath=1 - \message{usefiramath: Fira Math selected} - \usepackage{firamath-otf} - \setmathfont{Fira Math} - \setmathfont[range={"22EF, "22EE, "22F1, "2700-"27BF,"1F600-"1F64F}]{Latin Modern Math} -\else - \message{usefiramath: Default math font selected} -\fi -\RequirePackage[ - colorlinks=true, - linkcolor=linkcolor, - citecolor=linkcolor, - filecolor=linkcolor, - urlcolor=linkcolor, - pdfborderstyle={/S/U/W 1}, % underline links - linktoc=all, - bookmarksdepth=2, -]{hyperref} % Make links, cites, toc, etc. clickable - -\renewcommand\mkbibacro[1]{{\footnotesize\MakeUppercase{#1}}} - -\newcommand\ctformatchapter[1]{\parbox[t]{\dimexpr\textwidth-4em\relax}{\raggedright#1}} - -% \titleformat{\chapter}[display]{\vspace{-8em}\raggedleft{ -% {\color{ctcolormain}\rule[-5pt]{2pt}{5cm}}\quad{\color{ctcolormain}\fontsize{60}{60}\selectfont\thechapter} -% } -% }{-2.1em}{\ctformatchapter}[\phantomsection] - -\colorlet{linkcolor}{RWTHBlau100} -\newcommand{\chaptercolor}{RWTHBlau100} - -% sourcemap configuration for weird Citavi... -\DeclareSourcemap{ - \maps[ - datatype = bibtex, - overwrite = true - ]{ - \map{ - \step[ - fieldsource=doi, - match=\regexp{\{\\textunderscore\}|\{\\textunderscore\s+\}|\{\\_\}|\{\\_\s+\}}, - replace=_, - ]} - } -} -\DeclareSourcemap{ - \maps[datatype=bibtex]{ - \map{ - \step[fieldsource=url, final=true] - \step[fieldset=verba, origfieldval, final=true] - \step[fieldsource=verba, match=\regexp{\A(ht|f)tp(s)?:\/\/(www\.)?}, replace={}] - } - } -} -\DeclareFieldFormat{url}{% - \mkbibacro{URL}\addcolon\space - \href{#1}{\nolinkurl{\thefield{verba}}}} + + + + + +%%----END OF FILE---- \endinput %%----END OF FILE---- \ No newline at end of file