[latex3-commits] [git/LaTeX3-latex3-latex2e] develop: fix for #387 (19be836d)

Frank Mittelbach frank.mittelbach at latex-project.org
Wed Sep 9 20:24:14 CEST 2020


Repository : https://github.com/latex3/latex2e
On branch  : develop
Link       : https://github.com/latex3/latex2e/commit/19be836de07a91f60b78cbed9019bd9f8346face

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

commit 19be836de07a91f60b78cbed9019bd9f8346face
Author: Frank Mittelbach <frank.mittelbach at latex-project.org>
Date:   Wed Sep 9 20:24:14 2020 +0200

    fix for #387


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

19be836de07a91f60b78cbed9019bd9f8346face
 base/changes.txt                       |  5 ++++
 base/ltshipout.dtx                     | 19 +++++++++----
 base/testfiles-lthooks/github-0387.lvt | 26 +++++++++++++++++
 base/testfiles-lthooks/github-0387.tlg | 52 ++++++++++++++++++++++++++++++++++
 base/testfiles-lthooks/shipout-005.tlg |  6 ++--
 5 files changed, 100 insertions(+), 8 deletions(-)

diff --git a/base/changes.txt b/base/changes.txt
index e20ac7df..24cb8bd7 100644
--- a/base/changes.txt
+++ b/base/changes.txt
@@ -6,6 +6,11 @@ completeness or accuracy and it contains some references to files that
 are not part of the distribution.
 ================================================================================
 
+2020-09-09  Frank Mittelbach  <Frank.Mittelbach at latex-project.org>
+
+	* ltshipout.dtx (subsection{Emulating \pkg{atbegshi}}):
+	Avoid unnecessary overfull box warnings (gh/387)
+
 2020-08-24  Frank Mittelbach  <Frank.Mittelbach at latex-project.org>
 
 	* ltfssini.dtx:
diff --git a/base/ltshipout.dtx b/base/ltshipout.dtx
index 650c4686..e555bb16 100644
--- a/base/ltshipout.dtx
+++ b/base/ltshipout.dtx
@@ -31,8 +31,8 @@
 %%% From File: ltshipout.dtx
 %
 %    \begin{macrocode}
-\providecommand\ltshipoutversion{v1.0a}
-\providecommand\ltshipoutdate{2020/08/31}
+\providecommand\ltshipoutversion{v1.0b}
+\providecommand\ltshipoutdate{2020/09/09}
 %    \end{macrocode}
 %
 %<*driver>
@@ -412,7 +412,7 @@
 %
 % \begin{function}{\AtBeginShipoutInit}
 %   By default \pkg{atbegshi} delayed its action until
-%    \verb=\beg{document}=.  This command was forcing it in an earlier
+%    \verb=\begin{document}=.  This command was forcing it in an earlier
 %    place. With the new concept it does nothing.
 % \end{function}
 %
@@ -1085,7 +1085,7 @@
 %    Put the argument into a \texttt{picture} environment that doesn't take up
 %    any size and uses \texttt{1pt} for \cs{unitlength}.
 %    \fmi{Could perhaps be generalized as it might be useful elsewhere. For
-%    not it is not.}
+%    now it is not.}
 %    \begin{macrocode}
 \cs_new:Npn \@@_picture_overlay:n #1 {
 %    \end{macrocode}
