diff options
| author | Sebastian Kuhnert | 2008-11-25 11:37:29 +0000 |
|---|---|---|
| committer | Sebastian Kuhnert | 2008-11-25 11:37:29 +0000 |
| commit | 49ef533b7ec84fb913bbcd73728811166d1b637d (patch) | |
| tree | 2f1477c789c5c2a601f9ab515f7b4bb61831d20b | |
| parent | e2b140f3d060721714e03b9c35288d368c3ae8d9 (diff) | |
| download | exercisesheets-49ef533b7ec84fb913bbcd73728811166d1b637d.tar.gz exercisesheets-49ef533b7ec84fb913bbcd73728811166d1b637d.tar.bz2 exercisesheets-49ef533b7ec84fb913bbcd73728811166d1b637d.zip | |
exercisesheets.sty: update \pun to \points; improve layout
| -rw-r--r-- | exercisesheets.sty | 25 | ||||
| -rw-r--r-- | exercisesheets.tex | 11 |
2 files changed, 28 insertions, 8 deletions
diff --git a/exercisesheets.sty b/exercisesheets.sty index af902bc..341fabe 100644 --- a/exercisesheets.sty +++ b/exercisesheets.sty @@ -1,5 +1,5 @@ -\def\fileversion{0.5e} -\def\filedate{2008/11/20} +\def\fileversion{0.5f} +\def\filedate{2008/11/25} % TODO: allow \and in author and solutionsby % TODO: fix "above hint skip" @@ -525,7 +525,26 @@ } -\newcommand{\pun}[1][]{\space\hspace*{\fill}{\pgfkeysvalueof{/exsh/points font}\mbox{(#1)}}} +\newcommand{\pun}[1][]{% + \PackageWarning{exercisesheets}{Obsolete \string\pun[] macro used. Please use + something\MessageBreak like \string\points{10} or \string\points{oral} instead.}{}% + \exsh@subexpoints{#1}% +} \newcommand{\points}[1]{% + \ifthenelse{\equal{#1}{oral}}{% + \exshset{oral}% + \exsh@subexpoints{\pgfkeysvalueof{/exsh/strings/oral}}% + }{% + \exshset{points=#1}% + \ifthenelse{\equal{#1}{1}}{% + \exsh@subexpoints{1~\pgfkeysvalueof{/exsh/strings/point}}% + }{% + \exsh@subexpoints{#1~\pgfkeysvalueof{/exsh/strings/points}}% + }% + }% +} \newcommand{\exsh@subexpoints}[1]{% + \unskip\nobreak\space\nobreak\hspace*{\fill}\allowbreak\hspace*{\fill}% + {\pgfkeysvalueof{/exsh/points font}\mbox{(#1)}}% +} \newcommand{\TODO}{% \ifmmode diff --git a/exercisesheets.tex b/exercisesheets.tex index ae3b10e..32d4bab 100644 --- a/exercisesheets.tex +++ b/exercisesheets.tex @@ -35,7 +35,7 @@ \title{The \exsh Package} \author{Sebastian Kuhnert} -\date{November 13th, 2008} +\date{November 25th, 2008} \begin{document} \maketitle @@ -248,8 +248,9 @@ each place. \begin{lstlisting} \begin{exercise}[points=10] \begin{enumerate} - \item Part 1 \pun[5] - \item Part 2 \pun[5] + \item Part 1 \points{oral} + \item Part 2 \points{4} + \item Part 3 \points{6} \end{enumerate} \end{exercise} \end{lstlisting} @@ -338,7 +339,7 @@ values: \item[\option{exercise title font}] The font for the exercise title.\\ Default: \verb|\bfseries| \item[\option{points font}] The font for the number of points in the exercise - head (relative to the exercise title) and for \verb|\pun|.\\ + head (relative to the exercise title) and for \verb|\points|.\\ Default: \verb|\itshape| \item[\option{hint font}] The font for hints. \\ Default: empty, i.\,e.\ no change. @@ -389,7 +390,7 @@ The following options allow fine-tuning of the spacing: Example: Only include points for sub-exercises when solutions are typeset: \begin{lstlisting} -\ifsolutions{}{\renewcommand{\pun}[1][]{}} +\ifsolutions{}{\renewcommand{\points}[1]{}} \end{lstlisting} \subsection{Using Hooks} |
