[latex3-commits] [latex3/latex2e] newlabel: docu updates (5b05881a)
github at latex-project.org
github at latex-project.org
Wed May 17 00:06:51 CEST 2023
Repository : https://github.com/latex3/latex2e
On branch : newlabel
Link : https://github.com/latex3/latex2e/commit/5b05881a083a913db39fe7fb58c3acf71dd265b8
>---------------------------------------------------------------
commit 5b05881a083a913db39fe7fb58c3acf71dd265b8
Author: Frank Mittelbach <frank.mittelbach at latex-project.org>
Date: Wed May 17 00:06:51 2023 +0200
docu updates
>---------------------------------------------------------------
5b05881a083a913db39fe7fb58c3acf71dd265b8
base/doc/ltnews37.tex | 30 +++++++++++++++++-------------
base/ltxref.dtx | 6 +++---
2 files changed, 20 insertions(+), 16 deletions(-)
diff --git a/base/doc/ltnews37.tex b/base/doc/ltnews37.tex
index d54f5a77..f327cade 100644
--- a/base/doc/ltnews37.tex
+++ b/base/doc/ltnews37.tex
@@ -360,27 +360,31 @@ not use grouping.
\subsection{Extension of the \cs{label} command}
-Previously, in standard \LaTeX{}, the \cs{label} command stored into the
-second argument of the \cs{newlabel} command in the \texttt{.aux} file two values:
+Previously, in standard \LaTeX{}, the \cs{label} command wrote a \cs{newlabel} declaration into
+the \texttt{.aux} file and stored two values in
+second argument of this \cs{newlabel} command:
\cs{@currentlabel}, which normally contains the state of the current
-counter, and \cs{thepage} for the current page number. \pkg{hyperref} and
-\pkg{nameref} patched the \cs{label} command to store five values:
-Additionally they save \cs{@currentlabelname}, which normally contains the
+counter and \cs{thepage} for the current page number.
+
+The packages \pkg{hyperref} and
+\pkg{nameref} then patched the \cs{label} command to store five values instead.
+In addition to the above they saved \cs{@currentlabelname}, which normally contains the
current title text and can be retrieved with \cs{nameref}, and
-\cs{@currentHref} which is the name of the destination needed to create an
+\cs{@currentHref}, which is the name of the destination needed to create an
active link. The fifth argument was only used if external
references were loaded with the \pkg{xr-hyper} package.
-Starting with this release, the number of values have been unified.
+Starting with this release, the number of values stored in \cs{newlabel} have been unified.
\cs{label} now writes a
-\cs{newlabel} command containing five values in the second argument:
+\cs{newlabel} command that always contains five values in the second argument (each in a brace group):
\cs{@currentlabel}, \cs{thepage}, \cs{@currentlabelname},
-\cs{@currentHref}. The fifth value is reserved for the kernel.
+\cs{@currentHref}, and \cs{@kernel at reserved@label at data} (which is reserved for the kernel).
-Additionally a hook with one argument with the name \texttt{label} has been
-added. It is executed before the label writes to the \texttt{.aux} file
-but \emph{after} the \cs{@bsphack} command and \emph{inside} a group. Code
-using the hook can refer to the label argument with \verb+#1+.
+Additionally, a hook with the name \texttt{label} has been
+added. It takes one argument: the label string.
+Code added to the hook can refer to this argument with \verb+#1+.
+The hook is executed directly before the \cs{label} command writes to the \texttt{.aux} file
+but \emph{after} the \cs{@bsphack} command has done its spacing magic and it is located \emph{inside} a group, thus its code only affects the write operation.
\section{Code improvements}
diff --git a/base/ltxref.dtx b/base/ltxref.dtx
index d08b7f3e..0084dbfc 100644
--- a/base/ltxref.dtx
+++ b/base/ltxref.dtx
@@ -33,7 +33,7 @@
%<*driver>
% \fi
\ProvidesFile{ltxref.dtx}
- [2023/05/12 v1.1q LaTeX Kernel (Cross Referencing)]
+ [2023/05/16 v1.1q LaTeX Kernel (Cross Referencing)]
% \iffalse
\documentclass{ltxdoc}
\GetFileInfo{ltxref.dtx}
@@ -98,7 +98,7 @@
% (A reference command |\nameref| is provided by the \pkg{nameref} package.)
% |\label| also stores |\@currentHref| which if set should refer to a target name
% for links. This value is set and used by \pkg{hyperref}. Unlike the other values
-% |\@currentHref| should be set globally. A fifth value |\@kernel at reserved@data|
+% |\@currentHref| should be set globally. A fifth value |\@kernel at reserved@label at data|
% is reserved for the kernel to allow future extensions of the cross-reference
% system.
%
@@ -118,7 +118,7 @@
% \@currentlabel == {CNT}{eval(\p at cnt\theCNT)}. The command
% \label{FOO} then writes the following on file \@auxout :
% \newlabel{FOO}{{eval(\@currentlabel)}{eval(\thepage)}%
-% {eval(\@currentlabelname)}{eval(\@currentHref)}{eval(\@kernel at reserved@data)}}
+% {eval(\@currentlabelname)}{eval(\@currentHref)}{eval(\@kernel at reserved@label at data)}}
%
% \ref{FOO} ==
% BEGIN
More information about the latex3-commits
mailing list.