texlive[71063] Master: exercisesheets (24apr24)

commits+karl at tug.org commits+karl at tug.org
Wed Apr 24 22:20:13 CEST 2024


Revision: 71063
          https://tug.org/svn/texlive?view=revision&revision=71063
Author:   karl
Date:     2024-04-24 22:20:13 +0200 (Wed, 24 Apr 2024)
Log Message:
-----------
exercisesheets (24apr24)

Modified Paths:
--------------
    trunk/Master/tlpkg/bin/tlpkg-ctan-check
    trunk/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc

Added Paths:
-----------
    trunk/Master/texmf-dist/doc/latex/exercisesheets/
    trunk/Master/texmf-dist/doc/latex/exercisesheets/README
    trunk/Master/texmf-dist/doc/latex/exercisesheets/examples/
    trunk/Master/texmf-dist/doc/latex/exercisesheets/examples/exercises/
    trunk/Master/texmf-dist/doc/latex/exercisesheets/examples/exercises/exshexample-ex1.tex
    trunk/Master/texmf-dist/doc/latex/exercisesheets/examples/exercises/exshexample-ex2.lua
    trunk/Master/texmf-dist/doc/latex/exercisesheets/examples/exshexample-embedded.tex
    trunk/Master/texmf-dist/doc/latex/exercisesheets/examples/exshexample.tex
    trunk/Master/texmf-dist/doc/latex/exercisesheets/exercisesheets-doc.pdf
    trunk/Master/texmf-dist/doc/latex/exercisesheets/exercisesheets-doc.tex
    trunk/Master/texmf-dist/tex/latex/exercisesheets/
    trunk/Master/texmf-dist/tex/latex/exercisesheets/exercisesheets.sty
    trunk/Master/tlpkg/tlpsrc/exercisesheets.tlpsrc

Added: trunk/Master/texmf-dist/doc/latex/exercisesheets/README
===================================================================
--- trunk/Master/texmf-dist/doc/latex/exercisesheets/README	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/exercisesheets/README	2024-04-24 20:20:13 UTC (rev 71063)
@@ -0,0 +1,17 @@
+The exercisesheets package
+
+The exercisesheets package provides a way to typeset exercise sheets as used in
+university courses. It evolved from a set of macros an environments that were
+finally combined into this package.
+
+Copyright (c) 2008-2024 Sebastian Kuhnert, Frank Fuhlbrück
+Licence: LPPL 1.3c or later
+Current Maintainer: Frank Fuhlbrück
+
+Files belonging to this package:
+exercisesheets.sty      The package itself
+exercisesheets-doc.tex  Documentation source
+exsh_lexercise.lua      Helper file for internal lua code
+README                  This file
+examples                Folder with example tex files
+examples/exercises      Example exercise used by example tex files


Property changes on: trunk/Master/texmf-dist/doc/latex/exercisesheets/README
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/exercisesheets/examples/exercises/exshexample-ex1.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/exercisesheets/examples/exercises/exshexample-ex1.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/exercisesheets/examples/exercises/exshexample-ex1.tex	2024-04-24 20:20:13 UTC (rev 71063)
@@ -0,0 +1,9 @@
+\begin{exercise}
+  Include an exercise from an external file.
+  \begin{solution}[framed]
+    I just did this.
+    \pause
+    And this, too.
+  \end{solution}
+\end{exercise}
+


Property changes on: trunk/Master/texmf-dist/doc/latex/exercisesheets/examples/exercises/exshexample-ex1.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/exercisesheets/examples/exercises/exshexample-ex2.lua
===================================================================
--- trunk/Master/texmf-dist/doc/latex/exercisesheets/examples/exercises/exshexample-ex2.lua	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/exercisesheets/examples/exercises/exshexample-ex2.lua	2024-04-24 20:20:13 UTC (rev 71063)
@@ -0,0 +1,7 @@
+return exercise {
+  task = [[Include an exercise via the Lua interface.]],
+  solution=[[
+    I think this worked.
+  ]],
+}
+


