From 676242329ec5f59a109c5d1e233b86aee3cae6a1 Mon Sep 17 00:00:00 2001
From: Sebastian Kuhnert
Date: Thu, 30 Apr 2009 12:12:40 +0000
Subject: exercisesheets.sty: make exercise labels in .aux files fully expanded

---
 exercisesheets.sty | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

(limited to 'exercisesheets.sty')

diff --git a/exercisesheets.sty b/exercisesheets.sty
index 138cf16..e075b6a 100644
--- a/exercisesheets.sty
+++ b/exercisesheets.sty
@@ -493,17 +493,21 @@
     \edef\exsh@shortexname{:\space\pgfkeysvalueof{/exsh/name}}%
   }%
   \refstepcounter{section}%
-  \@startsection{section}{1}{\z@}%
-  {\pgfkeysvalueof{/exsh/above exercise skip}}%
-  {1em}% afterskip corrected below
-  {\pgfkeysvalueof{/exsh/exercise title font}}%
-  [\pgfkeysvalueof{/exsh/strings/exercise}~\arabic{section}\exsh@shortexname\exsh@shortpoints]{\noindent%
+  \edef\exsh@tmp{[\pgfkeysvalueof{/exsh/strings/exercise} \arabic{section}\exsh@shortexname\exsh@shortpoints]}%
+  \expandafter\exsh@startsection\exsh@tmp{\noindent%
     \pgfkeysvalueof{/exsh/strings/exercise}~\arabic{section}\exsh@exname\exsh@firstline\exsh@points}%
   \unskip\vskip\pgfkeysvalueof{/exsh/below exercise title skip}\relax
   \vskip-\parskip\relax
   \@afterindentfalse
   \ignorespaces
 }{}
+\providecommand{\exsh@startsection}[2][]{%
+  \@startsection{section}{1}{\z@}%
+  {\pgfkeysvalueof{/exsh/above exercise skip}}%
+  {1em}% afterskip corrected below
+  {\pgfkeysvalueof{/exsh/exercise title font}}%
+  [#1]{#2}%
+}%
 
 \AfterPackage*{varioref}{
   \labelformat{section}{\pgfkeysvalueof{/exsh/strings/exercise}~\arabic{section}}
-- 
cgit v1.2.3

