summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/showlabels/showlabels.dtx
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2006-05-27 00:52:47 +0000
committerKarl Berry <karl@freefriends.org>2006-05-27 00:52:47 +0000
commit1bb32c08a2c77aee09e03c5644231eaca3770563 (patch)
tree485563bcd5c4d5209e3dc23841e155ee53a8d821 /Master/texmf-dist/source/latex/showlabels/showlabels.dtx
parentb0d72d1435388dc39986ff56051d9c37e18ab28b (diff)
showlabels update
git-svn-id: svn://tug.org/texlive/trunk@1598 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/showlabels/showlabels.dtx')
-rw-r--r--Master/texmf-dist/source/latex/showlabels/showlabels.dtx45
1 files changed, 30 insertions, 15 deletions
diff --git a/Master/texmf-dist/source/latex/showlabels/showlabels.dtx b/Master/texmf-dist/source/latex/showlabels/showlabels.dtx
index e1a2e9337f9..7ac0207b94d 100644
--- a/Master/texmf-dist/source/latex/showlabels/showlabels.dtx
+++ b/Master/texmf-dist/source/latex/showlabels/showlabels.dtx
@@ -2,7 +2,7 @@
%
%% This is the showlabels package
%%
-%% This software is copyright, 1999, 2001--2005, Norman Gray.
+%% This software is copyright, 1999, 2001--2006, Norman Gray.
%%
%% This program is free software; you can redistribute it and/or
%% modify it under the terms of the GNU General Public License
@@ -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.26 2005/03/17 18:39:35 norman Exp $
+%% $Id: showlabels.dtx,v 1.28 2006/05/26 16:29:11 norman Exp $
%%
%
\def\ParseRCSDate$#1: #2 #3 ${\def\SL@Date{#2}}
-\ParseRCSDate$Date: 2005/03/17 18:39:35 $
+\ParseRCSDate$Date: 2006/05/26 16:29:11 $
\def\filename{showlabels}
-\def\fileversion{1.5a}
+\def\fileversion{1.6}
\def\filedate{\SL@Date}
\def\docdate{\SL@Date}
\def\filemaintainer{norman@astro.gla.ac.uk}
@@ -104,7 +104,7 @@
% \Lopt{inline} & put notes inline, as much as possible, and ignore
% any of the margin-placement options above \\
% \Lopt{nolabel} & do not insert a marginal note for |\label| commands
-% (see command |\showlabel| below)\\
+% (see command |\showlabels| below)\\
% \Lopt{draft} & [default] does nothing, partner of\dots\\
% \Lopt{final} & turns off all the package's functionality
% \end{tabular}
@@ -145,10 +145,12 @@
% then give the option \Lopt{nolabel} to the |\usepackage| command:
% |\usepackage[nolabel]{showlabels}|.
%
-% By default, the package reprints labels in the margin of the
+% By default, the package displays labels in the margin of the
% document, but as an alternative, labels can be kept inline as much
-% as possible. To select this, give the option \Lopt{inline},
-% and to select the default behaviour, use \Lopt{marginal}.
+% as possible; this is much more legible when there are multiple
+% labels on a single line. To select this, give the option
+% \Lopt{inline}, and to select the default behaviour, use
+% \Lopt{marginal}.
%
% Finally, we have the options \Lopt{final} and \Lopt{draft}. The option
% \Lopt{final} turns off all the functionality of this package. This
@@ -415,8 +417,9 @@
% |\SL@setlabel{bar}\SL@origfoo{bar}|.
%
% First, define a command |\SL@initfoo|, which, when executed, will
-% save the current (at that time) behaviour of the command |\foo|, and
-% redefine |\foo| to have the required behaviour; we will
+% save the current (at that time) behaviour of the command |\foo| as
+% |\@SL@origfoo|, and then set |\foo| to be equivalent to |\SL@foo|,
+% which does the magic; we will
% shortly give this command to |\AtBeginDocument|, so that it is
% switched on at the correct time, when other packages have done
% \emph{their} redefinitions of |\foo| (this makes it compatible with
@@ -446,9 +449,11 @@
% (putting it in the margin, for example), then calls the original
% |\foo| command (namely |\SL@origfoo|) with the original argument.
%
-% The first argument is the name of the command which this command is
-% replacing, for example `label'. The second is the argument
-% originally given to the command.
+% The command takes a single argument, namely the name of the command
+% being wrapped (for example, `label'). We set |\@tempa| to be the
+% original version of that command (stored in |\SL@orig#1|), and then
+% take one of two similar paths, depending on whether the command has
+% an optional argument or not.
%
% We have to be somewhat careful about the positioning of the
% |\@bsphack| and |\@esphack| commands. The |\@esphack| command should
@@ -471,11 +476,21 @@
% the work -- this is |\let| equal to either |\SL@margtext| or
% |\SL@inlinetext| below.
% \begin{macrocode}
-\def\SL@showlabels#1#2{%
+\def\SL@showlabels#1{%
+ \def\@tempa{\csname SL@orig#1\endcsname}
+ \@ifnextchar[\SL@showlabelsopt\SL@showlabelsplain
+}
+\def\SL@showlabelsopt[#1]#2{%
\@bsphack
\SL@setlabel{#2}\relax
\ifhmode \spacefactor\@savsf \ifdim\@savsk>\z@ \hskip1sp \fi\fi
- \csname SL@orig#1\endcsname{#2}%
+ \@tempa[#1]{#2}%
+}
+\def\SL@showlabelsplain#1{%
+ \@bsphack
+ \SL@setlabel{#1}\relax
+ \ifhmode \spacefactor\@savsf \ifdim\@savsk>\z@ \hskip1sp \fi\fi
+ \@tempa{#1}%
}
% \end{macrocode}
% \end{macro}