[latex3-commits] [git/LaTeX3-latex3-hyperref] main: load nameref earlier, issue #235 (a011ba9)

Ulrike Fischer fischer at troubleshooting-tex.de
Mon May 16 12:53:26 CEST 2022


Repository : https://github.com/latex3/hyperref
On branch  : main
Link       : https://github.com/latex3/hyperref/commit/a011ba9308a1b047dc151796de557da0bb22abaa

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

commit a011ba9308a1b047dc151796de557da0bb22abaa
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date:   Mon May 16 12:53:26 2022 +0200

    load nameref earlier, issue #235


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

a011ba9308a1b047dc151796de557da0bb22abaa
 ChangeLog.txt                                      |   1 +
 hyperref.dtx                                       |   8 +-
 .../latex2e.pvt => testfiles-make4ht/nameref.lvt   |   6 +-
 testfiles-make4ht/{ref1.tlg => nameref.tlg}        | 109 +++++----------------
 ...norversion.etex.tlg => gh235-hookrule.etex.tlg} |  28 ++----
 ...ersion.luatex.tlg => gh235-hookrule.luatex.tlg} |  33 ++-----
 testfiles/gh235-hookrule.lvt                       |  11 +++
 .../{38-pdfminorversion.tlg => gh235-hookrule.tlg} |  28 ++----
 8 files changed, 74 insertions(+), 150 deletions(-)

