[latex3-commits] [latex3/hyperref] develop: handler for varwidth, issue #204 and #293 (908b150)

github at latex-project.org github at latex-project.org
Tue Nov 7 19:54:56 CET 2023


Repository : https://github.com/latex3/hyperref
On branch  : develop
Link       : https://github.com/latex3/hyperref/commit/908b150980ad82fca0df5e80ce5126dd164ab9ae

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

commit 908b150980ad82fca0df5e80ce5126dd164ab9ae
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date:   Tue Nov 7 19:54:56 2023 +0100

    handler for varwidth, issue #204 and #293


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

908b150980ad82fca0df5e80ce5126dd164ab9ae
 ChangeLog.txt                       |   6 +-
 hyperref.dtx                        |  23 +++++-
 testfiles-pdftex/varwidth-gh204.lvt |  17 +++++
 testfiles-pdftex/varwidth-gh204.tlg | 136 ++++++++++++++++++++++++++++++++++++
 4 files changed, 180 insertions(+), 2 deletions(-)

diff --git a/ChangeLog.txt b/ChangeLog.txt
index e0b770c..660a345 100644
--- a/ChangeLog.txt
+++ b/ChangeLog.txt
@@ -1,4 +1,8 @@
-2023-10-31
+2023-11-07 Ulrike Fischer
+	* improve thm code, issue 304
+	* insert socket for varwidth, issue 204 and 293
+
+2023-10-31 Ulrike Fischer
     * hyperref-linktarget.dtx: switch to e-type
     
 ===========
diff --git a/hyperref.dtx b/hyperref.dtx
index c1e4124..8db594e 100644
--- a/hyperref.dtx
+++ b/hyperref.dtx
@@ -4312,9 +4312,16 @@
     \global\Hy at SavedSpaceFactor=\the\Hy at SavedSpaceFactor\relax
   }%
 }
