From ea2989d850c3595484164a95fa752b744955d0e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20Ke=C3=9Fler?= Date: Thu, 14 Oct 2021 12:59:49 +0200 Subject: [PATCH] update exercise sheet class with english version --- src/wip/exsheet.pysty | 23 ++++++++++++++++------- tests/wip/exercises/Makefile | 3 +++ tests/wip/exercises/test.tex | 34 ++++++++++++++++++++++++++++++++++ tests/wip/exercises/test.toc | 3 +++ 4 files changed, 56 insertions(+), 7 deletions(-) create mode 100644 tests/wip/exercises/Makefile create mode 100644 tests/wip/exercises/test.tex create mode 100644 tests/wip/exercises/test.toc diff --git a/src/wip/exsheet.pysty b/src/wip/exsheet.pysty index 47c82be..0b58bfa 100644 --- a/src/wip/exsheet.pysty +++ b/src/wip/exsheet.pysty @@ -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)} +} diff --git a/tests/wip/exercises/Makefile b/tests/wip/exercises/Makefile new file mode 100644 index 0000000..768055d --- /dev/null +++ b/tests/wip/exercises/Makefile @@ -0,0 +1,3 @@ +test: + latexmk -dvi- -pdf -gg -Werror -latexoption=-interaction=nonstopmode test.tex + latexmk -c test.tex diff --git a/tests/wip/exercises/test.tex b/tests/wip/exercises/test.tex new file mode 100644 index 0000000..16b76cd --- /dev/null +++ b/tests/wip/exercises/test.tex @@ -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} diff --git a/tests/wip/exercises/test.toc b/tests/wip/exercises/test.toc new file mode 100644 index 0000000..ac51e5c --- /dev/null +++ b/tests/wip/exercises/test.toc @@ -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}%