Verified Commit a2bd2e43 authored by Adrian C. Hinrichs's avatar Adrian C. Hinrichs
Browse files

Merge branch 'dev-hwa' into HEAD


Signed-off-by: Adrian C. Hinrichs's avatarAdrian C. Hinrichs <adrian.hinrichs@rwth-aachen.de>
parents aedceadb e961ad37
...@@ -36,8 +36,8 @@ ...@@ -36,8 +36,8 @@
%% LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, %% LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
%% OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE %% OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
%% SOFTWARE. %% SOFTWARE.
\def\fileversion{v3.2} \def\fileversion{v3.2c}
\def\filedate{2018/12/06} \def\filedate{2019/04/16}
\NeedsTeXFormat{LaTeX2e}[2005/12/01] \NeedsTeXFormat{LaTeX2e}[2005/12/01]
\ProvidesClass{homeworkassignment}[\filedate\space\fileversion] \ProvidesClass{homeworkassignment}[\filedate\space\fileversion]
\RequirePackage{suffix} \RequirePackage{suffix}
...@@ -56,6 +56,8 @@ ...@@ -56,6 +56,8 @@
\RequirePackage{adjustbox} \RequirePackage{adjustbox}
\RequirePackage{eso-pic} \RequirePackage{eso-pic}
\RequirePackage{xcolor}
\RequirePackage{kvoptions} \RequirePackage{kvoptions}
\SetupKeyvalOptions{ family=hwa, \SetupKeyvalOptions{ family=hwa,
prefix=hwa@ } prefix=hwa@ }
...@@ -67,10 +69,11 @@ ...@@ -67,10 +69,11 @@
\DeclareBoolOption[false]{listings} \DeclareBoolOption[false]{listings}
\DeclareBoolOption[true]{twoside} \DeclareBoolOption[true]{twoside}
\DeclareComplementaryOption{oneside}{twoside} \DeclareComplementaryOption{oneside}{twoside}
\DeclareBoolOption[true]{twocolumn} \DeclareBoolOption[false]{twocolumn}
\DeclareComplementaryOption{onecolumn}{twocolumn} \DeclareComplementaryOption{onecolumn}{twocolumn}
\DeclareBoolOption[false]{punchmark} \DeclareBoolOption[false]{punchmark}
\DeclareStringOption[all]{hlines} \DeclareStringOption[all]{hlines}
\DeclareStringOption[all]{todos}
\ifxetex \ifxetex
\DeclareBoolOption[true]{unicodemath} \DeclareBoolOption[true]{unicodemath}
\else \else
...@@ -89,6 +92,29 @@ ...@@ -89,6 +92,29 @@
\fi \fi
\LoadClass{article} \LoadClass{article}
\newboolean{hwa@todos@inplace}
\newboolean{hwa@todos@list}
\setboolean{hwa@todos@inplace}{true}
\setboolean{hwa@todos@list}{true}
\ifthenelse{\equal{\hwa@todos}{all}}{
}{
\ifthenelse{\equal{\hwa@todos}{nolist}}{
\ClassWarning{homeworkassignment}{You specified todos=none,
there will be no list of TODO}
\setboolean{hwa@todos@list}{false}
}{
\ifthenelse{\equal{\hwa@todos}{none}}{
\ClassWarning{homeworkassignment}{You specified todos=none,
there will be no TODOs printed in the final document}
\setboolean{hwa@todos@list}{false}
\setboolean{hwa@todos@inplace}{false}
}{
\ClassError{homeworkassignment}{\hwa@todos is not a valid value
for the option `todos`}
}
}
}
\RequirePackage{hyperref}
\ifhwa@listings \ifhwa@listings
\RequirePackage{listings} \RequirePackage{listings}
\lstset{ \lstset{
...@@ -190,12 +216,15 @@ ...@@ -190,12 +216,15 @@
\pagestyle{followingpage} \pagestyle{followingpage}
\renewcommand{\theequation}{\Roman{equation}} \renewcommand{\theequation}{\Roman{equation}}
\allowdisplaybreaks \allowdisplaybreaks
\ifthenelse{\boolean{xetex}}{ \ifthenelse{\boolean{xetex}}{
\RequirePackage{fontspec} \RequirePackage{fontspec}
\setsansfont{Gillius ADF} \setsansfont{TeX Gyre Adventor}
\setmainfont{TeX Gyre Pagella}
\setmonofont{Fira Mono}
}{ }{
\RequirePackage{gillius2} \RequirePackage{tgadventor}
\RequirePackage{tgpagella}
\RequirePackage{FiraMono}
} }
\newcommand{\hwa@pointboxsize}{3em} \newcommand{\hwa@pointboxsize}{3em}
\newcommand{\hwa@kurs}{?\GetTranslation{subject}?} % To store the value \newcommand{\hwa@kurs}{?\GetTranslation{subject}?} % To store the value
...@@ -209,7 +238,7 @@ ...@@ -209,7 +238,7 @@
\newcommand{\abgabe}[1]{\deadline{#1}} \newcommand{\abgabe}[1]{\deadline{#1}}
\newcommand{\hwa@sheetTitle}{} \newcommand{\hwa@sheetTitle}{}
\newcommand{\sheetTitle}[1]{\def\hwa@sheetTitle{#1}} \newcommand{\sheetTitle}[1]{\def\hwa@sheetTitle{#1}}
\DeclareDocumentCommand\problem{m o}{\@startsection{problem}%Name \DeclareDocumentCommand\hwa@problem{m o}{\@startsection{problem}%Name
{1}%Level {1}%Level
{\z@}%indent {\z@}%indent
{-2em \@plus -1em \@minus -1em}%beforeskip {-2em \@plus -1em \@minus -1em}%beforeskip
...@@ -225,7 +254,7 @@ ...@@ -225,7 +254,7 @@
\addcontentsline{toc}{section}{#1} \addcontentsline{toc}{section}{#1}
} }
\DeclareDocumentCommand\subproblem{m o}{\@startsection{subproblem}%Name \DeclareDocumentCommand\hwa@subproblem{m o}{\@startsection{subproblem}%Name
{2}%Level {2}%Level
{\z@}%indent {\z@}%indent
{-1em \@plus -.5em \@minus -.5em}%beforeskip {-1em \@plus -.5em \@minus -.5em}%beforeskip
...@@ -240,7 +269,7 @@ ...@@ -240,7 +269,7 @@
\addcontentsline{toc}{subsection}{#1} \addcontentsline{toc}{subsection}{#1}
} }
\DeclareDocumentCommand\subsubproblem{m o}{\@startsection{subsubproblem}%Name \DeclareDocumentCommand\hwa@subsubproblem{m o}{\@startsection{subsubproblem}%Name
{3}%Level {3}%Level
{\z@}%indent {\z@}%indent
{-.5em}%beforeskip {-.5em}%beforeskip
...@@ -282,10 +311,10 @@ ...@@ -282,10 +311,10 @@
} }
\IfNoValueTF{#2}{ \IfNoValueTF{#2}{
\problem{\GetTranslation{aufgabe} \hwa@problemno} \hwa@problem{\GetTranslation{aufgabe} \hwa@problemno}
\addToGradingTable{\# \hwa@problemno} \addToGradingTable{\# \hwa@problemno}
}{ }{
\problem{\GetTranslation{aufgabe} \hwa@problemno}[#2] \hwa@problem{\GetTranslation{aufgabe} \hwa@problemno}[#2]
\addToGradingTable{\# \hwa@problemno}{/#2} \addToGradingTable{\# \hwa@problemno}{/#2}
} }
} }
...@@ -294,7 +323,7 @@ ...@@ -294,7 +323,7 @@
\ifthenelse{\equal{#1}{}} { } { \ifthenelse{\equal{#1}{}} { } {
\stepcounter{problem}% to reset the lower counters \stepcounter{problem}% to reset the lower counters
\setcounter{problem}{#1}} \setcounter{problem}{#1}}
\problem{\GetTranslation{aufgabe} \hwa@problemno} \hwa@problem{\GetTranslation{aufgabe} \hwa@problemno}
} }
\DeclareDocumentCommand\newsubproblem{O{} g}{ \DeclareDocumentCommand\newsubproblem{O{} g}{
...@@ -302,11 +331,11 @@ ...@@ -302,11 +331,11 @@
\ifthenelse{\equal{#1}{}} { } { \ifthenelse{\equal{#1}{}} { } {
\setcounter{subproblem}{#1}} \setcounter{subproblem}{#1}}
\IfNoValueTF{#2}{ \IfNoValueTF{#2}{
\subproblem{\GetTranslation{aufgabe} \hwa@subproblem{\GetTranslation{aufgabe}
\hwa@problemno{}.\hwa@subproblemno} \hwa@problemno{}.\hwa@subproblemno}
} }
{ {
\subproblem{\GetTranslation{aufgabe} \hwa@subproblem{\GetTranslation{aufgabe}
\hwa@problemno{}.\hwa@subproblemno}[#2] \hwa@problemno{}.\hwa@subproblemno}[#2]
} }
} }
...@@ -315,13 +344,45 @@ ...@@ -315,13 +344,45 @@
\stepcounter{subsubproblem} \stepcounter{subsubproblem}
\ifthenelse{\equal{#1}{}} { } {\setcounter{subsubproblem}{#1}} \ifthenelse{\equal{#1}{}} { } {\setcounter{subsubproblem}{#1}}
\IfNoValueTF{#2}{ \IfNoValueTF{#2}{
\subsubproblem{\hwa@subsubproblemno)} \hwa@subsubproblem{\hwa@subsubproblemno)}
} }
{ {
\subsubproblem{\hwa@subsubproblemno)}[#2] \hwa@subsubproblem{\hwa@subsubproblemno)}[#2]
} }
} }
\NewDocumentEnvironment{problem}{O{} g}{
\newproblem[#1]{#2}
\newcommand{\task}[1]{
\begin{framed}
\keyword{Problem:} ##1
\end{framed}
}
}{}
\NewDocumentEnvironment{problem*}{O{} g}{
\newproblem*[#1]{#2}
\newcommand{\task}[1]{
\begin{framed}
\keyword{Problem:} ##1
\end{framed}
}
}{}
\NewDocumentEnvironment{subproblem}{O{} g}{
\newsubproblem[#1]{#2}
\newcommand{\task}[1]{
\begin{framed}
\keyword{Problem:} ##1
\end{framed}
}
}{}
\NewDocumentEnvironment{subsubproblem}{O{} g}{
\newsubsubproblem[#1]{#2}
\newcommand{\task}[1]{
\begin{framed}
\keyword{Problem:} ##1
\end{framed}
}
}{}
\newcommand{\hwa@QED}{\begin{flushright} \newcommand{\hwa@QED}{\begin{flushright}
\textsc{Qed} \textsc{Qed}
\end{flushright} \end{flushright}
...@@ -348,7 +409,7 @@ ...@@ -348,7 +409,7 @@
\newcommand{\Z}{\ensuremath{\mathbb{Z}}} \newcommand{\Z}{\ensuremath{\mathbb{Z}}}
\newcommand{\R}{\ensuremath{\mathbb{R}}} \newcommand{\R}{\ensuremath{\mathbb{R}}}
\newcommand{\Q}{\ensuremath{\mathbb{Q}}} \newcommand{\Q}{\ensuremath{\mathbb{Q}}}
\newcommand{\C}{\ensuremath{\mathbb{C}}} \newcommand{\Compl}{\ensuremath{\mathbb{C}}}
\newcommand{\F}{\ensuremath{\mathbb{F}}} \newcommand{\F}{\ensuremath{\mathbb{F}}}
\newcommand{\Primes}{\ensuremath{\mathbb{P}}} \newcommand{\Primes}{\ensuremath{\mathbb{P}}}
\DeclareMathOperator{\GL}{GL} \DeclareMathOperator{\GL}{GL}
...@@ -391,6 +452,28 @@ ...@@ -391,6 +452,28 @@
\renewcommand{\exists}{\ensuremath{\hskip 2pt \oexists \hskip 2pt}} \renewcommand{\exists}{\ensuremath{\hskip 2pt \oexists \hskip 2pt}}
\newcommand{\bigforall}{\mbox{\raisebox{-2pt}[\height][\depth]{\Large $\mathsurround4pt\forall$}}} \newcommand{\bigforall}{\mbox{\raisebox{-2pt}[\height][\depth]{\Large $\mathsurround4pt\forall$}}}
\newcommand{\bigexists}{\mbox{\raisebox{-2pt}[\height][\depth]{\Large $\mathsurround4pt\exists$}}} \newcommand{\bigexists}{\mbox{\raisebox{-2pt}[\height][\depth]{\Large $\mathsurround4pt\exists$}}}
\DeclareDocumentCommand\todo{G{}}{
\ifthenelse{\boolean{hwa@todos@inplace}}{
{\color{red}\textbf{~\label{TODO\alph{todoNum}}TODO~}#1~}
\xdef\hwa@todoList@aux{\hwa@todoList@aux
\string\item\string\hyperref[TODO\alph{todoNum}]{TODO #1}
}
\stepcounter{todoNum}
}{}
}
\newcounter{todoNum} \setcounter{todoNum}{1}
\DeclareDocumentCommand\hwa@tableOfTodos{}{
\ifthenelse{\boolean{hwa@todos@list}}{
\ifthenelse{\equal{\hwa@tableOfTodos}{}}{%Nothing
}{
{\color{red}
\hwa@problem{Table of ToDos}
\begin{itemize}
\hwa@todoList
\end{itemize}}
}
}{}
}
\DeclareDocumentCommand\addToGradingTable{m g}{ \DeclareDocumentCommand\addToGradingTable{m g}{
\edef\hwa@gradingtbl@aux@defs{\hwa@gradingtbl@aux@defs|p{\hwa@pointboxsize}} \edef\hwa@gradingtbl@aux@defs{\hwa@gradingtbl@aux@defs|p{\hwa@pointboxsize}}
\edef\hwa@gradingtbl@aux@lineOne{\hwa@gradingtbl@aux@lineOne{#1} &} \edef\hwa@gradingtbl@aux@lineOne{\hwa@gradingtbl@aux@lineOne{#1} &}
...@@ -420,6 +503,8 @@ ...@@ -420,6 +503,8 @@
\edef\hwa@gradingtbl@defs{} \edef\hwa@gradingtbl@defs{}
\newcommand{\hwa@gradingtbl@lineOne}{} \newcommand{\hwa@gradingtbl@lineOne}{}
\newcommand{\hwa@gradingtbl@lineTwo}{} \newcommand{\hwa@gradingtbl@lineTwo}{}
\newcommand{\hwa@todoList}{}
\newcommand\hwa@todoList@aux{}
\AtEndDocument{% \AtEndDocument{%
\immediate\write\@auxout{% \immediate\write\@auxout{%
\gdef\string\hwa@gradingtbl@defs{\hwa@gradingtbl@aux@defs} \gdef\string\hwa@gradingtbl@defs{\hwa@gradingtbl@aux@defs}
...@@ -430,6 +515,9 @@ ...@@ -430,6 +515,9 @@
\immediate\write\@auxout{% \immediate\write\@auxout{%
\gdef\string\hwa@gradingtbl@lineTwo{\hwa@gradingtbl@aux@lineTwo}% \gdef\string\hwa@gradingtbl@lineTwo{\hwa@gradingtbl@aux@lineTwo}%
} }
\immediate\write\@auxout{%
\gdef\string\hwa@todoList{\hwa@todoList@aux}%
}
} }
\renewcommand{\maketitle} { \renewcommand{\maketitle} {
\thispagestyle{firstpage} \thispagestyle{firstpage}
...@@ -440,11 +528,12 @@ ...@@ -440,11 +528,12 @@
}\else{ }\else{
\hwa@maketitletext \hwa@maketitletext
}\fi }\fi
\hwa@tableOfTodos
} }
\newcommand{\hwa@maketitletext}{ \newcommand{\hwa@maketitletext}{
\begin{centering} \begin{centering}
\huge{\textsf{\textbf{\hwa@kurs}}}\hwa@hline@LONE \large \huge{\textsf{\textbf{\hwa@kurs}}}\hwa@hline@LONE \large
\ifthenelse{\equal{\hwa@sheetTitle}{}}{}{\textsf{\hwa@sheetTitle}\\} \ifthenelse{\equal{\hwa@sheetTitle}{}}{}{\textbf{\hwa@sheetTitle}\\}
\GetTranslation{abgabe}: \hwa@abgabe\\ \GetTranslation{abgabe}: \hwa@abgabe\\
\hwa@hline@LTWO \hwa@hline@LTWO
\normalsize{\@author}\\ \normalsize{\@author}\\
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
% MIT License % MIT License
% %
% %
% Copyright (c) 2016-2018 by Adrian C. Hinrichs % Copyright (c) 2016-2019 by Adrian C. Hinrichs
% %
% %
% %
...@@ -29,8 +29,8 @@ ...@@ -29,8 +29,8 @@
% OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE % OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
% SOFTWARE. % SOFTWARE.
% \fi % \fi
\def\fileversion{v3.2} \def\fileversion{v3.2c}
\def\filedate{2018/12/06} \def\filedate{2019/04/16}
% \iffalse % \iffalse
%<*driver> %<*driver>
\ProvidesFile{homeworkassignment.dtx} \ProvidesFile{homeworkassignment.dtx}
...@@ -157,6 +157,10 @@ ...@@ -157,6 +157,10 @@
% functionality.} % functionality.}
% \dep{gillius}{Bob Tennent}{https://ctan.org/pkg/gillius}{A Gillian % \dep{gillius}{Bob Tennent}{https://ctan.org/pkg/gillius}{A Gillian
% Sans inspired font, used for all sans serifes fonts} % Sans inspired font, used for all sans serifes fonts}
% \dep{hyperref}{https://ctan.org/pkg/hyperref}{Sebastian Rahtz, Heiko
% Oberdiek}{For hyperrefs, obviously}
% \dep{xcolor}{Dr. Uwe Kern}{https://www.ctan.org/pkg/xcolor}{For
% coloring of ToDos}
% \end{description} % \end{description}
% \subsection{Recommended Dependencies} % \subsection{Recommended Dependencies}
% These are not loaded automatically, but require a switch as option % These are not loaded automatically, but require a switch as option
...@@ -193,6 +197,8 @@ ...@@ -193,6 +197,8 @@
\RequirePackage{adjustbox} \RequirePackage{adjustbox}
\RequirePackage{eso-pic} \RequirePackage{eso-pic}
\RequirePackage{xcolor}
% \end{macrocode} % \end{macrocode}
% \section{Options\label{sec:Options}} % \section{Options\label{sec:Options}}
% KV-Options is essential for this. % KV-Options is essential for this.
...@@ -241,9 +247,9 @@ ...@@ -241,9 +247,9 @@
% \DescribeMacro{onecolumn,twocolumn} % \DescribeMacro{onecolumn,twocolumn}
% Changes layout. \textrm{onecolumn} is the complementary option to % Changes layout. \textrm{onecolumn} is the complementary option to
% \texttt{twocolumn}.\\ % \texttt{twocolumn}.\\
% Standard Layout has two columns % Standard Layout has one columns
% \begin{macrocode} % \begin{macrocode}
\DeclareBoolOption[true]{twocolumn} \DeclareBoolOption[false]{twocolumn}
\DeclareComplementaryOption{onecolumn}{twocolumn} \DeclareComplementaryOption{onecolumn}{twocolumn}
% \end{macrocode} % \end{macrocode}
% \DescribeMacro{punchmark} % \DescribeMacro{punchmark}
...@@ -261,6 +267,13 @@ ...@@ -261,6 +267,13 @@
% \begin{macrocode} % \begin{macrocode}
\DeclareStringOption[all]{hlines} \DeclareStringOption[all]{hlines}
% \end{macrocode} % \end{macrocode}
% \DescribeMacro{todos=<1>}
% KeyValue-option. Takes which ToDos shall be displayed. Available are
% \texttt{all} (default),\texttt{nolist},\texttt{none}. See
% \autoref{cmd:TODOs} for explanation of the levels.
% \begin{macrocode}
\DeclareStringOption[all]{todos}
% \end{macrocode}
% \DescribeMacro{unicode-math} Loads the unicode--math--package and % \DescribeMacro{unicode-math} Loads the unicode--math--package and
% overwrites the damn \texttt{\textbackslash QED}--Command unicode--math % overwrites the damn \texttt{\textbackslash QED}--Command unicode--math
% introduces, that creates a filled out box and only works in % introduces, that creates a filled out box and only works in
...@@ -306,6 +319,32 @@ ...@@ -306,6 +319,32 @@
\fi \fi
\LoadClass{article} \LoadClass{article}
\newboolean{hwa@todos@inplace}
\newboolean{hwa@todos@list}
\setboolean{hwa@todos@inplace}{true}
\setboolean{hwa@todos@list}{true}
\ifthenelse{\equal{\hwa@todos}{all}}{
}{
\ifthenelse{\equal{\hwa@todos}{nolist}}{
\ClassWarning{homeworkassignment}{You specified todos=none,
there will be no list of TODO}
\setboolean{hwa@todos@list}{false}
}{
\ifthenelse{\equal{\hwa@todos}{none}}{
\ClassWarning{homeworkassignment}{You specified todos=none,
there will be no TODOs printed in the final document}
\setboolean{hwa@todos@list}{false}
\setboolean{hwa@todos@inplace}{false}
}{
\ClassError{homeworkassignment}{\hwa@todos is not a valid value
for the option `todos`}
}
}
}
% \end{macrocode}
% Load Hyperref (breaks if it is loaded before article
% \begin{macrocode}
\RequirePackage{hyperref}
% \end{macrocode} % \end{macrocode}
% Loads listings, if wanted % Loads listings, if wanted
% \begin{macrocode} % \begin{macrocode}
...@@ -462,19 +501,27 @@ ...@@ -462,19 +501,27 @@
% \end{macrocode} % \end{macrocode}
% \end{macro} % \end{macro}
% \subsection{fonts} % \subsection{fonts}
% \subsection{Serife (Default)}
% \subsubsection{San Serife}
% I fancy the Gillius-Font-Family, so that is the default Sans-Serif % I fancy the Gillius-Font-Family, so that is the default Sans-Serif
% font, when using XeTeX, The template does default to % font, when using XeTeX, The template does default to
% \href{https://www.1001fonts.com/gillius-adf-font.html}{Gillius ADF}, % \href{https://www.1001fonts.com/gillius-adf-font.html}{Gillius ADF},
% which is available for free, licensed under the GNU License. % which is available for free, licensed under the GNU License.
% \begin{macrocode} % \begin{macrocode}
\ifthenelse{\boolean{xetex}}{ \ifthenelse{\boolean{xetex}}{
\RequirePackage{fontspec} \RequirePackage{fontspec}
\setsansfont{Gillius ADF} \setsansfont{TeX Gyre Adventor}
}{ \setmainfont{TeX Gyre Pagella}
\RequirePackage{gillius2} \setmonofont{Fira Mono}
}{
\RequirePackage{tgadventor}
\RequirePackage{tgpagella}
\RequirePackage{FiraMono}
} }
% \end{macrocode} % \end{macrocode}
% \subsubsection{Monospace}
% \begin{macrocode}
% \end{macrocode}
% \section{Commands} % \section{Commands}
% \subsection{Constants} % \subsection{Constants}
% Defines some constants % Defines some constants
...@@ -530,15 +577,17 @@ ...@@ -530,15 +577,17 @@
% \subsection{Sectioning\label{SECTIONING_CMDS}} % \subsection{Sectioning\label{SECTIONING_CMDS}}
% Because the class is designed for Assignments, the % Because the class is designed for Assignments, the
% sectioning-commands are different from Article % sectioning-commands are different from Article
% \subsubsection{\enquote*{plain} % \subsubsection{internal
% Sectioning\label{PLAIN_SECTIONING_CMDS}} % Sectioning\label{PLAIN_SECTIONING_CMDS}}
% \begin{macro}{\problem}~\\ \DescribeMacro{\subproblem} % \begin{macro}{\hwa@problem}~\\ \DescribeMacro{\hwa@subproblem}
% \DescribeMacro{\subsubproblem} These commands work like their % \DescribeMacro{\hwa@subsubproblem} These commands work like their
% counterpart in article, except that there will be no number, nor % counterpart in article, except that there will be no number, nor
% will they increase a counter. Nevertheless, they will be shown % will they increase a counter. Nevertheless, they will be shown
% in the table of contents.\\ % in the table of contents. With version 4.0 they were made private,
% because I figured that they are not usefull enough and I am now able
% to introduce environments with the old names\\
% \begin{macrocode} % \begin{macrocode}
\DeclareDocumentCommand\problem{m o}{\@startsection{problem}%Name \DeclareDocumentCommand\hwa@problem{m o}{\@startsection{problem}%Name
{1}%Level {1}%Level
{\z@}%indent {\z@}%indent
{-2em \@plus -1em \@minus -1em}%beforeskip {-2em \@plus -1em \@minus -1em}%beforeskip
...@@ -554,7 +603,7 @@ ...@@ -554,7 +603,7 @@
\addcontentsline{toc}{section}{#1} \addcontentsline{toc}{section}{#1}
} }
\DeclareDocumentCommand\subproblem{m o}{\@startsection{subproblem}%Name \DeclareDocumentCommand\hwa@subproblem{m o}{\@startsection{subproblem}%Name
{2}%Level {2}%Level
{\z@}%indent {\z@}%indent
{-1em \@plus -.5em \@minus -.5em}%beforeskip {-1em \@plus -.5em \@minus -.5em}%beforeskip
...@@ -569,7 +618,7 @@ ...@@ -569,7 +618,7 @@
\addcontentsline{toc}{subsection}{#1} \addcontentsline{toc}{subsection}{#1}
} }
\DeclareDocumentCommand\subsubproblem{m o}{\@startsection{subsubproblem}%Name \DeclareDocumentCommand\hwa@subsubproblem{m o}{\@startsection{subsubproblem}%Name
{3}%Level {3}%Level
{\z@}%indent {\z@}%indent
{-.5em}%beforeskip {-.5em}%beforeskip
...@@ -662,10 +711,10 @@ ...@@ -662,10 +711,10 @@
} }
\IfNoValueTF{#2}{ \IfNoValueTF{#2}{
\problem{\GetTranslation{aufgabe} \hwa@problemno} \hwa@problem{\GetTranslation{aufgabe} \hwa@problemno}
\addToGradingTable{\# \hwa@problemno} \addToGradingTable{\# \hwa@problemno}
}{ }{
\problem{\GetTranslation{aufgabe} \hwa@problemno}[#2] \hwa@problem{\GetTranslation{aufgabe} \hwa@problemno}[#2]
\addToGradingTable{\# \hwa@problemno}{/#2} \addToGradingTable{\# \hwa@problemno}{/#2}
} }
} }
...@@ -674,7 +723,7 @@ ...@@ -674,7 +723,7 @@
\ifthenelse{\equal{#1}{}} { } { \ifthenelse{\equal{#1}{}} { } {
\stepcounter{problem}% to reset the lower counters \stepcounter{problem}% to reset the lower counters
\setcounter{problem}{#1}} \setcounter{problem}{#1}}
\problem{\GetTranslation{aufgabe} \hwa@problemno} \hwa@problem{\GetTranslation{aufgabe} \hwa@problemno}
} }
\DeclareDocumentCommand\newsubproblem{O{} g}{ \DeclareDocumentCommand\newsubproblem{O{} g}{
...@@ -682,11 +731,11 @@ ...@@ -682,11 +731,11 @@
\ifthenelse{\equal{#1}{}} { } { \ifthenelse{\equal{#1}{}} { } {
\setcounter{subproblem}{#1}} \setcounter{subproblem}{#1}}
\IfNoValueTF{#2}{ \IfNoValueTF{#2}{
\subproblem{\GetTranslation{aufgabe} \hwa@subproblem{\GetTranslation{aufgabe}
\hwa@problemno{}.\hwa@subproblemno} \hwa@problemno{}.\hwa@subproblemno}
} }
{ {
\subproblem{\GetTranslation{aufgabe} \hwa@subproblem{\GetTranslation{aufgabe}
\hwa@problemno{}.\hwa@subproblemno}[#2] \hwa@problemno{}.\hwa@subproblemno}[#2]