+%    \end{macrocode}
+% Packages like varwidth need an option to change the handling in vmode.
+% (Issue \#204). With a new format we therefore insert a socket.
+%    \begin{macrocode}
+\@ifl at t@r\fmtversion{2023-11-01}
+ {\NewSocket{hyp/raisedlink}{1}}
+ {\providecommand\UseSocket[2]{#2}} 
 \def\Hy at raisedlink#1{%
   \ifvmode
-    #1%
+    \UseSocket{hyp/raisedlink}{#1}%
   \else
     \Hy at SaveSpaceFactor
     \penalty\@M
@@ -10692,6 +10699,20 @@
 \def\hypergetpageref#1{\getrefbykeydefault{#1}{page}{0}}
 %    \end{macrocode}
 %
+% \section{Package varwidth support}
+% 2023-11-07: varwidth needs a special configuration point to inserts its handler.
+% We use a socket for this.
+% 
+%    \begin{macrocode}
+\@ifl at t@r\fmtversion{2023-11-01}
+ {
+   \AddToHook{package/varwidth/after}
+    { 
+      \NewSocketPlug{hyp/raisedlink}{varwidth}{\@vwid at wrap{#1}}
+      \appto\@vwid at setup{\AssignSocketPlug{hyp/raisedlink}{varwidth}}
+    }  
+ }{}
+%    \end{macrocode}
 % \section{Package titlesec and titletoc support}
 %
 %    This code is contributed by Javier Bezos
diff --git a/testfiles-pdftex/varwidth-gh204.lvt b/testfiles-pdftex/varwidth-gh204.lvt
new file mode 100644
index 0000000..d40aaca
--- /dev/null
+++ b/testfiles-pdftex/varwidth-gh204.lvt
@@ -0,0 +1,17 @@
+\documentclass{article}
+\input{regression-test}
+\usepackage{varwidth}
+\usepackage{hyperref}
+
+\begin{document}
+\START\showoutput
+abc
+
+\fbox{\begin{varwidth}{\textwidth}
+  \begin{enumerate}
+    \item One
+    \item Two
+  \end{enumerate}
+\end{varwidth}}
+
+\end{document}
\ No newline at end of file
diff --git a/testfiles-pdftex/varwidth-gh204.tlg b/testfiles-pdftex/varwidth-gh204.tlg
new file mode 100644
index 0000000..3b51261
--- /dev/null
+++ b/testfiles-pdftex/varwidth-gh204.tlg
@@ -0,0 +1,136 @@
+This is a generated file for the l3build validation system.
+Don't change this file in any respect.
+LaTeX Font Info:    External font `cmex10' loaded for size
+(Font)              <7> on input line ....
+LaTeX Font Info:    External font `cmex10' loaded for size
+(Font)              <5> on input line ....
+Completed box being shipped out [1]
+\vbox(633.0+0.0)x407.0
+.\hbox(0.0+0.0)x0.0
+.\vbox(0.0+0.0)x0.0, glue set - 14.99626fil
+..\kern 0.0
+..\kern 16.0
+..\kern -1.00374
+..\hbox(0.0+0.0)x0.0, glue set - 60.99626fil
+...\kern 0.0
+...\kern 62.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(633.0+0.0)x407.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
+....\glue 0.0 plus 1.0fil
+....\hbox(0.0+0.0)x345.0
+.....\hbox(0.0+0.0)x345.0
+...\glue 25.0
+...\glue(\lineskip) 0.0
+...\vbox(550.0+0.0)x345.0, glue set 510.3122fil
+....\write-{}
+....\pdfdest name{Doc-Start} xyz
+....\glue(\topskip) 3.05556
+....\hbox(6.94444+0.0)x345.0, glue set 314.72218fil
+.....\hbox(0.0+0.0)x15.0
+.....\OT1/cmr/m/n/10 a
+.....\OT1/cmr/m/n/10 b
+.....\kern0.27779
+.....\OT1/cmr/m/n/10 c
+.....\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(\lineskip) 1.0
+....\hbox(19.31665+14.31665)x345.0, glue set 279.0333fil
+.....\hbox(0.0+0.0)x15.0
+.....\hbox(19.31665+14.31665)x50.9667
+......\hbox(33.6333+0.0)x50.9667, shifted 14.31665
+.......\vbox(33.6333+0.0)x50.9667
+........\rule(0.4+0.0)x*
+........\hbox(32.83331+0.0)x50.9667
+.........\rule(*+*)x0.4
+.........\vbox(32.83331+0.0)x50.16672
+..........\glue 3.0
+..........\hbox(15.91666+10.91666)x50.16672
+...........\kern 3.0
+...........\mathon
+...........\vbox(15.91666+10.91666)x44.16672
+............\pdfdest name{Item.1} xyz
+............\penalty 10000
+............\glue 4.0 plus 2.0 minus 1.0
+............\glue -4.0 plus -2.0 minus -1.0
+............\hbox(6.83331+0.0)x44.16672, glue set 1.38887fil
+.............\kern 25.00003
+.............\hbox(6.44444+0.0)x0.0
+..............\glue 0.0
+..............\glue -20.00003
+..............\glue -5.0
+..............\hbox(6.44444+0.0)x20.00003, glue set 20.00003fil
+...............\glue 0.0 plus 1.0fil minus 1.0fil
+...............\hbox(6.44444+0.0)x0.0, glue set - 7.7778fil
+................\glue 0.0 plus 1.0fil minus 1.0fil
+................\OT1/cmr/m/n/10 1
+................\OT1/cmr/m/n/10 .
+..............\glue 5.0
+.............\penalty 0
+.............\OT1/cmr/m/n/10 O
+.............\OT1/cmr/m/n/10 n
+.............\OT1/cmr/m/n/10 e
+.............\penalty 10000
+.............\glue(\parfillskip) 0.0 plus 1.0fil
+.............\glue(\rightskip) 0.0
+.............\kern 0.0
+............\glue 4.0 plus 2.0 minus 1.0
+............\pdfdest name{Item.2} xyz
+............\penalty 10000
+............\glue 4.0 plus 2.0 minus 1.0
+............\glue 5.16669
+............\hbox(6.83331+0.0)x44.16672
+.............\kern 25.00003
+.............\hbox(6.44444+0.0)x0.0
+..............\glue 0.0
+..............\glue -20.00003
+..............\glue -5.0
+..............\hbox(6.44444+0.0)x20.00003, glue set 20.00003fil
+...............\glue 0.0 plus 1.0fil minus 1.0fil
+...............\hbox(6.44444+0.0)x0.0, glue set - 7.7778fil
+................\glue 0.0 plus 1.0fil minus 1.0fil
+................\OT1/cmr/m/n/10 2
+................\OT1/cmr/m/n/10 .
+..............\glue 5.0
+.............\penalty 0
+.............\OT1/cmr/m/n/10 T
+.............\OT1/cmr/m/n/10 w
+.............\kern-0.27779
+.............\OT1/cmr/m/n/10 o
+.............\penalty 10000
+.............\glue(\parfillskip) 0.0 plus 1.0fil
+.............\glue(\rightskip) 0.0
+.............\kern 0.0
+............\glue 0.0
+...........\mathoff
+...........\kern 3.0
+..........\glue 3.0
+.........\rule(*+*)x0.4
+........\rule(0.4+0.0)x*
+.....\penalty 10000
+.....\glue(\parfillskip) 0.0 plus 1.0fil
+.....\glue(\rightskip) 0.0
+....\glue -5.0
+....\glue 0.0 plus 1.0fil
+....\glue 0.0
+....\glue 0.0 plus 0.0001fil
+...\glue(\baselineskip) 23.55556
+...\hbox(6.44444+0.0)x345.0
+....\hbox(6.44444+0.0)x345.0, glue set 170.0fil
+.....\glue 0.0 plus 1.0fil
+.....\OT1/cmr/m/n/10 1
+.....\glue 0.0 plus 1.0fil
+.\kern 0.0
+(varwidth-gh204.aux)
+Package rerunfilecheck Info: File `varwidth-gh204.out' has not changed.
+(rerunfilecheck)             Checksum: D41D8CD98F00B204E9800998ECF8427E;0.





More information about the latex3-commits mailing list.