Implement Untitled Tasks

This commit is contained in:
Kim Wittenburg
2017-04-16 22:13:40 +02:00
parent 68dc1dd201
commit 6e9d56545d
2 changed files with 37 additions and 10 deletions

View File

@@ -380,6 +380,8 @@
% \subsubsection{Tasks}
% \changes{v1.1}{2017/04/16}{Support Untitled Tasks}
% The task mechanism of the \textsf{homework} class implements its own numbering
% mechanism. This is neccessary because the task numbers are not necessarily
% placed at the beginning of the title of a section.
@@ -402,7 +404,11 @@
\setcounter{task}{#1}%
}%
\if@tasknumbers%
\section{Aufgabe \arabic{task}: #2}%
\ifstrempty{#2}{%
\section{Aufgabe \arabic{task}}%
}{%
\section{Aufgabe \arabic{task}: #2}%
}%
\else%
\section{#2}%
\fi%
@@ -422,7 +428,11 @@
\setcounter{subtask}{#1}%
}%
\if@tasknumbers%
\subsection{\arabic{task}.\arabic{subtask}. #2}%
\ifstrempty{#2}{%
\subsection{Teilaufgabe \arabic{task}.\arabic{subtask}}%
}{%
\subsection{\arabic{task}.\arabic{subtask}. #2}%
}%
\else%
\subsection{#2}%
\fi%
@@ -443,7 +453,11 @@
\setcounter{subsubtask}{#1}%
}%
\if@tasknumbers%
\subsubsection{\arabic{task}.\arabic{subtask}.\arabic{subsubtask}. #2}%
\ifstrempty{#2}{%
\subsection{\arabic{task}.\arabic{subtask}.\arabic{subsubtask}}
}{%
\subsubsection{\arabic{task}.\arabic{subtask}.\arabic{subsubtask}. #2}%
}%
\else%
\subsubsection{#2}%
\fi%
@@ -531,9 +545,9 @@
\else
\def\homework@university{\@university}
\def\homework@course{\@course}
\fi
\fi%
% \end{macrocode}
% First we define the different layout parts. The title has six \emph{slots}
% each of which can hold a piece of text:
% \begin{description}
@@ -582,8 +596,8 @@
\def\titleright{\@date}%
\def\title{\@title}%
}%
% \end{macrocode}
% The following code prints the title with the information specified above.
% Depending on the value of |\ifextended| the title will be longer or
% shorter.