From e0bfe15f1394f3d7e91c74de733f88b1969bcf29 Mon Sep 17 00:00:00 2001
From: Sebastian Kuhnert
Date: Wed, 5 May 2010 12:45:37 +0000
Subject: allow \and in \author; minor changes

---
 exercisesheets.sty | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

(limited to 'exercisesheets.sty')

diff --git a/exercisesheets.sty b/exercisesheets.sty
index ee7ccd5..b724dde 100644
--- a/exercisesheets.sty
+++ b/exercisesheets.sty
@@ -1,11 +1,10 @@
 %\NeedsTeXFormat{LaTeX2e}[1994/12/01]
 \RequirePackage{svn-prov}
-\def\exsh@version{0.5j}
+\def\exsh@version{0.5g}
 \ProvidesPackageSVN{$Id$}[\exsh@version\space Typesetting of exercise sheets \revinfo]
 \GetFileInfoSVN*
 \message{`Typesetting of exercise sheets' \exsh@version\space <\filedate> (SVN Rev: \filerev)}
 
-% TODO: allow \and in author and solutionsby
 % TODO: fix "above hint skip"
 
 
@@ -54,12 +53,14 @@
   \pgfkeys{/exsh/semester/.initial/.expand once=\@date}
 }
 \apptocmd{\date}{\pgfkeys{/exsh/semester={#1}}}{}{}
-\def\exsh@patchauthor{%
-  \patchcmd{\exsh@author}{\and}{, }{\exsh@patchauthor}{}%
-}
 \pgfkeys{/exsh/author/.code={%
     \def\exsh@author{#1}%
-    \exsh@patchauthor
+    \def\exsh@repeat{1}%
+    \loop\ifnum\exsh@repeat>0
+      \def\exsh@repeat{0}%
+      \patchcmd{\exsh@author}{\and}{, }{\def\exsh@repeat{1}}{}%
+    \repeat
+    \show\exsh@author
   },
   /exsh/author/.expand once=\@author}
 \let\exsh@oldauthor\author
@@ -545,7 +546,7 @@
   \@ifnextchar\label{\exsh@label}{\leavevmode\ignorespaces}%
 }{}
 \newcommand{\exsh@label}[2]{#1{#2}\leavevmode\ignorespaces}
-\providecommand{\exsh@startsection}[2][]{%
+\newcommand{\exsh@startsection}[2][]{%
   \@startsection{section}{1}{\z@}%
   {\pgfkeysvalueof{/exsh/above exercise skip}}%
   {1em}% afterskip corrected below
@@ -565,8 +566,9 @@
 \@addtoreset{equation}{section}
 
 \newenvironment{hint}[1][]{%
-  \pgfkeys{exsh,every hint,#1,hint font}%
-  \par\vskip\pgfkeysvalueof{/exsh/above hint skip}\relax\noindent
+  \par
+  %\pgfkeys{exsh,every hint,#1,hint font}%
+  \vskip\pgfkeysvalueof{/exsh/above hint skip}\relax\noindent
   {\pgfkeysvalueof{/exsh/hint title font}\pgfkeysvalueof{/exsh/strings/hint}:}~\ignorespaces
 }{%
   \par
-- 
cgit v1.2.3