Property changes on: trunk/Master/texmf-dist/doc/latex/exercisesheets/examples/exercises/exshexample-ex2.lua
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/exercisesheets/examples/exshexample-embedded.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/exercisesheets/examples/exshexample-embedded.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/exercisesheets/examples/exshexample-embedded.tex	2024-04-24 20:20:13 UTC (rev 71063)
@@ -0,0 +1,116 @@
+\documentclass[aspectratio=169]{beamer}
+\usetheme{Berlin}
+\usefonttheme{professionalfonts}
+\useoutertheme{infolines}
+\useinnertheme{rounded}
+\setbeamertemplate{itemize items}[circle]
+\setbeamertemplate{enumerate items}[circle]
+\setbeamertemplate{sections/subsections in toc}[circle]
+\setbeamercolor{item projected}{bg=black}
+\setbeamercolor{item}{fg=black}
+\setbeamertemplate{navigation symbols}{}
+
+\setbeamertemplate{footline}[frame number]
+
+\setbeamercolor{block title}{bg=black}
+\setbeamercolor{section in toc}{fg=red,bg=white}
+
+\AtBeginSection[]{
+\begin{frame}
+\begin{block}{Overview}
+\tableofcontents[sectionstyle=show/shaded,subsectionstyle=hide/hide/hide]
+\end{block}
+\end{frame}
+}
+
+\AtBeginSubsection[]{
+\begin{frame}[allowframebreaks]
+\begin{block}{Overview}
+\tableofcontents[sectionstyle=show/hide,subsectionstyle=show/shaded/hide]
+\end{block}
+\end{frame}
+}
+
+
+\author{Example Author}
+\title{Embedding Exercises}
+\subtitle{a never-ending journey}
+\makeatletter
+\date{compilation date: \the\year-\two at digits{\the\month}-\two at digits{\the\day}}
+\makeatother
+
+
+
+\newenvironment<>{stlist}[1][]{%
+  \setbeamertemplate{enumerate items}{\alph{enumi})}
+  \setbeamertemplate{enumerate subitem}{\arabic{enumii}.}
+  \setbeamertemplate{enumerate subsubitem}{\arabic{enumii}.}
+  \begin{enumerate}[#1]
+}{\end{enumerate}}
+
+%embedded already sets a lot of values, see documentation
+%in non-embedded mode, exercisesheets clears beamers headline
+%and footline if non of the beamerwith...line arguments are used.
+\usepackage[embedded]{exercisesheets}
+\makeatletter
+\exshset{
+  strings/sheet={Missions},
+  exercisespath=exercises,
+  subtask environment=stlist,
+  task restate font={\color{gray}},
+  imp/.style={pointsinfo=important},
+  vi/.style={pointsinfo=very important},
+}
+\makeatother
+
+\parindent 0pt
+\setlength{\parskip}{\baselineskip}
+
+
+
+\begin{document}
+\begin{frame}
+\maketitle
+\end{frame}
+
+\section{Introduction}
+
+\begin{frame}
+  Let me tell you everything \pause\textbf{about embedding exercises}.
+\end{frame}
+
+\section{Examples}
+
+\subsection{without a sheet environment}
+
+  \begin{frame}
+    \begin{block}{}
+      Since our exercises are already in a dedicated subsection,\pause
+      we do not need an extra sheet environment.
+    \end{block}
+  \end{frame}
+
+  \includeexercise*[imp]{exshexample-ex1}
+  \includeLexercise*[vi]{exshexample-ex2}
+
+\subsection{with a sheet environment}
+
+\begin{sheet}[note={The exercises are within a separated sheet
+  environment.}]
+  \includeexercise*[imp,solutions]{exshexample-ex1}
+\end{sheet}
+
+\begingroup
+\def\sheetfancy[#1]#2{\textcolor{red}{#2}}%nope, nothing happens
+\exshset{sheet sectioning cmd=\sheetfancy}
+
+\begin{sheet}[note={This sheet header looks exactly like the first one, because \texttt{sheet sectioning cmd} is only used for
+non-beamer documents.}]
+  \includeLexercise*[imp,solutions]{exshexample-ex2}
+\end{sheet}
+\endgroup
+
+
+\end{document}
+
+


Property changes on: trunk/Master/texmf-dist/doc/latex/exercisesheets/examples/exshexample-embedded.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/exercisesheets/examples/exshexample.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/exercisesheets/examples/exshexample.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/exercisesheets/examples/exshexample.tex	2024-04-24 20:20:13 UTC (rev 71063)
@@ -0,0 +1,286 @@
+\long\def\ifbeamer#1#2{#2}
+\ifbeamer{\documentclass{beamer}}{\documentclass[a5paper]{article}}
+
+%navigation symbols and the title collide if
+%beamerwithheadline is set
+\ifbeamer{
+  \setbeamertemplate{navigation symbols}{}
+}{}
+
+%patchenumerate is the deafault
+\usepackage[patchenumerate=true,beamerwithheadline,
+  %when directly messing with page breaks
+  %and the sheet start page actio (as we do below)
+  %using exercisesheets' page numer redefinitions per
+  %sheet do not make much sense
+  patchpagenumbers=false,
+  beamerwithfootline,
+  beamercompatibility,
+  exercisespath=exercises]%
+  {exercisesheets}
+\usepackage{varioref}
+\usepackage{hyperref}
+\usepackage{xcolor}
+
+\exshset{solutions=true,
+task restate font={\color{black!60}},
+only={1-3,5-},
+}
+
+%solutions may be printed out on paper -> a4
+%exercises are read on (smartphone) screen -> a5
+\ifsolutions{
+  \usepackage[left=1cm,right=1cm,top=1cm,bottom=1.5cm,a4paper]{geometry}
+  }{
+  \usepackage[left=0.7cm,right=0.7cm,top=1cm,bottom=1.5cm]{geometry}
+}
+
+%Usually the person responsible for the entire course:
+\author{Exampleauthor}
+\date{Example term/semester}
+\title{Introduction to Exercise Sheets Creation}
+\subject{Introduction to Exercise Sheets Creation}
+%Only used for beamer at the moment:
+\exshset{exauthor={Author of exercises}}
+
+\ifbeamer{\exshset{beameruseblocks=false}}{}
+
+
+
+
+
+\begin{document}
+
+%1
+\begin{sheet}[note={Learn how to create nice exercise sheets.},
+  date={Novanuar 42, -2022},title={First Sheet}]
+
+  \includeexercise*{exshexample-ex1}
+  \includeLexercise*{exshexample-ex2}
+
+  \begin{exercise}[points={many, many},firstline={Read the manual.}]
+  \end{exercise}
+
+  \begin{exercise}[points={sum},firstline={After you read the manual:}]
+    Play around with this example. You might want to read further manuals like:
+    \begin{enumerate}
+      %pointsfloatright should be usually set globally
+      \item\points[pointsfloatright]{2}pgf (for pgfkeys)
+      \item enumitem and similar \points[abbrev,bonus]{1}
+      \begin{enumerate}
+        \item paralist \thesubex
+        \item
+          \begin{enumerate}
+            \item varioref
+          \end{enumerate}
+      \end{enumerate}
+      \item all the others \points[inplace]{3} (why not?)
+      \label{subex:man2}
+    \end{enumerate}
+  \end{exercise}
+\end{sheet}
+
+\begingroup
+\ifbeamer{}{
+  \exshset{
+    %default is \clearpage
+    sheet start page action={\pagebreak[3]\hrule},
+    sheet end page action={\vspace{4mm}\hrule\vspace{2cm}},
+  }
+}
+
+%2
+\begin{sheet}[date={Novanuar 35, -2022}]
+  \begin{exercise}[points={many, many},
+    firstline={Read the manual.}]
+  \end{exercise}
+  \begin{solution}[framed,fragile]
+    Oh no, it's quite long.
+    \newframe
+    Really long, but please \verb|\relax|.
+    Ok, but my brain feels like:
+    \begin{verbatim}
+%
+ x
+	$	t
+&
+
+
+\
+#
+    \end{verbatim}
+    And yours?
+  \end{solution}
+\end{sheet}
+
+%3
+\begin{sheet}[date={Novanuar 28, -2022},title={Third Sheet},
+  number within sheet]
+  \begin{exercise}[points={many, many},
+    firstline={Read the manual.}]
+    \begin{solution}
+      OK, done.
+      \newpage
+      still done.
+    \end{solution}
+  \end{exercise}
+\end{sheet}
+
+\endgroup
+
+%4
+\begin{sheet}
+  \begin{Lexercise}
+    task  = [[
+      This exercise will be skipped.
+    ]],
+  \end{Lexercise}
+  \begin{Lexercise}
+    task  = [[
+      \label{ex:skiplex}%
+      This exercise will be skipped, but it has a reference.
+    ]],
+    subexercises = {[[\label{subex:skiplexOne} first]]},
+  \end{Lexercise}
+  \begin{exercise}[points={many, many},%savetasks,
+    main task font={\tiny},subtask font={\itshape}
+  ]
+    \begin{maintask}
+      \label{ex:skipex} This exercise will be skipped.
+      Furt
+    \end{maintask}
+    \begin{subtasks}
+      \item {first \label{subex:skipexOneOne}} This is an \string\item\space inside a subtasks environment. If
+      \verb|subtask environment| is set to enumerate/itemize etc.,
+      this works with some caveats (font settings for substaks are not used).
+      \subtask{second}
+    \end{subtasks}
+    \begin{enumerate}
+      \setcounter{enumi}{2}
+      \subtask {first \label{subex:skipexOne}}
+      This is a \string\subtask{} without the susbtasks
+      environment, which is unsupported and a bad example!
+      \item {\label{subex:skipexTwo}} {12345}
+    \end{enumerate}
+  \end{exercise}
+\end{sheet}
+
+%5
+\begin{sheet}[date={Novanuar 21, -2022}]
+  \begin{exercise}[points={many, many},
+    firstline={Read the manual.}]
+    \begin{solution}[framed]
+      OK, done (again).
+      \newframe
+      Otherwise, I wouldn't know  \textbackslash newframe now which
+      does not exist in beamer.
+    \end{solution}
+  \end{exercise}
+
+  Loading varioref enables you to refer to sub-exercises, like
+  this: Did you do \ref{subex:man2}? It is the subexercise
+  \subexnref{subex:man2} and has label \subexlref{subex:man2}.
+
+
+  \begin{exercise}[points={many, many},
+  firstline={Play around with the options.}]
+    Some exercise, there are far too few.
+    \begin{solution}[defersolutiontitle]
+      \begin{frame}
+        This is a dual-use solution with explicit
+        beamer frames (and no framed).
+        \solutiontitle
+        Note, that we can freely place the title, because of
+        defersolutiontitle.
+      \end{frame}
+    \end{solution}
+  \end{exercise}
+
+  \begin{exercise}[points={many, many},beamersolution,
+  firstline={Play around with the options.}]
+    \begin{solution}
+      This solution is only shown if using the non-beamer version, because the option beamersolution was used. Otherwise both
+      solutions would be shown. You can set
+      the option beamersolution for individual (normal) solutions
+      to ignore some but not all solutions of an exercise.
+    \end{solution}
+    \begin{beamersolution}[defersolutiontitle]
+      \begin{frame}[t]
+      \solutiontitle
+      This beamersolution is only shown if using the beamer
+      version.
+      \end{frame}
+    \end{beamersolution}
+  \end{exercise}
+
+
+
+  \begin{exercise}[points={many, many},savetasks,
+    main task font={\tiny},subtask font={\itshape}
+  ]
+    \begin{maintask}
+      The exercise task can be saved and restated.
+    \end{maintask}
+    \begin{subtasks}
+      \subtask{first}
+      \begin{solution}[framed]
+        None (yet).
+      \end{solution}
+      \subtask{second}
+    \end{subtasks}
+    I forgot all the tasks!
+    \restatetask
+    Yeah, but what about the subtasks? I forgot the \restatetask[1] and the \restatetask[2] one. Or did I?
+  \end{exercise}
+
+  \begin{Lexercise}
+    --use [[]] if you need \ or escape it: "\\"
+    firstline = [[Assume $\pi=4$.]],
+    points=10,
+    name="Pragmatic",
+    options=[[main task font={\itshape}]],
+    task  = [[
+      This is the main task specified via the Lua
+      interface, like subexercise \ref{subex:skiplexOne} in \ref{ex:skiplex}, whereas \ref{subex:skipexOne}
+      and \ref{subex:skipexTwo} in
+      \ref{ex:skipex} use the \LaTeX~interface.
+    ]],
+    solution=[[
+      This is a solution for the main task.
+    ]],
+    altsolutions={
+      {
+        name="Alternative Solution",
+        text="This is also a solution."
+      },{
+        idea=true,
+        text="This is also a solution."
+      }
+    },
+  \end{Lexercise}
+
+  \begin{Lexercise}
+    firstline = "Assume $e=3$.",
+    points="sum",
+    task  = [[
+      This exercise has some subexercises. The Lua interface
+      computes point sums in a single pass.
+    ]],
+    subexercises = {
+      {
+        task = "First things first.",
+        bonuspoints = 4,
+        pointoptions = "abbrev",--passed to LaTeX interface
+        solution = [[None.]],
+      },{
+        task = "Second things afterwards.",
+        points = 16,
+        altsolutions = { [[None.]],[[Yet.]] },
+      }
+    }
+  \end{Lexercise}
+
+\end{sheet}
+
+\end{document}
+


Property changes on: trunk/Master/texmf-dist/doc/latex/exercisesheets/examples/exshexample.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/exercisesheets/exercisesheets-doc.pdf
===================================================================
(Binary files differ)

Index: trunk/Master/texmf-dist/doc/latex/exercisesheets/exercisesheets-doc.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/exercisesheets/exercisesheets-doc.pdf	2024-04-24 20:19:11 UTC (rev 71062)
+++ trunk/Master/texmf-dist/doc/latex/exercisesheets/exercisesheets-doc.pdf	2024-04-24 20:20:13 UTC (rev 71063)

Property changes on: trunk/Master/texmf-dist/doc/latex/exercisesheets/exercisesheets-doc.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/exercisesheets/exercisesheets-doc.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/exercisesheets/exercisesheets-doc.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/exercisesheets/exercisesheets-doc.tex	2024-04-24 20:20:13 UTC (rev 71063)
@@ -0,0 +1,1086 @@
+%% exercisesheets.tex
+%% Copyright 2008-2024 Sebastian Kuhnert, Frank Fuhlbrück
+%
+% This work may be distributed and/or modified under the conditions
+% of the LaTeX Project Public License, either version 1.3c of this
+% license or (at your option) any later version. The latest version
+% of this license is in https://www.latex-project.org/lppl.txt and
+% version 1.3c or later is part of all distributions of LaTeX
+% version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status `maintained'.
+%
+% The Current Maintainer of this work is Frank Fuhlbrück.
+%
+% This work consists of the files listed in README.
+
+\documentclass[DIV12,BCOR0mm]{scrartcl}
+
+\usepackage{arev}
+\usepackage[T1]{fontenc}
+\usepackage[utf8]{inputenc}
+\usepackage[activate]{microtype}
+\usepackage{csquotes}
+\usepackage{xspace}
+\usepackage{xcolor}
+\usepackage{calc}
+\usepackage{listings}
+\lstloadlanguages{TeX}
+\lstset{%
+  language=[LaTeX]TeX,
+  basicstyle=\ttfamily\color{blue!50!black},
+  texcs={def,let,renewcommand,long,begin,end,usepackage,ifdef},
+  texcsstyle=\color{blue!60!gray},
+  keywordstyle=\bfseries,
+  keywords={
+    beamersolution,
+    exshset,
+    exercise,
+    hint,
+    includeexercise,
+    inexlabel,
+    ifnonoralsolutions,
+    iforalsolutions,
+    ifsamplesolutions,
+    ifsolutions,
+    Lexercise,
+    loadexercise,
+    maintask,
+    newframe,
+    points,
+    restatetask,
+    restatetaskbeamer,
+    sheet,
+    solution,
+    subexnref,
+    subexlref,
+    subtask,
+    subtasks,
+    TODO,
+  },
+  keywordstyle=[2]\optionstyle,
+  keywords=[2]{
+    bonus,
+    firstline,
+    framed,
+    inplace,
+    name,
+    only,
+    optional,
+    options,
+    oral,
+    strings,
+    solutionsby,
+  },
+  identifierstyle=,%{}\color{red!60!gray},
+  texcl,
+  commentstyle=\itshape,
+  showstringspaces=false,
+  breaklines,
+  breakatwhitespace,
+  columns=flexible,
+  escapeinside={(*}{*)},
+  mathescape=false,
+}
+
+\usepackage[pdfusetitle,colorlinks]{hyperref}
+
+\newcommand{\exsh}{\texttt{exercisesheets}\xspace}
+
+\newcommand{\param}[1]{$\langle${\normalfont\itshape #1\/}$\rangle$}
+\newcommand{\maybe}[1]{\textcolor{green!50!black}{#1}}
+\newcommand{\mand}[1]{\textcolor{blue!50!black}{#1}}
+\newcommand{\codestyle}{\normalfont\ttfamily\color{blue!50!black}}
+\newcommand{\optionstyle}{\normalfont\ttfamily\color{red!50!black}}
+\newcommand{\option}[1]{{\optionstyle #1}}
+\newcommand{\optitem}[1][]{\item[{\codestyle #1}]}
+\newcommand{\vers}[1]{{\normalfont\ttfamily\color{black!90} #1}}
+\newcommand{\versitem}[1][]{\item[v. \vers{#1}]}
+\newcommand{\filename}[1]{{\normalfont\ttfamily\color{magenta!80!black}#1}}
+\newcommand{\binary}[1]{{\normalfont\ttfamily\color{yellow!50!black}#1}}
+\newcommand{\luadisp}[1]{{\normalfont\ttfamily\color{cyan!50!black}#1}}
+
+\usepackage[english,iso]{isodate}
+\title{The \exsh Package}
+\author{Sebastian Kuhnert\and Frank Fuhlbrück}
+\date{Version 0.17, \printdateTeX{2024/04/23}}
+
+\begin{document}
+\maketitle
+
+The \exsh package provides a way to typeset exercise sheets as used in university courses and school classes. It evolved from a set of macros an environments that were finally combined into this package. Starting from Version \vers{0.7}, there was an alternative variant designed for use with the beamer class, which is integrated into the main package since version \vers{0.11}. Not all combinations of options have been tested with the beamer variant. From version \vers{0.16} on, there is an embedded mode that allows using exercise in lecture notes etc. without requiring page breaks. Since the package includes a loading mechanism for exercises in external files, the same exercises can be reused in different contexts.
+
+
+\subsection*{Licence}
+Copyright \textcopyright{} 2008--2024 Sebastian Kuhnert and Frank Fuhlbrück.
+Permission is granted to copy, distribute and/or modify this software under the
+terms of the \LaTeX{} Project Public Licence, version 1.3c or later. This
+package is maintained, the Current Maintainer is
+Frank Fuhlbrück
+\footnote{\href{mailto:frank at fuhlbrueck.net}{frank at fuhlbrueck.net}}.
+
+
+\section{Reading this Document}
+
+\begin{itemize}
+  \item All macros and environments defined by this package are
+    printed in bold like this: \lstinline|\points| and
+    \lstinline|\begin{sheet}\end{sheet}|.
+  \item Key-value style options with a mandatory argument are
+    printed like this: {\codestyle \option{only}=\param{list of ranges}}, while optional (usually boolean) arguments
+    look like this: {\codestyle \option{embedded}\maybe{=\param{true/false}}}.
+\end{itemize}
+
+
+
+
+\section{Related Classes and Packages}
+
+\subsection{Packages with Similar Functionality}
+\begin{itemize}
+ \item The \texttt{exercise} package offers similar functionality, though the
+  concept is a bit different: That package provides explicit commands for
+  sub-exercises while \exsh (in its standard setting)
+  relies on other means like the \texttt{enumerate}
+  environment for this. An advantage of the \texttt{exercise} package is that
+  answers can be delayed. On the other hand \exsh's environment based user
+  interface is a bit cleaner and you have to care less about package internals.
+  \item The \texttt{xsim} (and its predecessor \texttt{exsheets}) package also offers a similar set of features for the average user. It also has a mechanism for hiding certain exercises and solutions that works a bit differently than the mechanism of
+  this package. There is (to my knowledge) no explicit beamer support.
+\end{itemize}
+
+\subsection{Recommended Additional Packages}
+\begin{itemize}
+ \item The use of \texttt{hyperref} is encouraged. Please use the options
+  \texttt{pdfusetitle}, \texttt{plainpages=false} and \texttt{pdfpagelabels} for
+  optimal results.
+ \item If the \texttt{babel} package is loaded, the appropriate
+  \option{language=\param{lang}}-option is automatically derived and can be
+  omitted.
+ \item The use of \texttt{enumitem} or \texttt{paralist} is recommended. Top
+  level enumerating lists are then modified to have the form (a), (b), \dots{},
+  which is useful in exercise definitions (you can override this).
+ \item If the \texttt{varioref} package is used, appropriate label formats are
+  installed for exercises and sub-exercises.
+ \item If the \texttt{xcolor} package is loaded, to-do markers generated with
+  \lstinline|\TODO| are printed in red.
+\end{itemize}
+
+\subsection{Packages Loaded by \exsh}
+\begin{itemize}
+ \item \texttt{etoolbox} (at least version
+  1.7)
+ \item \texttt{scrlfile} (part of \KOMAScript{})
+ \item \texttt{pgfkeys} (part of PGF 2.0)
+ \item \texttt{ifthen}
+ \item \texttt{amsmath} (for \lstinline|\numberwithin|)
+ \item \texttt{iflualatex}
+ \item \texttt{refcount} (for \lstinline|\getrefnumber|)
+\end{itemize}
+
+
+\section{Basic Usage}
+
+\subsection{Package Loading}
+The beamer variant is integrated now and automatically activated
+if the current document class is beamer.
+
+\begin{lstlisting}
+\usepackage(*\maybe{[\param{options}]}*){exercisesheets}
+\end{lstlisting}
+
+The following options are available:
+\begin{description}
+ \optitem[{\option{only}=\mand{\param{list of ranges}}}] When given, only the mentioned
+  sheets will be included in the output. This is useful to speed up compilation
+  times for big documents. Some efforts are made that sheet and exercise
+  numbering remain consistent and references to exercises and enumerated lists
+  on skipped sheets still work as expected. References to other objects are
+  broken though (they currently point to the exercise or item containing them).
+  The \param{list of ranges} is a comma separated list of sheet numbers and
+  sheet ranges. If a comma is included in the range, it has to be protected with
+  a pair of braces. The special sheet \enquote{number} \texttt{last} stands for
+  the last sheet in the document (this may require an additional \LaTeX{} run).
+  Examples:
+  \begin{description}
+   \optitem[{\option{only}=3}] Only include the 3rd sheet of the document.
+   \optitem[{\option{only}=\{1,3,5,7\}}] Only include the sheets 1, 3, 5 and 7.
+   \optitem[{\option{only}=last}] Only include the last sheet of the document.
+   \optitem[{\option{only}=\{3-5,8-last\}}] Exclude the sheets 1, 2, 6 and 7.
+   \optitem[{\option{only}=\{-2,5-\}}] Exclude the sheets 3 and 4.
+  \end{description}
+ \optitem[{\option{all}}] Typeset all sheets (equivalent to \option{only=-}). This is
+  the default.
+ \optitem[{\option{solutions\maybe{=\param{true/false/oral/nonoral/sample oral/sample nonoral/sample all}}}}] By default,
+  solutions (provided in the \texttt{solution} environment) are not included in
+  the output. By providing the option \option{solutions=true} (or just
+  \option{solutions}) this can be changed. Choosing \option{solutions=oral}
+  shows only solutions for exercises marked \option{oral} (useful for printouts
+  taken to class). Choosing \option{solutions=nonoral} shows only solutions for
+  exercises that are not marked \option{oral} (useful for correcting).
+  If you want to provided sample solutions for your students but only for some
+  of your exercises you can use the \texttt{sample} key to select those
+  exercises along with any options starting with sample here.
+  Note that non-sample exercises are skipped completely (not only their solutions) if you
+  choose an option starting with sample.
+ \optitem[{\option{gradingguides\maybe{=\param{true/false}}}}]
+  Within \texttt{gradingguide} environments (usually used inside \texttt{solution}) you can
+  specify e.g. the amount of points to assign for certain solutions. This option
+  controls whether or not to include this guides in the output (e.g. solutions for
+  correcting contain them, but sample solutions for students don't).
+ \optitem[{\option{solutionsby}=\mand{\param{name/names}}}] Use this to give the authors of the
+  solutions. They are credited at the beginning of each sheet, if the solutions
+  are included in the output.
+ \optitem[{\option{language}=\mand{\param{lang}}}] Set the language of the sheet and
+  exercise heads to \param{lang}. If the \texttt{babel} package is loaded this
+  is not necessary, as the main document language will be automatically
+  detected. Currently \option{english}, \option{german} and \option{ngerman} are
+  supported. Other translations are welcome: Please contact the author.
+ \optitem[{\option{pointsfloatright}}] Use an alternative mechanism to place points for Sub-Exercises.
+  If this option is used, the points label for a Sub-Exercise is placed at the (right) end of the current line.
+  It is especially useful if used in a context like \texttt{$\backslash$item$\backslash$points$\{3\}$}.
+  This option exploits (and partially breaks) RTL-Support.
+ \optitem[{\option{exercisespath}}] Set the (relative) path of the
+  directory containing exercises to be included via
+  \lstinline|\includeexercise|.
+ \optitem[{\option{patchenumerate}\maybe{=\param{true/false}}}] Sets
+  enumerate item labels for the first four levels, starting with
+  a), b) etc. for the top-level (sub-exercises). Depending on other
+  loaded packages (\lstinline|enumitem|, \lstinline|paralist|) the mechanism
+  slightly differs. This option is active by default.
+ \optitem[{\option{settitle}\maybe{=\param{true/false}}}] If set to true
+  (which is the default),
+  the document \lstinline|\title| will be automatically set to the value
+  of \option{strings/sheets} and the value of \option{strings/solutions} will be
+  appended if \option{solutions} is not \lstinline|false|.
+ \optitem[{\option{patchpagenumbers}\maybe{=\param{true/false}}}] If true
+  (default), pages will be numbered within sheets and page numbers
+  get a prefix of the form ``{\codestyle\param{sheet number}-}''.
+ \optitem[{\option{usestartsection}\maybe{=\param{true/false}}}] If true
+  (default), the command \lstinline|\@startsection| is used to create
+  the header of any exercise as a section, which (among other
+  things) adds an entry to the TOC (if existent) at level 1
+  (usually corresponding to \lstinline|\section|).
+ \optitem[{\option{embedded}\maybe{=\param{true/false}}}] Default: false.
+  Embedded mode allows for exercise ``sheets'' which do not
+  interfere with a surrounding document. More explicitly, it does
+  not interfere with \lstinline|secnumdepth|, defines special counters
+  \lstinline|exshsheet| and \lstinline|exshexercise| to use them for
+  \option{sheet counter} and \option{exercise counter},
+  respectively and sets all of \option{patchenumerate},
+  \option{settitle}, \option{patchpagenumbers} and
+  \option{usestartsection} to \lstinline|false|.
+  An internally defined macro which basically does no extra
+  formatting or adding anything to the TOC is used as
+  \option{sheet sectioning cmd} instead of the usual \lstinline|\part|.
+  Finally,
+  the \option{sheet start page action} and the
+  \option{sheet end page action} are both set to \lstinline|\relax|.
+  If you want to override any of this, do it after setting
+  \option{embedded} to \lstinline|true|.
+ \item{\option{minskips\maybe{=\param{true/false}}}} Default: false.
+  If true, the values of
+  \option{above sheet title skip},
+  \option{below sheet header skip},
+  \option{above first exercise skip} and
+  \option{below exercise title skip} are all set to 0pt.
+ \optitem[{\option{showtodos} / \option{hidetodos}}]
+  \lstinline|\TODO| markers
+  are hidden by default, this option switches their behavior. This
+  option is usually set within \lstinline|\ifsamplesolutions| or
+  similar.
+ \optitem[{\option{beamercompatibility}\maybe{=\param{true/false}}}]
+  This option (which only is effective in the non-beamer version)
+  defines several beamer macros with as trivial
+  effects as possible, e.g., \lstinline|\pause| becomes \lstinline|\relax|
+  and overlay specifications are mostly ignored. Be careful to use
+  this option after loading \lstinline|enumitem| etc. as the enumerate
+  and itemize environment are defined to swallow overlay
+  specifications without effect, this also holds for
+  \lstinline|\item<1->|. If you load \lstinline|exercisesheets| before them
+  use \lstinline|\exshset| afterwards.
+  The current list of redefinitions is as
+  follows:
+\begin{lstlisting}
+  \let\pause\relax
+  \def\frame{}
+  \renewcommand{\frame}[1][]{}
+  \let\endframe\relax
+  \def\onslide<##1>{}
+  \def\only<##1>##2{##2}
+  \def\uncover<##1>##2{##2}
+  \def\visible<##1>##2{##2}
+  \def\invisible<##1>##2{##2}
+  \long\def\alt<##1>##2##3{##2}
+  \long\def\temporal<##1>##2##3##4{##3}
+  \let\exsh at origitem\item
+  \def\exsh at ovrlitem<##1>{\exsh at origitem}
+  \def\item{\@ifnextchar<\exsh at ovrlitem\exsh at origitem}
+  \let\exsh at origitemize\itemize
+  \def\exsh at ovrlitemize[##1]{\exsh at origitemize}
+  \def\itemize{\@ifnextchar[\exsh at ovrlitemize\exsh at origitemize}
+  \let\exsh at origenumerate\enumerate
+  \def\exsh at ovrlenumerate[##1]{\exsh at origenumerate}
+  \def\enumerate{%
+    \@ifnextchar[\exsh at ovrlenumerate\exsh at origenumerate}
+\end{lstlisting}
+
+\optitem[{\option{filenameasexercisename}\maybe{=\param{true/false}}}]
+This option (set to false by default) causes
+\lstinline|\includeexercise| to
+set the name of an exercise as the filename (without extension).
+This has two purposes: If you have nice file names you can
+automatically name the exercise. On the other hand this is helpful
+during exercise sheet composition because it shows the name of
+the corresponding file in the compiled file.
+\end{description}
+
+\subsection{Supplying Meta-Data}
+
+The following commands are enhanced (or provided) to set the options controlling
+the sheet headers (see Section~\ref{sec:sheet}):
+\begin{lstlisting}
+\subject{(*\param{subject}*)}
+\author{(*\param{author}*)}
+\date{(*\param{semester}*)}
+\end{lstlisting}
+
+If one of these commands is omitted (and the corresponding option is not used
+either), a warning is issued.
+
+Please do not include a \lstinline|\title| in your document, as \exsh will
+automatically generate an appropriate one (this may require an additional
+\LaTeX{} run). If you want to set the title yourself, set the
+option \option{settitle} to \lstinline|false|.
+
+All this information is included in the PDF meta-data if the \texttt{hyperref}
+package is loaded with the option \texttt{pdfusetitle}.
+
+There is also a related option:
+\begin{description}
+ \optitem[{\option{exauthor}=\mand{\param{list of names}}}] If you want to use the
+ \lstinline|\author| macro for the general author of a course but
+ there are different authors for individual exercises or all
+ exercises in general, you can set this key. Currently only
+ exercisesheets-baemer uses this for the footline, while
+ \option{author} is used for the headline.
+\end{description}
+
+\subsection{Defining Exercise Sheets}
+\label{sec:sheet}
+\begin{lstlisting}
+\begin{sheet}(*\maybe{[\param{options}]}*)
+  (*\param{sheet contents}*)
+\end{sheet}
+\end{lstlisting}
+
+Insert a sheet into the document. This environment can be repeated to combine
+several sheets in a single \LaTeX{} file. For each sheet, a new page is started
+and an appropriate header is generated. The \param{sheet contents} can be
+anything but will usually consist of several \texttt{exercise} environments (see
+Section~\ref{sec:exercises-solutions}).
+
+The following \param{options} are supported:
+\begin{description}
+ \optitem[{\option{date}=\mand{\param{date}}}] Set the date the sheet was/will be issued. This
+  information is included in the sheet header. By default, this information is
+  omitted. See also the \option{semester} option.
+ \optitem[{\option{note}=\mand{\param{note}}}] Include \param{note} in the sheet header.
+  Useful to inform students when the sheet is due. If you want a note consisting
+  of more than one line split at a particular position, use
+  \lstinline|\protect\linebreak|.
+ \optitem[{\option{title}=\mand{\param{title}}}]
+  Directly set the sheet title. When this option is used, different
+  page numbering conventions are used. This is useful to
+  typeset exams (combined with the next option).
+ \optitem[{\option{number within sheet\maybe{=\param{true/false}}}}]
+  Deviate from the usual numbering theme and
+  restart from one for exercises on the sheet. The previous
+  counter value is restored after the sheet, so you can insert
+  a special sheet.
+ \optitem[{\option{author}=\mand{\param{author}}}] Set the author included in the sheet
+  head. By default, the value passed to \lstinline|\author| is used.
+ \optitem[{\option{exauthor}=\mand{\param{exauthor}}}] Only used by the beamer
+ variant, see above.
+ \optitem[{\option{subject}=\mand{\param{subject}}}] Set the subject included in the sheet
+  head. By default, the value passed to \lstinline|\subject| is used.
+ \optitem[{\option{semester}=\mand{\param{semester}}}] Set the semester included in the
+  sheet head. By default, the value passed to \lstinline|\date| is used.
+ \optitem[{\option{beamerwithheadline\maybe{=\param{true/false}}}}] Controls whether a headline with author, subject etc. is shown on beamer slides, similar to the regular sheets. This options is off by default as headlines (and footers) take a considerable amount
+ off space. If you specify the embedded option the current default headers and footers will be used if you omit this option. Otherwise omitting it will imply an empty headline.
+ \optitem[{\option{beamerwithfootline\maybe{=\param{true/false}}}}]
+ The same for the footer.
+ \optitem[{\option{beameruseblocks\maybe{=\param{true/false}}}}]
+ Controls whether the exercise title is shown inside a
+ beamer block (\param{true}) or a simple colorbox
+ (\param{false}, the default). Depending on your style a
+ block might look fancier, but it usually consume more space.
+\end{description}
+
+
+\subsection{Defining Exercises and Solutions}
+\label{sec:exercises-solutions}
+\begin{lstlisting}
+\begin{exercise}(*\maybe{[\param{options}]}*)
+  (*\param{exercise text}*)
+  \begin{solution}(*\maybe{[\param{solution options}]}*)
+    (*\param{solution text}*)
+  \end{solution}
+  \begin{beamersolution}(*\maybe{[\param{solution options}]}*)
+    (*\param{solution text}*)
+  \end{beamersolution}
+\end{exercise}
+\end{lstlisting}
+
+This inserts an exercise into the current document. All
+\lstinline|beamersolution|s are ignored, if the
+\exsh package with any class but beamer, but using beamer
+\exsh also processes
+normal solutions by default (set option \option{beamersolution}
+to turn this off).
+
+The following options are
+supported:
+\begin{description}
+ \optitem[{\option{name}=\mand{\param{text}}}] Use \param{text} as the name of the exercise.
+  Useful for exercises that prove a famous theorem.
+ \optitem[{\option{firstline}=\mand{\param{text}}}] Save some space by text \param{text}
+  behind the exercise title.
+ \optitem[{\option{savetasks\maybe{=\param{true/false}}}}] Saves the main task and each sub task
+  for later use with \lstinline|\restatetask[|%
+  \param{which}], where \param{which} is either \lstinline|main|
+  (default) or the number of a sub task.
+ \optitem[{\option{points}=\mand{\param{number/oral/sum}}}] Assign this
+  exercise \param{number} points. By default, exercises are
+  unlabelled. \param{oral} works the same way as the option
+  \option{oral}. The value \param{sum} displays the sum of all
+  occurrences of \lstinline|\points| within the exercise: Ordinary and
+  bonus points are treated separately. If there are only bonus
+  points, the option \option{bonus} is automatically triggered. To
+  undo this, either delete the \filename{.aux} file or explicitly use
+  \lstinline|\points[bonus=false]{\param{number}}| for at least one
+  subexercise. Points can be summed up also during a single pass
+  by using the Lua interface.
+ \optitem[{\option{oral}}] Label this exercise as \emph{oral}. This supersedes and is
+  superseded by the option \option{points}.
+ \optitem[{\option{pointsinfo}=\mand{\param{text}}}] Supply \param{text} as additional
+  information to be displayed after the points.
+ \optitem[{\option{optional}}] Shortcut for \option{pointsinfo=optional} with
+  automatic translation and abbreviation (if requested).
+ \optitem[{\option{bonus}}] Change \enquote{points} to \enquote{bonus points} (with
+  automatic translation and abbreviation).
+  \optitem[{\option{abbrev}}] Use abbreviated labels.
+ \optitem[{\option{exercisemark}=\mand{\param{symbol}}}] Mark the exercise
+  with \param{symbol} in the left margin.
+ \optitem[{\option{difficult}}] Shortcut for \option{exercisemark=*}.
+ \optitem[{\option{solutions\maybe{=\param{true/false/oral/nonoral/...}}}}] Use this to override the
+  document (or sheet) default.
+ \optitem[{\option{sample}}] Include this exercise (and its solution) in while compiling
+ sample solutions.
+ \optitem[{\option{beamersolution}}] For beamer variant only. If this option
+ is set all normal solutions will not be included and only
+ \lstinline|beamersolution|s are typeset.
+ \optitem[{\option{framed}}] For beamer variant only, simply ignored
+ elsewhere. If this option
+ is set for a normal solution, its content will be put on one or
+ more frames. Use \lstinline|\newframe| to start a new frame. This
+ option is especially helpful if you provide your own definitions
+ of \lstinline|\only| etc. and/or use the \option{beamercompatibility}.
+ for non-beamer compilation. \lstinline|\newframe|
+ is already defined as \lstinline|\relax| in  non-beamer \exsh,
+ even without invoking \option{beamercompatibility}.
+ \optitem[{\option{fragile}}] For beamer variant only and only
+ used combined with framed, simply ignored elsewhere. Frames are
+ declared as \texttt{fragile} und parsing of \lstinline|\newframe|
+ etc. is done via Lua\LaTeX. Thus Lua\LaTeX is required
+ (and this requires font setup via fontspec etc.), but
+ you do not have to use any Lua code yourself. Mostly useful
+ for listings and other verbatim stuff within solutions.
+\end{description}
+
+Solutions are only typeset, if the \option{solutions} option is in effect. There
+can be multiple solution environments within a single exercise environment; this
+is useful if the exercise consists of several sub-exercises. Sub-exercises can
+simply be defined with an \texttt{enumerate} or \texttt{compactenum}
+environment.
+
+\section{Utilities}
+
+\subsection{Loading Excercises From Files}
+\begin{lstlisting}
+\includeexercise(*\param{file name}*)
+\includeexercise*(*\param{file name}*)
+\end{lstlisting}
+
+Both load the exercise from exercisespath/\param{file name}. Note
+that the exercise environment must be contained in the file. The
+starred version is helpful for faster skipping of unused exercises.
+In this case, the file is not opened to search for labels. Whenever
+the exercise is not skipped and you use the starred version and also
+use labels within the exercise file, \exsh outputs an error. This is
+done to ensure that references are not overlooked when the exercise
+is actually skipped later.
+
+\subsection{Including Hints}
+
+\begin{lstlisting}
+\begin{hint}(*\maybe{[\param{options}]}*)
+  (*\param{hint text}*)
+\end{hint}
+\end{lstlisting}
+
+\begin{lstlisting}
+\begin{hint*}(*\maybe{[\param{options}]}*)
+  (*\param{hint text}*)
+\end{hint*}
+\end{lstlisting}
+
+These environments include hints in the exercise definition. The first form
+starts a new paragraph, the second one puts the hint in parenthesis.
+
+\subsection{TODO Markers}
+
+You can use the following to include a red TODO marker in your document. This is
+useful to mark places where work is still in progress. A warning is issued at
+each place. TODO markers can also contain an optional description
+of the task that needs to be done. If you switch off displaying
+TODO markers (s.a.) the warning will be issued nevertheless.
+
+\begin{lstlisting}
+\TODO[what needs to be done]
+\end{lstlisting}
+
+\subsection{Annotating Points for Sub-Exercises}
+\begin{lstlisting}
+\begin{exercise}[(*\option{points}*)=sum]%sum produces 4+6
+  \begin{enumerate}
+   \item Part 1 \points{oral}
+   \item Part 2 \points[optional]{oral}
+   \item Part 3 \points{4}
+   \item Part 4 \points[bonus]{6}
+  \end{enumerate}
+  Sub-Exercises within continuous text can be annotated like this \points[inplace]{3} without adding space.
+\end{exercise}
+\end{lstlisting}
+
+\subsection{Explicitly Stating Tasks}
+In principle, \exsh aims to be very lightweight and there is not
+much mandatory structure inside exercises. Furthermore, the
+\lstinline|enumi| counter is used for sub-exercise. There are, however,
+situations where we want more explicit structure, for instance to
+have special font for the main task or the subtasks or to reuse
+some of the tasks later. This is especially handy if using the
+beamer variant where the original task and a part of the solution might be on different slides. In the future it might be possible to
+use other counters then \lstinline|enumi|, which is also only possible
+if sub-exercises are not simply \lstinline|\item|s in
+\lstinline|enumerate|. If you want to reuse the main or any subtasks
+you may use \lstinline|\restatetask| or \lstinline|\restatetaskbeamer|
+(this shows noting if not compiled with beamer). There is also
+a starred version (\lstinline|\restatetask*| /
+\lstinline|\restatetaskbeamer*|) for each of them, which adds a newline.
+All four have an optional argument that allows to restate
+a subtask instead of the main task. This argument is either
+\lstinline|main|, a number of a \textbf{previous} subtask or
+\lstinline|cur| for the current subtask. Using \option{headerrestate}
+for your solution will automatically restate the current
+task within the beamer solution header (does noting without
+beamer).
+
+
+
+\begin{lstlisting}
+\begin{exercise}[(*\option{points}*)=oral]
+  \begin{maintask}
+    A and B are true.
+  \end{maintask}
+  \begin{subtasks}
+    \subtask{A is true}
+      \begin{solution}[framed]
+        We want to show: \restatetask %A and B are true.
+        \newframe
+        Out first step is to show: \restatetask[cur] %A is true
+      \end{solution}
+    \subtask{If A is true, B is true.}
+      \begin{solution}[framed]
+        Obvious (i.e.: homework).
+      \end{solution}
+    \subtask{B is true}
+      \begin{solution}[framed]
+        We already know: \restatetask[1] and
+        \restatetask[2], therefore B is also true.
+      \end{solution}
+  \end{subtasks}
+\end{exercise}
+\end{lstlisting}
+
+\subsection{Labels and References within an Exercise}
+While the global reference labels set via varioref (if loaded)
+are nice for references to subexercises far away, always mentioning
+the exercise number seems superfluous. Furthermore, for usage in indices etc. you might want to use the arabic representation instead. This is what the commands \lstinline|\subexnref| and
+\lstinline|\subexlref| are designed for. However, both of them still
+require an ordinary label, which is not allowed in
+exercises loaded with \lstinline|\loadexercise*|.
+For this purpose \lstinline|\inexlabel| can be used which is just a
+normal label that is not redefined to produce an error.
+Furthermore, we define a counter \lstinline|subex| (which is
+currently just an alias for enumi, but this might change). You can
+use this counter (alias) with common commands like
+\lstinline|\arabic| or \lstinline|\alph|.
+
+\begin{lstlisting}
+\begin{exercise}
+  \begin{enumerate}
+    \item \inexlabel{subex:xisseven} Let $x_{\thesubex}=7$.
+    \item Compute $x_{\subexnref{subex:xisseven}}+3$.
+    \begin{solution}
+      From \subexlref{subex:xisseven} %(a)
+      we know that $x_{\subexnref{subex:xisseven}}$ is $7$ and
+      thus the sum is $10$.
+    \end{solution}
+  \end{enumerate}
+\end{exercise}
+\end{lstlisting}
+
+
+
+\section{Advanced Usage}
+
+\subsection{Setting Options}
+
+Options can be given at different places.
+\begin{enumerate}
+ \item As local options to one of the environments.
+ \item As package options: This is convenient for global options but suffers
+  from shortcomings in way \LaTeX{} processes options: Macros are expanded and
+  spaces are stripped.
+ \item By the independent \lstinline|\exshset| command. This is especially useful in
+  the preamble to set options that would be garbled by the \LaTeX{} option
+  handling routine. It also allows to change an option for the rest of the
+  current scope.
+\end{enumerate}
+
+Example: Change the solution authors of the following sheets:
+\begin{lstlisting}
+(*\param{some sheets}*)
+\exshset{solutionsby=(*\param{other authors}*)}
+(*\param{more sheets}*)
+\end{lstlisting}
+
+\subsection{Changing Strings}
+
+For some languages, predefined sets of strings are provided and automatically
+activated. If your language is not supported or if you want to change (some of)
+the used strings, you can do so with the following options:
+\begin{description}
+ \optitem[{\option{strings/sheet}=\mand{\param{string}}}]
+ \optitem[{\option{strings/sheets}=\mand{\param{string}}}]
+ \optitem[{\option{strings/solutions}=\mand{\param{string}}}]
+ \optitem[{\option{strings/solutionsby}=\mand{\param{string}}}]
+ \optitem[{\option{strings/exercise}=\mand{\param{string}}}]
+ \optitem[{\option{strings/solution}=\mand{\param{string}}}]
+ \optitem[{\option{strings/hint}=\mand{\param{string}}}]
+ \optitem[{\option{strings/oral}=\mand{\param{string}}}]
+ \optitem[{\option{strings/oral abbrev}=\mand{\param{string}}}]
+ \optitem[{\option{strings/point}=\mand{\param{string}}}]
+ \optitem[{\option{strings/points}=\mand{\param{string}}}]
+ \optitem[{\option{strings/points abbrev}=\mand{\param{string}}}]
+ \optitem[{\option{strings/bonus point}=\mand{\param{string}}}]
+ \optitem[{\option{strings/bonus points}=\mand{\param{string}}}]
+ \optitem[{\option{strings/bonus points abbrev}=\mand{\param{string}}}]
+ \optitem[{\option{strings/optional}=\mand{\param{string}}}]
+ \optitem[{\option{strings/optional abbrev}=\mand{\param{string}}}]
+\end{description}
+
+Example: Give an introduction that should only be included in the version with
+solutions:
+
+\begin{lstlisting}
+\begin{solution}[(*\option{strings/solution}*)=Introduction]
+  (*\param{introduction text}*)
+\end{solution}
+\end{lstlisting}
+
+
+\subsection{Changing Fonts}
+
+The package \exsh comes with its own way to change the used fonts. Each font can
+be changed in the following way:
+\begin{lstlisting}
+\exshset{(*\param{font element}=\param{font specification}*)}
+\end{lstlisting}
+The available \param{font element}s are listed below together with their default
+values:
+\begin{description}
+ \optitem[{\option{sheet header font}}] The basic font for subject, author, semester,
+  date, note and solution authors in the sheet headers.\\
+  Default: \lstinline|\normalfont\normalsize|
+ \optitem[{\option{subject font}}] The font for the subject in the sheet header.\\
+  Default: \lstinline|\scshape|
+ \optitem[{\option{author font}}] The font for the author in the sheet header.\\
+  Default: \lstinline|\scshape|
+ \optitem[{\option{semester font}}] The font for the semester in the sheet header.\\
+  Default: empty, i.\,e.\ no change.
+ \optitem[{\option{date font}}] The font for the date in the sheet header.\\
+  Default: empty, i.\,e.\ no change.
+ \optitem[{\option{solutionsby font}}] The font for the information who has produced
+  the solutions provided below the sheet title.\\
+  Default: \lstinline|\itshape|
+ \optitem[{\option{sheet note font}}] The font for the note provided below the sheet
+  title.\\
+  Default: \lstinline|\itshape\bfseries|
+ \optitem[{\option{sheet title font}}] The font for the sheet title itself.\\
+  Default: \lstinline|\Large\bfseries|
+ \optitem[{\option{exercise title font}}] The font for the exercise title.\\
+  Default: \lstinline|\bfseries|
+ \optitem[{\option{points font}}] The font for the number of points in the exercise
+  head (relative to the exercise title) and for \lstinline|\points|.\\
+  Default: \lstinline|\itshape|
+ \optitem[{\option{main task font}}] The font for the
+  \lstinline|maintask| environment.\\
+  Default: empty, i.\,e.\ no change.
+ \optitem[{\option{subtask font}}] The font for each
+  \lstinline|\subtask|.\\
+  Default: empty, i.\,e.\ no change.
+ \optitem[{\option{task restate font}}] The font used for
+  \lstinline|\restatetask|.\\
+  Default: \lstinline|\itshape|
+ \optitem[{\option{hint font}}] The font for hints. \\
+  Default: empty, i.\,e.\ no change.
+ \optitem[{\option{hint title font}}] The font for the string \enquote{Hint:}.\\
+  Default: \lstinline|\itshape|
+ \optitem[{\option{solution font}}] The font for solutions.\\
+  Default: empty, i.\,e.\ no change.
+ \optitem[{\option{solution title font}}] The font for the string
+  \enquote{Solution:}\\
+  Default: \lstinline|\bfseries|
+ \optitem[{\option{grading guide font}}] The font for grading guides.\\
+  Default: \lstinline|\itshape|
+ \optitem[{\option{todo marker font}}] The font for the string \enquote{TODO}.\\
+  Default: \lstinline|\ifdef{\color}{\color{red}}{}\bfseries|
+\end{description}
+
+\subsection{Controlling the Spacing, Page Handling and Separations between Elements}
+
+The following options allow fine-tuning of the spacing:
+\begin{description}
+ \optitem[{\option{below slide headline skip}=\mand{\param{dimen}}}] The distance between
+ haedline (if present) and slide content. Only used by beamer
+ variant, ignored elsewhere.\\
+  Default: \texttt{0mm}
+ \optitem[{\option{above sheet title skip}=\mand{\param{dimen}}}] The distance between
+  author/date and sheet title.\\
+  Default: \texttt{4ex}
+ \optitem[{\option{above sheet note skip}=\mand{\param{dimen}}}] The distance above the
+  sheet note.\\
+  Default: \texttt{.7ex}
+ \optitem[{\option{above solutionsby skip}=\mand{\param{dimen}}}] The distance above the
+  solution author.\\
+  Default: \texttt{1ex}
+ \optitem[{\option{below sheet header skip}=\mand{\param{dimen}}}] The distance below the
+  sheet header.\\
+  Default: \texttt{4ex plus 1ex minus .5ex}
+ \optitem[{\option{above exercise skip}=\mand{\param{dimen}}}] The distance above
+  exercises.\\
+  Default: \texttt{3ex plus 1ex minus .5ex}
+ \optitem[{\option{below exercise title skip}=\mand{\param{dimen}}}] The distance below
+  exercise titles.\\
+  Default: \texttt{\textbackslash parskip}
+ \optitem[{\option{above solution skip}=\mand{\param{dimen}}}] The distance above
+  solutions.\\
+  Default: \texttt{1ex}
+ \optitem[{\option{above hint skip}=\mand{\param{dimen}}}] The distance above hints.\\
+  Default: \texttt{1ex}
+\end{description}
+
+The following two options control the page handling at the beginning and
+at the end of each sheet:
+\begin{description}
+ \optitem[{\option{sheet start page action}=\mand{\param{macro}}}] Executed at the beginning
+  of each sheet.\\
+  Default: \lstinline|\clearpage|
+ \optitem[{\option{sheet end page action}=\mand{\param{macro}}}] Executed at the end
+  of each sheet.\\
+  Default: \lstinline|\clearpage|
+\end{description}
+
+The following option controls what follows after the string
+\option{strings/solution} within a solution header. Using this, you can disable a solution header completely or, for instance, add
+a horizontal bar below each solution title.
+\begin{description}
+ \optitem[{\option{solution title separator}=\mand{\param{content}}}] Inserted directly after \option{strings/solution} in a solution title:\\
+  Default: \lstinline|:\par|
+\end{description}
+
+\subsection{Controlling the Sectioning (beta)}
+
+By default, exercises are sections and sheets are parts. They use
+the respective counters and commands. This is impractical, if you
+want to include exercise ``sheets'' as, e.g., a subsection within
+a section of a book or article. While the page handling options
+already allow to dismiss page breaks, sectioning commands might
+still break your layout or structure. Since version \vers{0.15} you
+can use your own counters and commands to start sheets and
+(to a certain degree) exercises. Exercises are currently still
+started by \lstinline|\@startsection| with the counter set to
+\option{exercise counter}, but the level set to 1 (e.g. section).
+This will likely change with one of the next versions, but needs
+some testing. Thus, if you use any of these options, watch for
+undesired consequences and report them via gitlab if possible.
+
+\begin{description}
+ \optitem[{\option{sheet sectioning cmd}=\mand{\param{macro}}}] This macro is
+ called only in one place in the following way:
+ \lstinline|\macro[short title]{long title}|, so it
+ must take one argument in [brackets] and one normal argument.\\
+  Default: \lstinline|\part|
+ \optitem[{\option{sheet counter}=\mand{\param{counter}}}] This counter will be
+ incremented wit every sheet. There was always an internal counter
+ \lstinline|sheetid| used to distinguish sheets for hyperref even if
+ \lstinline|part|s value changed. Do not use this counter here, as it will have strange effects (incremented twice).\\
+  Default: \lstinline|part|
+ \optitem[{\option{exercise counter}=\mand{\param{counter}}}] This counter will
+ be incremented wit every exercise (usually within each sheet).
+  Default: \lstinline|section|
+\end{description}
+
+\subsection{Special Code for Solutions}
+\begin{lstlisting}
+\ifsolutions{(*\param{if true}*)}{(*\param{if false}*)}
+\iforalsolutions{(*\param{if true}*)}{(*\param{if false}*)}
+\ifnonoralsolutions{(*\param{if true}*)}{(*\param{if false}*)}
+\ifsamplesolutions{(*\param{if true}*)}{(*\param{if false}*)}
+\end{lstlisting}
+
+There are also special options for conditionals to be used in the arguments of
+the environments defined by this package:
+\begin{description}
+ \item[\option{ifsolutions=\{\param{options if true}\}\{\param{options if
+      false}\}}] Execute \param{options if true} if solutions are included in
+  the current document, \param{options if false} otherwise.
+ \item[\option{iforalsolutions=\{\param{options if true}\}\{\param{options if
+      false}\}}] Execute \param{options if true} if solutions for oral exercises
+  are included in the current document, \param{options if false} otherwise.
+ \item[\option{ifnonoralsolutions=\{\param{options if true}\}\{\param{options if
+      false}\}}] Execute \param{options if true} if solutions for non-oral
+  exercises are included in the current document, \param{options if false}
+  otherwise.
+ \item[\option{ifsamplesolutions=\{\param{options if true}\}\{\param{options if
+      false}\}}] Execute \param{options if true} if sample solutions for marked
+  exercises are included in the current document, \param{options if false}
+  otherwise.
+\end{description}
+
+Example 1: Only include points for sub-exercises when solutions are typeset:
+\begin{lstlisting}
+\ifsolutions{}{\renewcommand{\points}[2][]{}}
+\end{lstlisting}
+
+Example 2: Modify the sheet header spacing in the non-solution version:
+\begin{lstlisting}
+\begin{sheet}[(*\option{ifsolutions}*)={}{(*\option{above title skip}*)=2ex}]% usually 4ex
+  \dots
+\end{sheet}
+\end{lstlisting}
+
+\subsection{Using Hooks}
+There are several hooks used by \exsh:
+\begin{description}
+ \optitem[{\option{every sheet}}] This is used at the beginning of every sheet.
+ \optitem[{\option{every exercise}}] This is used at the beginning of every exercise.
+ \optitem[{\option{every solution}}] This is used at the beginning of every solution.
+ \optitem[{\option{every hint}}] This is used at the beginning of every hint.
+\end{description}
+
+Hooks can be used to influence the behaviour of the respective environments.
+Users of \texttt{tikz} should be familiar with the concept.
+
+\subsection{Control Skipping of Custom Macros in Skipped Exercises}
+\begin{description}
+ \optitem[{\option{custom skip macro}=\mand{\param{macro}}}]
+\end{description}
+
+If an exercise is not printed, some macros like \lstinline|\label{}|
+are processed nevertheless. However, if you define your own macro
+using one of these, then this macro will be completely ignored
+if the exercise containing it is skipped. This option allows to
+define a custom handler for your macros. The most common use
+checks for your custom macros with
+nested \lstinline|\ifstrequal|s and then either
+executes a custom skipper, replaces your macro with
+the standard version or uses \lstinline|\expandafter| to
+deliver the expanded version of your macro to
+\lstinline|\exshskipcontinue|.
+
+Example:
+\begin{lstlisting}
+\def\mylabel#1{...}
+\def\myitem{...}
+\def\myitemtwo{...}
+\def\skipmylabel#1{...\exshskipcontinue}
+\long\def\customskip#1{
+  \ifstrequal{#1}{\mylabel}
+    {\skipmylabel}
+    {\ifstrequal{#1}{\myitem}
+      {\exshskipcontinue\item}
+      {\ifstrequal{#1}{\myitemtwo}
+        {\expandafter\exshskipcontinue\myitemtwo}
+        {\exshskipcontinue}
+      }
+    }
+}
+\exshset{custom skip macro={\customskip}}
+\end{lstlisting}
+
+\section{The Lua Interface}
+\label{sec:lua}
+
+Since version \vers{0.11} there is a Lua interface for the exercise
+environment. This interface will offer roughly the same features.
+Its main purpose will be allowing to reorder sub-exercises more
+easily and to offer more dynamic options for the display of
+solutions (one combined solution or single after each sub-%
+exercise). %TODO finish
+
+\begin{lstlisting}
+\begin{Lexercise}
+  --use [[]] if you need \ or escape it in "": "\\"
+  firstline = [[Assume $\pi=4$.]],
+  points=10,
+  name="Pragmatic",
+  options=[[main task font={\itshape}]],
+  task  = [[
+    This is the main task specified via the Lua
+    interface.
+  ]],
+  solution=[[
+    This is a solution for the main task.
+  ]],
+\end{Lexercise}
+\end{lstlisting}
+
+\section{Usage Tips}
+\label{sec:usage-tips}
+
+\subsection{Seperate Solution File}
+\label{sec:seper-solut-file}
+
+If you do not want to temporarily comment out the \option{solutions} option in
+your main file, say \texttt{exercises.tex}, you can create an additional file
+\texttt{solutions.tex} with the following contents:
+\begin{lstlisting}
+\PassOptionsToPackage{solutions}{exercisesheets}
+\input{exercises.tex}
+\end{lstlisting}
+If you leave out the \option{solutions} option in you main file, running
+\texttt{pdflatex exercises.tex} will create \texttt{exercises.pdf} without
+solutions and \texttt{pdflatex solutions.tex} will create \texttt{solutions.pdf}
+with solutions.
+
+This also works well in combination with a makefile that generates
+\texttt{solutions.tex} as a temporary file.
+
+\subsection{Compatibilty with make4ht and tex4ebook}
+Since version \vers{0.15} this package can be used with make4ht and tex4ebook in non-beamer mode. Some code for the sheet and exercise header already provides a similar alignment as when producing PDF files. If your goal is an exercise (or solution) document within a single HTML file that looks as similar to the PDF as possible, consider \url{https://tex.stackexchange.com/questions/605478/}, \url{https://tex.stackexchange.com/questions/662445} and \url{https://tex.stackexchange.com/questions/630992}.
+
+\section{Changelog}
+\label{sec:changelog}
+
+\begin{itemize}
+    \versitem[0.17:]  2024-04-23
+      \begin{itemize}
+        \item Make embedded mode work better with beamer. This
+        includes not overriding headlines and footlines and
+        incrementing the frame counter for non-frames.
+        \item issue an explicit warning if \string\subtask is outside of a subtasks environment
+        \item clearify documentation and use consistent styling
+        \item additional example for embedding exercises
+      \end{itemize}
+    \versitem[0.16:]  2024-03-07
+      \begin{itemize}
+        \item Embedded mode and most of the additional options it
+        automatically sets.
+      \end{itemize}
+    \versitem[0.15.1:]  2023-12-14
+      \begin{itemize}
+        \item bugfix: beamer support was broken in \vers{0.15} due to
+        a missing macro.
+      \end{itemize}
+    \versitem[0.15:]  2023-11-30
+      \begin{itemize}
+        \item new option \option{solution title separator}
+        (initially set to\lstinline|:\par|). Among other things, this
+        allows for solutions without any caption or header by
+        setting \option{solution title separator},~
+        \option{solution title font} as well as
+        \option{strings/solution} to \lstinline|\relax|.
+        \item initial support for \binary{make4ht} and
+        \binary{tex4ebook} by avoiding certain behavior when these
+        modes are used. Note that both are incompatible with beamer
+        mode.
+        \item initial decoupling of exercise and sheet from
+        sections and parts using the new options (defaults in
+        parenthesis) \option{sheet sectioning cmd} (\lstinline|\part|),
+        \option{sheet counter} (\lstinline|part|) and
+        \option{exercise counter} (\lstinline|section|).
+      \end{itemize}
+    \versitem[0.14:]  2023-02-06
+      \begin{itemize}
+        \item new option \option{headerrestate} to restate
+        the current (if in subexercise) or main task within
+        a solutions header
+        \item bugfix: \lstinline|\restatetask| etc. give meaningful error if \option{savetasks} is not set.
+      \end{itemize}
+    \versitem[0.13.1:]  2022-11-22
+      \begin{itemize}
+        \item bugfix: \lstinline|\detokenize| filenames when
+          \option{filenameasexercisename} is active as otherwise,
+          e.g., underscores would not be allowed in filenames.
+      \end{itemize}
+    \versitem[0.12.2:]  2022-10-20
+    \versitem[0.13:]  2022-11-07
+      \begin{itemize}
+        \item bugfix: \lstinline|\begingroup| and \lstinline|\endgroup|
+          within \lstinline|\subtask| now contain everything up to the
+          next \lstinline|\subtask|.
+        \item \lstinline|\restatetask| has now a starred version that
+          adds a newline and beamer versions for both the
+          regular and the starred version. Furthermore, there
+          is an argument \option{cur} to restate the current
+          subtask (the one just given before). This is only
+          defined within the aforementioned group, i.e.,
+          throws an error after \lstinline|\end{subtasks}|.
+      \end{itemize}
+    \versitem[0.12.2:]  2022-10-20
+      \begin{itemize}
+        \item bugfix: \luadisp{dofile} with
+        \luadisp{kpse.find\_file}
+        \item docs: document option \option{fragile}
+      \end{itemize}
+  \versitem[0.12.1:]  2022-10-19
+      \begin{itemize}
+        \item bugfix for \lstinline|\begin{enumerate}[<+->]|
+      \end{itemize}
+  \versitem[0.12:]  2022-09-02
+      \begin{itemize}
+        \item new option \option{beamerwithfootline}
+      \end{itemize}
+  \versitem[0.11:]  2022-02-11
+      \begin{itemize}
+        \item Local references and the subex counter
+        \item Lua interface (not documented yet, see example and example file)
+        \item Framed solutions can now be fragile, however this
+        also requires Lua\LaTeX (but not using the Lua Interface).
+        \item beamer version is now included (no separate package)
+        \item some bug fixes
+      \end{itemize}
+\end{itemize}
+
+
+\end{document}
+
+%%% Local Variables:
+%%% mode: latex
+%%% TeX-master: t
+%%% End:
+
+%%% Local IspellDict: british


Property changes on: trunk/Master/texmf-dist/doc/latex/exercisesheets/exercisesheets-doc.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/tex/latex/exercisesheets/exercisesheets.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/exercisesheets/exercisesheets.sty	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/exercisesheets/exercisesheets.sty	2024-04-24 20:20:13 UTC (rev 71063)
@@ -0,0 +1,1961 @@
+%% exercisesheets.sty
+%% Copyright 2008-2023 Sebastian Kuhnert, Frank Fuhlbrück
+%
+% This work may be distributed and/or modified under the conditions
+% of the LaTeX Project Public License, either version 1.3c of this
+% license or (at your option) any later version. The latest version
+% of this license is in https://www.latex-project.org/lppl.txt and
+% version 1.3c or later is part of all distributions of LaTeX
+% version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status `maintained'.
+%
+% The Current Maintainer of this work is Frank Fuhlbrück.
+%
+% This work consists of the files listed in README.
+
+
+%\NeedsTeXFormat{LaTeX2e}[1994/12/01]
+
+% don't forget to update the version and date in exercisesheets.tex
+\def\exsh at version{0.17}
+\def\exsh at date{2024/04/23}
+
+\ProvidesPackage{exercisesheets}[\exsh at date\space\exsh at version\space Typesetting of exercise sheets]
+\message{`Typesetting of exercise sheets' \exsh at version\space <\exsh at date>}
+
+% TODO: fix "above hint skip"
+
+
+\RequirePackage{etoolbox}%[2008/06/28]
+\RequirePackage{scrlfile}
+\RequirePackage{environ}
+
+\RequirePackage{pgfkeys}
+\RequirePackage{keyval}
+\RequirePackage{kvoptions}
+
+\RequirePackage{ifthen}
+\RequirePackage{ifluatex}
+
+\RequirePackage{amsmath}
+
+\RequirePackage{currfile}
+\RequirePackage{catchfile}
+
+%we need getrefnumber
+\RequirePackage{refcount}
+
+% configuration keys
+
+\newif\ifexsh at beamer
+\@ifclassloaded{beamer}{\exsh at beamertrue}{}
+\newif\ifexsh at html
+\@ifclassloaded{tex4ht}{\exsh at htmltrue}{}
+\ifdefined\HCode
+  \exsh at htmltrue
+\fi
+\ifexsh at html
+  \def\exsh at inshtml#1{\HCode{#1}}
+\else
+  \def\exsh at inshtml#1{}
+\fi
+
+\newif\ifexsh at patchenumerate\exsh at patchenumeratetrue
+\newif\ifexsh at settitle\exsh at settitletrue
+\newif\ifexsh at patchpagenumbers\exsh at patchpagenumberstrue
+\newif\ifexsh at patchheadandfoot\exsh at patchheadandfoottrue
+\newif\ifexsh at usestartsection\exsh at usestartsectiontrue
+\newif\ifexsh at firstexonsheet
+\def\exsh at firstexonsheettrue{\global\let\ifexsh at firstexonsheet\iftrue}
+\def\exsh at firstexonsheetfalse{\global\let\ifexsh at firstexonsheet\iffalse}
+\newif\ifexsh at savetasks
+\newif\ifexsh at solutions
+\newif\ifexsh at oralsolutions
+\newif\ifexsh at nonoralsolutions
+\newif\ifexsh at samplesolutions
+\newif\ifexsh at exnumsheet
+\newif\ifexsh at forcesample %force printing sample sol. of wrong type
+%For beamer only
+%%%%%%%%%%%%%%% BEGIN BEAMER-SPECIFIC: %%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\ifexsh at beamer
+\newif\ifexsh at beamerwithheadline
+\newif\ifexsh at beamerwithfootline
+\newif\ifexsh at beameruseblocks
+\newif\ifexsh at defersolutiontitle
+\newif\ifexsh at headerrestate
+\newif\ifexsh at framed
+\newif\ifexsh at fragile
+\fi
+%Also only true for beamer, but we want to use it elsewhere
+\newif\ifexsh at beamersolution
+%%
+\newif\ifexsh at gradingguides
+\newif\ifexsh at inplace
+\newif\ifexsh at sample
+\newif\ifexsh at hide%currently only set via sample in exercise env.
+\newif\ifexsh at pointsfloatright
+\newif\ifexsh at bonus
+\newif\ifexsh at abbrev
+\newif\ifexsh at sumuppoints
+\newif\ifexsh at filenameasexercisename
+\newif\ifexsh at showtodos
+\newif\ifexsh at beamercompatdone
+
+\def\exsh at beamercompatibility{
+\ifexsh at beamercompatdone
+  \PackageError{exercisesheets}{
+    beamercompatibility used twice}{}%
+\else
+%%%%%%%%%%%%%%% BEGIN BEAMER-SPECIFIC: %%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\ifexsh at beamer
+  %currently we do nothing if beamer is loaded,
+  %but this might change
+\else%--------- NON-BEAMER: ---------------------------------------
+  \let\pause\relax
+  \def\frame{}
+  \renewcommand{\frame}[1][]{}
+  \let\endframe\relax
+  \def\onslide<##1>{}
+  \def\only<##1>##2{##2}
+  \def\uncover<##1>##2{##2}
+  \def\visible<##1>##2{##2}
+  \def\invisible<##1>##2{##2}
+  \long\def\alt<##1>##2##3{##2}
+  \long\def\temporal<##1>##2##3##4{##3}
+  \let\exsh at origitem\item
+  \def\exsh at ovrlitem<##1>{\exsh at origitem}
+  \def\item{\@ifnextchar<\exsh at ovrlitem\exsh at origitem}
+  \let\exsh at origitemize\itemize
+  \def\exsh at ovrlitemize[##1]{\exsh at origitemize}
+  \def\itemize{\@ifnextchar[\exsh at ovrlitemize\exsh at origitemize}
+  \let\exsh at origenumerate\enumerate
+  \def\exsh at ovrlenumerate[##1]{\exsh at origenumerate}
+  \def\enumerate{\@ifnextchar[\exsh at ovrlenumerate\exsh at origenumerate}
+\fi
+%%%%%%%%%%%%%%% END BEAMER-SPECIFIC %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+  \exsh at beamercompatdonetrue
+\fi
+}
+
+\pgfkeys{/exsh/.is family,/exsh,
+  patchenumerate/.is if=exsh at patchenumerate,
+  patchenumerate/.default=true,
+  settitle/.is if=exsh at settitle,
+  settitle/.default=true,
+  patchpagenumbers/.is if=exsh at patchpagenumbers,
+  patchpagenumbers/.default=true,
+  usestartsection/.is if=exsh at usestartsection,
+  usestartsection/.default=true,
+  embedded/.code={%
+    \exsh at patchenumeratefalse
+    \exsh at settitlefalse
+    \exsh at patchpagenumbersfalse
+    \exsh at patchheadandfootfalse
+    \exsh at usestartsectionfalse
+    \pgfkeysalso{secnumdepth=keep}%
+    \def\exhs at sheetnoheader[##1]##2{}%
+    \newcounter{exshsheet}
+    \newcounter{exshexercise}
+    \pgfkeysalso{
+      sheet sectioning cmd=\exhs at sheetnoheader,
+      sheet counter=exshsheet,
+      exercise counter=exshexercise,
+      sheet start page action=\relax,
+      sheet end page action=\relax,
+    }%
+  },
+  minskips/.code={%
+    \pgfkeysalso{
+      above sheet title skip=0pt,
+      below sheet header skip=0pt,
+      above first exercise skip=0pt,
+      below exercise title skip=0pt,
+    }%
+  },
+  savetasks/.is if=exsh at savetasks,
+  savetasks/.default=true,
+  solutions/.is choice,
+  solutions/true/.code=\exsh at solutionstrue\exsh at oralsolutionstrue\exsh at nonoralsolutionstrue,
+  solutions/oral/.code=\exsh at solutionstrue\exsh at oralsolutionstrue\exsh at nonoralsolutionsfalse,
+  solutions/nonoral/.code=\exsh at solutionstrue\exsh at oralsolutionsfalse\exsh at nonoralsolutionstrue,
+  solutions/sample nonoral/.code=\exsh at solutionstrue\exsh at oralsolutionsfalse\exsh at nonoralsolutionstrue\exsh at samplesolutionstrue,
+  solutions/sample oral/.code=\exsh at solutionstrue\exsh at oralsolutionstrue\exsh at nonoralsolutionsfalse\exsh at samplesolutionstrue,
+  solutions/sample all/.code=\exsh at solutionstrue\exsh at oralsolutionstrue\exsh at nonoralsolutionstrue\exsh at samplesolutionstrue,
+  solutions/false/.code=\exsh at solutionsfalse\exsh at oralsolutionsfalse\exsh at nonoralsolutionsfalse,
+  solutions/.default=true,
+  number within sheet/.is if=exsh at exnumsheet,
+  number within sheet/.default=true,
+  forcesample/.is if=exsh at forcesample,
+  forcesample/.default=true,
+  gradingguides/.is if=exsh at gradingguides,
+  gradingguides/.default=true,
+  only/.initial={-},
+  all/.style={/exsh/only={-}},all/.value forbidden,
+  solutionsby/.code={\def\exsh at solutionsby{#1}},
+  solutionsby/.value required,
+  exercisespath/.code={\def\exsh at exercisespath{#1}},
+  exercisespath/.value required,
+  bonus/.is if=exsh at bonus,
+  bonus/.default=true,
+  inplace/.is if=exsh at inplace,
+  inplace/.default=true,
+  sample/.is if=exsh at sample,
+  sample/.default=true,
+  showtodos/.is if=exsh at showtodos,
+  showtodos/.default=true,
+  filenameasexercisename/.is if=exsh at filenameasexercisename,
+  filenameasexercisename/.default=true,
+  pointsfloatright/.is if=exsh at pointsfloatright,
+  pointsfloatright/.default=true,
+  abbrev/.is if=exsh at abbrev,
+  abbrev/.default=true,
+  beamercompatibility/.default={ignore},
+  beamercompatibility/.initial={ignore},
+  beamercompatibility/.code={\exsh at beamercompatibility}
+}
+
+%%%%%%%%%%%%%%% BEGIN BEAMER-SPECIFIC: %%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\ifexsh at beamer
+\pgfkeys{exsh,
+  beamerwithheadline/.is if=exsh at beamerwithheadline,
+  beamerwithheadline/.default=true,
+  beamerwithfootline/.is if=exsh at beamerwithfootline,
+  beamerwithfootline/.default=true,
+  beameruseblocks/.is if=exsh at beameruseblocks,
+  beameruseblocks/.default=true,
+  beamersolution/.is if=exsh at beamersolution,
+  beamersolution/.default=true,
+  defersolutiontitle/.is if=exsh at defersolutiontitle,
+  defersolutiontitle/.default=true,
+  headerrestate/.is if=exsh at headerrestate,
+  headerrestate/.default=true,
+  framed/.is if=exsh at framed,
+  framed/.default=true,
+  fragile/.is if=exsh at fragile,
+  fragile/.default=true,
+  beamersolution/.initial={false},
+  beamerwithheadline/.initial={false},
+  beamerwithfootline/.initial={false},
+  beameruseblocks/.initial={false},
+  defersolutiontitle/.initial={false},
+  headerrestate/.initial={false},
+  framed/.initial={false},
+}
+\else%--------- NON-BEAMER: ---------------------------------------
+\pgfkeys{exsh,
+  beamerwithheadline/.default={ignore},
+  beamerwithheadline/.initial={ignore},
+  beamerwithfootline/.default={ignore},
+  beamerwithfootline/.initial={ignore},
+  beamersolution/.default={ignore},
+  beamersolution/.initial={ignore},
+  defersolutiontitle/.default={ignore},
+  defersolutiontitle/.initial={ignore},
+  headerrestate/.default={ignore},
+  headerrestate/.initial={ignore},
+  framed/.default={ignore},
+  framed/.initial={ignore},
+  framed/.code={\let\newframe\relax},
+  fragile/.default={ignore},
+  fragile/.initial={ignore},
+}
+\fi
+%%%%%%%%%%%%%%% END BEAMER-SPECIFIC %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% store title data for sheet headers
+\ifundef\subject{% \subject is only provided by KOMA classes
+  \newcommand{\subject}[1]{}%
+  \def\@subject{}%
+}{}
+% beamer has subject, but not \@subject:
+\providecommand{\@subject}{}
+\apptocmd{\subject}{\pgfkeys{/exsh/subject={#1}}}{}{}%
+\ifdefempty{\@subject}{
+  \pgfkeys{exsh,subject/.initial={\PackageWarning{exercisesheets}{No \string\subject\space given}}}
+}{
+  \pgfkeys{/exsh/subject/.initial/.expand once=\@subject}
+}
+\ifdefstring{\@date}{\today}{
+  \pgfkeys{/exsh/semester/.initial={\PackageWarning{exercisesheets}{No semester given in \string\date}}}
+}{
+  \pgfkeys{/exsh/semester/.initial/.expand once=\@date}
+}
+\let\@exsh at origdate\date
+\renewcommand{\date}[1]{\@exsh at origdate{#1}\pgfkeys{/exsh/semester={#1}}}
+% this breaks (likely because of detokenization):
+% -> missing \begin{document}
+% \apptocmd{\date}{\pgfkeys{/exsh/semester={#1}}}{}{}
+\pgfkeys{/exsh/author/.code={%
+    \def\exsh at author{#1}%
+    \def\exsh at repeat{1}%
+    \loop\ifnum\exsh at repeat>0
+      \def\exsh at repeat{0}%
+      \patchcmd{\exsh at author}{\and}{, }{\def\exsh at repeat{1}}{}%
+    \repeat
+  },
+  /exsh/author/.expand once=\@author}
+\let\exsh at oldauthor\author
+\def\author#1{\exsh at oldauthor{#1}\pgfkeys{/exsh/author={#1}}}
+
+% helper macro for automatic language selection
+\newif\ifexsh at provideonly
+\def\exsh at deforprovide#1#2{%
+  \ifthenelse{\(\NOT\boolean{exsh at provideonly}\)
+    \OR \equal{}{\pgfkeysvalueof{#1}}}{%
+    \pgfkeys{#1=#2}%
+  }{}%
+}
+
+\pgfkeys{exsh,
+  %general package options
+  patchenumerate/.initial=true,
+  settitle/.initial=true,
+  patchpagenumbers/.initial=true,
+  custom skip macro/.initial=\exsh at skipcustomstuff,
+  showtodos/.initial={false},
+  hidetodos/.style={/exsh/showtodos=false},
+  hidetodos/.value forbidden,
+  % additional sheet info
+  title/.initial={},
+  date/.initial={},
+  note/.initial={},
+  exauthor/.initial={\exsh at author},
+  number within sheet/.initial={false},
+  %
+  % additional exercise info
+  name/.initial={},
+  forcesample/.initial={false},
+  firstline/.initial={},
+  points/.initial={},
+  oral/.style={/exsh/points=oral},oral/.value forbidden,
+  inplace/.initial={false},
+  sample/.initial={false},
+  filenameasexercisename/.initial={false},
+  pointsfloatright/.initial={false},
+  bonus/.initial={false},
+  nobonus/.style={/exsh/bonus=false},nobonus/.value forbidden,
+  abbrev/.initial={false},
+  noabbrev/.style={/exsh/abbrev=false},noabbrev/.value forbidden,
+  pointsinfo/.initial={},
+  optional/.style={/exsh/pointsinfo=\ifexsh at abbrev%
+       \pgfkeysvalueof{/exsh/strings/optional abbrev}%
+    \else%
+       \pgfkeysvalueof{/exsh/strings/optional}%
+    \fi},
+  optional/.value forbidden,
+  exercisemark/.initial={},
+  difficult/.style={/exsh/exercisemark=*},difficult/.value forbidden,
+  savetasks/.initial=false,
+}
+\pgfkeys{exsh,
+  %
+  % translatable strings
+  strings/sheet/.initial={},
+  strings/sheets/.initial={},
+  strings/solutions/.initial={},
+  strings/solutionsby/.initial={},
+  strings/gradingguide/.initial={},
+  strings/exercise/.initial={},
+  strings/solution/.initial={},
+  strings/idea/.initial={},
+  strings/hint/.initial={},
+  strings/remark/.initial={},
+  strings/oral/.initial={},
+  strings/oral abbrev/.initial={},
+  strings/point/.initial={},
+  strings/points/.initial={},
+  strings/points abbrev/.initial={},
+  strings/bonus point/.initial={},
+  strings/bonus points/.initial={},
+  strings/bonus points abbrev/.initial={},
+  strings/optional/.initial={},
+  strings/optional abbrev/.initial={},
+  %
+  % languages: predifined string sets
+  language/.is choice,
+  language/german/.code={%
+    \exsh at deforprovide{/exsh/strings/sheet}       {\"Ubungsblatt}%
+    \exsh at deforprovide{/exsh/strings/sheets}      {\"Ubungsbl\"atter}%
+    \exsh at deforprovide{/exsh/strings/solutions}   {L\"osungsvorschl\"age}%
+    \exsh at deforprovide{/exsh/strings/solutionsby} {L\"osungen von}%
+    \exsh at deforprovide{/exsh/strings/gradingguide}{Bepunktung}%
+    \exsh at deforprovide{/exsh/strings/exercise}    {Aufgabe}%
+    \exsh at deforprovide{/exsh/strings/solution}    {L\"osung}%
+    \exsh at deforprovide{/exsh/strings/idea}        {L\"osungsidee}%
+    \exsh at deforprovide{/exsh/strings/hint}        {Hinweis}%
+    \exsh at deforprovide{/exsh/strings/remark}      {Bemerkung}%
+    \exsh at deforprovide{/exsh/strings/oral}        {m\"undlich}%
+    \exsh at deforprovide{/exsh/strings/oral abbrev} {mdl.}%
+    \exsh at deforprovide{/exsh/strings/point}       {Punkt}%
+    \exsh at deforprovide{/exsh/strings/points}      {Punkte}%
+    \exsh at deforprovide{/exsh/strings/points abbrev}{P.}%
+    \exsh at deforprovide{/exsh/strings/bonus point} {Zusatzpunkt}%
+    \exsh at deforprovide{/exsh/strings/bonus points}{Zusatzpunkte}%
+    \exsh at deforprovide{/exsh/strings/bonus points abbrev}{ZP.}%
+    \exsh at deforprovide{/exsh/strings/optional}    {optional}%
+    \exsh at deforprovide{/exsh/strings/optional abbrev} {opt.}%
+  },language/german/.value forbidden,
+  language/ngerman/.style={/exsh/language/german=#1},
+  language/english/.code={%
+    \exsh at deforprovide{/exsh/strings/sheet}       {Exercise Sheet}%
+    \exsh at deforprovide{/exsh/strings/sheets}      {Exercise Sheets}%
+    \exsh at deforprovide{/exsh/strings/solutions}   {Suggested Solutions}%
+    \exsh at deforprovide{/exsh/strings/solutionsby} {Solutions by}%
+    \exsh at deforprovide{/exsh/strings/gradingguide}{Grading guideline}%
+    \exsh at deforprovide{/exsh/strings/exercise}    {Exercise}%
+    \exsh at deforprovide{/exsh/strings/solution}    {Solution}%
+    \exsh at deforprovide{/exsh/strings/idea}        {Idea for solution}%
+    \exsh at deforprovide{/exsh/strings/hint}        {Hint}%
+    \exsh at deforprovide{/exsh/strings/remark}      {Remark}%
+    \exsh at deforprovide{/exsh/strings/oral}        {oral}%
+    \exsh at deforprovide{/exsh/strings/oral abbrev} {oral}%
+    \exsh at deforprovide{/exsh/strings/point}       {point}%
+    \exsh at deforprovide{/exsh/strings/points}      {points}%
+    \exsh at deforprovide{/exsh/strings/points abbrev}{p.}%
+    \exsh at deforprovide{/exsh/strings/bonus point} {bonus point}%
+    \exsh at deforprovide{/exsh/strings/bonus points}{bonus points}%
+    \exsh at deforprovide{/exsh/strings/bonus points abbrev}{b.p.}%
+    \exsh at deforprovide{/exsh/strings/optional}    {optional}%
+    \exsh at deforprovide{/exsh/strings/optional abbrev} {opt.}%
+  },language/english/.value forbidden,
+  language/.unknown/.code={%
+    \PackageWarning{exercisesheets}{Unknown language \pgfkeyscurrentname.
+      Defaulting to English.}{}%
+    \pgfkeys{/exsh/language=english}%
+  },
+  %
+  % alternate strings
+  idea/.style={/exsh/strings/solution=\pgfkeysvalueof{/exsh/strings/idea}},
+  remark/.style={/exsh/strings/hint=\pgfkeysvalueof{/exsh/strings/remark}},
+  %
+  % hooks
+  every sheet/.code={},
+  every exercise/.code={},
+  every solution/.code={},
+  every hint/.code={},
+  %
+  % sectioning cmds and counters for sheet and exercise
+  % sheet sectioning cmd must take an optional
+  % and a mandatory argument
+  sheet sectioning cmd/.initial={\part},
+  sheet counter/.initial={part},
+  secnumdepth/.initial={-1},
+  exercise counter/.initial={section},
+  %
+  % font specifications
+  sheet header font/.initial=\normalfont\normalsize,
+  subject font/.initial=\scshape,
+  author font/.initial=\scshape,
+  semester font/.initial={},
+  date font/.initial={},
+  solutionsby font/.initial=\itshape,
+  sheet note font/.initial=\itshape\bfseries,
+  sheet title font/.initial=\Large\bfseries,
+  exercise title font/.initial=\bfseries,
+  points font/.initial=\itshape,
+  main task font/.initial={},
+  subtask font/.initial={},
+  task restate font/.initial=\itshape,
+  hint font/.initial={},
+  hint title font/.initial=\itshape,
+  solution font/.initial={},
+  solution title font/.initial=\bfseries,
+  solution title separator/.initial={:\par},
+  grading guide font/.initial=\itshape,
+  todo marker font/.initial=\ifdef{\color}{\color{red}}{}\bfseries,
+  %
+  % skip values
+  below slide headline skip/.initial={0mm},
+  above sheet title skip/.initial={4ex},
+  above sheet note skip/.initial={.7ex},
+  above solutionsby skip/.initial={1ex},
+  below sheet header skip/.initial={4ex plus 1ex minus .5ex},
+  above exercise skip/.initial={3ex plus 1ex minus .5em},
+  above first exercise skip/.initial={3ex plus 1ex minus .5em},
+  below exercise title skip/.initial={\parskip},
+  above solution skip/.initial={1ex},
+  above hint skip/.initial={1ex},
+  %
+  % page handling
+  sheet start page action/.initial={\clearpage},
+  sheet end page action/.initial={\clearpage},
+  %
+  % conditionals
+  ifsolutions/.code 2 args={\ifsolutions{\pgfkeysalso{#1}}{\pgfkeysalso{#2}}},
+  iforalsolutions/.code 2 args={\iforalsolutions{\pgfkeysalso{#1}}{\pgfkeysalso{#2}}},
+  ifnonoralsolutions/.code 2 args={\ifnonoralsolutions{\pgfkeysalso{#1}}{\pgfkeysalso{#2}}},
+}
+
+% default values
+\pgfkeys{exsh,solutions=false,all}
+
+% process package options
+\@expandtwoargs\pgfqkeys{/exsh}{\csname opt at exercisesheets.sty\endcsname}
+
+% mark options as processed
+\expandafter\undef\csname opt at exercisesheets.sty\endcsname
+
+% allow further keys to be set
+\def\exshset#1{\pgfkeys{exsh,#1}}
+
+%%%%%%%%%%%%%%% BEGIN BEAMER-ONLY: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\ifexsh at beamer
+\define at key{beamerframe}{t}[true]{% top
+  \beamer at frametopskip=-2pt\relax%
+  \beamer at framebottomskip=0pt plus 1fill\relax%
+  \beamer at frametopskipautobreak=\beamer at frametopskip\relax%
+  \beamer at framebottomskipautobreak=\beamer at framebottomskip\relax%
+}
+\fi
+%%%%%%%%%%%%%%% END BEAMER-ONLY %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% automatic language selection
+\AfterEndPreamble{%
+  \exsh at provideonlytrue
+  \ifdef{\bbl at main@language}{%
+    \pgfkeys{/exsh/language=\bbl at main@language}%
+  }{%
+    \pgfkeys{/exsh/language=english}%
+  }%
+  \exsh at provideonlyfalse
+}%
+
+% range checks
+\newif\ifexsh at isinrange
+\newif\ifexsh at singularrange
+\def\exsh at checkrange#1{%
+  \edef\exsh at range@entry{#1}%
+  \def\exsh at range@curstart{}%
+  \exsh at isinrangefalse
+  \exsh at singularrangetrue
+  \pgfkeysgetvalue{/exsh/only}{\exsh at temp}%
+  \ifthenelse{\equal{-}{\exsh at temp}}{%
+    \exsh at isinrangetrue
+    \ifnumequal{\exsh at lastsheet}{1}{%
+      \exsh at singularrangetrue
+    }{%
+      \exsh at singularrangefalse
+    }%
+  }{%
+    \expandafter\exsh at range@parsestart\exsh at temp\exsh at range@end
+  }%
+}
+\def\exsh at range@parsestart#1{%
+  \ifstrequal{#1}{,}{%
+    \exsh at singularrangefalse
+    \ifdefstring{\exsh at range@curstart}{last}{%
+      \let\exsh at range@curstart\exsh at lastsheet
+    }{}%
+    \ifdefequal{\exsh at range@entry}{\exsh at range@curstart}{%
+      \exsh at isinrangetrue
+    }{}%
+    \def\exsh at range@curstart{}%
+    \exsh at range@parsestart
+  }{%
+    \ifstrequal{#1}{\exsh at range@end}{%
+      \ifdefstring{\exsh at range@curstart}{last}{%
+        \let\exsh at range@curstart\exsh at lastsheet
+      }{}%
+      \ifdefequal{\exsh at range@entry}{\exsh at range@curstart}{%
+        \exsh at isinrangetrue
+      }{}%
+    }{%
+      \ifdefequal{#1}{-}{%
+        \exsh at singularrangefalse
+        \ifdefstring{\exsh at range@curstart}{}{%
+          \def\exsh at range@curstart{0}%
+        }{}%
+        \ifdefstring{\exsh at range@curstart}{last}{%
+          \let\exsh at range@curstart\exsh at lastsheet
+        }{}%
+        \def\exsh at range@curend{}%
+        \exsh at range@parseend
+      }{%
+        \appto{\exsh at range@curstart}{#1}%
+        \exsh at range@parsestart
+      }%
+    }%
+  }%
+}
+\def\exsh at range@parseend#1{%
+  \ifstrequal{#1}{,}{%
+    \ifdefstring{\exsh at range@curend}{last}{%
+      \def\exsh at range@curend{10000}%
+    }{}%
+    \ifdefstring{\exsh at range@curend}{}{
+      \def\exsh at range@curend{10000}%
+    }{}%
+    \ifthenelse{\NOT \(\exsh at range@curstart > \exsh at range@entry
+      \OR \exsh at range@entry > \exsh at range@curend\)}{%
+      \exsh at isinrangetrue
+    }{}%
+    \def\exsh at range@curstart{}%
+    \exsh at range@parsestart
+  }{%
+    \ifstrequal{#1}{\exsh at range@end}{%
+      \ifdefstring{\exsh at range@curend}{last}{%
+        \def\exsh at range@curend{10000}%
+      }{}%
+      \ifdefstring{\exsh at range@curend}{}{
+        \def\exsh at range@curend{10000}%
+      }{}%
+      \ifthenelse{\NOT \(\exsh at range@curstart > \exsh at range@entry
+        \OR \exsh at range@entry > \exsh at range@curend\)}{%
+        \exsh at isinrangetrue
+      }{%
+      }%
+    }{%
+      \appto{\exsh at range@curend}{#1}%
+      \exsh at range@parseend
+    }%
+  }%
+}
+
+% remember last sheet (for range checks)
+\def\exsh at lastsheet{0}% to be overridden in aux file
+\AtEndDocument{%
+  \immediate\write\@auxout{\string\gdef\string\exsh at lastsheet{\arabic{\pgfkeysvalueof{/exsh/sheet counter}}}}%
+}
+
+\ifexsh at patchpagenumbers
+  \numberwithin{page}{\pgfkeysvalueof{/exsh/sheet counter}}
+  \renewcommand{\thepage}{\arabic{page}}%changed for every sheet
+\fi
+\ifthenelse{\equal{\pgfkeysvalueof{/exsh/secnumdepth}}{keep}}{}{
+  \setcounter{secnumdepth}{\pgfkeysvalueof{/exsh/secnumdepth}}
+}
+
+\AfterPackage*{hyperref}{%
+  % make PDF destinations unique:
+  \def\theHsection{\arabic{sheetid}.\arabic{\pgfkeysvalueof{/exsh/exercise counter}}}%
+  \ifexsh at patchpagenumbers
+    \def\theHpage{\arabic{sheetid}-\arabic{page}}%
+  \fi
+  %
+  % open bookmarks when typesetting a single sheet
+  \AtEndPreamble{%
+    \exsh at checkrange{0}%
+    \ifexsh at singularrange\hypersetup{bookmarksopen}\fi
+  }%
+}
+
+
+\ifexsh at settitle
+% automatic title selection
+\let\exsh at title\relax
+\let\exsh at title@new\relax
+\def\exsh at write@title#1{%
+  \xdef\exsh at title@new{\expandonce #1}%
+  \protected at write\@auxout{}{\string\gdef\string\exsh at title{\expandonce\exsh at title@new}}%
+}
+\AfterEndDocument{%
+  \ifthenelse{\equal{\exsh at title}{\exsh at title@new}}{}{%
+    \@latex at warning@no at line{Label(s) may have changed.
+      Rerun to get cross-references right}%
+  }%
+}
+\AfterEndPreamble{%
+  \exsh at checkrange{0}%
+  \ifexsh at singularrange\else
+    \pgfkeysgetvalue{/exsh/strings/sheets}{\exsh at tmp}%
+    \exsh at write@title{\exsh at tmp}%
+  \fi
+}
+
+
+\AtBeginDocument{%
+  \ifexsh at solutions
+    \title{\exsh at title: \pgfkeysvalueof{/exsh/strings/solutions}}%
+  \else
+    \title{\exsh at title}
+  \fi
+}
+\else
+  \def\exsh at write@title#1{}
+\fi
+
+\newcounter{sheetid}% only used to disambiguate hyperref labels
+\newenvironment{sheet}[1][]{%
+  \pgfkeys{exsh,every sheet,#1}%
+%   \pgfkeysvalueof{/exsh/sheet start page action}%
+  \stepcounter{sheetid}%
+  \ifthenelse{\equal{}{\pgfkeysvalueof{/exsh/title}}}{%
+    \numdef\exsh at tmp{\value{\pgfkeysvalueof{/exsh/sheet counter}}+1}%
+    \edef\exsh at temp{\expandonce{\pgfkeysvalueof{/exsh/strings/sheet}}\noexpand~\exsh at tmp}%
+    \pgfkeys{/exsh/title/.expand once={\exsh at temp}}%
+    \ifexsh at patchpagenumbers
+      \def\thepage{\arabic{\pgfkeysvalueof{/exsh/sheet counter}}-\arabic{page}}%
+    \fi
+  }{%
+    \ifexsh at patchpagenumbers
+      \def\thepage{\arabic{page}}%
+    \fi
+  }%
+  \ifexsh at exnumsheet
+    \edef\exsh at exnumstore{\arabic{\pgfkeysvalueof{/exsh/exercise counter}}}
+    \setcounter{\pgfkeysvalueof{/exsh/exercise counter}}{0}%
+  \fi
+  \numdef\exsh at tmp{\value{\pgfkeysvalueof{/exsh/sheet counter}}+1}%
+  \exsh at checkrange{\exsh at tmp}%
+  \ifexsh at isinrange
+    \ifexsh at singularrange
+      \pgfkeysgetvalue{/exsh/title}{\exsh at temp}%
+      \exsh at write@title{\exsh at temp}%
+    \fi
+    \exsh at sheethead
+  \else
+    \refstepcounter{\pgfkeysvalueof{/exsh/sheet counter}}%
+    \def\exsh at skipwhat{sheet}\expandafter\exsh at skipstuff
+  \fi
+}{%
+  \par
+  \begingroup
+  \ifnum\value{page}=1\thispagestyle{empty}\fi
+  \ifexsh at isinrange
+    \pgfkeysvalueof{/exsh/sheet end page action}%
+  \fi
+  \endgroup
+  \ifexsh at exnumsheet
+    \setcounter{\pgfkeysvalueof{/exsh/exercise counter}}{\exsh at exnumstore}%
+  \fi
+}
+\listadd{\exsh at enums}{enumerate}
+\listadd{\exsh at enums}{compactenum}
+\listadd{\exsh at enums}{asparaenum}
+\listadd{\exsh at enums}{inparaenum}
+\listadd{\exsh at enums}{subtasks}
+\listadd{\exsh at nonenums}{itemize}
+\listadd{\exsh at nonenums}{compactitem}
+\listadd{\exsh at nonenums}{asparaitem}
+\listadd{\exsh at nonenums}{inparaitem}
+\listadd{\exsh at nonenums}{description}
+\listadd{\exsh at nonenums}{compactdesc}
+\listadd{\exsh at nonenums}{asparadesc}
+\listadd{\exsh at nonenums}{inparadesc}
+\listadd{\exsh at nonenums}{asparablank}
+\listadd{\exsh at nonenums}{inparablank}
+\listadd{\exsh at nonenums}{list}
+
+%%%%%%%%%%%%%%% BEGIN BEAMER-SPECIFIC: %%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\ifexsh at beamer
+  \let\exsh at hyper@itemtrue\relax
+\else%--------- NON-BEAMER: ---------------------------------------
+  \ifexsh at html
+    \let\exsh at hyper@itemtrue\relax%
+  \else
+    \def\exsh at hyper@itemtrue{\@hyper at itemtrue}%
+  \fi
+\fi
+%%%%%%%%%%%%%%% END BEAMER-SPECIFIC %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%TODO: We need some proper switch-case here
+%evaluate csname/csdef+detokenize
+\ExplSyntaxOn
+\cs_new_eq:NN \exsh at ifsingletoken \tl_if_single_token:nTF
+\ExplSyntaxOff
+\long\def\exsh at skipstuff#1{%
+   \exsh at ifsingletoken{#1}{%
+    \ifstrequal{#1}{\begin}{\exsh at skipstuff@begin}{%
+     \ifstrequal{#1}{\end}{\exsh at skipstuff@end}{%
+      \ifstrequal{#1}{\includeexercise}{\exsh at skipstuff@incex}{%
+       \ifstrequal{#1}{\includeLexercise}{\exsh at skipstuff@incLex}{%
+        \ifstrequal{#1}{\label}{\exsh at skipstuff@label}{%
+        \ifstrequal{#1}{\subtask}{\exsh at skipstuff@subtask}{%
+          \ifstrequal{#1}{\input}{\exsh at skipstuff@input}{%
+            \ifstrequal{#1}{\exsh at skipstuff@endfile}{\currfile at pop\exsh at skipstuff}{%
+              \ifstrequal{#1}{\setcounter}{\expandafter\exsh at skipstuff\setcounter}{%
+                \ifstrequal{#1}{\item}{\ifdef{\@enumctr}{\exsh at hyper@itemtrue\refstepcounter{\@enumctr}}{}}{}%
+                \pgfkeysvalueof{/exsh/custom skip macro}{#1}}}}}}}}}}%
+  }{%
+    \exsh at skipstuff#1%
+  }%
+}%
+\let\exshskipcontinue\exsh at skipstuff
+\long\def\exsh at skipcustomstuff#1{\exshskipcontinue}
+\def\exsh at skipstuff@end#1{%
+  \expandafter\ifstrequal\expandafter{\exsh at skipwhat}{#1}{%
+    \expandafter\end\expandafter{\exsh at skipwhat}%
+    \let\exsh at skipwhat\relax%
+  }{
+    \endgroup\exsh at skipstuff%
+  }%
+}
+\def\exsh at skipstuff@begin#1{%
+  \begingroup
+  \ifstrequal{#1}{Lexercise}{\exsh at skipstuff@Lexercise}{%
+    \ifstrequal{#1}{exercise}{\refstepcounter{\pgfkeysvalueof{/exsh/exercise counter}}%
+      % automatic label for the first exercise in every included file
+      \ifthenelse{\equal{\jobname}{\currfilebase}}{}{%
+        \ifcsdef{exsh at autolabel@\currfilebase}{}{%
+          \csdef{exsh at autolabel@\currfilebase}{}%
+          \exsh at autolabel{ex:\currfilebase}}}%
+    }{}%
+    \ifinlist{#1}{\exsh at enums}{%
+      \exsh at skipstuff@beginenum
+    }{%
+      \ifinlist{#1}{\exsh at nonenums}{%
+        \undef\@enumctr
+      }{}%
+      \exsh at skipstuff
+    }%
+  }%
+}
+\def\exsh at skipstuff@beginenum{%
+  \ifnum\@enumdepth>\thr@@
+    \@toodeep
+  \else
+    \advance\@enumdepth\@ne
+    \edef\@enumctr{enum\romannumeral\the\@enumdepth}%
+    \setcounter{\@enumctr}{0}%
+  \fi
+  \@ifundefined{@enumlabel@}{%
+    \exsh at skipstuff
+  }{%
+    \@ifnextchar[{\@enumlabel@{\exsh at skipstuff}[}{\exsh at skipstuff}%
+  }%
+}
+\def\exsh at skipstuff@label#1{%
+  % Locally modify \protected at write to use \immediate\write instead.
+  % This is needed to include labels after the last shipout in the aux file.
+  \begingroup
+  \def\protected at write##1##2##3{%
+    \begingroup
+    \let\protect\@unexpandable at protect
+    \immediate\write##1{##3}%
+    \endgroup
+  }%
+  \label{#1}%
+  \endgroup
+  \exsh at skipstuff
+}
+\def\exsh at skipstuff@subtask#1{%
+  \exsh at skipstuff \item #1
+}
+\def\exsh at skipstuff@input#1{%
+  \CatchFileDef{\exsh at inputfilecontent}{#1}{}%
+  \currfile at push
+  \currfile at set{#1}%
+  \expandafter\exsh at skipstuff\exsh at inputfilecontent\exsh at skipstuff@endfile
+}
+
+\def\exsh at skipstuff@incex{%
+  \@ifstar\exsh at skipstuff@incex@@\exsh at skipstuff@incex@%
+}
+
+\newcommand{\exsh at skipstuff@incex@}[2][]{%
+  \exsh at skipstuff\input{%
+    \ifdefvoid{\exsh at exercisespath}{}{\exsh at exercisespath/}#2}%
+}
+
+\newcommand{\exsh at skipstuff@incex@@}[2][]{%
+  \refstepcounter{\pgfkeysvalueof{/exsh/exercise counter}}
+  \exsh at autolabel{ex:#2}
+  \exsh at skipstuff
+}
+
+\def\exsh at skipstuff@incLex{%
+  \@ifstar\exsh at skipstuff@incLex@@\exsh at skipstuff@incLex@%
+}
+
+\newcommand{\exsh at skipstuff@incLex@}[2][]{%
+  \exsh at dlua{
+    local prefix =
+      "\ifdefvoid{\exsh at exercisespath}{}{\exsh at exercisespath/}"
+    exsh_cur_exercise=dofile(prefix .. "#2.lua")
+  }%
+  \expandafter\exsh at skipstuff%
+    \exsh at dlua{exsh_texprintlines(exsh_cur_exercise)}%
+}
+
+\let\exsh at skipstuff@incLex@@\exsh at skipstuff@incex@@
+
+%%%%%%%%%%%%%%% BEGIN BEAMER-SPECIFIC: %%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\ifexsh at beamer
+\def\exsh at sheethead{%
+  \pgfkeysvalueof{/exsh/sheet start page action}%
+  \pgfkeysgetvalue{/exsh/title}{\exsh at tmp}%
+  \ifexsh at solutions
+    \expandafter\edef\expandafter\exsh at tmp{\expandonce\exsh at tmp:\noexpand~\pgfkeysvalueof{/exsh/strings/solutions}}%
+  \fi
+  \refstepcounter{\pgfkeysvalueof{/exsh/sheet counter}}%
+  \begin{frame}
+  \begin{block}{}
+    \centering\Large\exsh at tmp
+  \end{block}
+    \begingroup
+      \pgfkeysvalueof{/exsh/sheet header font}%
+      \ifexsh at solutions%
+        \ifdefvoid{\exsh at solutionsby}{}{%
+          \begingroup
+            \begin{block}{}
+              \pgfkeysvalueof{/exsh/solutionsby font}%
+              \vskip\pgfkeysvalueof{/exsh/above solutionsby skip}%
+              \relax%
+              \pgfkeysvalueof{/exsh/strings/solutionsby}%
+              ~\exsh at solutionsby\\\unskip%
+            \end{block}%
+          \endgroup
+        }%
+      \else
+      \fi
+      \ifthenelse{\equal{}{\pgfkeysvalueof{/exsh/note}}}{%
+      }{%
+        \ifbool{exsh at samplesolutions}{}{%
+          \begingroup
+            \begin{block}{}
+              \pgfkeysvalueof{/exsh/sheet note font}%
+              \vskip\pgfkeysvalueof{/exsh/above sheet note skip}\relax
+              \pgfkeysvalueof{/exsh/note}\\\unskip%
+            \end{block}%
+          \endgroup
+        }%
+      }%
+    \endgroup
+%   \stepcounter{page}%
+  \end{frame}
+}
+\global\def\exsh at alignright#1{\hfill #1}%
+\else%--------- NON-BEAMER: ---------------------------------------
+\ifexsh at html
+%   \global\def\exsh at part[#1]#2{#2}
+%   \exshset{sheet sectioning cmd/.initial={\exsh at part}}
+  \global\def\exsh at alignright#1{%
+    \exsh at inshtml{<span style="float:right">}#1%
+    \exsh at inshtml{</span>}
+  }
+  \global\def\exsh at centering#1{%
+    \exsh at inshtml{<span style="display: block;text-align:center">}#1%
+    \exsh at inshtml{</span>}
+  }
+\else
+  \global\def\exsh at alignright#1{\hfill #1}%
+  \global\def\exsh at centering#1{\centering #1}
+\fi
+\def\exsh at sheethead{%
+  \pgfkeysvalueof{/exsh/sheet start page action}%
+  \pgfkeysgetvalue{/exsh/title}{\exsh at tmp}%
+  \ifexsh at solutions
+    \expandafter\edef\expandafter\exsh at tmp{\expandonce\exsh at tmp:\noexpand~\pgfkeysvalueof{/exsh/strings/solutions}}%
+  \fi
+  \refstepcounter{\pgfkeysvalueof{/exsh/sheet counter}}%
+  \pgfkeysvalueof{/exsh/sheet sectioning cmd}[\pgfkeysvalueof{/exsh/title}]{\normalsize
+    \pgfkeysvalueof{/exsh/sheet header font}%
+    \begingroup\raggedright%
+      {\pgfkeysvalueof{/exsh/subject font}\pgfkeysvalueof{/exsh/subject}}%
+      \exsh at alignright{\pgfkeysvalueof{/exsh/semester font}%
+        \pgfkeysvalueof{/exsh/semester}%
+      }\\
+      {\pgfkeysvalueof{/exsh/author font}\exsh at author}%
+      \exsh at alignright{
+        \pgfkeysvalueof{/exsh/date font}\pgfkeysvalueof{/exsh/date}%
+      }\\
+      \vskip\pgfkeysvalueof{/exsh/above sheet title skip}\relax%
+    \endgroup
+    \begingroup
+      \exsh at centering{\pgfkeysvalueof{/exsh/sheet title font}\exsh at tmp\\}\unskip
+    \endgroup
+    \begingroup
+      \pgfkeysvalueof{/exsh/sheet header font}%
+      \ifexsh at solutions%
+        \ifdefvoid{\exsh at solutionsby}{}{%
+          \begingroup
+            \pgfkeysvalueof{/exsh/solutionsby font}%
+            \vskip\pgfkeysvalueof{/exsh/above solutionsby skip}\relax
+            \exsh at centering{\pgfkeysvalueof{/exsh/strings/solutionsby}~\exsh at solutionsby\\}\unskip%
+          \endgroup
+        }%
+      \else
+      \fi
+      \ifthenelse{\equal{}{\pgfkeysvalueof{/exsh/note}}}{%
+      }{%
+        \ifbool{exsh at samplesolutions}{}{%
+          \begingroup
+            \pgfkeysvalueof{/exsh/sheet note font}%
+            \vskip\pgfkeysvalueof{/exsh/above sheet note skip}\relax
+            \exsh at centering{\pgfkeysvalueof{/exsh/note}\\}\unskip%
+          \endgroup
+        }%
+      }%
+    \endgroup
+  }%
+  \ifdim\z@=\pgfkeysvalueof{/exsh/below sheet header skip}\relax
+    \vskip-\parskip
+  \else
+    \unskip\vskip\pgfkeysvalueof{/exsh/below sheet header skip}\relax
+  \fi
+%   \unskip
+%   \vskip\pgfkeysvalueof{/exsh/below sheet header skip}\relax
+  \exsh at firstexonsheettrue
+  \ifexsh at patchpagenumbers%
+    \stepcounter{page}%
+  \fi
+}%
+\fi
+%%%%%%%%%%%%%%% END BEAMER-SPECIFIC %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\ifdef{\othersectionslevelsformat}{%
+  \renewcommand{\othersectionlevelsformat}[1]{%
+    \ifstrequal{#1}{section}%
+    {}%
+    {\csname the#1\endcsname\autodot\enskip}}%
+}{}
+
+%Do not use \let here as \label may change before its use
+\def\exsh at autolabel{\label}
+\def\inexlabel{\label}
+
+\newcounter{exsh at pts@cur}
+\newcounter{exsh at ptsbonus@cur}
+\newenvironment*{exercise}[1][]{%
+  % TODO: \edef is not safe with luatex and umlauts, only fixed for "oral" for now
+  % TODO: check whether the TODO above is still relevant
+  %\edef seams to work fine with lualatex from TeXLive 2020
+  \pgfkeys{exsh,every exercise,#1,includeoverride}%
+  \ifthenelse{\equal{sum}{\pgfkeysvalueof{/exsh/points}}}{%
+    \ifcsname exsh at sumpts@\the\numexpr\arabic{\pgfkeysvalueof{/exsh/exercise counter}}+1\endcsname
+      \edef\exsh at sumpts{%
+        \csname exsh at sumpts@\the\numexpr\arabic{\pgfkeysvalueof{/exsh/exercise counter}}+1%
+        \endcsname%
+      }%
+      \edef\exsh at sumptsbonus{%
+        \csname exsh at sumptsbonus@\the\numexpr\arabic{\pgfkeysvalueof{/exsh/exercise counter}}+1%
+        \endcsname%
+      }%
+      \ifnumequal{\exsh at sumpts}{0}{%
+        \ifnumequal{\exsh at sumptsbonus}{0}{}{%
+          \edef\exsh at sumpts{\exsh at sumptsbonus}%
+          \exshset{bonus}%
+        }%
+      }{%
+        \ifnumequal{\exsh at sumptsbonus}{0}{}{%
+          \edef\exsh at sumpts{\exsh at sumpts+\exsh at sumptsbonus}%
+        }%
+      }%
+    \else%
+      \def\exsh at sumpts{??}%
+    \fi%
+    \exshset{points/.expanded={\exsh at sumpts}}
+    \setcounter{exsh at pts@cur}{0}
+    \setcounter{exsh at ptsbonus@cur}{0}
+    \exsh at sumuppointstrue%
+  }{%
+    \exsh at sumuppointsfalse%
+  }%
+  \ifthenelse{\equal{off}{\pgfkeysvalueof{/exsh/points}}}{%
+    \def\exsh at points{}%
+    \def\exsh at shortpoints{}%
+  }{%
+    \ifthenelse{\equal{}{\pgfkeysvalueof{/exsh/points}}}{%
+      \edef\exsh at points{\pgfkeysvalueof{/exsh/pointsinfo}}%
+    }{%
+      \ifthenelse{\equal{oral}{\pgfkeysvalueof{/exsh/points}}}{%
+        \ifexsh at abbrev%
+          \pgfkeysgetvalue{/exsh/strings/oral abbrev}{\exsh at points}%
+        \else%
+          \pgfkeysgetvalue{/exsh/strings/oral}{\exsh at points}%
+        \fi%
+      }{%
+         \ifexsh at abbrev%
+            \ifexsh at bonus%
+              \edef\exsh at points{\pgfkeysvalueof{/exsh/points} \pgfkeysvalueof{/exsh/strings/bonus points abbrev}}%
+            \else%
+              \edef\exsh at points{\pgfkeysvalueof{/exsh/points} \pgfkeysvalueof{/exsh/strings/points abbrev}}%
+            \fi%
+         \else%
+          \ifthenelse{\equal{1}{\pgfkeysvalueof{/exsh/points}}}{%
+            \ifexsh at bonus%
+              \edef\exsh at points{1 \pgfkeysvalueof{/exsh/strings/bonus point}}%
+            \else%
+              \edef\exsh at points{1 \pgfkeysvalueof{/exsh/strings/point}}%
+            \fi%
+          }{%
+            \ifexsh at bonus%
+              \edef\exsh at points{\pgfkeysvalueof{/exsh/points} \pgfkeysvalueof{/exsh/strings/bonus points}}%
+            \else%
+              \edef\exsh at points{\pgfkeysvalueof{/exsh/points} \pgfkeysvalueof{/exsh/strings/points}}%
+            \fi%
+           }%
+         \fi%
+       }%
+      \ifthenelse{\equal{}{\pgfkeysvalueof{/exsh/pointsinfo}}}{}{%
+        \edef\exsh at points{\expandonce\exsh at points, \pgfkeysvalueof{/exsh/pointsinfo}}%
+      }%
+    }%
+    \ifthenelse{\equal{}{\exsh at points}}{%
+      \def\exsh at shortpoints{}%
+    }{%
+      \edef\exsh at shortpoints{ (\expandonce\exsh at points)}%
+    }%
+%     \preto\exsh at points{
+%       \exsh at inshtml{<span style="float:right">}\hfill
+%       \enskip\exsh at alignright\bgroup%
+%       \pgfkeysvalueof{/exsh/points font}}%
+%     \appto\exsh at points{\egroup\exsh at inshtml{</span>}}%
+    \edef\exsh at points{\exsh at alignright{%
+      \pgfkeysvalueof{/exsh/points font}\expandonce\exsh at points
+    }}
+  }%
+  \ifthenelse{\equal{}{\pgfkeysvalueof{/exsh/firstline}}}{%
+    \def\exsh at firstline{}%
+  }{%
+    \def\exsh at firstline{\pgfkeysvalueof{/exsh/firstline}}%
+    \preto\exsh at firstline{\quad\bgroup\normalfont\normalsize}%
+    \appto\exsh at firstline{\egroup}%
+  }%
+  \ifthenelse{\equal{}{\pgfkeysvalueof{/exsh/name}}}{%
+    \def\exsh at exname{}%
+    \def\exsh at shortexname{}%
+  }{%
+    \edef\exsh at exname{\space(\pgfkeysvalueof{/exsh/name})}%
+    \edef\exsh at shortexname{:\space\pgfkeysvalueof{/exsh/name}}%
+  }%
+  \refstepcounter{\pgfkeysvalueof{/exsh/exercise counter}}%
+  \edef\exsh at tmp{[\pgfkeysvalueof{/exsh/strings/exercise} \arabic{\pgfkeysvalueof{/exsh/exercise counter}}\exsh at shortexname\expandonce\exsh at shortpoints]}%
+  \ifbool{exsh at samplesolutions}{\ifbool{exsh at sample}{\exsh at hidefalse}{\exsh at hidetrue}}{\exsh at hidefalse}%
+  \ifbool{exsh at hide}{%
+    \def\exsh at skipwhat{exercise}\exsh at skipstuff%
+  }{%
+    \expandafter\exsh at startheader\exsh at tmp{\noindent%
+      \hbox to 0pt{\hss\pgfkeysvalueof{/exsh/exercisemark}}%
+      \pgfkeysvalueof{/exsh/strings/exercise}~\arabic{\pgfkeysvalueof{/exsh/exercise counter}}\exsh at exname\exsh at firstline\expandonce\exsh at points}%
+    \ifdim\z@=\pgfkeysvalueof{/exsh/below exercise title skip}\relax
+      \vskip-\parskip
+    \else
+      \unskip\vskip\pgfkeysvalueof{/exsh/below exercise title skip}\relax
+    \fi
+    \@afterindentfalse
+    % automatic label for the first exercise in every included file
+    \ifthenelse{\equal{\jobname}{\currfilebase}}{}{%
+      \ifcsdef{exsh at autolabel@\currfilebase}{}{%
+        \csdef{exsh at autolabel@\currfilebase}{}%
+        \exsh at autolabel{ex:\currfilebase}}}%
+    % Use \leavevmode to ensure proper distances above environments that start
+    % with a new \par. Make sure that a \label does not mess up the layout.
+    \@ifnextchar\label{\exsh at label}{\leavevmode\ignorespaces}%
+  }%
+}{%
+  %before writing point sums check that we actually computed them
+  \ifexsh at sumuppoints%
+    \immediate\write\@auxout{
+      \string\expandafter\gdef%
+      \detokenize{\csname} exsh at sumpts@\arabic{\pgfkeysvalueof{/exsh/exercise counter}}\endcsname{%
+        \arabic{exsh at pts@cur}%
+      }%
+      \string\expandafter\gdef%
+      \detokenize{\csname} exsh at sumptsbonus@\arabic{\pgfkeysvalueof{/exsh/exercise counter}}\endcsname{%
+        \arabic{exsh at ptsbonus@cur}%
+      }%
+    }%
+  \fi
+  \ifexsh at beamer\clearpage\fi%%%% <<<<<BEAMER ONLY%%%%%%%%%%%%%%%%%
+}
+\newcommand{\exsh at label}[2]{#1{#2}\leavevmode\ignorespaces}
+
+%%%%%%%%%%%%%%% BEGIN BEAMER-SPECIFIC: %%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\ifexsh at beamer
+\newcommand{\exsh at startheader}[2][]{%
+   \newpage
+   \stepcounter{framenumber}
+%   \begin{block}{}
+%   \pgfkeysvalueof{/exsh/exercise title font}{#2}%
+%   \end{block}
+  \ifbool{exsh at beameruseblocks}{%
+    \begingroup
+    \usebeamercolor{block title}
+    \setbeamercolor{block body}{bg=bg,fg=fg}
+    \block{}{\pgfkeysvalueof{/exsh/exercise title font}{#2}}%
+      \endblock
+    \endgroup
+  }{
+    \begin{beamercolorbox}[rounded=true,wd={\textwidth}]%
+      {block title}
+      \pgfkeysvalueof{/exsh/exercise title font}{#2}
+    \end{beamercolorbox}
+  }
+  \ifexsh at patchenumerate
+    \setbeamertemplate{enumerate items}{\insertenumlabel}
+    \renewcommand{\insertenumlabel}{
+      \ifnum\@enumdepth=1
+        \alph{enumi})
+      \else\ifnum\@enumdepth=2
+        \arabic{enumii}.
+      \else
+        \roman{enumiii}
+      \fi\fi
+    }
+  \fi
+}%
+\else%--------- NON-BEAMER: ---------------------------------------
+\ifexsh at usestartsection
+  \newcommand{\exsh at startheader}[2][]{%
+    \@startsection{section}{1}{\z@}{%
+      \ifexsh at firstexonsheet
+        \pgfkeysvalueof{/exsh/above first exercise skip}%
+      \else
+        \pgfkeysvalueof{/exsh/above exercise skip}
+      \fi
+    }{1em}% afterskip corrected below
+    {\pgfkeysvalueof{/exsh/exercise title font}}%
+    [#1]{#2}%
+    \exsh at firstexonsheetfalse
+  }%
+\else
+  \newcommand{\exsh at startheader}[2][]{%
+    \ifexsh at firstexonsheet
+      \ifdim\z@=\pgfkeysvalueof{/exsh/above first exercise skip}\relax
+        \vskip-\parskip
+      \else
+        \unskip%
+        \vskip\pgfkeysvalueof{/exsh/above first exercise skip}\relax
+      \fi
+    \else
+      \ifdim\z@=\pgfkeysvalueof{/exsh/above exercise skip}\relax
+        \vskip-\parskip
+      \else
+        \unskip%
+        \vskip\pgfkeysvalueof{/exsh/above exercise skip}\relax
+      \fi
+    \fi
+    {\pgfkeysvalueof{/exsh/exercise title font} #2}%
+    \exsh at firstexonsheetfalse
+  }
+\fi
+\fi
+%%%%%%%%%%%%%%% END BEAMER-SPECIFIC %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%includeoverride is not part of the public interface
+\exshset{includeoverride/.style={}}
+\def\includeexercise{%
+  \@ifstar\exsh at includeexercise@\exsh at includeexercise%
+}
+
+\newcommand{\exsh at includeexercise}[2][]{%
+  \ifbool{exsh at filenameasexercisename}{%
+    \exshset{includeoverride/.style={name={\detokenize{#2}},#1}}%
+  }{%
+    \exshset{includeoverride/.style={#1}}%
+  }%
+  \input{\ifdefvoid{\exsh at exercisespath}{}{\exsh at exercisespath/}#2}
+  \exshset{includeoverride/.style={}}
+}
+
+\newcommand{\exsh at includeexercise@}[2][]{%
+  \ifbool{exsh at filenameasexercisename}{%
+    \exshset{includeoverride/.style={name={\detokenize{#2}},#1}}%
+  }{%
+    \exshset{includeoverride/.style={#1}}%
+  }%
+  \begingroup
+  %auto labelling is still allowed, but other labels are forbidden
+  %here we may use \let as the definition is close to its use
+  \let\exsh at autolabel\label
+  \let\inexlabel\label
+  \def\label##1{%
+    \PackageError{exercisesheets}{\string\label{##1}\space
+    inside \string\includeexercise*}{}%
+  }
+  \input{\ifdefvoid{\exsh at exercisespath}{}{\exsh at exercisespath/}#2}
+  \endgroup
+  \exshset{includeoverride/.style={}}
+}
+
+
+\def\includeLexercise{%
+  \@ifstar\exsh at includeLexercise@\exsh at includeLexercise%
+}
+
+\ifluatex
+\newcommand{\exsh at includeLexercise}[2][]{%
+  \ifbool{exsh at filenameasexercisename}{%
+    \exshset{includeoverride/.style={name={#2},#1}}%
+  }{%
+    \exshset{includeoverride/.style={#1}}%
+  }%
+  \directlua{
+    local prefix =
+      "\ifdefvoid{\exsh at exercisespath}{}{\exsh at exercisespath/}"
+    exsh_cur_exercise=dofile(prefix .. "#2.lua")
+    exsh_texprintlines(exsh_cur_exercise)
+  }%
+  \exshset{includeoverride/.style={}}%
+}
+
+\newcommand{\exsh at includeLexercise@}[2][]{%
+  \ifbool{exsh at filenameasexercisename}{%
+    \exshset{includeoverride/.style={name={#2},#1}}%
+  }{%
+    \exshset{includeoverride/.style={#1}}%
+  }%
+  \begingroup
+  %auto labelling is still allowed, but other labels are forbidden
+  %here we may use \let as the definition is close to its use
+  \let\exsh at autolabel\label
+  \def\label##1{%
+    \PackageError{exercisesheets}{\string\label{##1}\space
+    inside \string\includeLexercise*}{}%
+  }
+  \directlua{
+    local prefix =
+      "\ifdefvoid{\exsh at exercisespath}{}{\exsh at exercisespath/}"
+    exsh_cur_exercise=dofile(prefix .. "#2.lua")
+    exsh_texprintlines(exsh_cur_exercise)
+  }%
+  \endgroup
+  \exshset{includeoverride/.style={}}
+}
+\else
+  \newcommand{\exsh at includeLexercise}[2][]{
+    \refstepcounter{\pgfkeysvalueof{/exsh/exercise counter}}
+    Lexercise needs Lua\LaTeX!
+  }
+  \let\exsh at includeLexercise@\exsh at includeLexercise
+\fi
+
+\AfterPackage*{varioref}{
+  \labelformat{section}{\pgfkeysvalueof{/exsh/strings/exercise}~\arabic{section}}
+}
+
+
+\let\exsh at subexn\getrefnumber
+
+\ifexsh at patchenumerate
+  \AfterPackage*{varioref}{
+    \labelformat{enumi}{\arabic{\pgfkeysvalueof{/exsh/exercise counter}}.\alph{enumi}}
+    \def\exsh at afterdot#1.#2{#2}%x.y -> y
+    \def\exsh at subexn#1{%
+      \if\getrefnumber{#1}0%
+        0%
+      \else%x.y->y, then inverse \@alph
+        \the\numexpr(\expandafter\expandafter\expandafter%
+        \expandafter\expandafter\expandafter%
+        \expandafter`\expandafter\expandafter\expandafter%
+        \exsh at afterdot\getrefnumber{#1}-`a+1)\relax%
+      \fi%
+    }
+  }
+  \AfterPackage*{paralist}{
+    \setdefaultenum{(a)}{(1)}{i.}{A.}
+  }
+  \AfterPackage*{enumitem}{
+    \setenumerate[1]{label=(\alph*)}
+    \setenumerate[2]{label=(\arabic*)}
+    \setenumerate[3]{label=\roman*.}
+    \setenumerate[4]{label=\Alph.}
+  }
+  \def\theHenumi{enumi.\arabic{\pgfkeysvalueof{/exsh/sheet counter}}.\arabic{\pgfkeysvalueof{/exsh/exercise counter}}.\arabic{enumi}}
+%%%%%%%%%%%%%%% BEGIN BEAMER-SPECIFIC: %%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\ifexsh at beamer
+  % code below breaks [] argument after \begin{enumerate}
+  % when beamer is used
+  % in beamer we set item labels separately
+  % see beamer specific def. of \exsh at startheader
+\else%--------- NON-BEAMER: ---------------------------------------
+  \AtEndPreamble{%
+    \@ifpackageloaded{paralist}{}{%
+      \@ifpackageloaded{enumitem}{}{%
+        \apptocmd{\enumerate}{
+          \ifnum\@enumdepth=1%
+            \def\labelenumi{(\alph{enumi})}
+            \def\labelenumii{\arabic{enumii}.}
+            \def\labelenumiii{\roman{enumiii}.}
+          \fi
+        }{}{}%
+      }%
+    }%
+  }%
+\fi
+%%%%%%%%%%%%%%% END BEAMER-SPECIFIC %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\fi
+
+\newcommand{\subexnref}[1]{\exsh at subexn{#1}}
+\newcommand{\subexlref}[1]{(\@alph{\exsh at subexn{#1}})}
+
+%for now this is not part of the public interface
+\exshset{subtask counter/.initial={enumi}}
+\exshset{subtask environment/.initial={enumerate}}
+\exshset{subtask item/.initial={item}}
+\edef\exsh at subtaskctr{\pgfkeysvalueof{/exsh/subtask counter}}
+\def\exsh at subtaskenv{\pgfkeysvalueof{/exsh/subtask environment}}
+\def\exsh at subtaskitm{\pgfkeysvalueof{/exsh/subtask item}}
+
+%define subex as an alias for enumi
+\expandafter\let\expandafter\c at subex%
+  \csname c@\exsh at subtaskctr\endcsname
+\expandafter\let\expandafter\p at subex%
+  \csname p@\exsh at subtaskctr\endcsname
+\expandafter\let\expandafter\thesubex%
+  \csname the\exsh at subtaskctr\endcsname
+\expandafter\let\expandafter\theHsubex%
+  \csname theH\exsh at subtaskctr\endcsname
+\expandafter\let\expandafter\cl at subex%
+  \csname cl@\exsh at subtaskctr\endcsname
+
+% reset equation numbering for each exercise
+\@addtoreset{equation}{\pgfkeysvalueof{/exsh/exercise counter}}
+
+\long\def\exsh at savemaintask#1{%
+  \global\def\exsh at restatetaskmain{#1}%
+  #1%
+}
+
+\newenvironment{maintask}[1][]{%
+  \pgfkeys{exsh,#1}%
+  \pgfkeysvalueof{/exsh/main task font}%
+  \ifbool{exsh at savetasks}{\Collect at Body\exsh at savemaintask}{}%
+  \ignorespaces
+}{}
+
+\newenvironment{subtasks}[1][]{%
+  \pgfkeys{exsh,#1}%
+  \begin{\exsh at subtaskenv}
+  \def\exsh at ifwithinsubt##1##2{##1}
+  \ignorespaces\begingroup
+}{
+  \endgroup
+  \end{\exsh at subtaskenv}%
+}
+
+\def\exsh at ifwithinsubt#1#2{#2}
+
+\def\exsh at ensuressubtasks{%
+  \exsh at ifwithinsubt{
+    \endgroup\begingroup
+  }{%
+    \PackageWarning{exercisesheets}{%
+      Using \subtask\space without a subtasks environment
+      is unsupported
+    }{}%
+  }%
+}
+
+\newcommand{\subtask}[2][]{%
+  \exsh at ensuressubtasks
+  \pgfkeys{exsh,#1}%
+  \csname\exsh at subtaskitm\endcsname%
+    {\pgfkeysvalueof{/exsh/subtask font} #2}%
+  \ifbool{exsh at savetasks}{%
+    \csgdef{exsh at restatetask\arabic{\exsh at subtaskctr}}{#2}%
+    \csdef{exsh at restatetaskcur}{#2}%
+  }{}%
+}
+
+\def\exsh at ensuresavetasks{%
+  \ifbool{exsh at savetasks}{}{%
+    \PackageError{exercisesheets}{%
+      If you want to restate something, you have to %
+      use the option savetasks.%
+    }{}%
+  }%
+}
+
+\def\restatetask{%
+  \exsh at ensuresavetasks%
+  \@ifstar\exsh at restatetask@\exsh at restatetask%
+}
+
+\newcommand{\exsh at restatetask}[1][main]{%
+  {\pgfkeysvalueof{/exsh/task restate font}%
+  \csname exsh at restatetask#1\endcsname}%
+}
+
+\newcommand{\exsh at restatetask@}[1][main]{%
+  {\pgfkeysvalueof{/exsh/task restate font}%
+  \csname exsh at restatetask#1\endcsname}\\%
+}
+
+%%%%%%%%%%%%%%% BEGIN BEAMER-SPECIFIC: %%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\ifexsh at beamer
+  \let\restatetaskbeamer\restatetask
+\else%--------- NON-BEAMER: ---------------------------------------
+  \def\restatetaskbeamer{%
+    \@ifstar\exsh at restatetaskbeamer\exsh at restatetaskbeamer%
+  }
+  \newcommand{\exsh at restatetaskbeamer}[1][main]{}
+\fi
+%%%%%%%%%%%%%%% END BEAMER-SPECIFIC %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\newenvironment{hint}[1][]{%
+  \par
+  \pgfkeys{exsh,every hint,#1,hint font}%
+  \vskip\pgfkeysvalueof{/exsh/above hint skip}\relax\noindent
+  {\pgfkeysvalueof{/exsh/hint title font}\pgfkeysvalueof{/exsh/strings/hint}:}~\ignorespaces
+}{%
+  \par
+}
+\newenvironment{hint*}[1][]{%
+  \pgfkeys{exsh,every hint,#1,hint font}%
+  ({\pgfkeysvalueof{/exsh/hint title font}\pgfkeysvalueof{/exsh/strings/hint}:}\space%
+}{%
+  \unskip)%
+}
+
+
+%%%%%%%%%%%%%%% BEGIN BEAMER-SPECIFIC: %%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\ifexsh at beamer
+  \let\exsh at postsolutionclear\clearpage
+\else%--------- NON-BEAMER: ---------------------------------------
+  \let\exsh at postsolutionclear\par
+\fi
+%%%%%%%%%%%%%%% END BEAMER-SPECIFIC %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\providecommand{\solution}{}
+\renewenvironment{solution}[1][]{%
+  \pgfkeys{exsh,every solution,#1,solution font}%
+  \ifthenelse{\equal{oral}{\pgfkeysvalueof{/exsh/points}}}{%
+    \ifbool{exsh at oralsolutions}{%
+      \let\next\exsh at startsolution
+    }{%
+      \let\next\exsh at skipsolution
+    }%
+  }{%
+    \ifbool{exsh at nonoralsolutions}{%
+      \let\next\exsh at startsolution
+    }{%
+      \let\next\exsh at skipsolution
+    }%
+  }%
+  \ifbool{exsh at forcesample}{%
+    \ifbool{exsh at samplesolutions}{%
+      \let\next\exsh at startsolution
+    }{}%
+  }{}%
+  \ifbool{exsh at beamersolution}{%
+    \let\next\exsh at skipsolution
+  }{}%
+  \next
+}{%
+  \ifbool{exsh at beamersolution}{}{%
+    \ifthenelse{\equal{oral}{\pgfkeysvalueof{/exsh/points}}}{%
+      \ifbool{exsh at oralsolutions}{\exsh at postsolutionclear}{}%
+    }{%
+      \ifbool{exsh at nonoralsolutions}{\exsh at postsolutionclear}{}%
+    }%
+  }%
+}
+
+
+%%%%%%%%%%%%%%% BEGIN BEAMER-SPECIFIC: %%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\ifexsh at beamer
+\def\exsh at solutiontitle#1{
+  \ifbool{exsh at beameruseblocks}{%
+    \begin{alertblock}{}%
+    {\pgfkeysvalueof{/exsh/solution title font}%
+      \pgfkeysvalueof{/exsh/strings/solution} %
+      (\pgfkeysvalueof{/exsh/strings/exercise} \arabic{\pgfkeysvalueof{/exsh/exercise counter}}%
+        \ifnum\@enumdepth>0\alph{subex}\fi)} %
+        \ifbool{exsh at headerrestate}{
+          \exsh at ensuresavetasks
+          \csname exsh at restatetask%
+          \ifnum\@enumdepth>0cur\else main\fi%
+          \endcsname%
+        }{}%
+    \end{alertblock}
+  }{
+    \begin{beamercolorbox}[rounded=true,wd={#1}]%
+        {block title alerted}
+      {\pgfkeysvalueof{/exsh/solution title font}%
+      \pgfkeysvalueof{/exsh/strings/solution} %
+      (\pgfkeysvalueof{/exsh/strings/exercise} \arabic{\pgfkeysvalueof{/exsh/exercise counter}}%
+        \ifnum\@enumdepth>0\alph{subex}\fi)} %
+      \ifbool{exsh at headerrestate}{
+        \exsh at ensuresavetasks
+        \csname exsh at restatetask%
+        \ifnum\@enumdepth>0cur\else main\fi%
+        \endcsname%
+      }{}%
+    \end{beamercolorbox}
+  }
+}
+\newcommand{\solutiontitle}[1][\linewidth]{
+  \ifhmode \linebreak\fi\exsh at solutiontitle{#1}
+}
+
+\newcommand{\deferredsolutiontitle}[1][\linewidth]{
+  \ifbool{exsh at defersolutiontitle}{%
+    \ifhmode \linebreak\fi\exsh at solutiontitle{#1}
+  }{}%
+}
+
+
+\long\def\exsh at processframes#1\newframe{%
+\ifstrequal{#1}{}{}{%
+\clearpage
+\begin{frame}[t]{}
+` \unskip\vskip1pt\vskip-\parskip
+  \solutiontitle[\textwidth]
+  #1
+\end{frame}%
+\exsh at processframes%
+}%no whitespace here is crucial for end detecttion
+}
+
+
+\long\def\exsh at collectedframe#1{
+\exsh at processframes#1\newframe\newframe
+}
+
+\else%--------- NON-BEAMER: ---------------------------------------
+%this command is only usefule for exercisesheets-beamer to place
+%the deferred title within a new frame
+\newcommand{\solutiontitle}[1][]{}
+\fi
+%%%%%%%%%%%%%%% END BEAMER-SPECIFIC %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+%%%%%%%%%%%%%%% BEGIN BEAMER-SPECIFIC: %%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\ifexsh at beamer
+\def\exsh at startsolution{%
+  \ifnum\@enumdepth=0
+    \ifbool{exsh at framed}{}{\clearpage\stepcounter{framenumber}}
+  \fi
+%   \usebeamercolor{block title alerted}
+%   \setbeamercolor{block body}{bg=bg,fg=fg}
+%   \block{}
+%     \pgfkeysvalueof{/exsh/solution title font}%
+%     \pgfkeysvalueof{/exsh/strings/solution} %
+%     (\pgfkeysvalueof{/exsh/strings/exercise} \arabic{\pgfkeysvalueof{/exsh/exercise counter}}%
+%     \alph{subex})%
+%   \endblock
+  \ifbool{exsh at framed}{\exsh at defersolutiontitletrue}{}
+  \ifbool{exsh at defersolutiontitle}{}{%
+    \ifhmode \linebreak\fi
+    \exsh at solutiontitle{\linewidth}
+  }%
+  \let\next\relax
+  \ifbool{exsh at framed}{%
+    \def\next{\Collect at Body\exsh at collectedframe}%
+    \ifbool{exsh at fragile}{%
+      \ifluatex%
+        \def\next{\exsh at start@lframed@}
+      \else
+        \PackageError{exercisesheets}{Fragile frames require
+          LuaLaTeX!}{}
+      \fi%
+    }{}%
+  }{}%
+  \next%
+}%
+\else%--------- NON-BEAMER: ---------------------------------------
+\def\exsh at startsolution{\@afterindentfalse
+  \vskip\pgfkeysvalueof{/exsh/above solution skip}\relax%
+  {\parindent \z@
+    \pgfkeysvalueof{/exsh/solution title font}%
+    \pgfkeysvalueof{/exsh/strings/solution}%
+    \pgfkeysvalueof{/exsh/solution title separator}%
+  }\nobreak%
+  \@afterheading
+}%
+\fi
+%%%%%%%%%%%%%%% END BEAMER-SPECIFIC %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\long\def\exsh at skipsolution#1{%
+  \ifstrequal{#1}{\end}{\exsh at endsolution}{\exsh at skipsolution}%
+}
+\def\exsh at endsolution#1{%
+  \ifstrequal{#1}{solution}{
+    \end{solution}
+  }{%
+    \ifstrequal{#1}{beamersolution}{
+      \end{beamersolution}
+    }{%
+      \exsh at skipsolution}%
+  }%
+}
+
+%%%%%%%%%%%%%%% BEGIN BEAMER-SPECIFIC: %%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\ifexsh at beamer
+\newenvironment<>{beamersolution}[1][]{%
+  \pgfkeys{exsh,every solution,#1,solution font}%
+  \ifthenelse{\equal{oral}{\pgfkeysvalueof{/exsh/points}}}{%
+    \ifbool{exsh at oralsolutions}{%
+      \let\next\exsh at startsolution
+    }{%
+      \let\next\exsh at skipsolution
+    }%
+  }{%
+    \ifbool{exsh at nonoralsolutions}{%
+      \let\next\exsh at startsolution
+    }{%
+      \let\next\exsh at skipsolution
+    }%
+  }%
+  \ifbool{exsh at forcesample}{%
+    \ifbool{exsh at samplesolutions}{%
+      \let\next\exsh at startsolution
+    }{}%
+  }{}%
+  \next
+}{%
+%   \ifbool{exsh at framed}{\end{frame}}{}
+  \ifthenelse{\equal{oral}{\pgfkeysvalueof{/exsh/points}}}{%
+    \ifbool{exsh at oralsolutions}{\clearpage}{}%
+  }{%
+    \ifbool{exsh at nonoralsolutions}{\clearpage}{}%
+  }%
+}
+\else%--------- NON-BEAMER: ---------------------------------------
+%the regular version of exercisesheets.sty skips all beamer solutions
+\newenvironment{beamersolution}[1][]{\exsh at skipsolution}{}%
+\fi
+%%%%%%%%%%%%%%% END BEAMER-SPECIFIC %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\newcommand{\points}[2][]{%
+  \ifthenelse{\equal{}{#2}}{}{\exshset{points=#2}}%
+  \bgroup%
+  \exshset{#1}%
+  \ifthenelse{\equal{}{\pgfkeysvalueof{/exsh/pointsinfo}}}{%
+    \def\exsh at tmp{}%
+  }{%
+    \def\exsh at tmp{, \pgfkeysvalueof{/exsh/pointsinfo}}%
+  }%
+  \ifthenelse{\equal{#2}{oral}}{%
+    \ifexsh at abbrev%
+      \exsh at subexpoints{\pgfkeysvalueof{/exsh/strings/oral abbrev}\exsh at tmp}%
+    \else%
+      \exsh at subexpoints{\pgfkeysvalueof{/exsh/strings/oral}\exsh at tmp}%
+    \fi%
+  }{%
+    \ifthenelse{\equal{#2}{}}{%
+      \exsh at subexpoints{\pgfkeysvalueof{/exsh/pointsinfo}}%
+    }{%
+      \ifexsh at abbrev%
+          \ifexsh at bonus%
+            \exsh at subexpoints{#2~\pgfkeysvalueof{/exsh/strings/bonus points abbrev}\exsh at tmp}%
+          \else%
+            \exsh at subexpoints{#2~\pgfkeysvalueof{/exsh/strings/points abbrev}\exsh at tmp}%
+          \fi%
+      \else%
+        \ifthenelse{\equal{#2}{1}}{%
+          \ifexsh at bonus%
+            \exsh at subexpoints{1~\pgfkeysvalueof{/exsh/strings/bonus point}\exsh at tmp}%
+          \else%
+            \exsh at subexpoints{1~\pgfkeysvalueof{/exsh/strings/point}\exsh at tmp}%
+          \fi%
+        }{%
+          \ifexsh at bonus%
+            \exsh at subexpoints{#2~\pgfkeysvalueof{/exsh/strings/bonus points}\exsh at tmp}%
+          \else%
+            \exsh at subexpoints{#2~\pgfkeysvalueof{/exsh/strings/points}\exsh at tmp}%
+          \fi%
+        }%
+      \fi%
+      \ifexsh at sumuppoints%
+        \ifexsh at bonus%
+          \addtocounter{exsh at ptsbonus@cur}{#2}
+        \else%
+          \addtocounter{exsh at pts@cur}{#2}
+        \fi%
+      \fi%
+    }%
+  }%
+  \egroup
+  \ignorespaces
+}
+
+\newenvironment{gradingguide}[1][]{%
+  \pgfkeys{exsh,#1,grading guide font}%
+  \ifbool{exsh at gradingguides}{%
+    \let\next\exsh at startguide
+  }{%
+    \let\next\exsh at skipguide
+  }%
+  \next
+}{}
+
+\def\exsh at startguide{\@afterindentfalse%
+  \par
+  {\parindent \z@
+    \pgfkeysvalueof{/exsh/strings/gradingguide}: }\nobreak%
+  \@afterheading
+}%
+
+\long\def\exsh at skipguide#1{%
+  \ifstrequal{#1}{\end}{\exsh at endguide}{\exsh at skipguide}%
+}
+\def\exsh at endguide#1{%
+  \ifstrequal{#1}{gradingguide}{\end{gradingguide}}{\exsh at skipguide}%
+}
+
+
+\ifluatex%
+  \ifdefined\luatextextdir
+    \def\exsh at putatend#1{%
+      \leavevmode\luatextextdir TRT\unskip{\luatextextdir TLT{\hfill~~#1}}\luatextextdir TLT}%
+  \else
+    \def\exsh at putatend#1{%
+      \leavevmode\textdir TRT\unskip{\textdir TLT{\hfill~~#1}}\textdir TLT}%
+  \fi
+\else%
+  \def\exsh at putatend#1{%
+    \TeXXeTstate=1%
+    \beginR\unskip{\beginL~~#1\endL}\hfill\beginL\TeXXeTstate=0}%
+\fi
+
+\def\exsh at leaveinplace#1{\unskip~{#1} }
+\def\exsh at insertFill#1{\unskip\nobreak\space\nobreak\hspace*{\fill}\allowbreak\hspace*{\fill}{#1}\unskip}
+
+\newcommand{\exsh at subexpoints}[1]{%
+   \ifexsh at inplace%
+     \exsh at leaveinplace{\pgfkeysvalueof{/exsh/points font}\mbox{(#1)}}%
+   \else%
+     \ifexsh at pointsfloatright% can be used directly after \item etc.
+       \exsh at putatend{\pgfkeysvalueof{/exsh/points font}\mbox{(#1)}}%
+     \else% original points macro with fill
+       \exsh at insertFill{\pgfkeysvalueof{/exsh/points font}\mbox{(#1)}}%
+     \fi%
+   \fi%
+}
+
+\newcommand{\TODO}[1][]{%
+  \ifexsh at showtodos
+    \ifmmode
+      \text{\pgfkeysvalueof{/exsh/todo marker font}TODO #1}%
+    \else
+      {\pgfkeysvalueof{/exsh/todo marker font}TODO #1}%
+    \fi
+  \fi
+  \PackageWarning{exercisesheets}{TODO marker found}%
+}
+
+\newcommand{\ifsolutions}[2]{%
+  \ifbool{exsh at solutions}{#1}{#2}%
+}
+
+\newcommand{\iforalsolutions}[2]{%
+  \ifbool{exsh at oralsolutions}{#1}{#2}%
+}
+\newcommand{\ifnonoralsolutions}[2]{%
+  \ifbool{exsh at nonoralsolutions}{#1}{#2}%
+}
+\newcommand{\ifsamplesolutions}[2]{%
+  \ifbool{exsh at samplesolutions}{#1}{#2}%
+}
+\newcommand{\samplehide}[1]{%
+  \ifbool{exsh at samplesolutions}{}{#1}%
+}
+
+
+%%%%%%%%%%%%%%% BEGIN BEAMER-ONLY: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\ifexsh at beamer
+\ifexsh at patchheadandfoot
+  \setbeamertemplate{headline}{}%
+  \setbeamertemplate{footline}{}%
+\fi
+\ifbool{exsh at beamerwithheadline}{%
+  \setbeamertemplate{headline}{%
+%     \leavevmode%
+    \begin{beamercolorbox}[wd=\paperwidth,vmode]{frametitle}
+      \vspace{0.4em}
+      \leavevmode
+      \begingroup
+        \footnotesize%
+        \hspace*{2ex}{\pgfkeysvalueof{/exsh/subject font}%
+        \pgfkeysvalueof{/exsh/subject}} \hfill%
+        {\pgfkeysvalueof{/exsh/semester font}%
+        \pgfkeysvalueof{/exsh/semester}}\hspace{2ex}\hfil%
+        \vspace{1mm}\linebreak%
+        \hspace*{2ex}{\pgfkeysvalueof{/exsh/author font}\exsh at author}%
+        \hfill{\pgfkeysvalueof{/exsh/date font}%
+        \pgfkeysvalueof{/exsh/date}}%
+        \hspace{2ex}\hfil%\vspace{-1em}
+      \endgroup
+      \vspace{0.4em}
+    \end{beamercolorbox}%
+    \vspace*{3mm}
+    \vskip\pgfkeysvalueof{/exsh/below slide headline skip}\relax%
+  }
+  \addtobeamertemplate{frametitle}{\vspace{-3mm}}{}
+}{}%
+
+
+\ifbool{exsh at beamerwithfootline}{%
+  \setbeamertemplate{footline}{%
+    \leavevmode%
+    \hbox{\begin{beamercolorbox}[wd=.5\paperwidth,ht=2.5ex,dp=1.125ex,leftskip=.3cm,rightskip=.3cm]{frametitle}%
+    {\pgfkeysvalueof{/exsh/author font}\pgfkeysvalueof{/exsh/exauthor}}
+    \end{beamercolorbox}%
+    \begin{beamercolorbox}[wd=.5\paperwidth,ht=2.5ex,dp=1.125ex,leftskip=.3cm,rightskip=.3cm plus1fil]{author in head/foot}%
+      \usebeamerfont{author in head/foot}
+      \inserttitle
+      \hfill\insertpagenumber
+    \end{beamercolorbox}}%
+    \vskip0pt%
+  }
+}{}%
+\fi
+%%%%%%%%%%%%%%% END BEAMER-ONLY %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\ifluatex
+  \let\exsh at dlua\directlua
+\else
+  \def\exsh at dlua#1{}
+\fi
+
+%change only some catcodes to
+\begingroup
+\catcode`!=0
+\catcode`\@=11
+\catcode`\_=12
+\catcode`\{=12 %set those to the same value (11/12) as below!
+\catcode`\}=12 %
+\catcode`<=1
+\catcode`>=2
+\catcode`\~=11
+\catcode`\\=11
+%% Expanded, when \catcode`\^^M=12 holds
+!global!long!def!exsh at start@Lexercise#1\end{Lexercise}< %
+  !exsh at dlua<exsh_cur_exercise=exercise({#1})> %
+  !endgroup!end<Lexercise>%
+>
+!global!long!def!exsh at start@skip at Lexercise#1\end{Lexercise}< %
+  !exsh at dlua<exsh_cur_exercise=exercise({#1})> %
+  !ifluatex!else%
+    !refstepcounter<!pgfkeysvalueof</exsh/exercise counter>>%
+  !fi
+  !endgroup!endgroup%
+  !expandafter!exsh at skipstuff%
+    !exsh at dlua<exsh_texprintlines(exsh_cur_exercise)>%
+>
+!global!long!def!exsh at start@lframed#1\end{solution}< %
+  !exsh at dlua<exsh_cur_solution=fragileframed([[#1]])> %
+  !endgroup!end<solution>%
+    !exsh at dlua<exsh_texprintlines(exsh_cur_solution)>%
+>
+!endgroup
+
+\def\exsh at lua@catcodesBG{
+\begingroup
+\catcode`!=12
+\catcode`\$=12
+\catcode`\#=12
+\catcode`\_=12
+\catcode`\^=12
+\catcode`\&=12
+\catcode`\|=12
+\catcode`\{=12 %set those to the same value (11/12) as above!
+\catcode`\}=12 %
+\catcode`\~=12
+\catcode`\@=11
+\catcode`\%=12
+\catcode`\ =12
+\catcode9=12
+\catcode`\^^I=12
+\catcode`\^^J=12\catcode`\^^M=12\catcode`\\=11\endlinechar-1}
+
+\newenvironment{Lexercise}{%
+  \exsh at lua@catcodesBG\exsh at start@Lexercise%
+}{%
+  \ifluatex
+    \exsh at dlua{exsh_texprintlines(exsh_cur_exercise)}%
+  \else
+    \refstepcounter{\pgfkeysvalueof{/exsh/exercise counter}}
+    Lexercise needs Lua\LaTeX!
+  \fi
+}
+
+\def\exsh at skipstuff@Lexercise{\exsh at lua@catcodesBG\exsh at start@skip at Lexercise}%
+\def\exsh at start@lframed@{\exsh at lua@catcodesBG\exsh at start@lframed}
+
+\exsh at dlua{dofile(kpse.find_file("exsh_lexercise.lua"))}


Property changes on: trunk/Master/texmf-dist/tex/latex/exercisesheets/exercisesheets.sty
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/tlpkg/bin/tlpkg-ctan-check
===================================================================
--- trunk/Master/tlpkg/bin/tlpkg-ctan-check	2024-04-24 20:19:11 UTC (rev 71062)
+++ trunk/Master/tlpkg/bin/tlpkg-ctan-check	2024-04-24 20:20:13 UTC (rev 71063)
@@ -317,7 +317,7 @@
     exam exam-lite exam-n exam-randomizechoices exam-zh
     examdesign example examplep examz
     exceltex excludeonly exercise exercisebank exercisepoints exercises
-    exesheet exframe exp-testopt
+    exercisesheets exesheet exframe exp-testopt
     expdlist expex expex-acro expex-glossonly expkv-bundle export
     expose-expl3-dunkerque-2019 expressg
     exsheets exsol extarrows exteps

Modified: trunk/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc
===================================================================
--- trunk/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc	2024-04-24 20:19:11 UTC (rev 71062)
+++ trunk/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc	2024-04-24 20:20:13 UTC (rev 71063)
@@ -491,6 +491,7 @@
 depend exercisebank
 depend exercisepoints
 depend exercises
+depend exercisesheets
 depend exesheet
 depend exframe
 depend exp-testopt

Added: trunk/Master/tlpkg/tlpsrc/exercisesheets.tlpsrc
===================================================================


More information about the tex-live-commits mailing list.