From e480192748bfcf90d6b341056638d42ccc67c265 Mon Sep 17 00:00:00 2001
From: Frank Fuhlbrück
Date: Thu, 15 Oct 2020 09:21:05 +0200
Subject: Beamer-Version

---
 exercisesheets.sty | 30 ++++++++++++++++++++++++------
 1 file changed, 24 insertions(+), 6 deletions(-)

(limited to 'exercisesheets.sty')

diff --git a/exercisesheets.sty b/exercisesheets.sty
index 7038d00..c4a4e67 100644
--- a/exercisesheets.sty
+++ b/exercisesheets.sty
@@ -18,8 +18,8 @@
 %\NeedsTeXFormat{LaTeX2e}[1994/12/01]
 
 % don't forget to update the version and date in exercisesheets.tex
-\def\exsh@version{0.6}
-\def\exsh@date{2019/2/11}
+\def\exsh@version{0.7}
+\def\exsh@date{2020/10/11}
 
 \ProvidesPackage{exercisesheets}[\exsh@date\space\exsh@version\space Typesetting of exercise sheets]
 \message{`Typesetting of exercise sheets' \exsh@version\space <\exsh@date>}
@@ -84,6 +84,9 @@
   pointsfloatright/.default=true,
   abbrev/.is if=exsh@abbrev,
   abbrev/.default=true,
+  %options from exercisesheets-beamer are ignored
+  beamersolution/.default={ignore},
+  beamersolution/.initial={ignore}
 }
 
 % store title data for sheet headers
@@ -102,7 +105,11 @@
 }{
   \pgfkeys{/exsh/semester/.initial/.expand once=\@date}
 }
-\apptocmd{\date}{\pgfkeys{/exsh/semester={#1}}}{}{}
+\let\@exsh@origdate\date
+\renewcommand{\date}[1]{\@exsh@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@author{#1}%
     \def\exsh@repeat{1}%
@@ -129,6 +136,7 @@
   title/.initial={},
   date/.initial={},
   note/.initial={},
+  exauthor/.initial={\exsh@author},
   %
   % additional exercise info
   name/.initial={},
@@ -781,11 +789,21 @@
   \@afterheading
 }%
 
+%the regular version of exercisesheets.sty skips all beamer solutions
+\newenvironment{beamersolution}[1][]{\exsh@skipsolution}{}%
+
 \long\def\exsh@skipsolution#1{%
   \ifstrequal{#1}{\end}{\exsh@endsolution}{\exsh@skipsolution}%
 }
 \def\exsh@endsolution#1{%
-  \ifstrequal{#1}{solution}{\end{solution}}{\exsh@skipsolution}%
+  \ifstrequal{#1}{solution}{
+    \end{solution}
+  }{%
+    \ifstrequal{#1}{beamersolution}{
+      \end{beamersolution}
+    }{%
+      \exsh@skipsolution}%
+  }%
 }
 
 
@@ -850,8 +868,8 @@
   \next
 }{}
 
-\def\exsh@startguide{\@afterindentfalse
-  \linebreak
+\def\exsh@startguide{\@afterindentfalse%
+  \par
   {\parindent \z@
     \pgfkeysvalueof{/exsh/strings/gradingguide}: }\nobreak%
   \@afterheading
-- 
cgit v1.2.3

