[latex3-commits] [latex3/hyperref] newlabel: adapt xr-hyper to newlabel (6d24df0)

github at latex-project.org github at latex-project.org
Sun May 14 00:35:23 CEST 2023


Repository : https://github.com/latex3/hyperref
On branch  : newlabel
Link       : https://github.com/latex3/hyperref/commit/6d24df0059a132f6f0ecda9484a92d5ca9a26c71

>---------------------------------------------------------------

commit 6d24df0059a132f6f0ecda9484a92d5ca9a26c71
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date:   Sun May 14 00:35:23 2023 +0200

    adapt xr-hyper to newlabel


>---------------------------------------------------------------

6d24df0059a132f6f0ecda9484a92d5ca9a26c71
 testfiles/xr-newlabel-1.lvt | 18 ++++------
 testfiles/xr-newlabel-1.tlg | 80 +++++++++++++++++++++++++++++++++++++++++++
 testfiles/xr-newlabel-2.lvt | 34 +++++++++++++++++++
 testfiles/xr-newlabel-2.tlg | 82 +++++++++++++++++++++++++++++++++++++++++++++
 testfiles/xr-newlabel-3.lvt | 34 +++++++++++++++++++
 testfiles/xr-newlabel-3.tlg | 82 +++++++++++++++++++++++++++++++++++++++++++++
 xr-hyper.sty                |  2 ++
 7 files changed, 321 insertions(+), 11 deletions(-)

diff --git a/testfiles/xr-newlabel-1.lvt b/testfiles/xr-newlabel-1.lvt
index 1702c6f..a66c46f 100644
--- a/testfiles/xr-newlabel-1.lvt
+++ b/testfiles/xr-newlabel-1.lvt
@@ -1,4 +1,5 @@
 \documentclass{book}
+\input{regression-test}
 \begin{filecontents}[force]{test-aux1.aux}
 % aux-file with five arguments
 \newlabel{Ia}{{1.1}{1}{}{}{}}
@@ -18,20 +19,15 @@
 \newlabel{IIIa}{{1.1}{1}{title}{section.title}{}}
 \end{filecontents}
 \usepackage{xr-hyper}
-%\usepackage{hyperref}
+
 \externaldocument{test-aux1}
 \externaldocument{test-aux2}
-%\externaldocument{test-aux3}
+\externaldocument{test-aux3}
 \begin{document}
+\START \showoutput
 
-\makeatletter
-\show\r at Ia
-\show\r at Ib
-\show\r at Icfail
-\show\r at IIa
-\show\r at IIb
-\show\r at IIbfail
-\show\r at IIc
-\show\r at IIIa
+\makeatletter \show\r at Ia \show\r at Ib \show\r at Icfail \show\r at IIa \show\r at IIb 
+\show\r at IIbfail \show\r at IIc \show\r at IIIa 
 
+\ref{IIIa}
 \end{document}
