Skip to content

Commit

Permalink
handler for varwidth, issue #204 and #293
Browse files Browse the repository at this point in the history
  • Loading branch information
u-fischer committed Nov 7, 2023
1 parent 77de81e commit 908b150
Show file tree
Hide file tree
Showing 4 changed files with 181 additions and 3 deletions.
8 changes: 6 additions & 2 deletions ChangeLog.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
2023-10-31
* hyperref-linktarget.dtx: switch to e-type
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

===========
Version: 2023-10-27 v7.01d

Expand Down
23 changes: 22 additions & 1 deletion hyperref.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -4312,9 +4312,16 @@
\global\Hy@SavedSpaceFactor=\the\Hy@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@t@r\fmtversion{2023-11-01}
{\NewSocket{hyp/raisedlink}{1}}
{\providecommand\UseSocket[2]{#2}}
\def\Hy@raisedlink#1{%
\ifvmode
#1%
\UseSocket{hyp/raisedlink}{#1}%
\else
\Hy@SaveSpaceFactor
\penalty\@M
Expand Down Expand Up @@ -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@t@r\fmtversion{2023-11-01}
{
\AddToHook{package/varwidth/after}
{
\NewSocketPlug{hyp/raisedlink}{varwidth}{\@vwid@wrap{#1}}
\appto\@vwid@setup{\AssignSocketPlug{hyp/raisedlink}{varwidth}}
}
}{}
% \end{macrocode}
% \section{Package titlesec and titletoc support}
%
% This code is contributed by Javier Bezos
Expand Down
17 changes: 17 additions & 0 deletions testfiles-pdftex/varwidth-gh204.lvt
Original file line number Diff line number Diff line change
@@ -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}
136 changes: 136 additions & 0 deletions testfiles-pdftex/varwidth-gh204.tlg
Original file line number Diff line number Diff line change
@@ -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.

0 comments on commit 908b150

Please sign in to comment.