aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--exercisesheets.sty5
-rw-r--r--exercisesheets.tex24
2 files changed, 28 insertions, 1 deletions
diff --git a/exercisesheets.sty b/exercisesheets.sty
index 0c9da03..42470e5 100644
--- a/exercisesheets.sty
+++ b/exercisesheets.sty
@@ -187,6 +187,11 @@
below exercise title skip/.initial={\parskip},
above solution skip/.initial={1ex},
above hint skip/.initial={1ex},
+ %
+ % conditionals
+ ifsolutions/.code 2 args={\ifsolutions{\pgfkeysalso{#1}}{\pgfkeysalso{#2}}},
+ iforalsolutions/.code 2 args={\iforalsolutions{\pgfkeysalso{#1}}{\pgfkeysalso{#2}}},
+ ifnonoralsolutions/.code 2 args={\ifnonoralsolutions{\pgfkeysalso{#1}}{\pgfkeysalso{#2}}},
}
% default values
diff --git a/exercisesheets.tex b/exercisesheets.tex
index 256f7d7..751735a 100644
--- a/exercisesheets.tex
+++ b/exercisesheets.tex
@@ -404,11 +404,33 @@ The following options allow fine-tuning of the spacing:
\ifnonoralsolutions{(*\param{if true}*)}{(*\param{if false}*)}
\end{lstlisting}
-Example: Only include points for sub-exercises when solutions are typeset:
+There are also special options for conditionals to be used in the arguments of
+the environments defined by this package:
+\begin{description}
+ \item[\option{ifsolutions=\{\param{options if true}\}\{\param{options if
+ false}\}}] Execute \param{options if true} if solutions are included in
+ the current document, \param{options if false} otherwise.
+ \item[\option{iforalsolutions=\{\param{options if true}\}\{\param{options if
+ false}\}}] Execute \param{options if true} if solutions for oral exercises
+ are included in the current document, \param{options if false} otherwise.
+ \item[\option{ifnonoralsolutions=\{\param{options if true}\}\{\param{options if
+ false}\}}] Execute \param{options if true} if solutions for non-oral
+ exercises are included in the current document, \param{options if false}
+ otherwise.
+\end{description}
+
+Example 1: Only include points for sub-exercises when solutions are typeset:
\begin{lstlisting}
\ifsolutions{}{\renewcommand{\points}[2][]{}}
\end{lstlisting}
+Example 2: Modify the sheet header spacing in the non-solution version:
+\begin{lstlisting}
+\begin{sheet}[ifsolutions={}{above title skip=2ex}]% usually 4ex
+ \dots
+\end{sheet}
+\end{lstlisting}
+
\subsection{Using Hooks}
There are several hooks used by \exsh:
\begin{description}