Skip to content

Commit

Permalink
improve infinite glue shrinkage log message
Browse files Browse the repository at this point in the history
  • Loading branch information
davidcarlisle committed Nov 14, 2023
1 parent 3e1a3a0 commit 2a5626b
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions base/ltmarks.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -898,6 +898,16 @@
% \begin{macro}{@@_prepare_and_extract:nnn}
%
% \begin{macrocode}
\cs_set_eq:cN{Ignore~infinite~glue~shrinkage~error}\c_max_dim
% \end{macrocode}
% \begin{macrocode}
\cs_new_protected:Npx \@@_vbox_set_split_to_maxdimen:NN #1#2
{ \tex_setbox:D #1 \tex_vsplit:D #2 to \exp_not:N\use:n{

This comment has been minimized.

Copy link
@josephwright

josephwright Nov 14, 2023

Member

Why not \vbox_set_split_to_ht:NNn?

This comment has been minimized.

Copy link
@FrankMittelbach

FrankMittelbach Nov 14, 2023

Member

because the whole exercise is to get the error display right and that means you have to do a lot of fiddling. If you throw in higher level commands then they show in the error message and not the disguised \c_max_dim

\use:c{Ignore~infinite~glue~shrinkage~error}
}
}
% \end{macrocode}
% \begin{macrocode}
\cs_new_protected:Npn \@@_prepare_and_extract:nnn #1#2#3 {
% \end{macrocode}
%
Expand Down Expand Up @@ -982,17 +992,17 @@
% \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
% however the splitting operation will balk, because it goes through
% 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.
% one if the material 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
\interactionmode 0\scan_stop:
\@@_vbox_set_split_to_maxdimen:NN \l_@@_ii_box \l_@@_box
\l_@@_interaction_tl
% \end{macrocode}
% After splitting we check if there is anything left in
Expand Down

0 comments on commit 2a5626b

Please sign in to comment.