[latex3-commits] [git/LaTeX3-latex3-hyperref] cleanup-patches: fix starred versions, update tests (22028ef)

Ulrike Fischer fischer at troubleshooting-tex.de
Mon Apr 11 20:00:40 CEST 2022


Repository : https://github.com/latex3/hyperref
On branch  : cleanup-patches
Link       : https://github.com/latex3/hyperref/commit/22028ef4b37fdc3d95c16aaa5db54fd7de7a1141

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

commit 22028ef4b37fdc3d95c16aaa5db54fd7de7a1141
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date:   Mon Apr 11 20:00:40 2022 +0200

    fix starred versions, update tests


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

22028ef4b37fdc3d95c16aaa5db54fd7de7a1141
 hyperref.dtx                                       | 36 ++++++++++++----------
 ...g => refstarred-hyperref-noimplicit.luatex.tlg} | 13 +++++---
 ...eref.tlg => refstarred-hyperref-noimplicit.tlg} | 13 +++++---
 testfiles-3/refstarred-hyperref.luatex.tlg         |  2 +-
 testfiles-3/refstarred-hyperref.tlg                |  2 +-
 testfiles-3/refstarred-nameref.luatex.tlg          |  6 ++--
 testfiles-3/refstarred-nameref.tlg                 |  6 ++--
 7 files changed, 44 insertions(+), 34 deletions(-)

diff --git a/hyperref.dtx b/hyperref.dtx
index 2dc4bf0..c9e55bf 100644
--- a/hyperref.dtx
+++ b/hyperref.dtx
@@ -7330,25 +7330,29 @@
       }%
     \fi
   \fi
-  \DeclareRobustCommand\ref{%
-    \@ifstar\@refstar\T at ref
-  }%
-  \DeclareRobustCommand\pageref{%
-    \@ifstar\@pagerefstar\T at pageref
-  }%
-  \DeclareRobustCommand*{\nameref}{%
-      \@ifstar\@namerefstar\T at nameref
-  }%
-  \DeclareRobustCommand*{\Ref}{%
-  \@ifstar\@Refstar\T at Ref
-  }%
+%    \end{macrocode}
+%    With active links we have to redefine the starred versions
+%   to avoid that they get links from the include |\@setref|:
+%    \begin{macrocode}
  \ifHy at implicit
    \let \T at Ref\HyRef at Ref
+   \def\@refstar#1{%
+     \HyRef at StarSetRef{#1}\@firstoffive
+   }
+   \def\@pagerefstar#1{%
+     \HyRef at StarSetRef{#1}\@secondoffive
+   }
+   \def\@namerefstar#1{%
+     \HyRef at StarSetRef{#1}\@thirdoffive
+   }
+   \def\@Refstar#1{%
+     \HyRef at StarSetRef{#1}\HyRef at MakeUppercaseFirstOfFive
+   }%
  \else
