Implement Short Author in Footer

This commit is contained in:
Kim Wittenburg
2017-04-23 16:34:00 +02:00
parent 57aa8d244d
commit baac9f4d03

View File

@@ -98,6 +98,14 @@
% %
% The opposite option \texttt{numberedsheets} is used by default. % 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} % \DescribeMacro{shorttitle}
% You can pass \texttt{shorttitle} class option to display the short university % 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 % name and short course name in the title. You could also explicitly pass
@@ -223,6 +231,12 @@
\uhhassignment@numberedsheetstrue \uhhassignment@numberedsheetstrue
} }
\newif\ifuhhassignment@repeatauthor
\uhhassignment@repeatauthorfalse
\DeclareOption{repeatauthor}{
\uhhassignment@repeatauthortrue
}
\newif\ifuhhassignment@shorttitle \newif\ifuhhassignment@shorttitle
\DeclareOption{shorttitle}{ \DeclareOption{shorttitle}{
\uhhassignment@shorttitletrue \uhhassignment@shorttitletrue
@@ -289,6 +303,8 @@
%%%%%%%%%% Constants %%%%%%%%% %%%%%%%%%% Constants %%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%\fi %%%%%%%%%%%%%%%%%%%%%%%%%%%\fi
% \subsection{Constants}
% The following constants are used throughout the template. They can be % The following constants are used throughout the template. They can be
% overridden for customizations. % overridden for customizations.
% \begin{macrocode} % \begin{macrocode}
@@ -367,17 +383,42 @@
% \end{macrocode} % \end{macrocode}
% \end{macro} % \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 % The default values for most fields are empty. The default university is the
% university of Hamburg. % university of Hamburg.
% \begin{macrocode} % \begin{macrocode}
\university[Uni Hamburg]{Universität Hamburg} \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 \let\@shortcourse\@course
\group{} \group{}
\def\@teacher{\ClassWarning{uhhassignment}{No \protect\teacher\space given}} \def\@teacher{
\ClassWarning{uhhassignment}{No \protect\teacher\space given}
}
\let\@shortteacher\@teacher \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{} \title{}
% \end{macrocode} % \end{macrocode}
% \subsubsection{Todos} % \subsubsection{Todos}
@@ -517,7 +558,12 @@
% Footer % Footer
\setkomafont{pagefoot}{\textnormal} \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}[]{% \newpagestyle{firstpage}[]{%
\ihead{} \ihead{}