diff options
| author | Sebastian Kuhnert | 2017-12-11 11:33:06 +0100 |
|---|---|---|
| committer | Sebastian Kuhnert | 2017-12-11 11:35:00 +0100 |
| commit | de50d575e7a6f6d766e486c12f063e00219b03e9 (patch) | |
| tree | b489f80421da7c84d0bd3be3150cacc4559c0994 /exercisesheets.sty | |
| parent | 8cacfaa429f30b4754d7e1e27bb26b9435bb739f (diff) | |
| download | exercisesheets-de50d575e7a6f6d766e486c12f063e00219b03e9.tar.gz exercisesheets-de50d575e7a6f6d766e486c12f063e00219b03e9.tar.bz2 exercisesheets-de50d575e7a6f6d766e486c12f063e00219b03e9.zip | |
fix labels in skipped sheets after the last printed sheet; fix incomplete \ifx errors
Diffstat (limited to 'exercisesheets.sty')
| -rw-r--r-- | exercisesheets.sty | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/exercisesheets.sty b/exercisesheets.sty index a016940..33ce1f1 100644 --- a/exercisesheets.sty +++ b/exercisesheets.sty @@ -18,8 +18,8 @@ %\NeedsTeXFormat{LaTeX2e}[1994/12/01] % don't forget to update the version and date in exercisesheets.tex -\def\exsh@version{0.5j} -\def\exsh@date{2017/04/27} +\def\exsh@version{0.5k} +\def\exsh@date{2017/12/11} \ProvidesPackage{exercisesheets}[\exsh@date\space\exsh@version\space Typesetting of exercise sheets] \message{`Typesetting of exercise sheets' \exsh@version\space <\exsh@date>} @@ -503,14 +503,25 @@ \edef\@enumctr{enum\romannumeral\the\@enumdepth}% \setcounter{\@enumctr}{0}% \fi - \ifx\@enumlabel@\relax + \@ifundefined{@enumlabel@}{% \exsh@skipsheet - \else + }{% \@ifnextchar[{\@enumlabel@{\exsh@skipsheet}[}{\exsh@skipsheet}% - \fi + }% } \def\exsh@skipsheet@label#1{% - \label{#1}\exsh@skipsheet + % Locally modify \protected@write to use \immediate\write instead. + % This is needed to include labels after the last shipout in the aux file. + \begingroup + \def\protected@write##1##2##3{% + \begingroup + \let\protect\@unexpandable@protect + \immediate\write##1{##3}% + \endgroup + }% + \label{#1}% + \endgroup + \exsh@skipsheet } \def\exsh@skipsheet@input#1{% \CatchFileDef{\exsh@inputfilecontent}{#1}{}% |
