diff --git a/uhhassignment.dtx b/uhhassignment.dtx index 3e7899d..10ece01 100644 --- a/uhhassignment.dtx +++ b/uhhassignment.dtx @@ -98,6 +98,14 @@ % % The opposite option \texttt{numberedsheets} is used by default. % +% \DescribeMacro{repeatauthor} +% You can specify the \texttt{repeatauthor} class option to display a short +% version of the |\author| on each page in the footer (including the first +% page). The short version of the author is specified with the |\author| command +% as an optional first parameter. By default the normal |\author| is used as +% short author as well. By default the short author will not be displayed at +% all. +% % \DescribeMacro{shorttitle} % You can pass \texttt{shorttitle} class option to display the short university % name and short course name in the title. You could also explicitly pass @@ -223,6 +231,12 @@ \uhhassignment@numberedsheetstrue } +\newif\ifuhhassignment@repeatauthor +\uhhassignment@repeatauthorfalse +\DeclareOption{repeatauthor}{ + \uhhassignment@repeatauthortrue +} + \newif\ifuhhassignment@shorttitle \DeclareOption{shorttitle}{ \uhhassignment@shorttitletrue @@ -289,6 +303,8 @@ %%%%%%%%%% Constants %%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%\fi +% \subsection{Constants} + % The following constants are used throughout the template. They can be % overridden for customizations. % \begin{macrocode} @@ -367,17 +383,42 @@ % \end{macrocode} % \end{macro} +% \begin{macro}{\author} +% The |\author| command is overridden by this class to support a short author +% that may be printed at the bottom of each page. +% \begin{macrocode} +\renewcommand{\author}[2][]{ + \ifstrempty{#1}{ + \gdef\@shortauthor{#2} + }{ + \gdef\@shortauthor{#1} + } + \gdef\@author{#2} +} +% \end{macrocode} +% \end{macro} + % The default values for most fields are empty. The default university is the % university of Hamburg. % \begin{macrocode} \university[Uni Hamburg]{Universität Hamburg} -\def\@course{\ClassWarning{uhhassignment}{No \protect\course\space given}} +\def\@course{ + \ClassWarning{uhhassignment}{No \protect\course\space given} +} \let\@shortcourse\@course \group{} -\def\@teacher{\ClassWarning{uhhassignment}{No \protect\teacher\space given}} +\def\@teacher{ + \ClassWarning{uhhassignment}{No \protect\teacher\space given} +} \let\@shortteacher\@teacher -\def\@sheetno{\ClassWarning{uhhassignment}{No \protect\sheetno\space given}} +\def\@sheetno{ + \ClassWarning{uhhassignment}{No \protect\sheetno\space given} +} +\def\@shortauthor{ + \ClassWarning{uhhassignment}{No short \protect\author\space given} +} \title{} + % \end{macrocode} % \subsubsection{Todos} @@ -517,7 +558,12 @@ % Footer \setkomafont{pagefoot}{\textnormal} -\cfoot[Seite \pagemark{} von \pageref{LastPage}]{Seite \pagemark{} von \pageref{LastPage}} +\ifuhhassignment@repeatauthor + \ifoot[\@shortauthor]{\@shortauthor} + \ofoot[Seite \pagemark{} von \pageref{LastPage}]{Seite \pagemark{} von \pageref{LastPage}} +\else + \cfoot[Seite \pagemark{} von \pageref{LastPage}]{Seite \pagemark{} von \pageref{LastPage}} +\fi \newpagestyle{firstpage}[]{% \ihead{}