From ba431acdbef31632c86bff598a447e1d4f7c7938 Mon Sep 17 00:00:00 2001 From: Jan Wille <jan.wille@stud.hs-hannover.de> Date: Fri, 26 Mar 2021 10:24:40 +0100 Subject: [PATCH] reordering to ease reading of src code --- src/HsH-article.cls | 62 +++++++++++++++++++++++-------------- src/HsH-report.cls | 69 +++++++++++++++++++++++------------------- src/HsH-standalone.cls | 5 ++- 3 files changed, 79 insertions(+), 57 deletions(-) diff --git a/src/HsH-article.cls b/src/HsH-article.cls index 55a5f35..464139c 100644 --- a/src/HsH-article.cls +++ b/src/HsH-article.cls @@ -119,6 +119,11 @@ \renewcommand{\labelitemiii}{$-$} \renewcommand{\labelitemiv}{$\cdot$} +% custom commands +\newcommand{\includeHsHlogohere}[1][5cm]{\includegraphics[width=#1,page=\HsHlogoPage]{\HsHlogoPath}} +\newcommand{\uproman}[1]{\uppercase\expandafter{\romannumeral#1}} +\newcommand{\lowroman}[1]{\romannumeral#1\relax} + % do stuff \setlength\parindent{0pt} % indentation of new paragraphs \raggedbottom @@ -127,11 +132,39 @@ \renewcommand{\layercontentsmeasure}{\empty} % rulers when using draft disabled \MakeOuterQuote{"} % easy quotationmarks -% custom commands -\newcommand{\includeHsHlogohere}[1][5cm]{\includegraphics[width=#1,page=\HsHlogoPage]{\HsHlogoPath}} -\providecommand{\abs}[1]{\ensuremath{\left\vert#1\right\vert}} % Makro for vertical lines around absolute values -\newcommand{\uproman}[1]{\uppercase\expandafter{\romannumeral#1}} -\newcommand{\lowroman}[1]{\romannumeral#1\relax} + +% load config at beginning of document +\AtBeginDocument{ + \makeatletter + % solve some common errors: + \@ifpackageloaded{biblatex}{ + \renewcommand*{\mkbibacro}[1]{\MakeUppercase{#1}} % solves fontype warning in San-Serif + }{}% + \@ifpackageloaded{subfigure}{ + \newcommand{\subfigureautorefname}{\figureautorefname} + }{}% + % input config File: + \InputIfFileExists{config.tex}{ + \ClassInfo{\myClassName}{config.tex was found. Using it...} + }{ + \ClassInfo{\myClassName}{no config.tex!! I hope you configered it yourself.} + } + % provide some usefull commands: + \providecommand{\abs}[1]{\ensuremath{\left\vert#1\right\vert}} % Makro for vertical lines around absolute values + \makeatother +} + +% nicer abstract: +\renewenvironment{abstract}{% + \chapter*{\centering\abstractname} + \addcontentsline{toc}{chapter}{\abstractname} + \small + \quotation +}{% + \endquotation +} + +% decloration of Authorship \newcommand\declarationAuthorship{ \thispagestyle{plain} \vspace*{\fill} @@ -165,8 +198,8 @@ \newcommand{\proniomeverb}{am} \foreach \x [count=\i] in \@author{ \ifnum\i>1 - \gdef\pronomenf{We} \gdef\pronomen{we} + \gdef\pronomenf{We} \gdef\genitiv{our} \gdef\proniomeverb{are} \else\fi @@ -190,23 +223,6 @@ \end{flushright} } -% load config at beginning of document -\AtBeginDocument{ - \makeatletter - \@ifpackageloaded{biblatex}{ - \renewcommand*{\mkbibacro}[1]{\MakeUppercase{#1}} % solves fontype warning in San-Serif - }{}% - \@ifpackageloaded{subfigure}{ - \newcommand{\subfigureautorefname}{\figureautorefname} - }{}% - \InputIfFileExists{config.tex}{ - \ClassInfo{\myClassName}{config.tex was found. Using it...} - }{ - \ClassInfo{\myClassName}{no config.tex!! I hope you configered it yourself.} - } - \makeatother -} - % reconfig Titlepage \renewcommand\maketitle[1][c]{% \expandafter\ifnum \csname scr@v@3.12\endcsname>\scr@compatibility\relax diff --git a/src/HsH-report.cls b/src/HsH-report.cls index f64b90c..ab55a70 100644 --- a/src/HsH-report.cls +++ b/src/HsH-report.cls @@ -120,6 +120,11 @@ \renewcommand{\labelitemiii}{$-$} \renewcommand{\labelitemiv}{$\cdot$} +% custom commands +\newcommand{\includeHsHlogohere}[1][5cm]{\includegraphics[width=#1,page=\HsHlogoPage]{\HsHlogoPath}} +\newcommand{\uproman}[1]{\uppercase\expandafter{\romannumeral#1}} +\newcommand{\lowroman}[1]{\romannumeral#1\relax} + % do stuff \setlength\parindent{0pt} % indentation of new paragraphs \raggedbottom @@ -128,11 +133,39 @@ \renewcommand{\layercontentsmeasure}{\empty} % rulers when using draft disabled \MakeOuterQuote{"} % easy quotationmarks -% custom commands -\newcommand{\includeHsHlogohere}[1][5cm]{\includegraphics[width=#1,page=\HsHlogoPage]{\HsHlogoPath}} -\providecommand{\abs}[1]{\ensuremath{\left\vert#1\right\vert}} % Makro for vertical lines around absolute values -\newcommand{\uproman}[1]{\uppercase\expandafter{\romannumeral#1}} -\newcommand{\lowroman}[1]{\romannumeral#1\relax} + +% load config at beginning of document +\AtBeginDocument{ + \makeatletter + % solve some common errors: + \@ifpackageloaded{biblatex}{ + \renewcommand*{\mkbibacro}[1]{\MakeUppercase{#1}} % solves fontype warning in San-Serif + }{}% + \@ifpackageloaded{subfigure}{ + \newcommand{\subfigureautorefname}{\figureautorefname} + }{}% + % input config File: + \InputIfFileExists{config.tex}{ + \ClassInfo{\myClassName}{config.tex was found. Using it...} + }{ + \ClassInfo{\myClassName}{no config.tex!! I hope you configered it yourself.} + } + % provide some usefull commands: + \providecommand{\abs}[1]{\ensuremath{\left\vert#1\right\vert}} % Makro for vertical lines around absolute values + \makeatother +} + +% nicer abstract: +\renewenvironment{abstract}{% + \chapter*{\centering\abstractname} + \addcontentsline{toc}{chapter}{\abstractname} + \small + \quotation +}{% + \endquotation +} + +% decloration of Authorship \newcommand\declarationAuthorship{ \thispagestyle{plain} \vspace*{\fill} @@ -191,32 +224,6 @@ \end{flushright} } -\renewenvironment{abstract}{% - \chapter*{\centering\abstractname} - \addcontentsline{toc}{chapter}{\abstractname} - \small - \quotation -}{% - \endquotation -} - -% load config at beginning of document -\AtBeginDocument{ - \makeatletter - \@ifpackageloaded{biblatex}{ - \renewcommand*{\mkbibacro}[1]{\MakeUppercase{#1}} % solves fontype warning in San-Serif - }{}% - \@ifpackageloaded{subfigure}{ - \newcommand{\subfigureautorefname}{\figureautorefname} - }{}% - \InputIfFileExists{config.tex}{ - \ClassInfo{\myClassName}{config.tex was found. Using it...} - }{ - \ClassInfo{\myClassName}{no config.tex!! I hope you configered it yourself.} - } - \makeatother -} - % reconfig Titlepage \renewcommand\maketitle[1][l]{% \expandafter\ifnum \csname scr@v@3.12\endcsname>\scr@compatibility\relax diff --git a/src/HsH-standalone.cls b/src/HsH-standalone.cls index 33ab2d1..95f9899 100644 --- a/src/HsH-standalone.cls +++ b/src/HsH-standalone.cls @@ -92,9 +92,6 @@ % keep compatible \providecommand{\renewcaptionname}[3]{} -% custom commands -\providecommand{\abs}[1]{\ensuremath{\left\vert#1\right\vert}} % Makro for vertical lines around absolute values - % load config at beginning of document \AtBeginDocument{ \makeatletter @@ -106,5 +103,7 @@ }{ \ClassInfo{\myClassName}{no config.tex!! I hope you configured it yourself.} } + % provide some usefull commands: + \providecommand{\abs}[1]{\ensuremath{\left\vert#1\right\vert}} % Makro for vertical lines around absolute values \makeatother } -- GitLab