[latex3-commits] [latex3/latex2e] ltmarks-enhance: first attempt using \interactionmode (WIP) code can be simplified if we go this way. (3e1a3a00)
github at latex-project.org
github at latex-project.org
Tue Nov 14 15:59:55 CET 2023
Repository : https://github.com/latex3/latex2e
On branch : ltmarks-enhance
Link : https://github.com/latex3/latex2e/commit/3e1a3a0099141b4a23588e5ff5daf2b4125ddcb5
>---------------------------------------------------------------
commit 3e1a3a0099141b4a23588e5ff5daf2b4125ddcb5
Author: Frank Mittelbach <frank.mittelbach at latex-project.org>
Date: Tue Nov 14 15:59:55 2023 +0100
first attempt using \interactionmode (WIP)
code can be simplified if we go this way.
>---------------------------------------------------------------
3e1a3a0099141b4a23588e5ff5daf2b4125ddcb5
base/ltmarks.dtx | 23 ++++++++++++++---
base/testfiles-ltmarks/xmarks-006.tlg | 3 ++-
base/testfiles-ltmarks/xmarks-009.lvt | 14 ++++++++++
base/testfiles-ltmarks/xmarks-009.tlg | 48 +++++++++++++++++++++++++++++++++++
4 files changed, 84 insertions(+), 4 deletions(-)
diff --git a/base/ltmarks.dtx b/base/ltmarks.dtx
index 2f9f49d1..c5cbded7 100644
--- a/base/ltmarks.dtx
+++ b/base/ltmarks.dtx
@@ -979,10 +979,21 @@
% didn't show any) we vsplit it. Note that it
% doesn't matter that we set it to this strange size first. If there
% was infinite shrinkage after all, we end up with a low-level
-% \TeX{} error, but if that is the case then there is a coding error
-% somewhere and needs to be corrected.
-% \begin{macrocode}
+% \TeX{} error. Unfortunately this is something one cannot always
+% prevent. For example if there is infinite negative glue that is
+% canceled by infinite positive glue then we can't detect this case.
+% however the splitting operation will balk, because it goes throw
+% the vertical material item by item and complains the moment it
+% finds any negative infinite glue, even though it is a harmless
+% one if the material whole is considered as a whole.
+% We therefore, change the interaction mode, so that such errors
+% appear in the log, but do not stop the processing.
+% \begin{macrocode}
+ \tl_set:Ne \l_@@_interaction_tl
+ { \interactionmode \the\interactionmode\relax }
+ \interactionmode 0
\vbox_set_split_to_ht:NNn \l_@@_ii_box \l_@@_box \c_max_dim
+ \l_@@_interaction_tl
% \end{macrocode}
% After splitting we check if there is anything left in
% \cs{l_@@_box}. If not then the above split has set some split marks
@@ -1017,6 +1028,12 @@
% \end{macro}
%
%
+% \begin{macro}{\l_@@_interaction_tl}
+%
+% \begin{macrocode}
+\tl_new:N \l_@@_interaction_tl
+% \end{macrocode}
+% \end{macro}
%
% \begin{macro}{\@@_update_structure_from_material:nn}
%
diff --git a/base/testfiles-ltmarks/xmarks-006.tlg b/base/testfiles-ltmarks/xmarks-006.tlg
index c5d9bf45..285f83b3 100644
--- a/base/testfiles-ltmarks/xmarks-006.tlg
+++ b/base/testfiles-ltmarks/xmarks-006.tlg
@@ -1,5 +1,6 @@
This is a generated file for the l3build validation system.
Don't change this file in any respect.
==Even======|left=\MakeUppercase []{1\hskip 1em\relax A test}|right=|
-[5] [6]
+[5]
+[6]
==Even======|left=\MakeUppercase []{4\hskip 1em\relax C}|right=|
diff --git a/base/testfiles-ltmarks/xmarks-009.lvt b/base/testfiles-ltmarks/xmarks-009.lvt
index 5e19b8c7..717e7ffd 100644
--- a/base/testfiles-ltmarks/xmarks-009.lvt
+++ b/base/testfiles-ltmarks/xmarks-009.lvt
@@ -44,6 +44,20 @@
\ShowMarksAt{after material with infinite glue}
+\ExplSyntaxOn
+
+\__mark_update_structure_from_material:nn{page}
+ {text\markright{G} \par
+ \vskip 0pt minus 1fil\relax
+ text\markright{H} \par
+ \vskip 0pt minus -1fil\relax
+ text\markright{I} \par
+ }
+
+\ExplSyntaxOff
+
+\ShowMarksAt{after material with canceling infinite glue}
+
\ExplSyntaxOn
diff --git a/base/testfiles-ltmarks/xmarks-009.tlg b/base/testfiles-ltmarks/xmarks-009.tlg
index 2a032472..f9d5bab1 100644
--- a/base/testfiles-ltmarks/xmarks-009.tlg
+++ b/base/testfiles-ltmarks/xmarks-009.tlg
@@ -106,6 +106,54 @@ Marks: unused after material with infinite glue:
column (current):||||
column (first):||||
column (second):||||
+Marks: set 2e-right <- 'G' on line ...
+Marks: set 2e-right-nonempty <- 'G' on line ...
+Marks: set 2e-right <- 'H' on line ...
+Marks: set 2e-right-nonempty <- 'H' on line ...
+Marks: set 2e-right <- 'I' on line ...
+Marks: set 2e-right-nonempty <- 'I' on line ...
+! Infinite glue shrinkage found in box being split.
+\__box_dim_eval:n ...box_dim_eval:w #1\scan_stop:
+l. ... }
+The box you are \vsplitting contains some infinitely
+shrinkable glue, e.g., `\vss' or `\vskip 0pt minus 1fil'.
+Such glue doesn't belong there; but you can safely proceed,
+since the offensive shrinkability has been made finite.
+! Infinite glue shrinkage found in box being split.
+\__box_dim_eval:n ...box_dim_eval:w #1\scan_stop:
+l. ... }
+The box you are \vsplitting contains some infinitely
+shrinkable glue, e.g., `\vss' or `\vskip 0pt minus 1fil'.
+Such glue doesn't belong there; but you can safely proceed,
+since the offensive shrinkability has been made finite.
+Marks: 2e-left after material with canceling infinite glue:
+ page (current):||||
+ page (previous):||||
+ column (previous):||||
+ column (current):||||
+ column (first):||||
+ column (second):||||
+Marks: 2e-right after material with canceling infinite glue:
+ page (current):|C|G|I|
+ page (previous):|C|C|C|
+ column (previous):||||
+ column (current):||||
+ column (first):||||
+ column (second):||||
+Marks: 2e-right-nonempty after material with canceling infinite glue:
+ page (current):|C|G|I|
+ page (previous):|C|C|C|
+ column (previous):||||
+ column (current):||||
+ column (first):||||
+ column (second):||||
+Marks: unused after material with canceling infinite glue:
+ page (current):||||
+ page (previous):||||
+ column (previous):||||
+ column (current):||||
+ column (first):||||
+ column (second):||||
Marks: set 2e-left <- 'A1' on line ...
Marks: set 2e-right <- 'A2' on line ...
Marks: set 2e-right-nonempty <- 'A2' on line ...
More information about the latex3-commits
mailing list.