summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/showlabels/showlabels.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/showlabels/showlabels.dtx')
-rw-r--r--macros/latex/contrib/showlabels/showlabels.dtx83
1 files changed, 53 insertions, 30 deletions
diff --git a/macros/latex/contrib/showlabels/showlabels.dtx b/macros/latex/contrib/showlabels/showlabels.dtx
index ef6f107f60..2cfacf9112 100644
--- a/macros/latex/contrib/showlabels/showlabels.dtx
+++ b/macros/latex/contrib/showlabels/showlabels.dtx
@@ -2,7 +2,7 @@
%
%% This is the showlabels package
%%
-%%%% Copyright 1999, 2001-09, 2013-21, Norman Gray
+%%%% Copyright 1999, 2001-09, 2013-22, Norman Gray
%%
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public Licence, either version 1.3c
@@ -20,12 +20,12 @@
%% and the derived file showlabels.sty.
%%%% File: showlabels.dtx
-%%%% Source: 1f8b1fcbe557, 2021-10-27T16:06:03+01:00
+%%%% Source: dc6d682fadbc, 2022-07-18T23:32:32+01:00
-% This is revision 1f8b1fcbe557, 2021-10-27T16:06:03+01:00.
+% This is revision dc6d682fadbc, 2022-07-18T23:32:32+01:00.
%<+package>\NeedsTeXFormat{LaTeX2e}
-%<+package>\ProvidesPackage{showlabels}[2021/10/27\space v1.9.1]
-%<+package>\typeout{Package: `showlabels' v1.9.1\space<2021/10/27>}
+%<+package>\ProvidesPackage{showlabels}[2022/07/18\space v1.9.2]
+%<+package>\typeout{Package: `showlabels' v1.9.2\space<2022/07/18>}
%
%<*driver>
\documentclass{ltxdoc}
@@ -34,11 +34,11 @@
% Some commonly used abbreviations for option names, filenames,
% counters and packages.
% \begin{macrocode}
-\newcommand\Lopt[1]{\textsf{#1}} % package options
-\newcommand\file[1]{\texttt{#1}} % filename
+\newcommand\Lopt[1]{\textsf{#1}} % package options
+\newcommand\file[1]{\texttt{#1}} % filename
%\newcommand\Lcount[1]{\textsl{\small#1}}
\newcommand\Lenv[1]{\textsl{\{#1\}}}
-\newcommand\Lpackage[1]{\textsf{\{#1\}}} % packages
+\newcommand\Lpackage[1]{\textsf{\{#1\}}} % packages
%% \url macro (url.sty does this better, but we don't want extra dependencies)
\def\setpathdots{\discretionary{.}{}{.}}
\def\setpathslash{\discretionary{/}{}{/}}
@@ -63,8 +63,8 @@
%
%
% \title{The \texttt{showlabels} package}
-% \author{Norman Gray\\|gray@nxg.name|}
-% \date{Version 1.9.1, 2021 October 27}
+% \author{Norman Gray\\https://nxg.me.uk}
+% \date{Version 1.9.2, 2022 July 18}
%
% \maketitle
%
@@ -154,6 +154,9 @@
% situation which this package mishandles) to force inline labels
% temporarily, within a block or environment. Use the
% |\showlabelsinline| macro to do that.
+% \DescribeMacro{\showlabelsmarginal}
+% The corresponding |\showlabelsmarginal| command has the opposite
+% effect (included for symmetry; it's less likely to be useful).
%
% \section{Formatting}
%
@@ -194,7 +197,7 @@
% The command |\showlabeltype| will expand to the current label type
% (ie, `label' or `cite', etc), so it would be possible for
% |\showlabelsetlabel| to conditionalise on that, if you felt that
-% were necessary.\footnote{The support for an one-argument command in
+% were necessary.\footnote{The support for a one-argument command in
% $\backslash$\texttt{showlabels}, and the presence of the
% $\backslash$\texttt{showlabeltype} macro, were added in version 1.9.}
%
@@ -278,7 +281,7 @@
% The package might still work with \LaTeX2.09, but that's neither
% supported, nor even still tested.
%
-% This software is copyright, 1999, 2001-09, 2013-21 Norman Gray.
+% This software is copyright, 1999, 2001-09, 2013-22 Norman Gray.
% It is released under the terms of the \LaTeX\ Project Public Licence.
% See the copyright declaration at the top of file \texttt{showlabels.dtx},
% and the file \texttt{lppl.txt}, for the licence conditions.
@@ -286,7 +289,7 @@
% The canonical home page of the package is
% \url{https://purl.org/nxg/dist/showlabels}, and it is on CTAN at
% \url{https://www.ctan.org/pkg/showlabels}. The source is in
-% a repository online: \url{https://hg.sr.ht/~nxg/showlabels}.
+% a repository online: \url{https://heptapod.host/nxg/showlabels}.
%
% \section{Other packages}
%
@@ -345,19 +348,22 @@
% \fi
% \catcode`\~=12
% \iffalse @RELEASENOTES@ \fi
-% \begin{description}\item[1.9.1, 2021 October 27]\relax Commands with optional arguments, such as
+% \begin{description}\item[1.9.2, 2022 July 18]\relax No code changes from 1.9.2-b1, but the documentation notes a new home repository.\par \item[1.9.2-b1, 2022 June 11]\relax \P\thinspace Fixed a spacing bug when used with the |wrapfig| package
+% (issue 2\footnote{\url{https://heptapod.host/nxg/showlabels/-/issues/2}}).
+% Thanks to Romano Giannetti for the report. \P\thinspace Added a |\showlabelsmarginal| command. \P\thinspace The code has moved (again) to
+% heptapod.host\footnote{\url{https://heptapod.host}}: the new
+% repository is
+% https://heptapod.host/nxg/showlabels\footnote{\url{https://heptapod.host/nxg/showlabels}}.
+% The issues links in the list below are therefore broken.\par\item[1.9.1, 2021 October 27]\relax Commands with optional arguments, such as
% |\bibitem[P\'olya]{polya_54}| are now handled with the
% correct catcodes.
-% Fixes issue 1\footnote{\url{https://todo.sr.ht/~nxg/showlabels/1}}
+% Fixes issue 1\footnote{\url{https://heptapod.host/nxg/showlabels/-/issues/1}}
% (new sequencing for issues).
% Thanks to Michael Levitin for the report here.\par \item[1.9, 2021 October 9]\relax \P\thinspace Robustness fix: macros in arguments are now handled, so that
% (after |\showlabel{index}|),
% |\index{Poincar\'e}| doesn't cause an error. \P\thinspace The |\showlabel[optarg]{command}| optional argument
% can now take a one-argument command. \P\thinspace The macro |\showlabeltype| expands to the current
-% label type, for possible use in |\showlabelsetlabel|. \P\thinspace The code has moved from Bitbucket to
-% Sourcehut\footnote{\url{https://sourcehut.org}}: the new repository is
-% https://hg.sr.ht/~nxg/showlabels\footnote{\url{https://hg.sr.ht/~nxg/showlabels}}.
-% The issues links in the list below are therefore broken.\par\item[1.8, 2016 June 9]\relax The |ntheorem| package exposed an apparently
+% label type, for possible use in |\showlabelsetlabel|.\par\item[1.8, 2016 June 9]\relax The |ntheorem| package exposed an apparently
% long-standing incompleteness in the handling of |amsmath|
% documents.
% Fixes issue 9\footnote{\url{https://bitbucket.org/nxg/showlabels/issues/9/}}.\par \item[1.7, 2015 December 8]\relax Release v1.7.\par \item[1.7b2, 2015 December 7]\relax Make the combination of amsmath and [inline] mode work
@@ -455,8 +461,8 @@
% \LaTeX2e package.
% 29-Jan-92 Darrel Hankerson (hank@ducvax.auburn.edu)
% Update to NFSS. Change name to `showlabel.sty'. Substitute
-% \nintt -> \small\tt
-% \sevit -> \scriptsize\it
+% \nintt -> \small\tt
+% \sevit -> \scriptsize\it
% 21-Sep-91 Norman Gray no_gray@vax.acs.open.ac.uk
% Original release of labels.sty
% \fi
@@ -904,8 +910,10 @@
\def\SL@interlinetext#1{%
\setbox\@tempboxa=\hbox{\showlabelsetlabel{\SL@prlabelname{#1}}}\dp\@tempboxa\z@
\ifvmode
+ \@tempdima=\prevdepth
\nointerlineskip\vbox to 0pt{\vss
- \hbox to \columnwidth{\hss \box\@tempboxa}}%
+ \hbox to \hsize{\hss \box\@tempboxa}}\nobreak
+ \prevdepth=\@tempdima
% \end{macrocode}
% And in horizontal mode, squeeze it between the lines, at the current point,
% carefully taking up no space.
@@ -913,16 +921,16 @@
\else
\ifSL@setleft
\hbox to 0pt{%
- \hss
- \vbox to 0pt{\vss
- \hbox to 0pt{\hss\box\@tempboxa}%
- \showlabelrefline
+ \hss
+ \vbox to 0pt{\vss
+ \hbox to 0pt{\hss\box\@tempboxa}%
+ \showlabelrefline
}}%
\else
\hbox to 0pt{%
- \vbox to 0pt{\vss
- \box\@tempboxa
- \showlabelrefline
+ \vbox to 0pt{\vss
+ \box\@tempboxa
+ \showlabelrefline
}\hss}%
\fi
\penalty10000
@@ -1043,12 +1051,21 @@
% place, rather than within a zero depth box. This code \emph{assumes} that
% equation numbers are going to be on the right hand side of the page. It
% should probably check for the existence of the \Lopt{leqno} option (how?).
+%
+% Note that we \emph{do} want this to be |\columnwidth| rather than
+% |\hsize|. The \Lpackage{wrapfig} package retains the former as the
+% width of the whole column, even though it carefully changes the
+% latter to be the width of the \Lenv{wrapfigure} environment. In the
+% (unlikely) event we want numbered equations in such an environment
+% \emph{and} this label ends up on the left, we do want the
+% label right out in the left margin, rather than on the left of the
+% \Lenv{wrapfigure} environment.
% \begin{macro}{\SL@eqnrighttext}
% \begin{macro}{\SL@eqnlefttext}
% \begin{macrocode}
\def\SL@eqnrighttext#1{\rlap{\quad\SL@margintext{#1}}}
\def\SL@eqnlefttext #1{\hbox to 0pt{\kern -\columnwidth
- \llap{\SL@margintext{#1}\quad}\hss}}
+ \llap{\SL@margintext{#1}\quad}\hss}}
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -1142,6 +1159,12 @@
\def\showlabelsinline{\SL@labelsinlinetrue}
% \end{macrocode}
% \end{macro}
+% \begin{macro}{\showlabelsmarginal}
+% Add the complementary macro for symmetry, even though this is not
+% likely to be useful.
+% \begin{macrocode}
+\def\showlabelsmarginal{\SL@labelsinlinefalse}
+% \end{macrocode}
% By default, we run |\showlabels{label}|. The option \Lopt{nolabel}
% turns this off.
% \begin{macrocode}