[latex3-commits] [git/LaTeX3-latex3-latex2e] newlabel: switch to hook with argument (79a2c4f5)
Ulrike Fischer
fischer at troubleshooting-tex.de
Tue Apr 18 00:49:30 CEST 2023
Repository : https://github.com/latex3/latex2e
On branch : newlabel
Link : https://github.com/latex3/latex2e/commit/79a2c4f5158128f9669bf650c81143635e90963d
>---------------------------------------------------------------
commit 79a2c4f5158128f9669bf650c81143635e90963d
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date: Tue Apr 18 00:49:30 2023 +0200
switch to hook with argument
>---------------------------------------------------------------
79a2c4f5158128f9669bf650c81143635e90963d
base/doc/ltnews37.tex | 6 +++---
base/ltxref.dtx | 6 ++----
2 files changed, 5 insertions(+), 7 deletions(-)
diff --git a/base/doc/ltnews37.tex b/base/doc/ltnews37.tex
index dd8df96f..e12dfbc4 100644
--- a/base/doc/ltnews37.tex
+++ b/base/doc/ltnews37.tex
@@ -384,9 +384,9 @@ Starting with this release, the number of values have been unified.
\cs{@currentlabel}, \cs{thepage}, \cs{@currentlabelname},
\cs{@currentHref}. The fifth value is reserved for the kernel.
-Additionally a hook with the name \texttt{label} has been added. It is
-executed before the writing to the \texttt{.aux} file. Code using
-the hook can refer to the label argument with \cs{label at name}.
+Additionally a hook with argument with the name \texttt{label} has been
+added. It is executed before the writing to the \texttt{.aux} file. Code
+using the hook can refer to the label argument with \verb+#1+.
\section{Code improvements}
diff --git a/base/ltxref.dtx b/base/ltxref.dtx
index e335a989..2ef92244 100644
--- a/base/ltxref.dtx
+++ b/base/ltxref.dtx
@@ -390,12 +390,10 @@
\providecommand\@currentlabelname{}
\providecommand\@currentHref{}
\providecommand\@kernel at reserved@data{}
-\providecommand\label at name{}
-\NewHook{label}
+\NewHookWithArguments{label}{1}
\def\label#1{\@bsphack
\begingroup
- \def\label at name{#1}%
- \UseHook{label}%
+ \UseHookWithArguments{label}{1}{#1}%
\protected at write\@auxout{}%
{\string\newlabel{#1}{{\@currentlabel}{\thepage}%
{\@currentlabelname}{\@currentHref}{\@kernel at reserved@data}}}%
More information about the latex3-commits
mailing list.