@@ -1100,8 +1100,15 @@
     \vbox_to_zero:n {
       \kern -\c_@@_vorigin_tl \scan_stop:
       \unitlength 1pt \scan_stop:
-      \hbox_set_to_wd:Nnn \l_@@_tmp_box \c_zero_dim { \ignorespaces #1 }
-%      \box_set_wd:Nn \l_@@_tmp_box \c_zero_dim
+%    \end{macrocode}
+%    This mimics a simple zero-sized picture environment. The \cs{hss}
+%    is need in case there is horizontal material (without using
+%    \cs{put} with a positive width.
+% \changes{v1.0b}{2020/09/09}
+%         {Prevent overfull box warnings (gh/387)}
+%    \begin{macrocode}
+      \hbox_set_to_wd:Nnn \l_@@_tmp_box \c_zero_dim
+                          { \ignorespaces #1 \hss }
       \box_set_ht:Nn \l_@@_tmp_box \c_zero_dim
       \box_set_dp:Nn \l_@@_tmp_box \c_zero_dim
       \box_use:N \l_@@_tmp_box
diff --git a/base/testfiles-lthooks/github-0387.lvt b/base/testfiles-lthooks/github-0387.lvt
new file mode 100644
index 00000000..73288865
--- /dev/null
+++ b/base/testfiles-lthooks/github-0387.lvt
@@ -0,0 +1,26 @@
+
+\documentclass{book}
+\usepackage{atbegshi}
+
+
+\input{regression-test}
+
+
+\begin{document}
+
+\START
+
+\AtBeginShipout{%
+  \AtBeginShipoutUpperLeft{%
+    \parbox[t][\paperheight][b]{\paperwidth}{%
+%      \includegraphics[width=210mm,height=297mm]{example-image-a.png}
+Z \hfill Z
+    }%
+  }%
+}
+
+\showoutput
+
+Here!
+
+\end{document}
diff --git a/base/testfiles-lthooks/github-0387.tlg b/base/testfiles-lthooks/github-0387.tlg
new file mode 100644
index 00000000..0df5e402
--- /dev/null
+++ b/base/testfiles-lthooks/github-0387.tlg
@@ -0,0 +1,52 @@
+This is a generated file for the l3build validation system.
+Don't change this file in any respect.
+Completed box being shipped out [1]
+\vbox(627.36243+0.0)x380.0
+.\hbox(0.0+0.0)x0.0
+.\hbox(0.0+0.0)x0.0
+..\kern -72.27
+..\vbox(0.0+0.0)x0.0, glue set 72.27fil
+...\kern -72.27
+...\hbox(0.0+0.0)x0.0, glue set - 614.295fil
+....\vbox(0.0+794.96999)x614.295, glue set 788.13667fil
+.....\glue 0.0 plus 1.0fil minus 1.0fil
+.....\hbox(6.83331+0.0)x614.295, glue set 598.73944fill
+......\hbox(0.0+0.0)x0.0
+......\OT1/cmr/m/n/10 Z
+......\glue 3.33333 plus 1.66498 minus 1.11221
+......\glue 0.0 plus 1.0fill
+......\OT1/cmr/m/n/10 Z
+......\penalty 10000
+......\glue(\parfillskip) 0.0 plus 1.0fil
+......\glue(\rightskip) 0.0
+....\glue 0.0 plus 1.0fil minus 1.0fil
+...\glue 0.0 plus 1.0fil minus 1.0fil
+.\glue 22.0
+.\vbox(605.36243+0.0)x345.0, shifted 35.0
+..\vbox(12.0+0.0)x345.0, glue set 5.55556fil
+...\glue 0.0 plus 1.0fil
+...\hbox(6.44444+0.0)x345.0, glue set 339.99998fil
+....\glue 0.0 plus 1.0fil
+....\OT1/cmr/m/n/10 1
+..\glue 18.06749
+..\glue(\lineskip) 0.0
+..\vbox(550.0+0.0)x345.0, glue set 540.0fil
+...\write-{}
+...\glue(\topskip) 3.05556
+...\hbox(6.94444+0.0)x345.0, glue set 306.91664fil
+....\hbox(0.0+0.0)x15.0
+....\OT1/cmr/m/n/10 H
+....\OT1/cmr/m/n/10 e
+....\OT1/cmr/m/n/10 r
+....\OT1/cmr/m/n/10 e
+....\OT1/cmr/m/n/10 !
+....\penalty 10000
+....\glue(\parfillskip) 0.0 plus 1.0fil
+....\glue(\rightskip) 0.0
+...\glue 0.0 plus 1.0fil
+...\glue 0.0
+..\glue(\baselineskip) 25.29494
+..\hbox(0.0+0.0)x345.0
+.\kern 0.0
+.\kern 0.0
+(github-0387.aux)
diff --git a/base/testfiles-lthooks/shipout-005.tlg b/base/testfiles-lthooks/shipout-005.tlg
index 5a0877cd..87dd0f50 100644
--- a/base/testfiles-lthooks/shipout-005.tlg
+++ b/base/testfiles-lthooks/shipout-005.tlg
@@ -31,7 +31,7 @@ Completed box being shipped out [1]
 ..\kern -72.27
 ..\vbox(0.0+0.0)x0.0, glue set 72.27fil
 ...\kern -72.27
-...\hbox(0.0+0.0)x0.0, glue set - 50.58347fil
+...\hbox(0.0+0.0)x0.0, glue set - 25.29173fil
 ....\OT1/cmr/m/n/10 b
 ....\OT1/cmr/m/n/10 a
 ....\OT1/cmr/m/n/10 c
@@ -44,6 +44,7 @@ Completed box being shipped out [1]
 ....\OT1/cmr/m/n/10 n
 ....\OT1/cmr/m/n/10 d
 ....\glue 0.0 plus 1.0fil minus 1.0fil
+....\glue 0.0 plus 1.0fil minus 1.0fil
 ...\glue 0.0 plus 1.0fil minus 1.0fil
 .\glue 16.0
 .\vbox(617.0+0.0)x345.0, shifted 62.0
@@ -82,7 +83,7 @@ Completed box being shipped out [1]
 ..\kern -72.27
 ..\vbox(0.0+0.0)x0.0, glue set 72.27fil
 ...\kern -72.27
-...\hbox(0.0+0.0)x0.0, glue set - 47.00012fil
+...\hbox(0.0+0.0)x0.0, glue set - 23.50006fil
 ....\OT1/cmr/m/n/10 f
 ....\OT1/cmr/m/n/10 o
 ....\OT1/cmr/m/n/10 r
@@ -94,6 +95,7 @@ Completed box being shipped out [1]
 ....\OT1/cmr/m/n/10 n
 ....\OT1/cmr/m/n/10 d
 ....\glue 0.0 plus 1.0fil minus 1.0fil
+....\glue 0.0 plus 1.0fil minus 1.0fil
 ...\glue 0.0 plus 1.0fil minus 1.0fil
 .\kern 633.0
 .\kern 0.0





More information about the latex3-commits mailing list.