-   \let \@pagerefstar\T at pageref
-   \let \@refstar\T at ref
-   \let \@namerefstar\T at nameref
-   \let \@Refstar\T at Ref
+%   \let \@pagerefstar\T at pageref
+%   \let \@refstar\T at ref
+%   \let \@namerefstar\T at nameref
+%   \let \@Refstar\T at Ref
  \fi
 }
 \Hy at AtBeginDocument{%
diff --git a/testfiles-3/refstarred-nameref.luatex.tlg b/testfiles-3/refstarred-hyperref-noimplicit.luatex.tlg
similarity index 92%
copy from testfiles-3/refstarred-nameref.luatex.tlg
copy to testfiles-3/refstarred-hyperref-noimplicit.luatex.tlg
index 727f2d3..64ae1f5 100644
--- a/testfiles-3/refstarred-nameref.luatex.tlg
+++ b/testfiles-3/refstarred-hyperref-noimplicit.luatex.tlg
@@ -3,23 +3,24 @@ Don't change this file in any respect.
 > \ref=robust macro:
 ->\protect \ref  .
 > \ref =\long macro:
-->\@ifstar \T at ref \T at ref .
+->\@ifstar \@refstar \T at ref .
 <argument> \ref  
 l. ...\ShowCommand\ref
 > \Ref=robust macro:
 ->\protect \Ref  .
 > \Ref =macro:
-->\@ifstar \T at Ref \T at Ref .
+->\@ifstar \@Refstar \T at Ref .
 <argument> \Ref  
 l. ...\ShowCommand\Ref
 > \pageref=robust macro:
 ->\protect \pageref  .
 > \pageref =\long macro:
-->\@ifstar \T at pageref \T at pageref .
+->\@ifstar \@pagerefstar \T at pageref .
 <argument> \pageref  
 l. ...\ShowCommand\pageref
 Completed box being shipped out [1]
 \vbox(633.0+0.0)x407.0, direction TLT
+.\hbox(0.0+0.0)x0.0, direction TLT
 .\glue 16.0
 .\vbox(617.0+0.0)x345.0, shifted 62.0, direction TLT
 ..\vbox(12.0+0.0)x345.0, glue set 12.0fil, direction TLT
@@ -30,6 +31,7 @@ Completed box being shipped out [1]
 ..\glue(\lineskip) 0.0
 ..\vbox(550.0+0.0)x345.0, glue set 472.9515fil, direction TLT
 ...\write-{}
+...\pdfdest name{Doc-Start} xyz
 ...\glue(\topskip) 5.69
 ...\hbox(4.31+0.0)x345.0, glue set 310.83002fil, direction TLT
 ....\localpar
@@ -71,7 +73,7 @@ Completed box being shipped out [1]
 ...\write1{\@writefile{toc}{\protect \contentsline {section}{\protect \numberline \ETC.}
 ...\penalty 10000
 ...\glue 9.913 plus 0.86198
-...\write1{\newlabel{sec:test}{{a}{\thepage }{Test}{}{}}}
+...\write1{\newlabel{sec:test}{{a}{\thepage }{Test}{Doc-Start}{}}}
 ...\penalty 10000
 ...\penalty 10000
 ...\glue(\parskip) 0.0 plus 1.0
@@ -127,4 +129,5 @@ Completed box being shipped out [1]
 ....\glue 0.0 plus 1.0fil
 ....\TU/lmr/m/n/10 1
 ....\glue 0.0 plus 1.0fil
-(refstarred-nameref.aux)
+.\kern0.0
+(refstarred-hyperref-noimplicit.aux)
diff --git a/testfiles-3/refstarred-nameref.tlg b/testfiles-3/refstarred-hyperref-noimplicit.tlg
similarity index 91%
copy from testfiles-3/refstarred-nameref.tlg
copy to testfiles-3/refstarred-hyperref-noimplicit.tlg
index 32b1653..5877a5e 100644
--- a/testfiles-3/refstarred-nameref.tlg
+++ b/testfiles-3/refstarred-hyperref-noimplicit.tlg
@@ -3,23 +3,24 @@ Don't change this file in any respect.
 > \ref=robust macro:
 ->\protect \ref  .
 > \ref =\long macro:
-->\@ifstar \T at ref \T at ref .
+->\@ifstar \@refstar \T at ref .
 <argument> \ref  
 l. ...\ShowCommand\ref
 > \Ref=robust macro:
 ->\protect \Ref  .
 > \Ref =macro:
-->\@ifstar \T at Ref \T at Ref .
+->\@ifstar \@Refstar \T at Ref .
 <argument> \Ref  
 l. ...\ShowCommand\Ref
 > \pageref=robust macro:
 ->\protect \pageref  .
 > \pageref =\long macro:
-->\@ifstar \T at pageref \T at pageref .
+->\@ifstar \@pagerefstar \T at pageref .
 <argument> \pageref  
 l. ...\ShowCommand\pageref
 Completed box being shipped out [1]
 \vbox(633.0+0.0)x407.0
+.\hbox(0.0+0.0)x0.0
 .\glue 16.0
 .\vbox(617.0+0.0)x345.0, shifted 62.0
 ..\vbox(12.0+0.0)x345.0, glue set 12.0fil
@@ -30,6 +31,7 @@ Completed box being shipped out [1]
 ..\glue(\lineskip) 0.0
 ..\vbox(550.0+0.0)x345.0, glue set 472.97733fil
 ...\write-{}
+...\pdfdest name{Doc-Start} xyz
 ...\glue(\topskip) 5.69446
 ...\hbox(4.30554+0.0)x345.0, glue set 310.83327fil
 ....\hbox(0.0+0.0)x15.0
@@ -61,7 +63,7 @@ Completed box being shipped out [1]
 ...\write1{\@writefile{toc}{\protect \contentsline {section}{\protect \numberline \ETC.}
 ...\penalty 10000
 ...\glue 9.90276 plus 0.86108
-...\write1{\newlabel{sec:test}{{a}{\thepage }{Test}{}{}}}
+...\write1{\newlabel{sec:test}{{a}{\thepage }{Test}{Doc-Start}{}}}
 ...\penalty 10000
 ...\penalty 10000
 ...\glue(\parskip) 0.0 plus 1.0
@@ -107,4 +109,5 @@ Completed box being shipped out [1]
 ....\glue 0.0 plus 1.0fil
 ....\OT1/cmr/m/n/10 1
 ....\glue 0.0 plus 1.0fil
-(refstarred-nameref.aux)
+.\kern 0.0
+(refstarred-hyperref-noimplicit.aux)
diff --git a/testfiles-3/refstarred-hyperref.luatex.tlg b/testfiles-3/refstarred-hyperref.luatex.tlg
index faec9bd..4666163 100644
--- a/testfiles-3/refstarred-hyperref.luatex.tlg
+++ b/testfiles-3/refstarred-hyperref.luatex.tlg
@@ -9,7 +9,7 @@ l. ...\ShowCommand\ref
 > \Ref=robust macro:
 ->\protect \Ref  .
 > \Ref =macro:
-->\@ifstar \@Refstar \HyRef at Ref .
+->\@ifstar \@Refstar \T at Ref .
 <argument> \Ref  
 l. ...\ShowCommand\Ref
 > \pageref=robust macro:
diff --git a/testfiles-3/refstarred-hyperref.tlg b/testfiles-3/refstarred-hyperref.tlg
index 8dc6274..c0fcce1 100644
--- a/testfiles-3/refstarred-hyperref.tlg
+++ b/testfiles-3/refstarred-hyperref.tlg
@@ -9,7 +9,7 @@ l. ...\ShowCommand\ref
 > \Ref=robust macro:
 ->\protect \Ref  .
 > \Ref =macro:
-->\@ifstar \@Refstar \HyRef at Ref .
+->\@ifstar \@Refstar \T at Ref .
 <argument> \Ref  
 l. ...\ShowCommand\Ref
 > \pageref=robust macro:
diff --git a/testfiles-3/refstarred-nameref.luatex.tlg b/testfiles-3/refstarred-nameref.luatex.tlg
index 727f2d3..0ff9e9a 100644
--- a/testfiles-3/refstarred-nameref.luatex.tlg
+++ b/testfiles-3/refstarred-nameref.luatex.tlg
@@ -3,19 +3,19 @@ Don't change this file in any respect.
 > \ref=robust macro:
 ->\protect \ref  .
 > \ref =\long macro:
-->\@ifstar \T at ref \T at ref .
+->\@ifstar \@refstar \T at ref .
 <argument> \ref  
 l. ...\ShowCommand\ref
 > \Ref=robust macro:
 ->\protect \Ref  .
 > \Ref =macro:
-->\@ifstar \T at Ref \T at Ref .
+->\@ifstar \@Refstar \T at Ref .
 <argument> \Ref  
 l. ...\ShowCommand\Ref
 > \pageref=robust macro:
 ->\protect \pageref  .
 > \pageref =\long macro:
-->\@ifstar \T at pageref \T at pageref .
+->\@ifstar \@pagerefstar \T at pageref .
 <argument> \pageref  
 l. ...\ShowCommand\pageref
 Completed box being shipped out [1]
diff --git a/testfiles-3/refstarred-nameref.tlg b/testfiles-3/refstarred-nameref.tlg
index 32b1653..e2d434c 100644
--- a/testfiles-3/refstarred-nameref.tlg
+++ b/testfiles-3/refstarred-nameref.tlg
@@ -3,19 +3,19 @@ Don't change this file in any respect.
 > \ref=robust macro:
 ->\protect \ref  .
 > \ref =\long macro:
-->\@ifstar \T at ref \T at ref .
+->\@ifstar \@refstar \T at ref .
 <argument> \ref  
 l. ...\ShowCommand\ref
 > \Ref=robust macro:
 ->\protect \Ref  .
 > \Ref =macro:
-->\@ifstar \T at Ref \T at Ref .
+->\@ifstar \@Refstar \T at Ref .
 <argument> \Ref  
 l. ...\ShowCommand\Ref
 > \pageref=robust macro:
 ->\protect \pageref  .
 > \pageref =\long macro:
-->\@ifstar \T at pageref \T at pageref .
+->\@ifstar \@pagerefstar \T at pageref .
 <argument> \pageref  
 l. ...\ShowCommand\pageref
 Completed box being shipped out [1]





More information about the latex3-commits mailing list.