summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/showlabels/showlabels.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/source/latex/showlabels/showlabels.dtx')
-rw-r--r--Master/texmf-dist/source/latex/showlabels/showlabels.dtx47
1 files changed, 28 insertions, 19 deletions
diff --git a/Master/texmf-dist/source/latex/showlabels/showlabels.dtx b/Master/texmf-dist/source/latex/showlabels/showlabels.dtx
index c6f2c2dfe3d..b4591fd24dd 100644
--- a/Master/texmf-dist/source/latex/showlabels/showlabels.dtx
+++ b/Master/texmf-dist/source/latex/showlabels/showlabels.dtx
@@ -24,13 +24,13 @@
%% See the file LICENCE for a copy of the GPL.
%% You can also find an online copy at http://www.gnu.org/copyleft/gpl.html .
%%
-%% $Id: showlabels.dtx,v 1.34 2008/07/24 10:59:31 norman Exp $
+%% $Id: showlabels.dtx,v 1.36 2008/10/10 21:32:01 norman Exp $
%%
%
\def\filename{showlabels}
-\def\fileversion{1.6.3}
-\def\filedate{2008/07/24}
-\def\docdate{2008 July 24}
+\def\fileversion{1.6.4}
+\def\filedate{2008/10/10}
+\def\docdate{2008 October 10}
\def\filemaintainer{norman@astro.gla.ac.uk}
% \changes{v1.4}{2001/07/23}{Avoided defining RCSDate}
%<+package>\NeedsTeXFormat{LaTeX2e}
@@ -246,20 +246,23 @@
% people, including
% Andreas Balser,
% Francis M. C. Ching,
+% Sven de Vries,
% Michael Friendly,
% Tino G\"ortem\"oller,
% Lester L. Helms,
% Hagen Kleinert,
+% David R. Leal Valmana,
% Olivier Michel,
% Sungmo Park,
% Ignacy Sawicki,
% Andrei Shelankov,
% Patrick Sibille,
-% David R. Leal Valmana,
+% Mariano Su\'arez-Alvarez,
% Ji\v ri Vesely,
% Elmar Walhorn,
% Roland Winkler.
-% Many thanks to all. If I've missed your name out of this list,
+% Many thanks to all. If I've missed your name out of this list
+% (or indeed if I've alphabetised you incorrectly),
% please accept my apologies, and do let me know.
%
% Back in 29-Jan-92, Darrel Hankerson
@@ -271,7 +274,7 @@
%
%
% \StopEventually{}
-%
+%
% \section{Implementation}
% \begin{macrocode}
%<*package>
@@ -310,9 +313,8 @@
% |\SL@labelname| is initialised to |\relax|, redefined within the
% |\label| macro, and reset to |\relax| here. If it's already equal
% to |\relax| here, the equation number hasn't been labelled, and so
-% `???' is put in the margin. Don't do this for the \pstyle{amsmath} case
-% as it artfully incorporates the |\maketag@@@| mechanism into a
-% redefined |\@eqnnum|.
+% we avoid putting anything in the margin. In the \pstyle{amsmath} case
+% we instead redefine |\maketag@@@|.
%
% \begin{macrocode}
\ifSL@AMS
@@ -326,19 +328,32 @@
% \Lenv{eqnarray} environment within \pstyle{amsmath}), then fall back
% on the |\SL@labelname| contents instead.
% \iffalse See tests t2 and t11\fi
+% We must make sure to leave |\SL@labelname| equal to |\relax| at the
+% end of this macro, otherwise a |{eqnarray}| followed by an (AMSTeX)
+% |\eqref| can end up with the wrong label being referred to by the
+% |\maketag@@@| within |\eqref| (or something like that).
+%
+% The test here must be |\ifx\SL@labelname\relax| with
+% |\global\let\SL@labelname\relax|, not |\expandafter\ifx\SL@...| and
+% |\global\def\SL@labelname{\relax}| (as it once was), since the
+% latter evaluates to true when |\SL@...| is |\relax| \emph{and} when
+% |\SL@...| starts with two identical characters, which is wrong (it
+% took embarrassingly many goes to get this right).
% \begin{macrocode}
\let\SL@maketag@@@=\maketag@@@
\def\maketag@@@#1{%
\SL@maketag@@@{#1}%
+ \message{maketag@@@: df@label=\df@label, SL@labelname=\SL@labelname, env=\@currenvir}%
\ifx\df@label\@empty
\ifx\SL@labelname\relax
- \SL@eqnlrtext{???}% it's not clear to me when this would happen
+ % do nothing
\else
\SL@eqnlrtext{\SL@labelname}%
\fi
\else
\SL@eqnlrtext{\df@label}%
\fi
+ \global\let\SL@labelname\relax
}
\else
% \end{macrocode}
@@ -347,22 +362,16 @@
% how on earth had this escaped before?!?}
% \changes{v1.3d}{1999/07/23}{Removed ??? when no label exists}
% \changes{v1.6.1}{2007/06/17}{Fix test again.}
-% The test here must be |\ifx\SL@labelname\relax| with
-% |\global\let\SL@labelname\relax|, not |\expandafter\ifx\SL@...| and
-% |\global\def\SL@labelname{\relax}| (as it once was), since the
-% latter evaluates to true when |\SL@...| is |\relax| \emph{and} when
-% |\SL@...| starts with two identical characters, which is wrong (it
-% took embarrassingly many goes to get this right).
% \begin{macrocode}
\let\SL@eqnnum=\@eqnnum
\def\@eqnnum{%
\SL@eqnnum
\ifx\SL@labelname\relax
-% \SL@eqnlrtext{???}%
+ % do nothing
\else
\SL@eqnlrtext{\SL@labelname}%
- \global\let\SL@labelname\relax
\fi
+ \global\let\SL@labelname\relax
}
\fi
% \end{macrocode}