From e6f2973f164a3c87068b8cc728c35fa9909a6860 Mon Sep 17 00:00:00 2001 From: Jan Wille <jan.wille@stud.hs-hannover.de> Date: Sat, 12 Aug 2023 00:12:46 +0200 Subject: [PATCH] added macros for first and second examiner --- CHANGELOG.md | 4 ++++ HsH-classes.dtx | 28 ++++++++++++++++++++++++++-- README.md | 2 ++ src/HsH-article.cls | 28 ++++++++++++++++++++++++++-- src/HsH-report.cls | 28 ++++++++++++++++++++++++++-- 5 files changed, 84 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ea57924..c0e7cdc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,10 @@ All notable changes to this project will be documented in this file. - the margins are now set using relative values, which makes them adapt to different paper sizes - add alignment parameter to `\declarationofauthorship`, it is still by default aligned to the bottom of the page, but can now be pushed to the top using `\declarationofauthorship[t]` +### Added + +- macros for titlepage: `\firstexaminer` and `\secondexaminer` + ## [2.0] ### Changed diff --git a/HsH-classes.dtx b/HsH-classes.dtx index e7d8036..37941f7 100644 --- a/HsH-classes.dtx +++ b/HsH-classes.dtx @@ -196,6 +196,10 @@ \newcommand{\matrikelnr}[1]{\gdef\@matrikelnr{#1}} \newcommand*{\@professor}{} \newcommand{\professor}[1]{\gdef\@professor{#1}} +\newcommand*{\@firstexaminer}{} +\newcommand{\firstexaminer}[1]{\gdef\@firstexaminer{#1}} +\newcommand*{\@secondexaminer}{} +\newcommand{\secondexaminer}[1]{\gdef\@secondexaminer{#1}} \newcommand*{\@keywords}{} \newcommand{\keywords}[1]{\gdef\@keywords{#1}} \let\@author\@empty @@ -418,6 +422,16 @@ % %% reconfig Titlepage ----------------------------------------------------------------------------- +\iflanguage{english}{ + \setlocalecaption{english}{professor}{Professor} + \setlocalecaption{english}{firstexaminer}{First examiner} + \setlocalecaption{english}{secondexaminer}{Second examiner} +}{}% +\iflanguage{ngerman}{ + \setlocalecaption{ngerman}{professor}{Professor(in)/Lehrbeauftragte(r)} + \setlocalecaption{ngerman}{firstexaminer}{Erstpr{\"u}fer(in)} + \setlocalecaption{ngerman}{secondexaminer}{Zweitpr{\"u}fer(in)} +}{}% \newtoks\@tabtoks \newcommand\addtabtoks[1]{\global\@tabtoks\expandafter{\the\@tabtoks#1}} \newcommand\eaddtabtoks[1]{\edef\mytmp{#1}\expandafter\addtabtoks\expandafter{\mytmp}} @@ -568,7 +582,8 @@ \if\@author\@empty\else % sneeky comma needed after \@matrikelnr to deal with single item lists \foreach \x [count=\i,evaluate=\i as \y using {{\@matrikelnr,}[\i-1]}] in \@author {\eaddtabtoks{\x & \y\protect\\}} - \usekomafont{author}{\def\arraystretch{1.2} + \usekomafont{author}{ + \def\arraystretch{1.2} \if\@param l\begin{tabular}{@{}l l}\printtabtoks\end{tabular}\fi \if\@param c\begin{tabular}{l l}\printtabtoks\end{tabular}\fi \if\@param r\begin{tabular}{r r@{}}\printtabtoks\end{tabular}\fi @@ -580,7 +595,16 @@ {\usekomafont{date}{\@date\par}} %<article> \vskip 1em %<report> \vskip \z@ \@plus3fill - {\if\@professor\@empty\else\usekomafont{publishers}{Professor\iflanguage{ngerman}{(in)/Lehrbeauftragte(r)}{}: \@professor}\fi} + \usekomafont{publishers}{ + \def\arraystretch{1.2} + \if\@param l\begin{tabular}{@{}l l}\fi + \if\@param c\begin{tabular}{l l}\fi + \if\@param r\begin{tabular}{r r@{}}\fi + \if\@professor\@empty\else\textbf{\professorname:}&\@professor\\\fi + \if\@firstexaminer\@empty\else\textbf{\firstexaminername:}&\@firstexaminer\\\fi + \if\@secondexaminer\@empty\else\textbf{\secondexaminername:}&\@secondexaminer\\\fi + \end{tabular} + } %<*article> \ifx\@dedication\@empty\else \vskip 2em diff --git a/README.md b/README.md index 7ce5169..e4d81be 100644 --- a/README.md +++ b/README.md @@ -174,6 +174,8 @@ You can use the following macros to define the different information presented o - `\subtitle` is a smaller second line under the title. Can be empty - `\date` is the date of your project. You can use a custom one, but if you don't set it, the current date at compile time will be used. - `\professor` a new macro do define your professors name, if needed. +- `\firstexaminer` a new macro do define your first examiners name, if needed. +- `\secondexaminer` a new macro do define your second examiners name, if needed. - `\keywords` will not be printed on the title-page, but rather on the end of the abstract, if you define some. They will also be but into the PDFs metadata. diff --git a/src/HsH-article.cls b/src/HsH-article.cls index 2e04a9a..1d12944 100644 --- a/src/HsH-article.cls +++ b/src/HsH-article.cls @@ -145,6 +145,10 @@ \newcommand{\matrikelnr}[1]{\gdef\@matrikelnr{#1}} \newcommand*{\@professor}{} \newcommand{\professor}[1]{\gdef\@professor{#1}} +\newcommand*{\@firstexaminer}{} +\newcommand{\firstexaminer}[1]{\gdef\@firstexaminer{#1}} +\newcommand*{\@secondexaminer}{} +\newcommand{\secondexaminer}[1]{\gdef\@secondexaminer{#1}} \newcommand*{\@keywords}{} \newcommand{\keywords}[1]{\gdef\@keywords{#1}} \let\@author\@empty @@ -288,6 +292,16 @@ \let\declarationAuthorship\declarationofauthorship %% reconfig Titlepage ----------------------------------------------------------------------------- +\iflanguage{english}{ + \setlocalecaption{english}{professor}{Professor} + \setlocalecaption{english}{firstexaminer}{First examiner} + \setlocalecaption{english}{secondexaminer}{Second examiner} +}{}% +\iflanguage{ngerman}{ + \setlocalecaption{ngerman}{professor}{Professor(in)/Lehrbeauftragte(r)} + \setlocalecaption{ngerman}{firstexaminer}{Erstpr{\"u}fer(in)} + \setlocalecaption{ngerman}{secondexaminer}{Zweitpr{\"u}fer(in)} +}{}% \newtoks\@tabtoks \newcommand\addtabtoks[1]{\global\@tabtoks\expandafter{\the\@tabtoks#1}} \newcommand\eaddtabtoks[1]{\edef\mytmp{#1}\expandafter\addtabtoks\expandafter{\mytmp}} @@ -377,7 +391,8 @@ \if\@author\@empty\else % sneeky comma needed after \@matrikelnr to deal with single item lists \foreach \x [count=\i,evaluate=\i as \y using {{\@matrikelnr,}[\i-1]}] in \@author {\eaddtabtoks{\x & \y\protect\\}} - \usekomafont{author}{\def\arraystretch{1.2} + \usekomafont{author}{ + \def\arraystretch{1.2} \if\@param l\begin{tabular}{@{}l l}\printtabtoks\end{tabular}\fi \if\@param c\begin{tabular}{l l}\printtabtoks\end{tabular}\fi \if\@param r\begin{tabular}{r r@{}}\printtabtoks\end{tabular}\fi @@ -387,7 +402,16 @@ \vskip 1em {\usekomafont{date}{\@date\par}} \vskip 1em - {\if\@professor\@empty\else\usekomafont{publishers}{Professor\iflanguage{ngerman}{(in)/Lehrbeauftragte(r)}{}: \@professor}\fi} + \usekomafont{publishers}{ + \def\arraystretch{1.2} + \if\@param l\begin{tabular}{@{}l l}\fi + \if\@param c\begin{tabular}{l l}\fi + \if\@param r\begin{tabular}{r r@{}}\fi + \if\@professor\@empty\else\textbf{\professorname:}&\@professor\\\fi + \if\@firstexaminer\@empty\else\textbf{\firstexaminername:}&\@firstexaminer\\\fi + \if\@secondexaminer\@empty\else\textbf{\secondexaminername:}&\@secondexaminer\\\fi + \end{tabular} + } \ifx\@dedication\@empty\else \vskip 2em {\usekomafont{dedication}{\@dedication \par}}% diff --git a/src/HsH-report.cls b/src/HsH-report.cls index 7d82825..bbb8423 100644 --- a/src/HsH-report.cls +++ b/src/HsH-report.cls @@ -145,6 +145,10 @@ \newcommand{\matrikelnr}[1]{\gdef\@matrikelnr{#1}} \newcommand*{\@professor}{} \newcommand{\professor}[1]{\gdef\@professor{#1}} +\newcommand*{\@firstexaminer}{} +\newcommand{\firstexaminer}[1]{\gdef\@firstexaminer{#1}} +\newcommand*{\@secondexaminer}{} +\newcommand{\secondexaminer}[1]{\gdef\@secondexaminer{#1}} \newcommand*{\@keywords}{} \newcommand{\keywords}[1]{\gdef\@keywords{#1}} \let\@author\@empty @@ -320,6 +324,16 @@ \let\declarationAuthorship\declarationofauthorship %% reconfig Titlepage ----------------------------------------------------------------------------- +\iflanguage{english}{ + \setlocalecaption{english}{professor}{Professor} + \setlocalecaption{english}{firstexaminer}{First examiner} + \setlocalecaption{english}{secondexaminer}{Second examiner} +}{}% +\iflanguage{ngerman}{ + \setlocalecaption{ngerman}{professor}{Professor(in)/Lehrbeauftragte(r)} + \setlocalecaption{ngerman}{firstexaminer}{Erstpr{\"u}fer(in)} + \setlocalecaption{ngerman}{secondexaminer}{Zweitpr{\"u}fer(in)} +}{}% \newtoks\@tabtoks \newcommand\addtabtoks[1]{\global\@tabtoks\expandafter{\the\@tabtoks#1}} \newcommand\eaddtabtoks[1]{\edef\mytmp{#1}\expandafter\addtabtoks\expandafter{\mytmp}} @@ -425,7 +439,8 @@ \if\@author\@empty\else % sneeky comma needed after \@matrikelnr to deal with single item lists \foreach \x [count=\i,evaluate=\i as \y using {{\@matrikelnr,}[\i-1]}] in \@author {\eaddtabtoks{\x & \y\protect\\}} - \usekomafont{author}{\def\arraystretch{1.2} + \usekomafont{author}{ + \def\arraystretch{1.2} \if\@param l\begin{tabular}{@{}l l}\printtabtoks\end{tabular}\fi \if\@param c\begin{tabular}{l l}\printtabtoks\end{tabular}\fi \if\@param r\begin{tabular}{r r@{}}\printtabtoks\end{tabular}\fi @@ -435,7 +450,16 @@ \vskip 1.5em {\usekomafont{date}{\@date\par}} \vskip \z@ \@plus3fill - {\if\@professor\@empty\else\usekomafont{publishers}{Professor\iflanguage{ngerman}{(in)/Lehrbeauftragte(r)}{}: \@professor}\fi} + \usekomafont{publishers}{ + \def\arraystretch{1.2} + \if\@param l\begin{tabular}{@{}l l}\fi + \if\@param c\begin{tabular}{l l}\fi + \if\@param r\begin{tabular}{r r@{}}\fi + \if\@professor\@empty\else\textbf{\professorname:}&\@professor\\\fi + \if\@firstexaminer\@empty\else\textbf{\firstexaminername:}&\@firstexaminer\\\fi + \if\@secondexaminer\@empty\else\textbf{\secondexaminername:}&\@secondexaminer\\\fi + \end{tabular} + } \par \endgroup \vskip 3em -- GitLab