2021-10-10 13:25:25 +02:00
|
|
|
__HEADER__(Write up university exercise sheets)
|
|
|
|
|
2021-10-10 13:50:46 +02:00
|
|
|
% This is meant as a layouting class for easily writing up exercise sheets.
|
|
|
|
% Use \course \sheetnumber and \author to set metadata of the document
|
|
|
|
% Use option [largename] if the author(s) is/are too long and collide in the fancy header
|
|
|
|
% Use option [german|ngerman|english] to control language appearance
|
|
|
|
|
2021-10-10 13:25:25 +02:00
|
|
|
\RequirePackage{scrbase}
|
|
|
|
|
|
|
|
__LANGUAGE_OPTIONS__
|
|
|
|
|
|
|
|
__NEW_IF__(largename,false)
|
|
|
|
\DeclareOption{large-name}{__SET_IF__(largename,true)}
|
|
|
|
|
|
|
|
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{scrartcl}}
|
|
|
|
\ProcessOptions\relax
|
|
|
|
|
|
|
|
\LoadClass{scrartcl}
|
|
|
|
|
|
|
|
\KOMAoption{fontsize}{12pt}
|
|
|
|
\KOMAoption{parskip}{half-}
|
|
|
|
\KOMAoption{DIV}{12}
|
|
|
|
\KOMAoption{headings}{normal}
|
|
|
|
|
|
|
|
\RequirePackage{scrlayer-scrpage}
|
|
|
|
\KOMAoption{headsepline}{:}
|
|
|
|
|
2021-10-10 13:50:46 +02:00
|
|
|
\def\@course{__ERROR__(No \noexpand\course given){Use \noexpand\course{<coursename>} to set the course.}}%
|
2021-10-10 13:25:25 +02:00
|
|
|
\DeclareRobustCommand*{\course}[1]{\gdef\@course{#1}}
|
2021-10-10 13:50:46 +02:00
|
|
|
\def\@sheetnumber{__ERROR__(No \noexpand\sheetnumber given){Use \noexpand\sheetnumber{<num>} to set the current sheetnumber.}}%
|
2021-10-10 13:25:25 +02:00
|
|
|
\DeclareRobustCommand*{\sheetnumber}[1]{\gdef\@sheetnumber{__IF__(english) Sheet #1 \else Übungsblatt #1\fi}}
|
|
|
|
|
|
|
|
\renewcommand*{\@date}{\today}
|
|
|
|
|
|
|
|
\renewcommand*{\maketitle}{
|
|
|
|
\thispagestyle{plain}
|
|
|
|
{\makebox[0pt][l]{\usekomafont{myauthor}\@author}\hfill\makebox[0pt][r]{\usekomafont{date}\@date}\par}
|
|
|
|
\vspace{0.5em}
|
|
|
|
{\centering\usekomafont{title}\@course\par}
|
|
|
|
{\centering\usekomafont{subtitle}\@sheetnumber \par}
|
|
|
|
\vspace{2em}
|
|
|
|
\hrule
|
|
|
|
\addvspace{2em}
|
|
|
|
}
|
|
|
|
|
|
|
|
\setkomafont{title}{\LARGE\bfseries}
|
|
|
|
\setkomafont{subtitle}{}
|
|
|
|
\newkomafont{myauthor}{}
|
|
|
|
\setkomafont{date}{}
|
|
|
|
|
|
|
|
\pagestyle{scrheadings}
|
|
|
|
\ihead[]{__IF__(largename) \usekomafont{myauthor}\@author \\ \@course\;- \@sheetnumber\else \usekomafont{myauthor}\@author\fi }
|
|
|
|
\chead[]{__IF__(largename) \else \usekomafont{subtitle}\@course\;- \@sheetnumber\fi}
|
|
|
|
\ohead[]{\usekomafont{date}\@date}
|
|
|
|
|
|
|
|
% Page layout
|
|
|
|
\setlength{\parindent}{0pt}
|
|
|
|
|
|
|
|
\RequirePackage[a4paper, left=2cm, right=2cm, top=3cm, bottom=3cm, head=15.0pt, headsep=10pt]{geometry}
|
|
|
|
|
|
|
|
\setlength{\skip\footins}{15pt}
|
|
|
|
|
|
|
|
\setlength{\abovecaptionskip}{0cm}
|
|
|
|
\setlength{\belowcaptionskip}{0cm}
|
|
|
|
|
|
|
|
%Für Zeilenabstand 1,5
|
|
|
|
\RequirePackage[onehalfspacing]{setspace}
|