Skip to content

Commit

Permalink
use a private register instead of a group
Browse files Browse the repository at this point in the history
  • Loading branch information
FrankMittelbach committed Nov 29, 2022
1 parent d60f89f commit fda509b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
3 changes: 2 additions & 1 deletion base/changes.txt
Expand Up @@ -17,7 +17,8 @@ All changes above are only part of the development branch for the next release.
2022-11-28 Frank Mittelbach <Frank.Mittelbach@latex-project.org>

* ltspace.dtx (subsection{Horizontal space (and breaks)}):
We start with \hspace with \leavevmode in case it starts the paragraph.
We use a private register instead of a group with \hspace in case it
starts the paragraph.
Otherwise \everypar and friends will be executed inside a group (gh/967)

2022-11-28 Frank Mittelbach <Frank.Mittelbach@latex-project.org>
Expand Down
10 changes: 6 additions & 4 deletions base/ltspace.dtx
Expand Up @@ -1268,12 +1268,14 @@
%<latexrelease>\IncludeInRelease{2020/10/01}%
%<latexrelease> {\@hspace}{Support calc with \hspace}%
% \end{macrocode}
% We start with \cs{leavevmode} in case the \cs{hspace} starts the paragraph.
% Otherwise \cs{everypar} etc.\ will end up inside the group. This is a bug fix so
% We use a private register to calculate the space (if \pkg{calc} is used). Previously
% we used a group but that results in
% \cs{everypar} etc.\ being executed inside the group if the \cs{hspace} starts a paragraph.
% This is a bug fix so
% we do not provide rollback to the incorrect intermediate version.
% \begin{macrocode}
\def\@hspace#1{\leavevmode
\begingroup\setlength\skip@{#1}\hskip\skip@\endgroup}
\newskip\hsp@ce@skip
\def\@hspace#1{\setlength\hsp@ce@skip{#1}\hskip\hsp@ce@skip}
%</2ekernel|latexrelease>
%<latexrelease>\EndIncludeInRelease
% \end{macrocode}
Expand Down

0 comments on commit fda509b

Please sign in to comment.