update exercise sheet class with english version

This commit is contained in:
Maximilian Keßler 2021-10-14 12:59:49 +02:00
parent ef818c9c10
commit ea2989d850
4 changed files with 56 additions and 7 deletions

View File

@ -1,24 +1,33 @@
__HEADER__(Include exercise sheets into lecture notes easily.)
\RequirePackage{xkeyval}
__LANGUAGE_OPTIONS__
__LANGUAGE_OPTIONS_X__
__END_OPTIONS__
__END_OPTIONS_X__
\RequirePackage{mkessler-fancythm}
\def__PACKAGE_MACRO__(sheet){
__IF__(english) Exercise Sheet\else Übungsblatt\fi
}
\newcounter{__PACKAGE_PREFIX__sheet}
\declaretheorem[style=thmgreenmargin, numberwithin=__PACKAGE_PREFIX__sheet, name=__IF__(english) Exercise\else Aufgabe\fi]{__PACKAGE_PREFIX__aufgabe}
\declaretheorem[style=thmgreenmargin, numberwithin=__PACKAGE_PREFIX__sheet, name=__IF__(english) Exercise\else Aufgabe\fi]{__PACKAGE_PREFIX__sheetexercise}
\usepackage{xkeyval}
\NewDocumentEnvironment{aufgabe}{O{}}{
\begin{__PACKAGE_PREFIX__aufgabe\expandafter}\if\relax\detokenize{#1}\relax\else[#1]\fi\label{aufgabe-\the__PACKAGE_PREFIX__aufgabe}
\NewDocumentEnvironment{sheetexercise}{O{}}{
\begin{__PACKAGE_PREFIX__sheetexercise\expandafter}\if\relax\detokenize{#1}\relax\else[#1]\fi\label{exercise-\the__PACKAGE_PREFIX__sheetexercise}
}{
\end{__PACKAGE_PREFIX__aufgabe\expandafter}\relax
\end{__PACKAGE_PREFIX__sheetexercise\expandafter}\relax
}
\newcommand\blatt{\refstepcounter{__PACKAGE_PREFIX__sheet}\subsection*{\the__PACKAGE_PREFIX__sheet. Übungsblatt}\addcontentsline{toc}{subsection}{\the__PACKAGE_PREFIX__sheet. Übungsblatt}}
\newcommand\exercisesheet{
\refstepcounter{__PACKAGE_PREFIX__sheet}
\subsection*{\the__PACKAGE_PREFIX__sheet. __PACKAGE_MACRO__(sheet)}
\addcontentsline{toc}{subsection}{\the__PACKAGE_PREFIX__sheet. __PACKAGE_MACRO__(sheet)}
}

View File

@ -0,0 +1,3 @@
test:
latexmk -dvi- -pdf -gg -Werror -latexoption=-interaction=nonstopmode test.tex
latexmk -c test.tex

View File

@ -0,0 +1,34 @@
\documentclass{article}
\usepackage{mkessler-hypersetup}
\usepackage{mkessler-exsheet}
\usepackage{parskip}
\begin{document}
\tableofcontents
\section{test}
\exercisesheet
\begin{sheetexercise}
\begin{itemize}
\item test
\end{itemize}
test
\end{sheetexercise}
\begin{sheetexercise}
test
\end{sheetexercise}
\exercisesheet
\begin{sheetexercise}
\end{sheetexercise}
\autoref{exercise-1.1}
\end{document}

View File

@ -0,0 +1,3 @@
\contentsline {section}{\numberline {1}test}{1}{section.1}%
\contentsline {subsection}{1. Exercise Sheet}{1}{section*.2}%
\contentsline {subsection}{2. Exercise Sheet}{1}{section*.3}%