From 5d9728c50066dca3017faa37fee2e0daec8b0d52 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Tue, 18 Nov 2008 00:39:59 +0000 Subject: showlabels update (17nov08) git-svn-id: svn://tug.org/texlive/trunk@11336 c570f23f-e606-0410-a88d-b1316a301751 --- .../source/latex/showlabels/showlabels.drv | 65 ++++++++++++++++++++++ .../source/latex/showlabels/showlabels.dtx | 47 +++++++++------- 2 files changed, 93 insertions(+), 19 deletions(-) create mode 100644 Master/texmf-dist/source/latex/showlabels/showlabels.drv (limited to 'Master/texmf-dist/source/latex/showlabels') diff --git a/Master/texmf-dist/source/latex/showlabels/showlabels.drv b/Master/texmf-dist/source/latex/showlabels/showlabels.drv new file mode 100644 index 00000000000..ae2e961c032 --- /dev/null +++ b/Master/texmf-dist/source/latex/showlabels/showlabels.drv @@ -0,0 +1,65 @@ +%% +%% This is file `showlabels.drv', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% showlabels.dtx (with options: `driver') +%% Showlabels: Style to display labels in the margin +%% This is the showlabels package +%% +%% This software is copyright, 1999, 2001--2008, Norman Gray. +%% +%% This program is free software; you can redistribute it and/or +%% modify it under the terms of the GNU General Public License +%% as published by the Free Software Foundation; either version 2 +%% of the License, or (at your option) any later version. +%% +%% This program is distributed in the hope that it will be useful, +%% but WITHOUT ANY WARRANTY; without even the implied warranty of +%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +%% GNU General Public License for more details. +%% +%% You should have received a copy of the GNU General Public License +%% along with this program; if not, write to the Free Software +%% Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +%% +%% Author: Norman Gray, norman@astro.gla.ac.uk. +%% Department of Physics and Astronomy, University of Glasgow, UK +%% +%% 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.36 2008/10/10 21:32:01 norman Exp $ +%% +\def\filename{showlabels} +\def\fileversion{1.6.4} +\def\filedate{2008/10/10} +\def\docdate{2008 October 10} +\def\filemaintainer{norman@astro.gla.ac.uk} +\documentclass{ltxdoc} +\EnableCrossrefs +\newcommand\Lopt[1]{\textsf{#1}} % package options +\newcommand\file[1]{\texttt{#1}} % filename +\newcommand\Lenv[1]{\textsl{\{#1\}}} +\newcommand\pstyle[1]{\textsf{\{#1\}}} % packages +%% \url macro (url.sty does this better, but we don't want extra dependencies) +\def\setpathdots{\discretionary{.}{}{.}} +\def\setpathslash{\discretionary{/}{}{/}} +{\catcode`\.=\active + \catcode`\/=\active + \gdef\pathcats{% + \catcode`\%=12 \catcode`\~=12 + \catcode`\.=\active \let.\setpathdots + \catcode`\/=\active \let/\setpathslash + \catcode`\#=12 \catcode`\_=12}% + } +\def\setpath#1{\ttfamily <\nobreak #1\nobreak>\endgroup} +\def\url{\begingroup\pathcats\setpath} +\begin{document} +\DocInput{showlabels.dtx} +\PrintIndex +\end{document} +\endinput +%% +%% End of file `showlabels.drv'. 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} -- cgit v1.2.3