aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrank Fuhlbrück2023-02-06 15:48:33 +0100
committerFrank Fuhlbrück2023-02-06 15:48:33 +0100
commit79977e2d85e6aca37c9dd58b219d198d42ce6f4c (patch)
treec26bdd52583a55ca5d672bf21b3df636f13fa75f
parentef66000ff714e4e5cb5c1fd55748d5c4fe300150 (diff)
downloadexercisesheets-0.14.tar.gz
exercisesheets-0.14.tar.bz2
exercisesheets-0.14.zip
v0.14: option headerrestate0.14
-rw-r--r--exercisesheets.sty42
-rw-r--r--exercisesheets.tex16
2 files changed, 48 insertions, 10 deletions
diff --git a/exercisesheets.sty b/exercisesheets.sty
index 006d9ed..6799a34 100644
--- a/exercisesheets.sty
+++ b/exercisesheets.sty
@@ -1,5 +1,5 @@
%% exercisesheets.sty
-%% Copyright 2008-2022 Sebastian Kuhnert, Frank Fuhlbrück
+%% Copyright 2008-2023 Sebastian Kuhnert, Frank Fuhlbrück
%
% This work may be distributed and/or modified under the conditions
% of the LaTeX Project Public License, either version 1.3c of this
@@ -18,8 +18,8 @@
%\NeedsTeXFormat{LaTeX2e}[1994/12/01]
% don't forget to update the version and date in exercisesheets.tex
-\def\exsh@version{0.13.1}
-\def\exsh@date{2022/11/22}
+\def\exsh@version{0.14}
+\def\exsh@date{2023/02/06}
\ProvidesPackage{exercisesheets}[\exsh@date\space\exsh@version\space Typesetting of exercise sheets]
\message{`Typesetting of exercise sheets' \exsh@version\space <\exsh@date>}
@@ -67,6 +67,7 @@
\newif\ifexsh@beamerwithfootline
\newif\ifexsh@beameruseblocks
\newif\ifexsh@defersolutiontitle
+\newif\ifexsh@headerrestate
\newif\ifexsh@framed
\newif\ifexsh@fragile
\fi
@@ -179,6 +180,8 @@
beamersolution/.default=true,
defersolutiontitle/.is if=exsh@defersolutiontitle,
defersolutiontitle/.default=true,
+ headerrestate/.is if=exsh@headerrestate,
+ headerrestate/.default=true,
framed/.is if=exsh@framed,
framed/.default=true,
fragile/.is if=exsh@fragile,
@@ -188,6 +191,7 @@
beamerwithfootline/.initial={false},
beameruseblocks/.initial={false},
defersolutiontitle/.initial={false},
+ headerrestate/.initial={false},
framed/.initial={false},
}
\else%--------- NON-BEAMER: ---------------------------------------
@@ -200,6 +204,8 @@
beamersolution/.initial={ignore},
defersolutiontitle/.default={ignore},
defersolutiontitle/.initial={ignore},
+ headerrestate/.default={ignore},
+ headerrestate/.initial={ignore},
framed/.default={ignore},
framed/.initial={ignore},
framed/.code={\let\newframe\relax},
@@ -1275,7 +1281,17 @@
}{}%
}
+\def\exsh@ensuresavetasks{%
+ \ifbool{exsh@savetasks}{}{%
+ \PackageError{exercisesheets}{%
+ If you want to restate something, you have to %
+ use the option savetasks.%
+ }{}%
+ }%
+}
+
\def\restatetask{%
+ \exsh@ensuresavetasks%
\@ifstar\exsh@restatetask@\exsh@restatetask%
}
@@ -1365,18 +1381,30 @@
\def\exsh@solutiontitle#1{
\ifbool{exsh@beameruseblocks}{%
\begin{alertblock}{}%
- \pgfkeysvalueof{/exsh/solution title font}%
+ {\pgfkeysvalueof{/exsh/solution title font}%
\pgfkeysvalueof{/exsh/strings/solution} %
(\pgfkeysvalueof{/exsh/strings/exercise} \arabic{section}%
- \ifnum\@enumdepth>0\alph{subex}\fi)%
+ \ifnum\@enumdepth>0\alph{subex}\fi)} %
+ \ifbool{exsh@headerrestate}{
+ \exsh@ensuresavetasks
+ \csname exsh@restatetask%
+ \ifnum\@enumdepth>0cur\else main\fi%
+ \endcsname%
+ }{}%
\end{alertblock}
}{
\begin{beamercolorbox}[rounded=true,wd={#1}]%
{block title alerted}
- \pgfkeysvalueof{/exsh/solution title font}%
+ {\pgfkeysvalueof{/exsh/solution title font}%
\pgfkeysvalueof{/exsh/strings/solution} %
(\pgfkeysvalueof{/exsh/strings/exercise} \arabic{section}%
- \ifnum\@enumdepth>0\alph{subex}\fi)%
+ \ifnum\@enumdepth>0\alph{subex}\fi)} %
+ \ifbool{exsh@headerrestate}{
+ \exsh@ensuresavetasks
+ \csname exsh@restatetask%
+ \ifnum\@enumdepth>0cur\else main\fi%
+ \endcsname%
+ }{}%
\end{beamercolorbox}
}
}
diff --git a/exercisesheets.tex b/exercisesheets.tex
index 1bf1604..c41250f 100644
--- a/exercisesheets.tex
+++ b/exercisesheets.tex
@@ -1,5 +1,5 @@
%% exercisesheets.tex
-%% Copyright 2008-2022 Sebastian Kuhnert, Frank Fuhlbrück
+%% Copyright 2008-2023 Sebastian Kuhnert, Frank Fuhlbrück
%
% This work may be distributed and/or modified under the conditions
% of the LaTeX Project Public License, either version 1.3c of this
@@ -53,7 +53,7 @@
\usepackage[english,iso]{isodate}
\title{The \exsh Package}
\author{Sebastian Kuhnert\and Frank Fuhlbrück}
-\date{Version 0.13.1, \printdateTeX{2022/11/22}}
+\date{Version 0.14, \printdateTeX{2023/02/06}}
\begin{document}
\maketitle
@@ -480,7 +480,10 @@ a starred version (\verb|\restatetask*| /
All four have an optional argument that allows to restate
a subtask instead of the main task. This argument is either
\option{main}, a number of a \textbf{previous} subtask or
-\option{cur} for the current subtask.
+\option{cur} for the current subtask. Using \option{headerrestate}
+for your solution will automatically restate the current
+task within the beamer solution header (does noting without
+beamer).
@@ -839,6 +842,13 @@ This also works well in combination with a make file that generates
\label{sec:changelog}
\begin{itemize}
+ \item[v. 0.14:] 2023-02-06
+ \begin{itemize}
+ \item new option \option{headerrestate} to restate
+ the current (if in subexercise) or main task within
+ a solutions header
+ \item bugfix: \verb|\restatetask| etc. give meaningful error if \option{savetasks} is not set.
+ \end{itemize}
\item[v. 0.13.1:] 2022-11-22
\begin{itemize}
\item bugfix: \verb|\detokenize| filenames when