diff --git a/testfiles/xr-newlabel-1.tlg b/testfiles/xr-newlabel-1.tlg
new file mode 100644
index 0000000..1b61d61
--- /dev/null
+++ b/testfiles/xr-newlabel-1.tlg
@@ -0,0 +1,80 @@
+This is a generated file for the l3build validation system.
+Don't change this file in any respect.
+> \r at Ia=macro:
+->{1.1}{1}{}{}{}.
+l. ...\makeatletter \show\r at Ia
+                              \show\r at Ib \show\r at Icfail \show\r at IIa \show\r at IIb
+> \r at Ib=macro:
+->{1.2}{1}{}{}{}.
+l. ...\makeatletter \show\r at Ia \show\r at Ib
+                                         \show\r at Icfail \show\r at IIa \show\r at IIb
+> \r at Icfail=macro:
+->{1.3}{1}.
+l. ......etter \show\r at Ia \show\r at Ib \show\r at Icfail
+                                                   \show\r at IIa \show\r at IIb
+> \r at IIa=macro:
+->{1.1}{1}{}{}{}.
+l. ......r at Ia \show\r at Ib \show\r at Icfail \show\r at IIa
+                                                   \show\r at IIb
+> \r at IIb=macro:
+->{1.2}{1}{}{}{}.
+l. ...... at Ib \show\r at Icfail \show\r at IIa \show\r at IIb
+> \r at IIbfail=macro:
+->{1.2}{1}{}{}{}{}{}{}.
+l. ...\show\r at IIbfail
+                     \show\r at IIc \show\r at IIIa
+> \r at IIc=macro:
+->{1.3}{1}{}{}{}.
+l. ...\show\r at IIbfail \show\r at IIc
+                                 \show\r at IIIa
+> \r at IIIa=macro:
+->{1.1}{1}{title}{section.title}{}.
+l. ...\show\r at IIbfail \show\r at IIc \show\r at IIIa
+Completed box being shipped out [1]
+\vbox(627.36243+0.0)x380.0
+.\glue 22.0
+.\vbox(605.36243+0.0)x345.0, shifted 35.0
+..\vbox(12.0+0.0)x345.0, glue set 5.55556fil
+...\glue 0.0 plus 1.0fil
+...\hbox(6.44444+0.0)x345.0
+....\hbox(6.44444+0.0)x345.0, glue set 339.99998fil
+.....\glue 0.0 plus 1.0fil
+.....\OT1/cmr/m/n/10 1
+..\glue 18.06749
+..\glue(\lineskip) 0.0
+..\vbox(550.0+0.0)x345.0, glue set 540.0fil
+...\write-{}
+...\glue(\topskip) 3.05556
+...\hbox(6.94444+0.0)x345.0, glue set 248.83316fil
+....\hbox(0.0+0.0)x15.0
+....\OT1/cmr/m/n/10 1
+....\OT1/cmr/m/n/10 .
+....\OT1/cmr/m/n/10 1
+....\OT1/cmr/m/n/10 t
+....\OT1/cmr/m/n/10 i
+....\OT1/cmr/m/n/10 t
+....\OT1/cmr/m/n/10 l
+....\OT1/cmr/m/n/10 e
+....\OT1/cmr/m/n/10 s
+....\OT1/cmr/m/n/10 e
+....\OT1/cmr/m/n/10 c
+....\OT1/cmr/m/n/10 t
+....\OT1/cmr/m/n/10 i
+....\OT1/cmr/m/n/10 o
+....\OT1/cmr/m/n/10 n
+....\OT1/cmr/m/n/10 .
+....\OT1/cmr/m/n/10 t
+....\OT1/cmr/m/n/10 i
+....\OT1/cmr/m/n/10 t
+....\OT1/cmr/m/n/10 l
+....\OT1/cmr/m/n/10 e
+....\hbox(0.0+0.0)x0.0
+....\penalty 10000
+....\glue(\parfillskip) 0.0 plus 1.0fil
+....\glue(\rightskip) 0.0
+...\glue 0.0 plus 1.0fil
+...\glue 0.0
+..\glue(\baselineskip) 25.29494
+..\hbox(0.0+0.0)x345.0
+...\hbox(0.0+0.0)x345.0
+(xr-newlabel-1.aux)
diff --git a/testfiles/xr-newlabel-2.lvt b/testfiles/xr-newlabel-2.lvt
new file mode 100644
index 0000000..49cb73e
--- /dev/null
+++ b/testfiles/xr-newlabel-2.lvt
@@ -0,0 +1,34 @@
+\documentclass{book}
+\input{regression-test}
+
+\begin{filecontents}[force]{test-aux1.aux}
+% aux-file with five arguments
+\newlabel{Ia}{{1.1}{1}{}{}{}}
+\newlabel{Ib}{{1.2}{1}{}{}{}}
+\newlabel{Icfail}{{1.3}{1}}%to check if test stopped
+\end{filecontents}
+\begin{filecontents}[force]{test-aux2.aux}
+% aux-file with two arguments
+\newlabel{IIa}{{1.1}{1}}
+\newlabel{IIb}{{1.2}{1}}
+\newlabel{IIbfail}{{1.2}{1}{}{}{}}%to check if test stopped
+\newlabel{IIc}{{1.3}{1}}
+\end{filecontents}
+
+\begin{filecontents}[force]{test-aux3.aux}
+% aux-file with five arguments and destinations
+\newlabel{IIIa}{{1.1}{1}{title}{section.title}{}}
+\end{filecontents}
+\usepackage{xr-hyper}
+\usepackage{hyperref}
+\externaldocument{test-aux1}
+\externaldocument{test-aux2}
+\externaldocument{test-aux3}
+\begin{document}
+\START \showoutput
+
+\makeatletter \show\r at Ia \show\r at Ib \show\r at Icfail \show\r at IIa \show\r at IIb 
+\show\r at IIbfail \show\r at IIc \show\r at IIIa 
+
+\ref{IIIa}
+\end{document}
diff --git a/testfiles/xr-newlabel-2.tlg b/testfiles/xr-newlabel-2.tlg
new file mode 100644
index 0000000..b368a67
--- /dev/null
+++ b/testfiles/xr-newlabel-2.tlg
@@ -0,0 +1,82 @@
+This is a generated file for the l3build validation system.
+Don't change this file in any respect.
+> \r at Ia=macro:
+->{1.1}{1}{}{}{}.
+l. ...\makeatletter \show\r at Ia
+                              \show\r at Ib \show\r at Icfail \show\r at IIa \show\r at IIb
+> \r at Ib=macro:
+->{1.2}{1}{}{}{}.
+l. ...\makeatletter \show\r at Ia \show\r at Ib
+                                         \show\r at Icfail \show\r at IIa \show\r at IIb
+> \r at Icfail=macro:
+->{1.3}{1}{}{}{}.
+l. ......etter \show\r at Ia \show\r at Ib \show\r at Icfail
+                                                   \show\r at IIa \show\r at IIb
+> \r at IIa=macro:
+->{1.1}{1}{}{}{}.
+l. ......r at Ia \show\r at Ib \show\r at Icfail \show\r at IIa
+                                                   \show\r at IIb
+> \r at IIb=macro:
+->{1.2}{1}{}{}{}.
+l. ...... at Ib \show\r at Icfail \show\r at IIa \show\r at IIb
+> \r at IIbfail=macro:
+->{1.2}{1}{}{}{}.
+l. ...\show\r at IIbfail
+                     \show\r at IIc \show\r at IIIa
+> \r at IIc=macro:
+->{1.3}{1}{}{}{}.
+l. ...\show\r at IIbfail \show\r at IIc
+                                 \show\r at IIIa
+> \r at IIIa=macro:
+->{1.1}{1}{title}{section.title}{test-aux3.pdf}.
+l. ...\show\r at IIbfail \show\r at IIc \show\r at IIIa
+Completed box being shipped out [1]
+\vbox(627.36243+0.0)x380.0
+.\hbox(0.0+0.0)x0.0
+.\vbox(0.0+0.0)x0.0, glue set - 20.99626fil
+..\kern 0.0
+..\kern 22.0
+..\kern -1.00374
+..\hbox(0.0+0.0)x0.0, glue set - 33.99626fil
+...\kern 0.0
+...\kern 35.0
+...\kern -1.00374
+...\pdfdest name{page.1} xyz
+...\penalty 10000
+...\glue 0.0 plus 1.0fil minus 1.0fil
+..\glue 0.0 plus 1.0fil minus 1.0fil
+.\glue(\lineskip) 0.0
+.\vbox(627.36243+0.0)x380.0
+..\glue 22.0
+..\vbox(605.36243+0.0)x345.0, shifted 35.0
+...\vbox(12.0+0.0)x345.0, glue set 5.55556fil
+....\glue 0.0 plus 1.0fil
+....\hbox(6.44444+0.0)x345.0
+.....\hbox(6.44444+0.0)x345.0, glue set 339.99998fil
+......\glue 0.0 plus 1.0fil
+......\OT1/cmr/m/n/10 1
+...\glue 18.06749
+...\glue(\lineskip) 0.0
+...\vbox(550.0+0.0)x345.0, glue set 540.0fil
+....\write-{}
+....\pdfdest name{Doc-Start} xyz
+....\glue(\topskip) 3.55556
+....\hbox(6.44444+0.0)x345.0, glue set 317.22218fil
+.....\hbox(0.0+0.0)x15.0
+.....\pdfstartlink(*+*)x* attr{/Border[0 0 1]/H/I/C[0 .5 .5]} action user{/Subtype/Link/A<</F(test-aux3.pdf)/S/GoToR/D(section.title)>>}
+.....\OT1/cmr/m/n/10 1
+.....\OT1/cmr/m/n/10 .
+.....\OT1/cmr/m/n/10 1
+.....\pdfendlink
+.....\penalty 10000
+.....\glue(\parfillskip) 0.0 plus 1.0fil
+.....\glue(\rightskip) 0.0
+....\glue 0.0 plus 1.0fil
+....\glue 0.0
+...\glue(\baselineskip) 25.29494
+...\hbox(0.0+0.0)x345.0
+....\hbox(0.0+0.0)x345.0
+.\kern 0.0
+(xr-newlabel-2.aux)
+Package rerunfilecheck Info: File `xr-newlabel-2.out' has not changed.
+(rerunfilecheck)             Checksum: D41D8CD98F00B204E9800998ECF8427E;0.
diff --git a/testfiles/xr-newlabel-3.lvt b/testfiles/xr-newlabel-3.lvt
new file mode 100644
index 0000000..6a36f17
--- /dev/null
+++ b/testfiles/xr-newlabel-3.lvt
@@ -0,0 +1,34 @@
+\documentclass{book}
+\input{regression-test}
+\begin{filecontents}[force]{test-aux1.aux}
+% aux-file with five arguments
+\newlabel{Ia}{{1.1}{1}{}{}{}}
+\newlabel{Ib}{{1.2}{1}{}{}{}}
+\newlabel{Icfail}{{1.3}{1}}%to check if test stopped
+\end{filecontents}
+\begin{filecontents}[force]{test-aux2.aux}
+% aux-file with two arguments
+\newlabel{IIa}{{1.1}{1}}
+\newlabel{IIb}{{1.2}{1}}
+\newlabel{IIbfail}{{1.2}{1}{}{}{}}%to check if test stopped
+\newlabel{IIc}{{1.3}{1}}
+\end{filecontents}
+
+\begin{filecontents}[force]{test-aux3.aux}
+% aux-file with five arguments and destinations
+\newlabel{IIIa}{{1.1}{1}{title}{section.title}{}}
+\end{filecontents}
+\usepackage{xr-hyper}
+\externaldocument{test-aux1}
+\externaldocument{test-aux2}
+\externaldocument{test-aux3}
+\usepackage{hyperref}
+
+\begin{document}
+\START \showoutput
+
+\makeatletter \show\r at Ia \show\r at Ib \show\r at Icfail \show\r at IIa \show\r at IIb 
+\show\r at IIbfail \show\r at IIc \show\r at IIIa 
+
+\ref{IIIa}
+\end{document}
diff --git a/testfiles/xr-newlabel-3.tlg b/testfiles/xr-newlabel-3.tlg
new file mode 100644
index 0000000..9080120
--- /dev/null
+++ b/testfiles/xr-newlabel-3.tlg
@@ -0,0 +1,82 @@
+This is a generated file for the l3build validation system.
+Don't change this file in any respect.
+> \r at Ia=macro:
+->{1.1}{1}{}{}{}.
+l. ...\makeatletter \show\r at Ia
+                              \show\r at Ib \show\r at Icfail \show\r at IIa \show\r at IIb
+> \r at Ib=macro:
+->{1.2}{1}{}{}{}.
+l. ...\makeatletter \show\r at Ia \show\r at Ib
+                                         \show\r at Icfail \show\r at IIa \show\r at IIb
+> \r at Icfail=macro:
+->{1.3}{1}.
+l. ......etter \show\r at Ia \show\r at Ib \show\r at Icfail
+                                                   \show\r at IIa \show\r at IIb
+> \r at IIa=macro:
+->{1.1}{1}{}{}{}.
+l. ......r at Ia \show\r at Ib \show\r at Icfail \show\r at IIa
+                                                   \show\r at IIb
+> \r at IIb=macro:
+->{1.2}{1}{}{}{}.
+l. ...... at Ib \show\r at Icfail \show\r at IIa \show\r at IIb
+> \r at IIbfail=macro:
+->{1.2}{1}{}{}{}{}{}{}.
+l. ...\show\r at IIbfail
+                     \show\r at IIc \show\r at IIIa
+> \r at IIc=macro:
+->{1.3}{1}{}{}{}.
+l. ...\show\r at IIbfail \show\r at IIc
+                                 \show\r at IIIa
+> \r at IIIa=macro:
+->{1.1}{1}{title}{section.title}{}.
+l. ...\show\r at IIbfail \show\r at IIc \show\r at IIIa
+Completed box being shipped out [1]
+\vbox(627.36243+0.0)x380.0
+.\hbox(0.0+0.0)x0.0
+.\vbox(0.0+0.0)x0.0, glue set - 20.99626fil
+..\kern 0.0
+..\kern 22.0
+..\kern -1.00374
+..\hbox(0.0+0.0)x0.0, glue set - 33.99626fil
+...\kern 0.0
+...\kern 35.0
+...\kern -1.00374
+...\pdfdest name{page.1} xyz
+...\penalty 10000
+...\glue 0.0 plus 1.0fil minus 1.0fil
+..\glue 0.0 plus 1.0fil minus 1.0fil
+.\glue(\lineskip) 0.0
+.\vbox(627.36243+0.0)x380.0
+..\glue 22.0
+..\vbox(605.36243+0.0)x345.0, shifted 35.0
+...\vbox(12.0+0.0)x345.0, glue set 5.55556fil
+....\glue 0.0 plus 1.0fil
+....\hbox(6.44444+0.0)x345.0
+.....\hbox(6.44444+0.0)x345.0, glue set 339.99998fil
+......\glue 0.0 plus 1.0fil
+......\OT1/cmr/m/n/10 1
+...\glue 18.06749
+...\glue(\lineskip) 0.0
+...\vbox(550.0+0.0)x345.0, glue set 540.0fil
+....\write-{}
+....\pdfdest name{Doc-Start} xyz
+....\glue(\topskip) 3.55556
+....\hbox(6.44444+0.0)x345.0, glue set 317.22218fil
+.....\hbox(0.0+0.0)x15.0
+.....\pdfstartlink(*+*)x* attr{/Border[0 0 1]/H/I/C[1 0 0]} action goto name{section.title}
+.....\OT1/cmr/m/n/10 1
+.....\OT1/cmr/m/n/10 .
+.....\OT1/cmr/m/n/10 1
+.....\pdfendlink
+.....\penalty 10000
+.....\glue(\parfillskip) 0.0 plus 1.0fil
+.....\glue(\rightskip) 0.0
+....\glue 0.0 plus 1.0fil
+....\glue 0.0
+...\glue(\baselineskip) 25.29494
+...\hbox(0.0+0.0)x345.0
+....\hbox(0.0+0.0)x345.0
+.\kern 0.0
+(xr-newlabel-3.aux)
+Package rerunfilecheck Info: File `xr-newlabel-3.out' has not changed.
+(rerunfilecheck)             Checksum: D41D8CD98F00B204E9800998ECF8427E;0.
diff --git a/xr-hyper.sty b/xr-hyper.sty
index 3e71015..c20cb27 100644
--- a/xr-hyper.sty
+++ b/xr-hyper.sty
@@ -109,8 +109,10 @@
  }
 \ExplSyntaxOff 
 % we also have to ensure that hyperref doesn't remove the empty braces again
+% %  or that \XR at HYPcompargs adds more
 \AddToHook{package/hyperref/after}
  {
+   \def\XR at addURL#1\XR at HYPcompargs{\XR@@dURL#1{}{}{}{}\\}
    \def\XR@@dURL#1#2#3#4#5\\{%
      {#1}{#2}%
      \if!#4!%





More information about the latex3-commits mailing list.