[latex3-commits] [latex3/latex2e] ltmarks-enhance: added ltnews entry (cf3cbff1)

github at latex-project.org github at latex-project.org
Wed Nov 15 17:02:21 CET 2023


Repository : https://github.com/latex3/latex2e
On branch  : ltmarks-enhance
Link       : https://github.com/latex3/latex2e/commit/cf3cbff1f863ea8b7b4966062f6f92504827be7b

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

commit cf3cbff1f863ea8b7b4966062f6f92504827be7b
Author: Frank Mittelbach <frank.mittelbach at latex-project.org>
Date:   Wed Nov 15 17:02:21 2023 +0100

    added ltnews entry


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

cf3cbff1f863ea8b7b4966062f6f92504827be7b
 base/doc/ltnews39.tex                 | 70 +++++++++++++++++++++++++++++++----
 base/ltmarks.dtx                      |  8 ++--
 base/testfiles-ltmarks/xmarks-009.tlg |  8 ++--
 3 files changed, 70 insertions(+), 16 deletions(-)

diff --git a/base/doc/ltnews39.tex b/base/doc/ltnews39.tex
index 3002928c..8bb3ecb3 100644
--- a/base/doc/ltnews39.tex
+++ b/base/doc/ltnews39.tex
@@ -145,6 +145,60 @@
 \section{Introduction}
 
 
+\section{Enhancements to the new mark mechanism}
+
+In June 2022 we introduced a new mark mechanism in
+\LaTeX{}~\cite[p.~76]{39:ltnews} that allows keeping track of multiple
+independent marks. It also  properly supports top marks, something that wasn't
+reliably possible with \LaTeX{} before.
+
+There was, however, one limitation: to retrieve the marks from the
+page data it was necessary to \cs{vsplit} that data artificially so
+that \TeX{} would produce split marks that the mechanism could then
+use. Unfortunately, \TeX{} gets very upset if it finds infinite
+negative glue (e.g., from \cs{vss}) within this data. This is not
+totally surprising because such glue would allow to split off any
+amount of material as such glue would hide the size of it. \TeX{}
+therefore responds with an error message if it find such glue while
+doing a \cs{vsplit} operation (and it does so even if a later glue
+item cancels the infinite glue).
+
+To account for this, the code in 2022 attempted to detect this
+situation beforehand and if so did not do any splitting but, of
+course, it would then also not extract any mark information.
+
+In this release the approach has been changed and we always do a
+\cs{vsplit} operation and thus always get the right mark data
+extracted. While it is not possible to avoid upsetting \TeX{} in case
+we have infinite negative glue present, it is possible to hide this
+(more or less) from the user.\footnote{A note to \pkg{l3build} users
+that make use of its testing capabilities: the new mechanism
+temporarily changes \cs{interactionmode} and, for implementation
+reasons in \TeX{}, that results in extra newlines in the \texttt{.log}
+file, so instead of seeing \texttt{[1] [2]} you will see each on
+separate lines. This means that test files might show difference of
+that nature, once the code is active, and must therefore be
+regenerated as necessary.}  With the new code \TeX{} will neither stop
+nor show anything on the terminal. What we can't do, though, is to
+avoid that an error is written to the log file, but to make it clear
+that this error is harmless and should be ignored we have arranged the
+code so that the error message, if it is issued, takes the following
+format:
+\begin{verbatim}
+! Infinite glue shrinkage found in box being split.
+<argument> Infinite shrink error above ignored ! 
+l. ...  }
+\end{verbatim}
+Not perfect (especially the somewhat unmotivated \texttt{<argument>}),
+but you can only do so much if error messages and their texts are
+hard-wired in the engine.
+
+So why all this? There are two reasons: we do not loose marks in edge
+cases any longer and perhaps more importantly we are now also reliably
+able to extract marks from arbitrarily boxed data, something that
+wasn't possible at all before. This is, for example, necessary to
+support extended marks in \env{multicols} environments or extract them
+from floats, marginpars, etc.
 
 \section{New or improved commands}
 
@@ -209,19 +263,19 @@ in a hotfix for release 2023-11.
 \githubissue{1160}
 
 
-\subsection{\pkg{multicol}: \cs{columnbreak} interfers with mark mechanism}
+\subsection{\pkg{multicol}: \cs{columnbreak} interferes with mark mechanism}
 
 The \pkg{multicol} package has to keep track of marks (from
 \cs{markright} or \cs{markboth}) as part of its output routine code
 and can't rely on \LaTeX{} handling that automatically. It does so by
-artifically splitting page data with \cs{vsplit} to extract the mark
+artificially splitting page data with \cs{vsplit} to extract the mark
 data. With the introduction of \cs{columnbreak} that code failed
 sometimes, because it was not seeing any mark that followed such a
 forced column break.
 
 This has now been corrected, but there is further work to do, because
