From bcd469dc6ef29ef0fb4b5c0fed7a39906558bba0 Mon Sep 17 00:00:00 2001
From: Frank Fuhlbrück
Date: Mon, 16 Nov 2020 14:35:17 +0100
Subject: exsh: verzögerte Lösungstitel

---
 exercisesheets-beamer.sty | 38 +++++++++++++++++++++++++++++---------
 1 file changed, 29 insertions(+), 9 deletions(-)

(limited to 'exercisesheets-beamer.sty')

diff --git a/exercisesheets-beamer.sty b/exercisesheets-beamer.sty
index cbc46eb..517a4d0 100644
--- a/exercisesheets-beamer.sty
+++ b/exercisesheets-beamer.sty
@@ -50,6 +50,7 @@
 \newif\ifexsh@samplesolutions
 \newif\ifexsh@forcesample %force printing sample sol. of wrong type
 \newif\ifexsh@beamersolution
+\newif\ifexsh@defersolutiontitle
 \newif\ifexsh@gradingguides
 \newif\ifexsh@inplace
 \newif\ifexsh@sample
@@ -72,6 +73,8 @@
   forcesample/.default=true,
   beamersolution/.is if=exsh@beamersolution,
   beamersolution/.default=true,
+  defersolutiontitle/.is if=exsh@defersolutiontitle,
+  defersolutiontitle/.default=true,
   gradingguides/.is if=exsh@gradingguides,
   gradingguides/.default=true,
   only/.initial={-},
@@ -143,6 +146,7 @@
   name/.initial={},
   forcesample/.initial={false},
   beamersolution/.initial={false},
+  defersolutiontitle/.initial={false},
   firstline/.initial={},
   points/.initial={},
   oral/.style={/exsh/points=oral},oral/.value forbidden,
@@ -799,19 +803,35 @@
 %   \fi
 }
 
+\def\exsh@solutiontitle#1{
+  \begin{beamercolorbox}[rounded=true,wd={#1}]{block title alerted}
+    \pgfkeysvalueof{/exsh/solution title font}%
+    \pgfkeysvalueof{/exsh/strings/solution} %
+    (\pgfkeysvalueof{/exsh/strings/exercise} \arabic{section}%
+    \alph{enumi})%
+  \end{beamercolorbox}}
+\newcommand{\solutiontitle}[1][\linewidth]{
+  \ifbool{exsh@defersolutiontitle}{%
+    \ifhmode \linebreak\fi\exsh@solutiontitle{#1}
+  }{}%
+}
+
 \def\exsh@startsolution{%
   \ifnum\value{enumi}=0%
   \clearpage
   \fi
   \begingroup
-  \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
+%   \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@defersolutiontitle}{}{%
+    \ifhmode \linebreak\fi\exsh@solutiontitle{\linewidth}
+  }%
   \endgroup
   \@afterheading
 }%
@@ -992,7 +1012,6 @@
 }
 
 
-
 \setbeamertemplate{headline}{%
 \leavevmode%
   \begin{beamercolorbox}[wd=\paperwidth,ht=3.5em,dp=1.375ex]%
@@ -1005,6 +1024,7 @@
   \end{beamercolorbox}%
   \vspace{3mm}
 }
+\addtobeamertemplate{frametitle}{\vspace{-3mm}}{}
 
 \setbeamertemplate{footline}
 {%
-- 
cgit v1.2.3

