From 1c2f8218dd04778c243fa873f865c75b534cc6d8 Mon Sep 17 00:00:00 2001
From: Frank Fuhlbrück
Date: Fri, 28 Jan 2022 17:05:45 +0100
Subject: beamer merge completed

---
 exercisesheets.sty | 159 +++++++++++++++++++++++++++++++++++++++++++++++++----
 1 file changed, 147 insertions(+), 12 deletions(-)

(limited to 'exercisesheets.sty')

diff --git a/exercisesheets.sty b/exercisesheets.sty
index cad2a20..0192099 100644
--- a/exercisesheets.sty
+++ b/exercisesheets.sty
@@ -1192,6 +1192,76 @@
   }%
 }
 
+
+\ifexsh@beamer
+\def\exsh@solutiontitle#1{
+  \ifbool{exsh@beameruseblocks}{%
+    \begin{alertblock}{}%
+    \pgfkeysvalueof{/exsh/solution title font}%
+      \pgfkeysvalueof{/exsh/strings/solution} %
+      (\pgfkeysvalueof{/exsh/strings/exercise} \arabic{section}%
+        \ifnum\@enumdepth>0\alph{enumi}\fi)%
+    \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{section}%
+        \ifnum\@enumdepth>0\alph{enumi}\fi)%
+    \end{beamercolorbox}
+  }
+}
+\newcommand{\solutiontitle}[1][\linewidth]{
+  \ifbool{exsh@defersolutiontitle}{%
+    \ifhmode \linebreak\fi\exsh@solutiontitle{#1}
+  }{}%
+}
+
+
+\long\def\exsh@processframes#1\newframe{%
+\ifstrequal{#1}{}{}{%
+\clearpage
+\begin{frame}[t]
+  \solutiontitle[\textwidth]
+  #1
+\end{frame}%
+\exsh@processframes%
+}%no whitespace here is crucial for end detecttion
+}
+
+
+\long\def\exsh@collectedframe#1{
+\exsh@processframes#1\newframe\newframe
+}
+
+\else
+%this command is only usefule for exercisesheets-beamer to place
+%the deferred title within a new frame 
+\newcommand{\solutiontitle}[1][]{}
+\fi
+
+\ifexsh@beamer
+\def\exsh@startsolution{%
+  \ifnum\@enumdepth=0
+    \clearpage
+  \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{section}%
+%     \alph{enumi})%
+%   \endblock
+  \ifbool{exsh@framed}{\exsh@defersolutiontitletrue}{}
+  \ifbool{exsh@defersolutiontitle}{}{%
+    \ifhmode \linebreak\fi
+    \exsh@solutiontitle{\linewidth}
+  }%
+  \ifbool{exsh@framed}{\Collect@Body\exsh@collectedframe}{}%
+}%
+\else
 \def\exsh@startsolution{\@afterindentfalse
   \vskip\pgfkeysvalueof{/exsh/above solution skip}\relax%
   {\parindent \z@
@@ -1199,13 +1269,7 @@
     \pgfkeysvalueof{/exsh/strings/solution}:\par}\nobreak%
   \@afterheading
 }%
-
-%this command is only usefule for exercisesheets-beamer to place
-%the deferred title within a new frame 
-\newcommand{\solutiontitle}[1][]{}
-
-%the regular version of exercisesheets.sty skips all beamer solutions
-\newenvironment{beamersolution}[1][]{\exsh@skipsolution}{}%
+\fi
 
 \long\def\exsh@skipsolution#1{%
   \ifstrequal{#1}{\end}{\exsh@endsolution}{\exsh@skipsolution}%
@@ -1221,12 +1285,41 @@
   }%
 }
 
-
-\newcommand{\pun}[1][]{%
-  \PackageWarning{exercisesheets}{Obsolete \string\pun[] macro used. Please use
-    something\MessageBreak like \string\points{10} or \string\points{oral} instead.}{}%
-  \exsh@subexpoints{#1}%
+\ifexsh@beamer
+\newenvironment<>{beamersolution}[1][]{%
+  \pgfkeys{exsh,every solution,#1,solution font}%
+  \ifthenelse{\equal{oral}{\pgfkeysvalueof{/exsh/points}}}{%
+    \ifbool{exsh@oralsolutions}{%
+      \let\next\exsh@startsolution
+    }{%
+      \let\next\exsh@skipsolution
+    }%
+  }{%
+    \ifbool{exsh@nonoralsolutions}{%
+      \let\next\exsh@startsolution
+    }{%
+      \let\next\exsh@skipsolution
+    }%
+  }%
+  \ifbool{exsh@forcesample}{%
+    \ifbool{exsh@samplesolutions}{%
+      \let\next\exsh@startsolution
+    }{}%
+  }{}%
+  \next
+}{%
+%   \ifbool{exsh@framed}{\end{frame}}{}
+  \ifthenelse{\equal{oral}{\pgfkeysvalueof{/exsh/points}}}{%
+    \ifbool{exsh@oralsolutions}{\clearpage}{}%
+  }{%
+    \ifbool{exsh@nonoralsolutions}{\clearpage}{}%
+  }%
 }
+\else
+%the regular version of exercisesheets.sty skips all beamer solutions
+\newenvironment{beamersolution}[1][]{\exsh@skipsolution}{}%
+\fi
+
 \newcommand{\points}[2][]{%
   \ifthenelse{\equal{}{#2}}{}{\exshset{points=#2}}%
   \bgroup%
@@ -1363,6 +1456,48 @@
 }
 
 
+\ifexsh@beamer
+\setbeamertemplate{headline}{%
+% \leavevmode%
+  \ifbool{exsh@beamerwithheadline}{%
+    \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@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}}{}
+
+\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
+
 \ifluatex
   \let\exsh@dlua\directlua
 \else
-- 
cgit v1.2.3

