aboutsummaryrefslogtreecommitdiff
path: root/exercisesheets.sty
diff options
context:
space:
mode:
authorSebastian Kuhnert2010-02-12 14:43:59 +0000
committerSebastian Kuhnert2010-02-12 14:43:59 +0000
commit21a0ff7218f5ce3e3bf9b2ce694fd684019829e6 (patch)
treecb35c4e06fc30d0f2ef9df5399d40af1b4ffe999 /exercisesheets.sty
parent0a0c38f626bc0be583cae44583cdf13dc2c8ff34 (diff)
downloadexercisesheets-21a0ff7218f5ce3e3bf9b2ce694fd684019829e6.tar.gz
exercisesheets-21a0ff7218f5ce3e3bf9b2ce694fd684019829e6.tar.bz2
exercisesheets-21a0ff7218f5ce3e3bf9b2ce694fd684019829e6.zip
fix whitespace bug if an exercise starts with a label and a list environment
Diffstat (limited to 'exercisesheets.sty')
-rw-r--r--exercisesheets.sty17
1 files changed, 9 insertions, 8 deletions
diff --git a/exercisesheets.sty b/exercisesheets.sty
index d9e9614..2a967c9 100644
--- a/exercisesheets.sty
+++ b/exercisesheets.sty
@@ -1,9 +1,9 @@
%\NeedsTeXFormat{LaTeX2e}[1994/12/01]
-%\RequirePackage{svn-prov}
-\def\exsh@version{0.5i}
-%\ProvidesPackageSVN{$Id$}[\exsh@version\space Typesetting of exercise sheets \revinfo]
-%\GetFileInfoSVN*
-%\message{`Typesetting of exercise sheets' \exsh@version\space <\filedate> (SVN Rev: \filerev)}
+\RequirePackage{svn-prov}
+\def\exsh@version{0.5j}
+\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"
@@ -531,10 +531,11 @@
\pgfkeysvalueof{/exsh/strings/exercise}~\arabic{section}\exsh@exname\exsh@firstline\exsh@points}%
\unskip\vskip\pgfkeysvalueof{/exsh/below exercise title skip}\relax
\@afterindentfalse
- % ensure proper distances above environments that start with a new \par
- \leavevmode
- \ignorespaces
+ % Use \leavevmode to ensure proper distances above environments that start
+ % with a new \par. Make sure that a \label does not mess up the layout.
+ \@ifnextchar\label{\exsh@label}{\leavevmode\ignorespaces}%
}{}
+\newcommand{\exsh@label}[2]{#1{#2}\leavevmode\ignorespaces}
\providecommand{\exsh@startsection}[2][]{%
\@startsection{section}{1}{\z@}%
{\pgfkeysvalueof{/exsh/above exercise skip}}%