From 11ff8b0b78e054742de03c54e79dfba475e5c75b Mon Sep 17 00:00:00 2001
From: Frank Fuhlbrück
Date: Sat, 22 Jan 2022 02:18:40 +0100
Subject: consistent beamer spacinf

---
 exercisesheets-beamer.sty | 61 ++++++++++++++++++++++++++++++++++++-----------
 1 file changed, 47 insertions(+), 14 deletions(-)

(limited to 'exercisesheets-beamer.sty')

diff --git a/exercisesheets-beamer.sty b/exercisesheets-beamer.sty
index 1cc949e..fe40937 100644
--- a/exercisesheets-beamer.sty
+++ b/exercisesheets-beamer.sty
@@ -18,7 +18,7 @@
 %\NeedsTeXFormat{LaTeX2e}[1994/12/01]
 
 % don't forget to update the version and date in exercisesheets.tex
-\def\exsh@version{0.10+}
+\def\exsh@version{0.10+git}
 \def\exsh@date{2022/01/12}
 
 \ProvidesPackage{exercisesheets-beamer}[\exsh@date\space\exsh@version\space Typesetting of exercise sheets]
@@ -54,6 +54,7 @@
 \newif\ifexsh@exnumsheet
 \newif\ifexsh@forcesample %force printing sample sol. of wrong type
 \newif\ifexsh@beamerwithheadline
+\newif\ifexsh@beameruseblocks
 \newif\ifexsh@beamersolution
 \newif\ifexsh@defersolutiontitle
 \newif\ifexsh@framed
@@ -100,6 +101,8 @@
   filenameasexercisename/.default=true,
   beamerwithheadline/.is if=exsh@beamerwithheadline,
   beamerwithheadline/.default=true,
+  beameruseblocks/.is if=exsh@beameruseblocks,
+  beameruseblocks/.default=true,
   beamersolution/.is if=exsh@beamersolution,
   beamersolution/.default=true,
   defersolutiontitle/.is if=exsh@defersolutiontitle,
@@ -193,6 +196,7 @@
   forcesample/.initial={false},
   beamersolution/.initial={false},
   beamerwithheadline/.initial={false},
+  beameruseblocks/.initial={false},
   defersolutiontitle/.initial={false},
   framed/.initial={false},
   firstline/.initial={},
@@ -324,6 +328,7 @@
   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},
@@ -355,6 +360,13 @@
 % allow further keys to be set
 \def\exshset#1{\pgfkeys{exsh,#1}}
 
+\define@key{beamerframe}{t}[true]{% top
+  \beamer@frametopskip=-2pt\relax%
+  \beamer@framebottomskip=0pt plus 1fill\relax%
+  \beamer@frametopskipautobreak=\beamer@frametopskip\relax%
+  \beamer@framebottomskipautobreak=\beamer@framebottomskip\relax%
+}
+
 % automatic language selection
 \AfterEndPreamble{%
   \exsh@provideonlytrue
@@ -838,7 +850,7 @@
       }%
     }%
   \fi
-  \clearpage%
+  \clearpage
 }
 \newcommand{\exsh@label}[2]{#1{#2}\leavevmode\ignorespaces}
 \newcommand{\exsh@startsection}[2][]{%
@@ -846,11 +858,19 @@
 %   \begin{block}{}
 %   \pgfkeysvalueof{/exsh/exercise title font}{#2}%
 %   \end{block}
-  \begingroup
-  \usebeamercolor{block title}
-  \setbeamercolor{block body}{bg=bg,fg=fg}
-  \block{}{\pgfkeysvalueof{/exsh/exercise title font}{#2}}\endblock
-  \endgroup
+  \ifbool{exsh@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@patchenumerate
     \setbeamertemplate{enumerate items}{\insertenumlabel}
     \renewcommand{\insertenumlabel}{
@@ -1043,12 +1063,23 @@
 }
 
 \def\exsh@solutiontitle#1{
-  \begin{beamercolorbox}[rounded=true,wd={#1}]{block title alerted}
+  \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{beamercolorbox}}
+      \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}
@@ -1088,7 +1119,8 @@
 %   \endblock
   \ifbool{exsh@framed}{\exsh@defersolutiontitletrue}{}
   \ifbool{exsh@defersolutiontitle}{}{%
-    \ifhmode \linebreak\fi\exsh@solutiontitle{\linewidth}
+    \ifhmode \linebreak\fi
+    \exsh@solutiontitle{\linewidth}
   }%
   \ifbool{exsh@framed}{\Collect@Body\exsh@collectedframe}{}%
 }%
@@ -1298,7 +1330,8 @@
       \endgroup
       \vspace{0.4em}
     \end{beamercolorbox}%
-    \vspace{3mm}
+    \vspace*{3mm}
+    \vskip\pgfkeysvalueof{/exsh/below slide headline skip}\relax%
   }{}%
 }
 \addtobeamertemplate{frametitle}{\vspace{-3mm}}{}
-- 
cgit v1.2.3

