diff --git a/hhuthesis.cls b/hhuthesis.cls index 4d2f867bdfec3efd2a955d16cbb3a574a97bd146..b1220c64474abf3cea096ce1c7754ddb63e473f3 100644 --- a/hhuthesis.cls +++ b/hhuthesis.cls @@ -1,5 +1,5 @@ \NeedsTeXFormat{LaTeX2e} -\ProvidesClass{hhuthesis}[2020/06/22 HHU Thesis LaTeX document class v1.16] +\ProvidesClass{hhuthesis}[2020/09/03 HHU Thesis LaTeX document class v1.17] \DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}} % Options fallback. \ProcessOptions\relax @@ -207,7 +207,7 @@ \ifprintblackwhite\color{black}\else\color{hhublue}\fi\bfseries#1} \newcommand{\lststring}[1]{% \ifprintblackwhite\color{black}\else\color{hhudarkblue}\fi#1} -\newcommand{\setlstlistingstyle}{ +\newcommand{\setlstlistingstyle}{% \lstset{ basicstyle=\small\ttfamily, numbers=left, numberstyle=\footnotesize, @@ -216,12 +216,32 @@ stringstyle=\lststring, showstringspaces=false, frame=tb, + }% + \iflanguage{ngerman}{\renewcommand{\lstlistingname}{Quellcode}}{}% + \renewcommand*\thelstnumber{{\the\value{lstnumber}}:}% + \let\old@lstlistoflistings\lstlistoflistings% + \renewcommand{\lstlistoflistings}{% + \iflanguage{ngerman}% + {\renewcommand{\lstlistlistingname}{Quellcodeverzeichnis}}% + {\renewcommand{\lstlistlistingname}{List of Listings}}% + \addcontentsline{toc}{section}{\lstlistlistingname}% + \old@lstlistoflistings% + } +} + +%% Adapt styling of algorithms +\newcommand{\setalgorithmstyle}{% + \algrenewcommand\ALG@beginalgorithmic{\small} + \iflanguage{ngerman}{\floatname{algorithm}{Algorithmus}}{}% + \let\old@listofalgorithms\listofalgorithms% + \renewcommand{\listofalgorithms}{% + \iflanguage{ngerman}% + {\renewcommand{\listalgorithmname}{Algorithmenverzeichnis}}{}% + \addcontentsline{toc}{section}{\listalgorithmname}% + \old@listofalgorithms% } - \renewcommand*\thelstnumber{{\the\value{lstnumber}}:} } -%% Adapt algorithmicx font -\newcommand{\algsmallfont}{\algrenewcommand\ALG@beginalgorithmic{\small}} %%% Setup of title page diff --git a/thesis.tex b/thesis.tex index ad0e62ae96b2859a3eeb0a9942609a3c8bdd5237..27a5f8add2a2b85ea048fb025ac4322dd6c9be32 100644 --- a/thesis.tex +++ b/thesis.tex @@ -92,16 +92,12 @@ %% Quellcode \usepackage{listings} % Einbindung von Code. \setlstlistingstyle{} % Kosmetische Einstellungen -% Sprachabhängige Bezeichnung. -\iflanguage{ngerman}{\renewcommand{\lstlistingname}{Quellcode}}{} %% Algorithmen in Pseudocode \usepackage{algorithm} % Float-Umgebung für angegebene Algorithmen. \usepackage{algorithmicx} % Angabe von Algorithmen in Pseudocode. \usepackage{algpseudocode} % Standard Pseudocode-Elemente für Algorithmen. -\algsmallfont{} -% Sprachabhängige Bezeichnung. -\iflanguage{ngerman}{\floatname{algorithm}{Algorithmus}}{} +\setalgorithmstyle{} % Kosmetische Einstellungen %% Intelligenteres Referenzieren mittels \cref. %% \languagename um dynamisch zwischen ngerman oder english zu wechseln. @@ -166,16 +162,9 @@ \listoftables % Algorithms -\iflanguage{ngerman}% - {\renewcommand{\listalgorithmname}{Algorithmenverzeichnis}}{} -\addcontentsline{toc}{section}{\listalgorithmname} \listofalgorithms % Code Listings -\iflanguage{ngerman}% - {\renewcommand{\lstlistlistingname}{Quellcodeverzeichnis}}% - {\renewcommand{\lstlistlistingname}{List of Listings}} -\addcontentsline{toc}{section}{\lstlistlistingname} \lstlistoflistings \clearpage