diff --git a/ChangeLog.txt b/ChangeLog.txt
index 544f0fa..17f0bd7 100644
--- a/ChangeLog.txt
+++ b/ChangeLog.txt
@@ -1,6 +1,7 @@
 2022-05-16 Ulrike Fischer/David Carlisle
     * fixed: check if \nameref is already defined for compability
       with ltugboat.cls (issue #234)
+    * nameref is loaded always and earlier (issue#235)  
 
 2022-05-13 Ulrike Fischer/David Carlisle
 
diff --git a/hyperref.dtx b/hyperref.dtx
index 6096fad..0779f6c 100644
--- a/hyperref.dtx
+++ b/hyperref.dtx
@@ -609,6 +609,7 @@
 \RequirePackage{hycolor}
 \RequirePackage{letltxmacro}[2008/06/13]
 \RequirePackage{auxhook}[2009/12/14]
+\RequirePackage{nameref}[2012/07/28]
 \def\Hy at Error{\@PackageError{hyperref}}
 \def\Hy at Warning{\@PackageWarning{hyperref}}
 \def\Hy at WarningNoLine{\@PackageWarningNoLine{hyperref}}
@@ -6930,7 +6931,6 @@
 \ifHy at typexml
   \Hy at AtEndOfPackage{%
     \RequirePackage{color}%
-    \RequirePackage{nameref}[2012/07/28]%
   }%
 \fi
 \Hy at DisableOption{typexml}
@@ -7298,12 +7298,6 @@
   \Hy at DisableOption{frenchlinks}%
   \ifHy at texht
   \else
-    \ifHy at typexml
-    \else
-      \Hy at CatcodeWrapper{%
-        \RequirePackage{nameref}[2012/07/28]%
-      }%
-    \fi
 %    \end{macrocode}
 %    With active links we have to redefine the starred versions
 %   to avoid that they get links from the include |\@setref|:
diff --git a/testfiles-pvt/latex2e.pvt b/testfiles-make4ht/nameref.lvt
similarity index 53%
copy from testfiles-pvt/latex2e.pvt
copy to testfiles-make4ht/nameref.lvt
index cb96216..6b7f45a 100644
--- a/testfiles-pvt/latex2e.pvt
+++ b/testfiles-make4ht/nameref.lvt
@@ -3,5 +3,9 @@
 \usepackage{hyperref}
 
 \begin{document}
-\section{LaTeXe}
+\START
+\showoutput
+\section{abc}\label{blub}
+
+\nameref{blub}
 \end{document}
\ No newline at end of file
diff --git a/testfiles-make4ht/ref1.tlg b/testfiles-make4ht/nameref.tlg
similarity index 84%
copy from testfiles-make4ht/ref1.tlg
copy to testfiles-make4ht/nameref.tlg
index 804d86b..b964c24 100644
--- a/testfiles-make4ht/ref1.tlg
+++ b/testfiles-make4ht/nameref.tlg
@@ -1,15 +1,5 @@
 This is a generated file for the l3build validation system.
 Don't change this file in any respect.
-> \ref=document command:
-  #1:s
-->\IfBooleanTF {#1}{\@refstar }{\T at ref }.
-> \Ref=document command:
-  #1:s
-->\IfBooleanTF {#1}{\@Refstar }{\T at Ref }.
-> \pageref=document command:
-  #1:s
-->\IfBooleanTF {#1}{\@pagerefstar }{\T at pageref }.
-LaTeX Warning: Reference `*' on page 1 undefined on input line ....
 Completed box being shipped out [1]
 \vbox(633.0+0.0)x345.0
 .\hbox(0.0+0.0)x0.0
@@ -86,7 +76,7 @@ width:%.\ETC.}
 class="htf-calligraphy"-->++++++<!--/span-->+12}
 ...\special{t4ht+ at Css: img.math{vertical-align:middle;}}
 ...\special{t4ht+ at Css: div.par-math-display, div.math-display{text-align:center;}}
-...\write3{\:CrossWord{)F1F-}{ref1.html}{\folio }\prcnt:ch }
+...\write3{\:CrossWord{)F1F-}{nameref.html}{\folio }\prcnt:ch }
 ...\special{t4ht+ at Css: li p.indent { text-indent: 0em }}
 ...\special{t4ht+ at Css: li p:first-child{ margin-top:0em; }}
 ...\special{t4ht+ at Css: li p:last-child, li div:last-child { margin-bottom:0.5em; \ETC.}
@@ -194,22 +184,22 @@ class="htf-calligraphy"-->++++++<!--/span-->+12}
 ...\glue(\topskip) 5.69446
 ...\hbox(4.30554+0.0)x345.0, glue set 334.4444fil
 ....\hbox(0.0+0.0)x0.0
-....\special{t4ht>ref1.css}
+....\special{t4ht>nameref.css}
 ....\special{t4ht= 
 /* css.sty */}
-....\special{t4ht<ref1.css}
+....\special{t4ht<nameref.css}
 ....\special{t4ht=<!DOCTYPE html> 
 }
 ....\special{t4ht=<html lang="en-US" xml:lang="en-US" > 
 }
 ....\special{t4ht;8}
 ....\special{t4ht=<head>}
-....\special{t4ht>ref1.tmp}
+....\special{t4ht>nameref.tmp}
 ....\hbox(4.30554+0.0)x10.5556
 .....\OT1/cmr/m/n/10 x
 .....\special{t4ht;-}
 .....\OT1/cmr/m/n/10 x
-....\special{t4ht<ref1.tmp}
+....\special{t4ht<nameref.tmp}
 ....\special{t4ht=<title>}
 ....\special{t4ht=</title> 
 }
@@ -217,9 +207,9 @@ class="htf-calligraphy"-->++++++<!--/span-->+12}
 }
 ....\special{t4ht=<meta name="generator" content="TeX4ht (https://tug.org/tex4ht/)\ETC.}
 ....\special{t4ht=<meta name="viewport" content="width=device-width,initial-scale=\ETC.}
-....\special{t4ht=<link rel="stylesheet" type="text/css" href="ref1.css" /> 
+....\special{t4ht=<link rel="stylesheet" type="text/css" href="nameref.css" /> 
 }
-....\special{t4ht=<meta name="src" content="ref1.tex" /> 
+....\special{t4ht=<meta name="src" content="nameref.tex" /> 
 }
 ....\special{t4ht=</head>}
 ....\special{t4ht;9}
@@ -242,97 +232,51 @@ class="htf-calligraphy"-->++++++<!--/span-->+12}
 ....\glue(\rightskip) 0.0 plus 172.5 minus 172.5
 ...\glue(\parskip) 0.0 plus 1.0
 ...\glue(\parskip) 0.0
-...\glue(\baselineskip) 5.16669
-...\hbox(6.83331+0.0)x345.0, glue set 292.99997fil
+...\glue(\baselineskip) 5.05556
+...\hbox(6.94444+0.0)x345.0, glue set 296.38882fil
 ....\hbox(0.0+0.0)x15.0
 ....\special{t4ht=<h3 class="sectionHead">}
 ....\special{t4ht=<span class="titlemark">}
-....\OT1/cmr/m/n/10 a
+....\OT1/cmr/m/n/10 1
 ....\glue 10.00002
 ....\special{t4ht=</span>}
 ....\glue 3.33333 plus 1.66666 minus 1.11111
-....\write4{\doTocEntry\tocsection{a}{\csname a:TocLink\endcsname{1}{x1-1000a}{QQ\ETC.}
-....\write3{\:CrossWord{)Qx1-1000a}{1}{\folio }\prcnt:ch }
+....\write4{\doTocEntry\tocsection{1}{\csname a:TocLink\endcsname{1}{x1-10001}{QQ\ETC.}
+....\write3{\:CrossWord{)Qx1-10001}{1}{\folio }\prcnt:ch }
 ....\special{t4ht=<a 
- id="x1-1000a">}
+ id="x1-10001">}
 ....\special{t4ht=</a>}
-....\OT1/cmr/m/n/10 T
-....\kern-0.83334
-....\OT1/cmr/m/n/10 e
-....\OT1/cmr/m/n/10 s
-....\OT1/cmr/m/n/10 t
+....\OT1/cmr/m/n/10 a
+....\OT1/cmr/m/n/10 b
+....\kern0.27779
+....\OT1/cmr/m/n/10 c
 ....\special{t4ht=</h3>}
 ....\penalty 10000
 ....\glue(\parfillskip) 0.0 plus 1.0fil
 ....\glue(\rightskip) 0.0 plus 172.5 minus 172.5
-...\write1{\newlabel{sec:test}{{\rEfLiNK{x1-1000a}{\csname :autoref\endcsname{se\ETC.}
+...\write1{\newlabel{blub}{{\rEfLiNK{x1-10001}{\csname :autoref\endcsname{sectio\ETC.}
 ...\penalty 10000
 ...\glue(\parskip) 0.0 plus 1.0
 ...\glue(\parskip) 0.0
 ...\glue(\baselineskip) 5.05556
-...\hbox(6.94444+1.94444)x345.0, glue set 216.24988fil
+...\hbox(6.94444+0.0)x345.0, glue set 329.72218fil
 ....\hbox(0.0+0.0)x15.0
 ....\glue -15.0
-....\special{t4ht=<!--l. 14--><p class="noindent" >}
+....\special{t4ht=<!--l. 10--><p class="noindent" >}
 ....\special{t4ht=<a 
-href="#x1-1000a">}
+href="#x1-10001">}
 ....\OT1/cmr/m/n/10 a
-....\hbox(0.0+0.0)x0.0
-.....\special{t4ht=<!--tex4ht:ref: sec:test -->}
-....\special{t4ht=</a>}
-....\hbox(0.0+0.0)x0.0
-....\OT1/cmr/m/n/10 ,
-....\special{t4ht=<a 
-href="#x1-1000a">}
-....\OT1/cmr/m/n/10 a
-....\hbox(0.0+0.0)x0.0
-.....\special{t4ht=<!--tex4ht:ref: sec:test -->}
-....\special{t4ht=</a>}
-....\hbox(0.0+0.0)x0.0
-....\OT1/cmr/m/n/10 ,
-....\glue 3.33333 plus 1.66666 minus 1.11111
-....\special{t4ht=<a 
-href="#x1-1000a">}
-....\OT1/cmr/m/n/10 1
-....\hbox(0.0+0.0)x0.0
-.....\special{t4ht=<!--tex4ht:ref: sec:test -->}
-....\special{t4ht=</a>}
-....\hbox(0.0+0.0)x0.0
-....\glue 3.33333 plus 1.66666 minus 1.11111
-....\hbox(6.94444+0.0)x10.86105
-.....\OT1/cmr/bx/n/10 ?
-.....\OT1/cmr/bx/n/10 ?
-....\OT1/cmr/m/n/10 s
-....\OT1/cmr/m/n/10 e
+....\OT1/cmr/m/n/10 b
+....\kern0.27779
 ....\OT1/cmr/m/n/10 c
-....\OT1/cmr/m/n/10 :
-....\OT1/cmr/m/n/10 t
-....\OT1/cmr/m/n/10 e
-....\OT1/cmr/m/n/10 s
-....\OT1/cmr/m/n/10 t
-....\OT1/cmr/m/n/10 ,
-....\glue 20.00003
-....\special{t4ht=<a 
-href="#x1-1000a">}
-....\OT1/cmr/m/n/10 a
 ....\hbox(0.0+0.0)x0.0
-.....\special{t4ht=<!--tex4ht:ref: sec:test -->}
-....\special{t4ht=</a>}
-....\hbox(0.0+0.0)x0.0
-....\OT1/cmr/m/n/10 ,
-....\glue 3.33333 plus 1.66666 minus 1.11111
-....\glue 20.00003
-....\special{t4ht=<a 
-href="#x1-1000a">}
-....\OT1/cmr/m/n/10 1
-....\hbox(0.0+0.0)x0.0
-.....\special{t4ht=<!--tex4ht:ref: sec:test -->}
+.....\special{t4ht=<!--tex4ht:ref: blub -->}
 ....\special{t4ht=</a>}
 ....\hbox(0.0+0.0)x0.0
 ....\penalty 10000
 ....\glue(\parfillskip) 0.0 plus 1.0fil
 ....\glue(\rightskip) 0.0 plus 172.5 minus 172.5
-...\glue(\baselineskip) 10.05556
+...\glue(\baselineskip) 12.0
 ...\hbox(0.0+0.0)x0.0
 ....\special{t4ht=</p>}
 ...\glue(\parskip) 0.0 plus 1.0
@@ -356,5 +300,4 @@ href="#x1-1000a">}
 ...\hbox(0.0+0.0)x345.0
 ...\special{color pop}
 .\kern 0.0
-(ref1.aux)
-LaTeX Warning: There were undefined references.
+(nameref.aux)
diff --git a/testfiles/38-pdfminorversion.etex.tlg b/testfiles/gh235-hookrule.etex.tlg
similarity index 76%
copy from testfiles/38-pdfminorversion.etex.tlg
copy to testfiles/gh235-hookrule.etex.tlg
index 5f4e7ea..03a0b7d 100644
--- a/testfiles/38-pdfminorversion.etex.tlg
+++ b/testfiles/gh235-hookrule.etex.tlg
@@ -31,29 +31,21 @@ Completed box being shipped out [1]
 .....\hbox(0.0+0.0)x345.0
 ...\glue 25.0
 ...\glue(\lineskip) 0.0
-...\vbox(550.0+0.0)x345.0, glue set 527.9436fil
+...\vbox(550.0+0.0)x345.0, glue set 539.94232fil
 ....\write-{}
 ....\special{ps:SDict begin [/PageMode /UseOutlines/Page 1/View [/Fit] /DOCVIEW pd\ETC.}
 ....\special{ps:SDict begin [ {Catalog}<<>> /PUT pdfmark end}
 ....\special{ps:SDict begin H.S end}
 ....\special{ps:SDict begin 12 H.A end}
 ....\special{ps:SDict begin [/View [/XYZ H.V]/Dest (Doc-Start) cvn /DEST pdfmark e\ETC.}
-....\glue(\topskip) 3.55556
-....\hbox(6.44444+0.0)x345.0, glue set 324.99998fil
+....\glue(\topskip) 3.16669
+....\hbox(6.83331+0.0)x345.0, glue set 314.02773fil
 .....\hbox(0.0+0.0)x15.0
-.....\OT1/cmr/m/n/10 5
-.....\penalty 10000
-.....\glue(\parfillskip) 0.0 plus 1.0fil
-.....\glue(\rightskip) 0.0
-....\glue(\parskip) 0.0 plus 1.0
-....\glue(\parskip) 0.0
-....\glue(\baselineskip) 5.05556
-....\hbox(6.94444+0.0)x345.0, glue set 310.5555fil
-.....\hbox(0.0+0.0)x15.0
-.....\OT1/cmr/m/n/10 b
-.....\OT1/cmr/m/n/10 l
-.....\OT1/cmr/m/n/10 u
-.....\OT1/cmr/m/n/10 b
+.....\OT1/cmr/m/n/10 F
+.....\kern-0.83334
+.....\OT1/cmr/m/n/10 o
+.....\kern0.27779
+.....\OT1/cmr/m/n/10 o
 .....\penalty 10000
 .....\glue(\parfillskip) 0.0 plus 1.0fil
 .....\glue(\rightskip) 0.0
@@ -67,6 +59,6 @@ Completed box being shipped out [1]
 .....\OT1/cmr/m/n/10 1
 .....\glue 0.0 plus 1.0fil
 .\kern 0.0
-(38-pdfminorversion.aux)
-Package rerunfilecheck Info: File `38-pdfminorversion.out' has not changed.
+(gh235-hookrule.aux)
+Package rerunfilecheck Info: File `gh235-hookrule.out' has not changed.
 (rerunfilecheck)             Checksum: D41D8CD98F00B204E9800998ECF8427E;0.
diff --git a/testfiles/38-pdfminorversion.luatex.tlg b/testfiles/gh235-hookrule.luatex.tlg
similarity index 66%
copy from testfiles/38-pdfminorversion.luatex.tlg
copy to testfiles/gh235-hookrule.luatex.tlg
index 629ef73..52b03cc 100644
--- a/testfiles/38-pdfminorversion.luatex.tlg
+++ b/testfiles/gh235-hookrule.luatex.tlg
@@ -25,35 +25,22 @@ Completed box being shipped out [1]
 .....\hbox(0.0+0.0)x345.0, direction TLT
 ...\glue 25.0
 ...\glue(\lineskip) 0.0
-...\vbox(550.0+0.0)x345.0, glue set 527.9436fil, direction TLT
+...\vbox(550.0+0.0)x345.0, glue set 539.94232fil, direction TLT
 ....\write-{}
 ....\pdfdest name{Doc-Start} xyz
-....\glue(\topskip) 3.34
-....\hbox(6.66+0.22)x345.0, glue set 325.0fil, direction TLT
+....\glue(\topskip) 3.2
+....\hbox(6.8+0.11)x345.0, glue set 314.02002fil, direction TLT
 .....\localpar
 ......\localinterlinepenalty=0
 ......\localbrokenpenalty=0
 ......\localleftbox=null
 ......\localrightbox=null
 .....\hbox(0.0+0.0)x15.0, direction TLT
-.....\TU/lmr/m/n/10 6
-.....\penalty 10000
-.....\glue(\parfillskip) 0.0 plus 1.0fil
-.....\glue(\rightskip) 0.0
-....\glue(\parskip) 0.0 plus 1.0
-....\glue(\parskip) 0.0
-....\glue(\baselineskip) 4.84
-....\hbox(6.94+0.11)x345.0, glue set 310.54001fil, direction TLT
-.....\localpar
-......\localinterlinepenalty=0
-......\localbrokenpenalty=0
-......\localleftbox=null
-......\localrightbox=null
-.....\hbox(0.0+0.0)x15.0, direction TLT
-.....\TU/lmr/m/n/10 b
-.....\TU/lmr/m/n/10 l
-.....\TU/lmr/m/n/10 u
-.....\TU/lmr/m/n/10 b
+.....\TU/lmr/m/n/10 F
+.....\kern-0.83 (font)
+.....\TU/lmr/m/n/10 o
+.....\kern0.28 (font)
+.....\TU/lmr/m/n/10 o
 .....\penalty 10000
 .....\glue(\parfillskip) 0.0 plus 1.0fil
 .....\glue(\rightskip) 0.0
@@ -68,6 +55,6 @@ Completed box being shipped out [1]
 .....\TU/lmr/m/n/10 1
 .....\glue 0.0 plus 1.0fil
 .\kern0.0
-(38-pdfminorversion.aux)
-Package rerunfilecheck Info: File `38-pdfminorversion.out' has not changed.
+(gh235-hookrule.aux)
+Package rerunfilecheck Info: File `gh235-hookrule.out' has not changed.
 (rerunfilecheck)             Checksum: D41D8CD98F00B204E9800998ECF8427E;0.
diff --git a/testfiles/gh235-hookrule.lvt b/testfiles/gh235-hookrule.lvt
new file mode 100644
index 0000000..8c02fb4
--- /dev/null
+++ b/testfiles/gh235-hookrule.lvt
@@ -0,0 +1,11 @@
+\input{regression-test}
+\documentclass{article}
+\AddToHook{begindocument}[A]{}
+\DeclareHookRule {begindocument}{A} {after} {hyperref}
+\usepackage{hyperref}
+
+\begin{document}
+\START
+\showoutput
+Foo
+\end{document}
\ No newline at end of file
diff --git a/testfiles/38-pdfminorversion.tlg b/testfiles/gh235-hookrule.tlg
similarity index 67%
copy from testfiles/38-pdfminorversion.tlg
copy to testfiles/gh235-hookrule.tlg
index a886a78..e90f1a8 100644
--- a/testfiles/38-pdfminorversion.tlg
+++ b/testfiles/gh235-hookrule.tlg
@@ -25,25 +25,17 @@ Completed box being shipped out [1]
 .....\hbox(0.0+0.0)x345.0
 ...\glue 25.0
 ...\glue(\lineskip) 0.0
-...\vbox(550.0+0.0)x345.0, glue set 527.9436fil
+...\vbox(550.0+0.0)x345.0, glue set 539.94232fil
 ....\write-{}
 ....\pdfdest name{Doc-Start} xyz
-....\glue(\topskip) 3.55556
-....\hbox(6.44444+0.0)x345.0, glue set 324.99998fil
+....\glue(\topskip) 3.16669
+....\hbox(6.83331+0.0)x345.0, glue set 314.02773fil
 .....\hbox(0.0+0.0)x15.0
-.....\OT1/cmr/m/n/10 6
-.....\penalty 10000
-.....\glue(\parfillskip) 0.0 plus 1.0fil
-.....\glue(\rightskip) 0.0
-....\glue(\parskip) 0.0 plus 1.0
-....\glue(\parskip) 0.0
-....\glue(\baselineskip) 5.05556
-....\hbox(6.94444+0.0)x345.0, glue set 310.5555fil
-.....\hbox(0.0+0.0)x15.0
-.....\OT1/cmr/m/n/10 b
-.....\OT1/cmr/m/n/10 l
-.....\OT1/cmr/m/n/10 u
-.....\OT1/cmr/m/n/10 b
+.....\OT1/cmr/m/n/10 F
+.....\kern-0.83334
+.....\OT1/cmr/m/n/10 o
+.....\kern0.27779
+.....\OT1/cmr/m/n/10 o
 .....\penalty 10000
 .....\glue(\parfillskip) 0.0 plus 1.0fil
 .....\glue(\rightskip) 0.0
@@ -57,6 +49,6 @@ Completed box being shipped out [1]
 .....\OT1/cmr/m/n/10 1
 .....\glue 0.0 plus 1.0fil
 .\kern 0.0
-(38-pdfminorversion.aux)
-Package rerunfilecheck Info: File `38-pdfminorversion.out' has not changed.
+(gh235-hookrule.aux)
+Package rerunfilecheck Info: File `gh235-hookrule.out' has not changed.
 (rerunfilecheck)             Checksum: D41D8CD98F00B204E9800998ECF8427E;0.





More information about the latex3-commits mailing list.