aboutsummaryrefslogtreecommitdiff
path: root/exercisesheets-beamer.sty
diff options
context:
space:
mode:
Diffstat (limited to 'exercisesheets-beamer.sty')
-rw-r--r--exercisesheets-beamer.sty24
1 files changed, 14 insertions, 10 deletions
diff --git a/exercisesheets-beamer.sty b/exercisesheets-beamer.sty
index 517a4d0..f86d4db 100644
--- a/exercisesheets-beamer.sty
+++ b/exercisesheets-beamer.sty
@@ -51,6 +51,7 @@
\newif\ifexsh@forcesample %force printing sample sol. of wrong type
\newif\ifexsh@beamersolution
\newif\ifexsh@defersolutiontitle
+\newif\ifexsh@framed
\newif\ifexsh@gradingguides
\newif\ifexsh@inplace
\newif\ifexsh@sample
@@ -75,6 +76,8 @@
beamersolution/.default=true,
defersolutiontitle/.is if=exsh@defersolutiontitle,
defersolutiontitle/.default=true,
+ framed/.is if=exsh@framed,
+ framed/.default=true,
gradingguides/.is if=exsh@gradingguides,
gradingguides/.default=true,
only/.initial={-},
@@ -147,6 +150,7 @@
forcesample/.initial={false},
beamersolution/.initial={false},
defersolutiontitle/.initial={false},
+ framed/.initial={false},
firstline/.initial={},
points/.initial={},
oral/.style={/exsh/points=oral},oral/.value forbidden,
@@ -729,9 +733,6 @@
\endgroup
\setbeamertemplate{enumerate items}{\insertenumlabel}
\renewcommand{\insertenumlabel}{\alph{enumi})}
-% \let\orig@endenumerate\endenumerate%
-% \def{\endenumerate}{\orig@endenumerate\setcounter{enumi}{0}}%
- \apptocmd{\endenumerate}{\setcounter{enumi}{0}}{}{}%
}%
\AfterPackage*{varioref}{
@@ -792,7 +793,7 @@
}{}%
\next
}{%
-% \ifnum\value{enumi}=0
+ \ifbool{exsh@framed}{\end{frame}}{}
\ifbool{exsh@beamersolution}{}{%
\ifthenelse{\equal{oral}{\pgfkeysvalueof{/exsh/points}}}{%
\ifbool{exsh@oralsolutions}{\clearpage}{}%
@@ -808,7 +809,7 @@
\pgfkeysvalueof{/exsh/solution title font}%
\pgfkeysvalueof{/exsh/strings/solution} %
(\pgfkeysvalueof{/exsh/strings/exercise} \arabic{section}%
- \alph{enumi})%
+ \ifnum\@enumdepth>0\alph{enumi}\fi)%
\end{beamercolorbox}}
\newcommand{\solutiontitle}[1][\linewidth]{
\ifbool{exsh@defersolutiontitle}{%
@@ -817,10 +818,9 @@
}
\def\exsh@startsolution{%
- \ifnum\value{enumi}=0%
- \clearpage
+ \ifnum\@enumdepth=0
+ \clearpage
\fi
- \begingroup
% \usebeamercolor{block title alerted}
% \setbeamercolor{block body}{bg=bg,fg=fg}
% \block{}
@@ -829,11 +829,14 @@
% (\pgfkeysvalueof{/exsh/strings/exercise} \arabic{section}%
% \alph{enumi})%
% \endblock
+ \ifbool{exsh@framed}{\exsh@defersolutiontitletrue}{}
\ifbool{exsh@defersolutiontitle}{}{%
\ifhmode \linebreak\fi\exsh@solutiontitle{\linewidth}
}%
- \endgroup
- \@afterheading
+ \ifbool{exsh@framed}{\clearpage
+ \begin{frame}[t,fragile,environment=solution]
+ \solutiontitle
+ }{}%
}%
\long\def\exsh@skipsolution#1{%
@@ -872,6 +875,7 @@
}{}%
\next
}{%
+ \ifbool{exsh@framed}{\end{frame}}{}
\ifthenelse{\equal{oral}{\pgfkeysvalueof{/exsh/points}}}{%
\ifbool{exsh@oralsolutions}{\clearpage}{}%
}{%