Debian Codegraph @

texmf-dist/source/latex/uhhassignment/uhhassignment.dtx

raw
1 % \iffalse meta-comment
2 %
3 % Copyright (C) 2017 by Kim Wittenburg
4 %
5 % This file may be distributed and/or modified under the
6 % conditions of the LaTeX Project Public License, either
7 % version 1.3 of this license or (at your option) any later
8 % version. The latest version of this license is in:
9 %
10 % http://www.latex-project.org/lppl.txt
11 %
12 % and version 1.3 or later is part of all distributions of
13 % LaTeX version 2005/12/01 or later.
14 %
15 % \fi
16
17
18 % \iffalse
19 %<driver>\ProvidesFile{uhhassignment.dtx}
20 %
21 %<class>\NeedsTeXFormat{LaTeX2e}[2005/12/01]
22 %<class>\ProvidesClass{uhhassignment}[2017/04/22 v1.0 The UHH-Assignment Class]
23 %<*driver>
24 \documentclass{ltxdoc}
25 \usepackage[utf8]{inputenc}
26 \usepackage[T1]{fontenc}
27 \usepackage[english]{babel}
28
29 \usepackage{idxlayout}
30 \usepackage{hypdoc}
31 \usepackage{enumitem}
32
33 \usepackage{lmodern}
34
35 \CodelineIndex
36 \EnableCrossrefs
37 \RecordChanges
38 \begin{document}
39 \DocInput{uhhassignment.dtx}
40 \end{document}
41 %</driver>
42 % \fi
43
44
45 % \CheckSum{409}
46 %
47 % \CharacterTable
48 % {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
49 % Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
50 % Digits \0\1\2\3\4\5\6\7\8\9
51 % Exclamation \! Double quote \" Hash (number) \#
52 % Dollar \$ Percent \% Ampersand \&
53 % Acute accent \' Left paren \( Right paren \)
54 % Asterisk \* Plus \+ Comma \,
55 % Minus \- Point \. Solidus \/
56 % Colon \: Semicolon \; Less than \<
57 % Equals \= Greater than \> Question mark \?
58 % Commercial at \@ Left bracket \[ Backslash \\
59 % Right bracket \] Circumflex \^ Underscore \_
60 % Grave accent \` Left brace \{ Vertical bar \|
61 % Right brace \} Tilde \~}
62
63
64 % \changes{v1.0}{2017/04/12}{Initial version}
65 %
66 % \DoNotIndex{\#,\$,\%,\&,\@,\\,\{,\},\^,\_,\~,\ ,\relax}
67 % \DoNotIndex{\@ne,\newif,\fi,\gdef,\let,\newcommand,\renewcommand,\ifdefempty,
68 % \ifstrempty,\RequirePackage}
69 % \DoNotIndex{\LoadClassWithOptions,\ClassWarning,\DeclareOption,
70 % \ExecuteOptions,\ProcessOptions}
71 % \DoNotIndex{\advance,\begingroup,\catcode,\closein,\begin}
72 % \DoNotIndex{\end,\closeout,\day,\def,\edef,\else,\empty,\endgroup}
73 % \DoNotIndex{\newcounter,\arabic,\setcounter,\stepcounter}
74 % \DoNotIndex{\baselineskip,\headheight,\hfill,\par,\parskip,\setlength,\vspace,
75 % \widthof}
76 % \DoNotIndex{\bfseries,\Huge,\footnotesize,\LARGE,\Large,\large,\normalfont,
77 % \raggedright,\raggedleft,\RedeclareSectionCommands,\scriptsize,
78 % \setkomafont,\sffamily,\textbf,\textnormal,\textsc,\ttfamily,
79 % \usekomafont}
80 % \DoNotIndex{\ifoot,\ihead,\cfoot,\clearpairofpagestyles,\newpagestyle,\color,
81 % \colorbox,\marginpar,\ofoot,\ohead,\pagestyle,\thispagestyle}
82 % \DoNotIndex{\pagemark,\pageref}
83 % \DoNotIndex{\protect,\space}
84
85 % \title{The \textsf{uhhassignment} document class}
86 % \author{Kim Wittenburg \\ \texttt{[email protected]}}
87 %
88 % \maketitle
89 %
90 % \begin{abstract}
91 % The \textsf{uhhassignment} document class is a document class designed to be
92 % used for assignments in university (or school). The class predominantly
93 % implements a custom layout for titles but also featues some helpful new
94 % commands. The class was originally designed to be used at the university of
95 % Hamburg.
96 % \end{abstract}
97 %
98 % \addcontentsline{toc}{section}{Change History}
99 % \PrintChanges
100 %
101 % \tableofcontents
102 %
103 % \section{Usage}
104 %
105 % \subsection{Class Options}
106 %
107 % Currently the \textsf{uhhassignment} class supports three (or rather six)
108 % options:
109 %
110 % \index{unnumberedsheets}
111 % By default the \textsf{uhhassignment} class expects the assignment sheets to
112 % be numbered and issues a warning if the |\sheetno| is missing. However if you
113 % do not want to specify a sheet number you can use the
114 % \texttt{unnumberedsheets} class option to suppress the warning. The package
115 % option also removes any text indicating the sheet number from the output.
116 %
117 % \index{numberedsheets}
118 % The opposite option \texttt{numberedsheets} is used by default.
119 %
120 % \index{repeatauthor}
121 % You can specify the \texttt{repeatauthor} class option to display a short
122 % version of the |\author| on each page in the footer (including the first
123 % page). The short version of the author is specified with the |\author| command
124 % as an optional first parameter. By default the normal |\author| is used as
125 % short author as well. By default the short author will not be displayed at
126 % all.
127 %
128 % \index{shorttitle}\index{longtitle}
129 % You can pass \texttt{shorttitle} class option to display the short university
130 % name and short course name in the title. You could also explicitly pass
131 % \texttt{longtitle} which is the default.
132 %
133 % \index{shortheader}\index{longheader}
134 % Similarly you cann pass \texttt{shortheader} or \texttt{longheader} to display
135 % the short or regular university and course name in the header on each
136 % subsequent page.
137 %
138 % \subsection{The Title}
139 %
140 % The main feature of the \textsf{uhhassignment} class is the custom title
141 % layout. The layout implements some new fields like the name of the university
142 % (or school), the name of the teacher or the number of the exercise sheet. The
143 % full list of supported fields is listed below. The actual title layout may be
144 % different depending on which of the following fields are actually specified.
145 %
146 % \begingroup
147 % \setlist[description]{
148 % font={\normalfont}
149 % }
150 %
151 % \begin{description}
152 % \item[|\textbackslash university|\oarg{short uni}\marg{uni}]
153 % \DescribeMacro{\university}
154 % Lets you specify the name of the university (or school). The default
155 % value is \texttt{Universität Hamburg}.
156 % \item[|\textbackslash course|\oarg{short course} \marg{course}]
157 % \DescribeMacro{\course}
158 % Lets you specify the name of the course of the assignment. The
159 % course is sometimes referred to as a \emph{module}.
160 % \item[|\textbackslash teacher|\marg{teacher}] \DescribeMacro{\teacher}
161 % Lets you specify the name of the teacher or teachers of the course.
162 % If you want to specify multiple teachers it is recommended that you
163 % separate them with the |\\| command.
164 % \item[|\textbackslash group|\marg{group number}] \DescribeMacro{\group}
165 % The exercises for many university courses are divided into multiple
166 % exercise groups. Using this command you can specify the number of
167 % your group.
168 % \item[|\textbackslash sheetno|\marg{sheet number}] \DescribeMacro{\sheetno}
169 % Lets you specify the current exercise sheet. If no |\title| is
170 % provided the sheet number is used as title of the document.
171 % \end{description}
172 % \endgroup
173 %
174 % In addition to the above new commands you can also specify a |\title|, |\date|
175 % and one or more |\author|s.
176 %
177 % \DescribeMacro{\id}
178 % Sometimes you have to provide your student ID with your solutions to an
179 % exercise sheet. The \textsf{uhhassignment} class provides the |\id|\marg{id}
180 % command for this case. This command should be used when specifying the authors
181 % with the |\author| command. It might look like this:
182 % |\author{John Doe\id{1234567}}|
183 %
184 % \subsection{Tasks and Subtasks}
185 %
186 % The \textsf{uhhassignment} class is based on \textsf{srcarctl} from the KOMA
187 % packages so its main sectioning level are sections (not chapters). Sections
188 % and subsections however do not always accurately reflect the semantics of
189 % solutions to an assignment. Instead the \textsf{uhhassignment} class provides
190 % the following commands:
191 %
192 % \smallskip
193 %
194 % \DescribeMacro{\task}|\task|\oarg{task number}\marg{task name}\\
195 % The |\task| command replaces the |\section| command. It incrementally numbers
196 % the tasks (starting at 1). If you want to skip a task you can use the optional
197 % \meta{task number} argument to set the task number to a specific value.
198 % Subsequent tasks are then incrementally numbered.
199 %
200 % \smallskip
201 %
202 % \DescribeMacro{\subtask}|\subtask|\oarg{task number}\marg{task name}\\
203 % \DescribeMacro{\subsubtask}|\subsubtask|\oarg{task number}\marg{task name}\\
204 % The |\subtask| and |\subsubtask| replace |\subsection| and |\subsubsection|
205 % respectively. They work analogous to |\task|.
206 %
207 % \smallskip
208 %
209 % The standard sectioning commands are not modified by the
210 % \textsf{uhhassignment} class so it is still possible to use them. In fact the
211 % |\task| commands do create sections and subsections internally. You should
212 % however be careful in using |\section|s yourself because it may be difficult
213 % to distinguish |\task|s from |\section|s.
214 %
215 % \subsection{Todos}
216 %
217 % The \textsf{uhhassignment} class offers rudimentary support for todo notes.
218 % Currently todo support is very limited and may not work in some cases.
219 %
220 % \smallskip
221 %
222 % \DescribeMacro{\todo}|\todo|\oarg{todo text}\\
223 % The |\todo| command does two things:
224 % \begin{enumerate}
225 % \item It puts a todo marker in the text where the |\todo| command is
226 % specified. The todo marker is defined by the |\todomark| command.
227 % \DescribeMacro{\todomark}
228 % \item It puts a todo note at the page margin so that you can easily spot
229 % open todos in the PDF. The text of the todo note can be customized using
230 % the \meta{todo text} optional argument.
231 % \end{enumerate}
232 %
233 % \StopEventually{
234 % \addcontentsline{toc}{section}{Index}
235 % \PrintIndex
236 % }
237 %
238 % \section{Implementation}
239 %
240 % In addition to the options provided by \textsf{scrartcl} the
241 % \textsf{uhhassignment} class supports the following options.
242 % \begin{macrocode}
243 \newif\ifuhhassignment@numberedsheets
244 \DeclareOption{unnumberedsheets}{
245 \uhhassignment@numberedsheetsfalse
246 }
247
248 \DeclareOption{numberedsheets}{
249 \uhhassignment@numberedsheetstrue
250 }
251
252 \newif\ifuhhassignment@repeatauthor
253 \uhhassignment@repeatauthorfalse
254 \DeclareOption{repeatauthor}{
255 \uhhassignment@repeatauthortrue
256 }
257
258 \newif\ifuhhassignment@shorttitle
259 \DeclareOption{shorttitle}{
260 \uhhassignment@shorttitletrue
261 }
262
263 \DeclareOption{longtitle}{
264 \uhhassignment@shorttitlefalse
265 }
266
267 \newif\ifuhhassignment@shortheader
268 \DeclareOption{shortheader}{
269 \uhhassignment@shortheadertrue
270 }
271
272 \DeclareOption{longheader}{
273 \uhhassignment@shortheaderfalse
274 }
275
276 \ExecuteOptions{longtitle,longheader,numberedsheets}
277
278 \ProcessOptions\relax
279 % \end{macrocode}
280 %
281 % The \textsf{uhhassignment} class is based on \textsf{scrartcl}.
282 % \begin{macrocode}
283 \LoadClassWithOptions{scrartcl}
284 % \end{macrocode}
285
286 % \iffalse %%%%%%%%%%%%%%%%%%%
287 %%%%%%%% Dependencies %%%%%%%%
288 %%%%%%%%%%%%%%%%%%%%%%%%%%%\fi
289
290 % \subsection{Dependencies}
291 %
292 % \begin{macrocode}
293 \RequirePackage[utf8]{inputenc} % UTF-8 Encoding
294 \RequirePackage{cmap} % Special Characters
295 \RequirePackage[T1]{fontenc} % Font Encoding
296 \RequirePackage[ngerman]{babel} % German Language
297 \RequirePackage{etoolbox} % Programming
298 \RequirePackage{calc} % Calculations
299
300 \RequirePackage[a4paper,
301 left=25mm,
302 right=25mm,
303 top=20mm,
304 bottom=50mm]{geometry} % Page Margins
305
306 \RequirePackage[headsepline]{scrlayer-scrpage} % Header and Footer
307 \RequirePackage{lastpage} % Page Numbers
308
309 \RequirePackage{amsmath} % Maths
310 \RequirePackage{amssymb} % Maths
311 \RequirePackage{amsthm} % Beweise
312 \RequirePackage{enumitem} % Customizable Enumerations
313
314 \RequirePackage{xcolor} % Colors
315 \RequirePackage{framed} % Colored Boxes
316 \RequirePackage[colorlinks,linkcolor=black]{hyperref} % References
317 \RequirePackage{lmodern} % Better Font
318 % \end{macrocode}
319
320 % \iffalse %%%%%%%%%%%%%%%%%%%
321 %%%%%%%%%% Constants %%%%%%%%%
322 %%%%%%%%%%%%%%%%%%%%%%%%%%%\fi
323
324 % \subsection{Constants}
325
326 % The following constants are used throughout the template. They can be
327 % overridden for customizations.
328 % \begin{macrocode}
329 \def\uhhassignment@sheetid{Aufgabenblatt}
330 \def\uhhassignment@groupid{Übungsgruppe}
331 % \end{macrocode}
332
333 % \iffalse %%%%%%%%%%%%%%%%%%%
334 %%%%%%% Custom Commands %%%%%%
335 %%%%%%%%%%%%%%%%%%%%%%%%%%%\fi
336
337 % \subsection{Definitions}
338 %
339 % \subsubsection{Title Elements}
340 %
341 % \begin{macro}{\university}
342 % The |\university| command stores the name of the university for later use.
343 % \begin{macrocode}
344 \newcommand{\university}[2][]{
345 \ifstrempty{#1}{
346 \gdef\@shortuniversity{#2}
347 }{
348 \gdef\@shortuniversity{#1}
349 }
350 \gdef\@university{#2}
351 }
352 % \end{macrocode}
353 % \end{macro}
354
355 % \begin{macro}{\course}
356 % The |\course| command stores the name of the course for later use.
357 % \begin{macrocode}
358 \newcommand{\course}[2][]{
359 \ifstrempty{#1}{
360 \gdef\@shortcourse{#2}
361 }{
362 \gdef\@shortcourse{#1}
363 }
364 \gdef\@course{#2}
365 }
366 % \end{macrocode}
367 % \end{macro}
368
369 % \begin{macro}{\teacher}
370 % The |\teacher| command stores the name of the teacher for later use.
371 % \begin{macrocode}
372 \newcommand{\teacher}[1]{
373 \gdef\@teacher{#1}
374 }
375 % \end{macrocode}
376 % \end{macro}
377
378 % \begin{macro}{\group}
379 % The |\group| command stores the name of the group for later use.
380 % \begin{macrocode}
381 \newcommand{\group}[1]{
382 \gdef\@group{#1}
383 }
384 % \end{macrocode}
385 % \end{macro}
386
387 % \begin{macro}{\sheetno}
388 % The |\sheetno| command stores the assignment sheet number for later use.
389 % \begin{macrocode}
390 \newcommand{\sheetno}[1]{
391 \gdef\@sheetno{#1}
392 }
393 % \end{macrocode}
394 % \end{macro}
395
396 % \begin{macro}{\id}
397 % The |\id| macro prints the id of an author. The default implementation puts
398 % the id on a new line in parentheses.
399 % \begin{macrocode}
400 \newcommand{\id}[1]{\\\ttfamily\footnotesize(#1)}
401 % \end{macrocode}
402 % \end{macro}
403
404 % \begin{macro}{\author}
405 % The |\author| command is overridden by this class to support a short author
406 % that may be printed at the bottom of each page.
407 % \begin{macrocode}
408 \renewcommand{\author}[2][]{
409 \ifstrempty{#1}{
410 \gdef\@shortauthor{#2}
411 }{
412 \gdef\@shortauthor{#1}
413 }
414 \gdef\@author{#2}
415 }
416 % \end{macrocode}
417 % \end{macro}
418
419 % The default values for most fields are empty. The default university is the
420 % university of Hamburg.
421 % \begin{macrocode}
422 \university[Uni Hamburg]{Universität Hamburg}
423 \def\@course{
424 \ClassWarning{uhhassignment}{No \protect\course\space given}
425 }
426 \let\@shortcourse\@course
427 \group{}
428 \def\@teacher{
429 \ClassWarning{uhhassignment}{No \protect\teacher\space given}
430 }
431 \let\@shortteacher\@teacher
432 \def\@sheetno{
433 \ClassWarning{uhhassignment}{No \protect\sheetno\space given}
434 }
435 \def\@shortauthor{
436 \ClassWarning{uhhassignment}{No short \protect\author\space given}
437 }
438 \title{}
439
440 % \end{macrocode}
441
442 % \subsubsection{Todos}
443
444 % \begin{macro}{\todomark}
445 % The |\todomark| is placed in the text when the |\todo| command is used. The
446 % default implementation draws a purple box with the text "Todo" inside.
447 % \begin{macrocode}
448 \newcommand{\todomark}{%
449 \colorbox{purple}{%
450 \textnormal\ttfamily\bfseries\color{white}%
451 TODO%
452 }%
453 }
454 % \end{macrocode}
455 % \end{macro}
456
457 % \begin{macro}{\todo}
458 % The |\todo| macro places the |\todomark| and puts a todo text in a marginpar.
459 % \begin{macrocode}
460 \newcommand{\todo}[1][]{%
461 \ifstrempty{#1}{%
462 \def\todotext{Todo}%
463 }{%
464 \def\todotext{Todo: #1}%
465 }%
466 \todomark%
467 {%
468 \marginpar{%
469 \raggedright\normalfont\sffamily\scriptsize\todotext%
470 }%
471 }%
472 }
473 % \end{macrocode}
474 % \end{macro}
475
476 % \subsubsection{Tasks}
477
478 % The task mechanism of the \textsf{uhhassignment} class implements its own
479 % numbering mechanism. This is neccessary because the task numbers do not
480 % necessarily correlate with section numbers.
481 % \begin{macrocode}
482 \setcounter{secnumdepth}{0}
483 % \end{macrocode}
484
485 % \begin{macro}{\task}
486 % The |\task| command is basically just a wrapper around a section with a
487 % semi-customizable section title.
488 % \begin{macrocode}
489 \newcounter{task}
490 \newcommand{\task}[2][]{%
491 \ifstrempty{#1}{%
492 \stepcounter{task}%
493 }{%
494 \setcounter{task}{#1}%
495 }%
496 \ifstrempty{#2}{%
497 \section{Aufgabe \arabic{task}}%
498 }{%
499 \section{Aufgabe \arabic{task}: #2}%
500 }%
501 }
502 % \end{macrocode}
503 % \end{macro}
504
505 % \begin{macro}{\subtask}
506 % The equivalent of |\subsection| for the \textsf{uhhassignment} class.
507 % |\subtask| essentially wraps |\subsection| with a semi-customizable title.
508 % \begin{macrocode}
509 \newcounter{subtask}[task]
510 \newcommand{\subtask}[2][]{%
511 \ifstrempty{#1}{%
512 \stepcounter{subtask}%
513 }{%
514 \setcounter{subtask}{#1}%
515 }%
516 \ifstrempty{#2}{%
517 \subsection{Teilaufgabe \arabic{task}.\arabic{subtask}}%
518 }{%
519 \subsection{\arabic{task}.\arabic{subtask}. #2}%
520 }%
521 }
522 % \end{macrocode}
523 % \end{macro}
524
525 % \begin{macro}{\subsubtask}
526 % The equivalent of |\subsubsection| for the \textsf{uhhassignment} class.
527 % |\subsubtask| essentially wraps |\subsection| with a semi-customizable title.
528 % It probably is not neccessary to use this very often.
529 % \begin{macrocode}
530 \newcounter{subsubtask}[subtask]
531 \newcommand{\subsubtask}[2][]{%
532 \ifstrempty{#1}{%
533 \stepcounter{subsubtask}%
534 }{%
535 \setcounter{subsubtask}{#1}%
536 }%
537 \ifstrempty{#2}{%
538 \subsection{\arabic{task}.\arabic{subtask}.\arabic{subsubtask}}
539 }{%
540 \subsubsection{\arabic{task}.\arabic{subtask}.\arabic{subsubtask}. #2}%
541 }%
542 }
543 % \end{macrocode}
544 % \end{macro}
545
546 % \iffalse %%%%%%%%%%%%%%%%%%%
547 %%%%%%%%% Page Setup %%%%%%%%%
548 %%%%%%%%%%%%%%%%%%%%%%%%%%%\fi
549
550 % \subsection{Page Setup}
551
552 % The \textsf{uhhassignment} class defines its own header and footer using
553 % \textsf{scrlayer-scrpage}. The default setup shows the course, sheet number,
554 % university and date on every page.
555 % \begin{macrocode}
556 \setlength{\headheight}{50pt}
557 \pagestyle{scrheadings}
558 \clearpairofpagestyles
559
560 % Header
561 \ifuhhassignment@shortheader
562 \ifuhhassignment@numberedsheets
563 \ihead{\textbf{\@shortcourse}\\\uhhassignment@sheetid{} \@sheetno}
564 \else
565 \ihead{\textbf{\@shortcourse}}
566 \fi
567 \ohead{\textbf{\@shortuniversity}\\\@date}
568 \else
569 \ifuhhassignment@numberedsheets
570 \ihead{\textbf{\@course}\\\uhhassignment@sheetid{} \@sheetno}
571 \else
572 \ihead{\textbf{\@course}}
573 \fi
574 \ohead{\textbf{\@university}\\\@date}
575 \fi
576
577 % Footer
578 \setkomafont{pagefoot}{\textnormal}
579 \ifuhhassignment@repeatauthor
580 \ifoot[\@shortauthor]{\@shortauthor}
581 \ofoot[Seite \pagemark{} von \pageref{LastPage}]{Seite \pagemark{} von \pageref{LastPage}}
582 \else
583 \cfoot[Seite \pagemark{} von \pageref{LastPage}]{Seite \pagemark{} von \pageref{LastPage}}
584 \fi
585
586 \newpagestyle{firstpage}[]{%
587 \ihead{}
588 \cfoot{\pagemark{}}
589 }
590 % \end{macrocode}
591
592 % \iffalse %%%%%%%%%%%%%%%%%%%
593 %%%%%%%%%%% Layout %%%%%%%%%%%
594 %%%%%%%%%%%%%%%%%%%%%%%%%%%\fi
595
596 % \subsection{Layout}
597
598 % The \textsf{uhhassignment} class overrides some font settings and adjusts the
599 % paragraph spacing to create a more distinct layout.
600 %
601 % \begin{macrocode}
602 \setlength{\parskip}{5pt}
603
604 \setkomafont{section}{\normalfont\bfseries\LARGE}
605 \setkomafont{subsection}{\normalfont\bfseries\Large}
606 \setkomafont{subsubsection}{\normalfont\bfseries\large}
607 \RedeclareSectionCommands[afterskip=.25\baselineskip]{section}
608 \RedeclareSectionCommands[
609 beforeskip=0.5\baselineskip,
610 afterskip=.125\baselineskip]{subsection}
611 % \end{macrocode}
612
613 % \begin{macro}{\maketitle}
614 % The \textsf{uhhassignment} class completely redefines the |\maketitle| macro.
615 % This implementation actually defines the layout of the final title depending
616 % on which information was specified by the user (group number, a title, \dots).
617 %
618 % We differentiate two \emph{states} of the title. If the user does not specify
619 % a title and does not specify a group the title will be rearranged to not
620 % display too much empty space. This is implemented via the |\ifextended|
621 % definition.
622 % \begin{macrocode}
623 \renewcommand*{\maketitle}{%
624 \thispagestyle{plain}%
625
626 \newif\ifextended
627 \extendedtrue
628
629 \ifuhhassignment@shorttitle
630 \let\university\@shortuniversity
631 \let\course\@shortcourse
632 \else
633 \let\university\@university
634 \let\course\@course
635 \fi
636 % \end{macrocode}
637
638 % First we define the different layout parts. The title has six \emph{slots}
639 % each of which can hold a piece of text:
640 % \begin{description}
641 % \item[Top Left] On the top left the course name ist printed in a bold
642 % font.
643 % \item[Top Right] On the top right the name of the university is printed
644 % in a bold font.
645 % \item[Meta Left] Below the course name a piece of information is
646 % printed. The contents of this slot depend on the
647 % specified information and can be either the group
648 % number or the teacher.
649 % \item[Meta Right] Similar to meta left but below the university name.
650 % This slot typically holds the teacher or the date.
651 % \item[Title Left] Above the actual title there is a row of secondary
652 % titles. On the left of this row the sheet number is
653 % printed.
654 % \item[Title Right] Similarly to title left this slot may contain the
655 % date.
656 % \end{description}
657 % Below the header the actual document title and the author(s) are printed.
658 % If no |\title| is specified the sheet number becomes the title (|\title|
659 % however remains empfy).
660 % \begin{macrocode}
661 \ifdefempty{\@title}{%
662 \ifdefempty{\@group}{%
663 \def\metaleft{\@teacher}%
664 \def\metaright{\@date}%
665 \def\titleright{}%
666 \extendedfalse
667 }{%
668 \def\metaleft{\uhhassignment@sheetid{} \@group}%
669 \def\metaright{\@teacher}%
670 \def\titleright{\@date}%
671 }%
672 \def\titleleft{}%
673 \ifuhhassignment@numberedsheets
674 \def\title{\uhhassignment@sheetid{} \@sheetno}%
675 \else
676 % Title remains user-specified
677 \fi
678 }{%
679 \ifdefempty{\@group}{%
680 \def\metaleft{}%
681 \def\metaright{\@teacher}%
682 }{%
683 \def\metaleft{\uhhassignment@groupid{} \@group}%
684 \def\metaright{\@teacher}%
685 }%
686 \ifuhhassignment@numberedsheets
687 \def\titleleft{\uhhassignment@sheetid{} \@sheetno}%
688 \else
689 \def\titleleft{}
690 \fi
691 \def\titleright{\@date}%
692 \def\title{\@title}%
693 }%
694 % \end{macrocode}
695
696 % The following code prints the title with the information specified above.
697 % Depending on the value of |\ifextended| the title will be longer or
698 % shorter.
699 %
700 % Each field (heading, secondary title, title, author) is put in a separate
701 % group to avoid interference.
702 % \begin{macrocode}
703
704 \begingroup% Heading Group
705 \usekomafont{pageheadfoot}%
706 \usekomafont{pagehead}%
707 \setlength{\parskip}{0pt}%
708
709 \textbf{\course} \hfill \textbf{\university}\par%
710
711 \begin{minipage}[t]{\widthof{\metaleft}}%
712 \metaleft%
713 \end{minipage}%
714 \hfill%
715 \begin{minipage}[t]{\widthof{\metaright}}%
716 \raggedleft%
717 \metaright%
718 \end{minipage}%
719 \endgroup%
720
721 \ifextended%
722 \vspace{\baselineskip}%
723 \fi%
724
725 \begingroup% Secondary Title Groupt
726 \Large\bfseries\titleleft\hfill\titleright%
727 \endgroup%
728
729 \begingroup% Title Group
730 \begin{center}%
731 \Huge\textsc{\title}%
732 \end{center}%
733 \endgroup%
734
735 \begingroup% Author Group
736 \setlength{\baselineskip}{2.75\baselineskip}%
737 \vspace{-\baselineskip}%
738 \begin{center}%
739 \begin{tabular}[t]{c}%
740 \@author%
741 \end{tabular}%
742 \end{center}%
743 \endgroup%
744 }
745 % \end{macrocode}
746 % \end{macro}
747 % \Finale
748
749 \endinput