From 49ef533b7ec84fb913bbcd73728811166d1b637d Mon Sep 17 00:00:00 2001
From: Sebastian Kuhnert
Date: Tue, 25 Nov 2008 11:37:29 +0000
Subject: exercisesheets.sty: update \pun to \points; improve layout

---
 exercisesheets.sty | 25 ++++++++++++++++++++++---
 1 file changed, 22 insertions(+), 3 deletions(-)

(limited to 'exercisesheets.sty')

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
-- 
cgit v1.2.3

