From 17a58e4027daa4d176be6edb73767ee942f20ce3 Mon Sep 17 00:00:00 2001
From: Sebastian Kuhnert
Date: Mon, 13 Jul 2009 13:50:09 +0000
Subject: exercisesheets.sty: fix automatic title setting

---
 exercisesheets.sty | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

(limited to 'exercisesheets.sty')

diff --git a/exercisesheets.sty b/exercisesheets.sty
index 3d54984..7b3b5e6 100644
--- a/exercisesheets.sty
+++ b/exercisesheets.sty
@@ -303,11 +303,9 @@
   \protected@write\@auxout{}{\string\gdef\string\exsh@title{\expandonce\exsh@title@new}}%
 }
 \AfterEndDocument{%
-  \ifthenelse{\NOT\equal{\exsh@title}{\exsh@title@new}}{%
+  \ifthenelse{\equal{\exsh@title}{\exsh@title@new}}{}{%
     \@latex@warning@no@line{Label(s) may have changed.
       Rerun to get cross-references right}%
-  }{%
-%    \ifthenelse
   }%
 }
 \AfterEndPreamble{%
@@ -330,7 +328,8 @@
   \pgfkeys{exsh,every sheet,#1}%
   \ifthenelse{\equal{}{\pgfkeysvalueof{/exsh/title}}}{%
     \numdef\exsh@tmp{\value{part}+1}%
-    \pgfkeys{/exsh/title/.expanded={\pgfkeysvalueof{/exsh/strings/sheet}\noexpand~\exsh@tmp}}%
+    \edef\exsh@temp{\expandonce{\pgfkeysvalueof{/exsh/strings/sheet}}\noexpand~\exsh@tmp}%
+    \pgfkeys{/exsh/title/.expand once={\exsh@temp}}%
     \def\thepage{\arabic{part}-\arabic{page}}%
   }{%
     \def\thepage{\arabic{page}}%
@@ -340,8 +339,7 @@
   \exsh@checkrange{\exsh@tmp}%
   \ifexsh@isinrange
     \ifexsh@singularrange
-      \pgfkeysgetvalue{/exsh/strings/sheet}{\exsh@temp}%
-      \eappto\exsh@temp{\noexpand~\expandonce\exsh@tmp}%
+      \pgfkeysgetvalue{/exsh/title}{\exsh@temp}%
       \exsh@write@title{\exsh@temp}%
     \fi
     \exsh@sheethead
-- 
cgit v1.2.3

