\long\def\ifbeamer#1#2{#1} \ifbeamer{\documentclass{beamer}}{\documentclass{article}} %navigation symbols and the title collide if %beamerwithheadline is set \ifbeamer{ \setbeamertemplate{navigation symbols}{} }{} %patchenumerate is the deafault \usepackage[patchenumerate=true,beamerwithheadline, beamercompatibility]% {exercisesheets\ifbeamer{-beamer}{}} \usepackage{varioref} \usepackage{hyperref} \usepackage{xcolor} \begin{document} %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{ %default is \clearpage sheet start page action={\pagebreak[3]\hrule}, sheet end page action={\vspace{4mm}\hrule\vspace{2cm}}, } } \exshset{solutions=true, task restate font={\color{black!60}}, } \begin{sheet}[note={Learn how to create nice exercise sheets.}, date={Novanuar 42, -2022},title={First Sheet}] \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 \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} \begin{sheet}[date={Novanuar 35, -2022}] \begin{exercise}[points={many, many}, firstline={Read the manual.}] \end{exercise} \end{sheet} \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. \end{solution} \end{exercise} \end{sheet} \begin{sheet}[date={Novanuar 21, -2022}] \begin{exercise}[points={many, many}, firstline={Read the manual.}] Observe how a sheet with title restarts the exercise numbering. \begin{solution}[framed] OK, done (again). \newframe Otherwise, I would'nt now now \textbackslash newframe 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}? \begin{exercise}[points={many, many}, firstline={Play around with the options.}] Observe how a sheet with title restarts the exercise numbering. \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.}] Observe how a sheet with title restarts the exercise numbering. \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{frame} \begin{exercise}[points={many, many}] \visible<1>{Be careful using only etc.} \visible<2>{The overlay specification is simply ignored.} \visible<3>{So all content is visible simultaneously and should not contradict or break itself.} \end{exercise} \end{frame} \begin{exercise}[points={many, many},savetasks, main task font={\scshape},subtask font={\itshape} ] \begin{maintask} The exercise task can be saved and restated. \end{maintask} \begin{subtasks} \subtask{first} \begin{solution} 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} \end{sheet} \end{document}