[latex3-commits] [git/LaTeX3-latex3-latex2e] copyedits-chris: ltpara more temporary local stuff (1bacc248)
Chris Rowley
car222222 at github.github.io
Mon Sep 20 08:04:21 CEST 2021
Repository : https://github.com/latex3/latex2e
On branch : copyedits-chris
Link : https://github.com/latex3/latex2e/commit/1bacc2484cf06bfe03892f28ebe200bf106925bd
>---------------------------------------------------------------
commit 1bacc2484cf06bfe03892f28ebe200bf106925bd
Author: Chris Rowley <car222222 at users.noreply.github.com>
Date: Mon Sep 20 13:04:21 2021 +0700
ltpara more temporary local stuff
Incorporating change from kern to glue
>---------------------------------------------------------------
1bacc2484cf06bfe03892f28ebe200bf106925bd
base/ltpara.dtx | 27 ++++++++++++++-------------
1 file changed, 14 insertions(+), 13 deletions(-)
diff --git a/base/ltpara.dtx b/base/ltpara.dtx
index c07e74da..f01b03b2 100644
--- a/base/ltpara.dtx
+++ b/base/ltpara.dtx
@@ -928,7 +928,7 @@
% \end{itemize}
%
% Unfortunately, \TeX{} has some (these days) unnecessary
-% optimisations: if a \cs{vbox} ends and \TeX{} is still in
+% optimizations: if a \cs{vbox} ends and \TeX{} is still in
% horizontal mode it simply exercises the paragraph builder instead
% of issuing a \cs{par}. It is therefore necessary for \LaTeX{} to
% ensure that this case doesn't happen and all boxes internally
@@ -1034,12 +1034,12 @@
\mode_if_horizontal:TF {
% \end{macrocode}
% The final action (before getting to the point where
-% \cs{tex_par:D} is called) is to add a kern item XXXX DC so that the
-% primitive is prevented from removing glue (if there was some). If
-% we don't do this and the
-% horizontal list ended in several glue items we would end up with
-% removing two glue items instead of just the last one, which would be wrong.
-% We use a kern as that is minimally faster. XXX DC
+% \cs{tex_par:D} is called) is to add an extra glue item so that the
+% primitive is prevented from removing intended glue
+% (if there was some). If we don't do this and the
+% horizontal list ends in several glue items we would end up
+% removing two glue items instead of just the last one, which would be wrong. XXX DC needs more rewriting
+% We use glue (rather than a kern) so that is minimally faster. XXX DC
%
% There is however one other \TeX{} optimization that hurts: in a
% sequence like this \verb=$$ ... $$ \par= \TeX{} will be in
@@ -1052,14 +1052,15 @@
% simply goes silently to vmode. Now if we would had added something (to
% prevent glue removal) that would look to \TeX{} like material
% after the display and so we would end up with an empty paragraph
-% just containing \cs{parfillskip}. XXX not needed!!
+% just containing \cs{parfillskip}. XXX not needed!! Bad text also.
%
-% We therefore check if the current hlist is empty XXX DC but add nonempty
-% (\cs{tex_lastnodetype:D} has the value \texttt{-1} and
-% only if not we add our kern. XXX See DC but use “if so add extra zero skip”
+% We therefore check whether the current hlist ends with a glue item XXX DC add nonempty??
+% (\cs{tex_lastnodetype:D} has the value \texttt{-1}) and
+% if it does then we add an extra zero-length glue item as a guard,
+% so that only this extra glue is removed by the primitive. XXX See DC too
% \begin{macrocode}
- \if_int_compare:w 0 < \tex_lastnodetype:D
- \tex_kern:D \c_zero_dim
+ \if_int_compare:w 11 = \tex_lastnodetype:D
+ \tex_hskip:D \c_zero_dim
\fi:
% \end{macrocode}
% To run the \hook{para/after} hook we first end the
More information about the latex3-commits
mailing list.