diff options
| author | Frank Fuhlbrück | 2022-01-22 02:18:40 +0100 |
|---|---|---|
| committer | Frank Fuhlbrück | 2022-01-22 02:18:40 +0100 |
| commit | 11ff8b0b78e054742de03c54e79dfba475e5c75b (patch) | |
| tree | 79219bdc15ca2e61bd7a3a95ddc5afecbb7db274 | |
| parent | 0f1e5c6c1712957a86654177d55175aaf7cd2f8e (diff) | |
| download | exercisesheets-11ff8b0b78e054742de03c54e79dfba475e5c75b.tar.gz exercisesheets-11ff8b0b78e054742de03c54e79dfba475e5c75b.tar.bz2 exercisesheets-11ff8b0b78e054742de03c54e79dfba475e5c75b.zip | |
consistent beamer spacinf
| -rw-r--r-- | examples/exshexample.tex | 31 | ||||
| -rw-r--r-- | exercisesheets-beamer.sty | 61 | ||||
| -rw-r--r-- | exercisesheets.sty | 1 |
3 files changed, 65 insertions, 28 deletions
diff --git a/examples/exshexample.tex b/examples/exshexample.tex index f7782e0..1761154 100644 --- a/examples/exshexample.tex +++ b/examples/exshexample.tex @@ -15,8 +15,6 @@ \usepackage{hyperref} \usepackage{xcolor} -\begin{document} - %Usually the person responsible for the entire course: \author{Exampleauthor} \date{Example term/semester} @@ -25,7 +23,9 @@ %Only used for beamer at the moment: \exshset{exauthor={Author of exercises}} -\ifbeamer{}{ +\ifbeamer{ + \exshset{beameruseblocks=false} +}{ \exshset{ %default is \clearpage sheet start page action={\pagebreak[3]\hrule}, @@ -38,6 +38,9 @@ task restate font={\color{black!60}}, } + +\begin{document} + \begin{sheet}[note={Learn how to create nice exercise sheets.}, date={Novanuar 42, -2022},title={First Sheet}] @@ -126,25 +129,25 @@ task restate font={\color{black!60}}, \end{beamersolution} \end{exercise} - \begin{frame} - \begin{exercise}[points={many, many}] - \visible<1>{Be careful using only etc.} - \visible<2>{The overlay specification is simply - ignored.} - \visible<3>{So all content is visible simultaneously and - should not contradict or break itself.} - \end{exercise} - \end{frame} +% \begin{frame}[t] +% \begin{exercise}[points={many, many}] +% \visible<1>{Be careful using only etc.} +% \visible<2>{The overlay specification is simply +% ignored.} +% \visible<3>{So all content is visible simultaneously and +% should not contradict or break itself.} +% \end{exercise} +% \end{frame} \begin{exercise}[points={many, many},savetasks, - main task font={\scshape},subtask font={\itshape} + main task font={\tiny},subtask font={\itshape} ] \begin{maintask} The exercise task can be saved and restated. \end{maintask} \begin{subtasks} \subtask{first} - \begin{solution} + \begin{solution}[framed] None (yet). \end{solution} \subtask{second} 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}}{} diff --git a/exercisesheets.sty b/exercisesheets.sty index fd0f574..0024d76 100644 --- a/exercisesheets.sty +++ b/exercisesheets.sty @@ -339,6 +339,7 @@ todo marker font/.initial=\ifdef{\color}{\color{red}}{}\bfseries, % % skip values + below sheet headline skip/.initial={}, above sheet title skip/.initial={4ex}, above sheet note skip/.initial={.7ex}, above solutionsby skip/.initial={1ex}, |
