[latex3-commits] [git/LaTeX3-latex3-latex2e] marks: One more special case, make sure the test box is not totally empty (644de07c)

Frank Mittelbach frank.mittelbach at latex-project.org
Mon Apr 4 14:50:01 CEST 2022


Repository : https://github.com/latex3/latex2e
On branch  : marks
Link       : https://github.com/latex3/latex2e/commit/644de07cfdff90f2f0509506ee2501d1a3a70cc4

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

commit 644de07cfdff90f2f0509506ee2501d1a3a70cc4
Author: Frank Mittelbach <frank.mittelbach at latex-project.org>
Date:   Mon Apr 4 14:50:01 2022 +0200

    One more special case, make sure the test box is not totally empty


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

644de07cfdff90f2f0509506ee2501d1a3a70cc4
 base/ltmarks.dtx | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/base/ltmarks.dtx b/base/ltmarks.dtx
index ada4f4e7..40943e8c 100644
--- a/base/ltmarks.dtx
+++ b/base/ltmarks.dtx
@@ -801,6 +801,16 @@
          \box_set_to_last:N \l_@@_box
          \box_if_vertical:NT \l_@@_box
              { \vbox_unpack:N \l_@@_box }
+%    \end{macrocode}
+%    If it wasn't a vbox, it was either an hbox or there was no box.
+%    Given that we are only interested in the marks we don't need put
+%    it back in that case. However, we have to make sure that the box
+%    is not totally empty (which it might have been from the start, or
+%    now), because \TeX{} does not report a badness for empty boxes
+%    which means out test would incorrectly conclude that we have
+%    infinite shrinking. A simple \cs{kern} is enough to avoid this.
+%    \begin{macrocode}
+         \tex_kern:D\c_zero_dim
        }
     \int_compare:nNnTF \tex_badness:D > 0
 %    \end{macrocode}





More information about the latex3-commits mailing list.