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

@@ -67,7 +67,7 @@
\RequirePackage{xcolor} % Colors \RequirePackage{xcolor} % Colors
\RequirePackage{framed} % Colored Boxes \RequirePackage{framed} % Colored Boxes
\RequirePackage[colorlinks,linkcolor=blue!70]{hyperref} % Links and References \RequirePackage[colorlinks,linkcolor=black]{hyperref} % Links and References
\RequirePackage{lmodern} % Better Font \RequirePackage{lmodern} % Better Font
%%%%%%% Custom Commands %%%%%% %%%%%%% Custom Commands %%%%%%
@@ -135,6 +135,7 @@
} }
\setcounter{secnumdepth}{0} \setcounter{secnumdepth}{0}
\newif\if@tasknumbers \newif\if@tasknumbers
@@ -148,7 +149,11 @@
\setcounter{task}{#1}% \setcounter{task}{#1}%
}% }%
\if@tasknumbers% \if@tasknumbers%
\ifstrempty{#2}{%
\section{Aufgabe \arabic{task}}%
}{%
\section{Aufgabe \arabic{task}: #2}% \section{Aufgabe \arabic{task}: #2}%
}%
\else% \else%
\section{#2}% \section{#2}%
\fi% \fi%
@@ -162,7 +167,11 @@
\setcounter{subtask}{#1}% \setcounter{subtask}{#1}%
}% }%
\if@tasknumbers% \if@tasknumbers%
\ifstrempty{#2}{%
\subsection{Teilaufgabe \arabic{task}.\arabic{subtask}}%
}{%
\subsection{\arabic{task}.\arabic{subtask}. #2}% \subsection{\arabic{task}.\arabic{subtask}. #2}%
}%
\else% \else%
\subsection{#2}% \subsection{#2}%
\fi% \fi%
@@ -176,7 +185,11 @@
\setcounter{subsubtask}{#1}% \setcounter{subsubtask}{#1}%
}% }%
\if@tasknumbers% \if@tasknumbers%
\ifstrempty{#2}{%
\subsection{\arabic{task}.\arabic{subtask}.\arabic{subsubtask}}
}{%
\subsubsection{\arabic{task}.\arabic{subtask}.\arabic{subsubtask}. #2}% \subsubsection{\arabic{task}.\arabic{subtask}.\arabic{subsubtask}. #2}%
}%
\else% \else%
\subsubsection{#2}% \subsubsection{#2}%
\fi% \fi%

View File

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