-as of now \pkg{multicol} does not handle marks using the new mark
-mechanism at all.
+as of now \pkg{multicol} does not yet handle marks using the new mark
+mechanism\Dash see the discussion at the beginning of the newsletter.
 %
 \githubissue{1130}
 
@@ -253,10 +307,10 @@ didn't get this treatment. This oversight has now been corrected.
 %\newblock ISBN 0-201-52983-1.
 %\newblock Reprinted with corrections in 1996.
 %
-%
-%\bibitem{39:ltnews} \LaTeX{} Project Team.
-%  \emph{\LaTeXe{} news 1--39}.\\
-%  \url{https://latex-project.org/news/latex2e-news/ltnews.pdf}
+
+\bibitem{39:ltnews} \LaTeX{} Project Team.
+  \emph{\LaTeXe{} news 1--39}.\\
+  \url{https://latex-project.org/news/latex2e-news/ltnews.pdf}
 %
 %\bibitem{39:blueprint} Frank Mittelbach and Chris Rowley.
 %  \emph{\LaTeX{} Tagged PDF \Dash A blueprint for a large project}.\\
diff --git a/base/ltmarks.dtx b/base/ltmarks.dtx
index 21182b2e..d41104de 100644
--- a/base/ltmarks.dtx
+++ b/base/ltmarks.dtx
@@ -993,13 +993,13 @@
 %    you get is something like
 %\begin{verbatim}
 %   ! Infinite glue shrinkage found in box being split.
-%   <argument> Glue shrinkage error above ignored ! 
+%   <argument> Infinite shrink error above ignored ! 
 %   l. ...  }
 %\end{verbatim}
 %    which hopefully makes it clear that the error is harmless and
 %    and should be ignored by the reader of the \texttt{.log}.
 %    \begin{macrocode}
-\cs_set_eq:cN {Glue~shrinkage~error~above~ignored~!}\c_max_dim
+\cs_set_eq:cN {Infinite~shrink~error~above~ignored~!}\c_max_dim
 %    \end{macrocode}
 %
 %    The whole definition of \cs{@@_vbox_set_split_to_maxdimen:NN}
@@ -1020,7 +1020,7 @@
 %    \end{macrocode}
 %    Then we change them so that no escape char is printed in the
 %    error message (accounts for the missing backslash in front of
-%    \verb/Glue shrinkage .../) and we set the interaction to
+%    \verb/Infinite shrink .../) and we set the interaction to
 %    \cs{nonstopmode} so that the the error (if any) just goes into
 %    the \texttt{.log} file and \TeX{} doesn't stop at that point.
 %    \begin{macrocode}
@@ -1044,7 +1044,7 @@
       \exp_not:N \use:n {
 %        \use:c{~Ignore~infinite~glue~shrinkage~error}
 %        \use:c{Glue~shrinkage~error~is~harmless~!}
-        \use:c{Glue~shrinkage~error~above~ignored~!}
+        \use:c{Infinite~shrink~error~above~ignored~!}
       }
 %    \end{macrocode}
 %    Finally, we change the escape char and the interaction mode back
diff --git a/base/testfiles-ltmarks/xmarks-009.tlg b/base/testfiles-ltmarks/xmarks-009.tlg
index 71a9556d..f9733a89 100644
--- a/base/testfiles-ltmarks/xmarks-009.tlg
+++ b/base/testfiles-ltmarks/xmarks-009.tlg
@@ -72,7 +72,7 @@ Marks: set 2e-right <- 'F' on line ...
 Marks: set 2e-right-nonempty <- 'F' on line ...
 Marks: mark extraction needs recursion on line ...
 ! Infinite glue shrinkage found in box being split.
-<argument> Glue shrinkage error above ignored ! 
+<argument> Infinite shrink error above ignored ! 
 l. ...   }
 The box you are \vsplitting contains some infinitely
 shrinkable glue, e.g., `\vss' or `\vskip 0pt minus 1fil'.
@@ -113,14 +113,14 @@ 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.
-<argument> Glue shrinkage error above ignored ! 
+<argument> Infinite shrink error above ignored ! 
 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.
-<argument> Glue shrinkage error above ignored ! 
+<argument> Infinite shrink error above ignored ! 
 l. ...   }
 The box you are \vsplitting contains some infinitely
 shrinkable glue, e.g., `\vss' or `\vskip 0pt minus 1fil'.
@@ -189,7 +189,7 @@ Marks: set 2e-right <- 'A3' on line ...
 Marks: set 2e-right-nonempty <- 'A3' on line ...
 Marks: mark extraction needs recursion on line ...
 ! Infinite glue shrinkage found in box being split.
-<argument> Glue shrinkage error above ignored ! 
+<argument> Infinite shrink error above ignored ! 
 l. ...   \l_last_marks_tl
 The box you are \vsplitting contains some infinitely
 shrinkable glue, e.g., `\vss' or `\vskip 0pt minus 1fil'.





More information about the latex3-commits mailing list.