[latex3-commits] [latex3/latex2e] newlabel: rename hook, add testfile (d537bc33)
github at latex-project.org
github at latex-project.org
Thu May 11 15:27:28 CEST 2023
Repository : https://github.com/latex3/latex2e
On branch : newlabel
Link : https://github.com/latex3/latex2e/commit/d537bc333a8334e314c88a1c08971d050a418127
>---------------------------------------------------------------
commit d537bc333a8334e314c88a1c08971d050a418127
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date: Thu May 11 15:27:28 2023 +0200
rename hook, add testfile
>---------------------------------------------------------------
d537bc333a8334e314c88a1c08971d050a418127
base/ltxref.dtx | 4 ++--
base/testfiles/tlb-label-001.lvt | 26 ++++++++++++++++++++++++++
base/testfiles/tlb-label-001.tlg | 6 ++++++
3 files changed, 34 insertions(+), 2 deletions(-)
diff --git a/base/ltxref.dtx b/base/ltxref.dtx
index 2ef92244..5e1f85cd 100644
--- a/base/ltxref.dtx
+++ b/base/ltxref.dtx
@@ -390,10 +390,10 @@
\providecommand\@currentlabelname{}
\providecommand\@currentHref{}
\providecommand\@kernel at reserved@data{}
-\NewHookWithArguments{label}{1}
+\NewHookWithArguments{cmd/label/before}{1}
\def\label#1{\@bsphack
\begingroup
- \UseHookWithArguments{label}{1}{#1}%
+ \UseHookWithArguments{cmd/label/before}{1}{#1}%
\protected at write\@auxout{}%
{\string\newlabel{#1}{{\@currentlabel}{\thepage}%
{\@currentlabelname}{\@currentHref}{\@kernel at reserved@data}}}%
diff --git a/base/testfiles/tlb-label-001.lvt b/base/testfiles/tlb-label-001.lvt
new file mode 100644
index 00000000..b1577763
--- /dev/null
+++ b/base/testfiles/tlb-label-001.lvt
@@ -0,0 +1,26 @@
+\RequirePackage[enable-debug]{expl3}
+\ExplSyntaxOn
+\debug_on:n { check-declarations , deprecation }
+\ExplSyntaxOff
+
+\documentclass{article}
+
+\input{regression-test}
+
+\DebugHooksOn
+
+\begin{document}
+\START \showoutput
+\makeatletter
+\AddToHookWithArguments
+ {cmd/label/before}{\typeout{Setting label #1:
+ \@currentlabel, \@currentlabelname, \@currentHref}}
+
+\refstepcounter{section}
+\def\@currentlabelname{Titel}
+\gdef\@currentHref{Destination}
+\label{test}
+
+\newpage
+\end{document}
+
diff --git a/base/testfiles/tlb-label-001.tlg b/base/testfiles/tlb-label-001.tlg
new file mode 100644
index 00000000..d275fce2
--- /dev/null
+++ b/base/testfiles/tlb-label-001.tlg
@@ -0,0 +1,6 @@
+This is a generated file for the l3build validation system.
+Don't change this file in any respect.
+**** Add to hook cmd/label/before (top-level) on input line ... <- \typeout {Setting label ##1: \@currentlabel , \@currentlabelname , \@currentHref }
+Update code for hook 'cmd/label/before' on input line ...:
+Setting label test: 1, Titel, Destination
+(tlb-label-001.aux)
More information about the latex3-commits
mailing list.