From e5493ce1b5cb7ccd95635326ec803c24a06dfceb Mon Sep 17 00:00:00 2001 From: Jan Wille <jan.wille@stud.hs-hannover.de> Date: Fri, 19 Mar 2021 16:40:46 +0100 Subject: [PATCH] included imatNR and prof in titlepage --- src/HsH-report.cls | 24 ++++++++++++++++++++++-- src/personal.tex | 5 +++++ 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/src/HsH-report.cls b/src/HsH-report.cls index 597f35e..f3e2c27 100644 --- a/src/HsH-report.cls +++ b/src/HsH-report.cls @@ -81,6 +81,10 @@ % config for title, header and footer +\newcommand*{\@matrikelnr}{}% +\newcommand{\matrikelnr}[1]{\gdef\@matrikelnr{#1}}% +\newcommand*{\@prof}{}% +\newcommand{\prof}[1]{\gdef\@prof{#1}}% \InputIfFileExists{personal.tex}{ \ClassInfo{\myClassName}{personal.tex was found. Using it...} }{ @@ -117,6 +121,14 @@ \renewcommand{\layercontentsmeasure}{\empty} % rulers when using draft disabled \MakeOuterQuote{"} % easy quotationmarks +% internal stuff +\newtoks\@tabtoks +\newcommand\addtabtoks[1]{\global\@tabtoks\expandafter{\the\@tabtoks#1}} +\newcommand\eaddtabtoks[1]{\edef\mytmp{#1}\expandafter\addtabtoks\expandafter{\mytmp}} +%\newcommand*\resettabtoks{\global\@tabtoks{}} +\newcommand*\printtabtoks{\the\@tabtoks} + + % custom commands \newcommand{\includeHsHlogohere}{\includegraphics[width=5cm,page=\HsHlogoPage]{\HsHlogoPath}} \providecommand{\abs}[1]{\ensuremath{\left\vert#1\right\vert}} % Makro for vertical lines around absolute values @@ -297,12 +309,20 @@ {\ifx\@subtitle\@empty\else\usekomafont{subtitle}{\@subtitle\par}\fi}% % Customised: ----------------------------------------------------------- \vskip 4em - {\if\@author\@empty\else\usekomafont{author}{\parbox{\dimexpr\linewidth}{\centering\@author}}\fi}% - % end Customised: -------------------------------------------------------- + {\ifx\@matrikelnr\@empty + \if\@author\@empty\else\usekomafont{author}{\parbox{\dimexpr\linewidth}{\centering\@author}}\fi + \else + \if\@author\@empty\else + \foreach \x [count=\i,evaluate=\i as \y using {{\@matrikelnr}[\i-1]}] in \@author {\eaddtabtoks{\x & \y\protect\\}} + \usekomafont{author}{\begin{tabular}{l l}\printtabtoks\end{tabular}} + \fi + \fi}% \vskip 1.5em {\usekomafont{date}{\@date \par}}% \vskip \z@ \@plus3fill + \if\@prof\@empty\else\usekomafont{author}{Professor(in)/Lehrbeauftragte(r): \@prof}\fi %{\usekomafont{publishers}{\@publishers \par}}% + % end Customised: -------------------------------------------------------- \vskip 3em \end{center}\par \@thanks\global\let\@thanks\@empty diff --git a/src/personal.tex b/src/personal.tex index 69c3a92..dd71070 100644 --- a/src/personal.tex +++ b/src/personal.tex @@ -2,8 +2,13 @@ Max Mustermann, Mira Musterfrau } +\matrikelnr{ + 1234567, + 9876543 +} \titlehead{titlehead} \subject{Subject} \title{Title} \subtitle{Subtitle} \date{\today} +\prof{Professor} -- GitLab