diff options
Diffstat (limited to 'exercisesheets.sty')
| -rw-r--r-- | exercisesheets.sty | 38 |
1 files changed, 23 insertions, 15 deletions
diff --git a/exercisesheets.sty b/exercisesheets.sty index cfa10b5..3d54984 100644 --- a/exercisesheets.sty +++ b/exercisesheets.sty @@ -534,25 +534,27 @@ } \newenvironment{solution}[1][]{% \pgfkeys{exsh,every solution,#1,solution font}% - \ifbool{exsh@solutions}{% - \ifthenelse{\equal{oral}{\pgfkeysvalueof{/exsh/points}}}{% - \ifbool{exsh@oralsolutions}{ - \let\next\exsh@startsolution - }{% - \let\next\exsh@skipsolution - }% + \ifthenelse{\equal{oral}{\pgfkeysvalueof{/exsh/points}}}{% + \ifbool{exsh@oralsolutions}{% + \let\next\exsh@startsolution }{% - \ifbool{exsh@nonoralsolutions}{ - \let\next\exsh@startsolution - }{% - \let\next\exsh@skipsolution - }% + \let\next\exsh@skipsolution }% }{% - \let\next\next\exsh@skipsolution + \ifbool{exsh@nonoralsolutions}{% + \let\next\exsh@startsolution + }{% + \let\next\exsh@skipsolution + }% }% \next -}{\ifbool{exsh@solutions}{\par}{}} +}{% + \ifthenelse{\equal{oral}{\pgfkeysvalueof{/exsh/points}}}{% + \ifbool{exsh@oralsolutions}{\par}{}% + }{% + \ifbool{exsh@nonoralsolutions}{\par}{}% + }% +} \def\exsh@startsolution{\@afterindentfalse \vskip\pgfkeysvalueof{/exsh/above solution skip}\relax% @@ -600,4 +602,10 @@ \PackageWarning{exercisesheets}{TODO marker found}% } -\newcommand{\ifsolutions}[2]{\ifexsh@solutions #1\else #2\fi} +\newcommand{\ifsolutions}[2]{% + \ifthenelse{\equal{oral}{\pgfkeysvalueof{/exsh/points}}}{% + \ifbool{exsh@oralsolutions}{#1}{#2}% + }{% + \ifbool{exsh@nonoralsolutions}{#1}{#2}% + }% +} |
