[latex3-commits] [git/LaTeX3-latex3-hyperref] main: lastnodetype test fixes #167 (f596673)

David Carlisle d.p.carlisle at gmail.com
Tue Feb 9 20:24:34 CET 2021


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

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

commit f59667380eef4f9ec2c3344dca6a4472c25ef599
Author: David Carlisle <d.p.carlisle at gmail.com>
Date:   Tue Feb 9 19:24:34 2021 +0000

    lastnodetype test fixes #167


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

f59667380eef4f9ec2c3344dca6a4472c25ef599
 hyperref.dtx                 |  6 +++++-
 testfiles/gh167-lastskip.lvt | 23 +++++++++++++++++++++++
 testfiles/gh167-lastskip.tlg |  5 +++++
 3 files changed, 33 insertions(+), 1 deletion(-)

diff --git a/hyperref.dtx b/hyperref.dtx
index 72cb657..4d48e1c 100644
--- a/hyperref.dtx
+++ b/hyperref.dtx
@@ -4445,7 +4445,11 @@
   \let\Hy at RestoreLastskip\relax
   \ifvmode
     \ifdim\lastskip=\z@
-      \let\Hy at RestoreLastskip\nobreak
+      \ifnum\lastnodetype=11 %
+        \let\Hy at RestoreLastskip\nobreak
+      \else
+        \let\Hy at RestoreLastskip\relax
+      \fi
     \else
       \begingroup
         \skip@=-\lastskip
diff --git a/testfiles/gh167-lastskip.lvt b/testfiles/gh167-lastskip.lvt
new file mode 100644
index 0000000..018afad
--- /dev/null
+++ b/testfiles/gh167-lastskip.lvt
@@ -0,0 +1,23 @@
+\input{regression-test}
+\documentclass{article}
+
+\usepackage{hyperref}  %
+\textheight 3cm
+
+\begin{document}
+\begin{minipage}{5cm}
+\rule{1cm}{2cm}
+\end{minipage}
+
+%\refstepcounter{section}
+\makeatletter \Hy at SaveLastskip\Hy at RestoreLastskip\makeatother
+\begin{minipage}{5cm}
+\rule{1cm}{2cm}
+\end{minipage}
+
+\START
+\LONGTYPEOUT{no overfull box}
+
+\clearpage
+
+\stop\end{document}
\ No newline at end of file
diff --git a/testfiles/gh167-lastskip.tlg b/testfiles/gh167-lastskip.tlg
new file mode 100644
index 0000000..a11b6ae
--- /dev/null
+++ b/testfiles/gh167-lastskip.tlg
@@ -0,0 +1,5 @@
+This is a generated file for the l3build validation system.
+Don't change this file in any respect.
+no overfull box
+[1
+] [2]





More information about the latex3-commits mailing list.