summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/base/ltspace.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/source/latex/base/ltspace.dtx')
-rw-r--r--Master/texmf-dist/source/latex/base/ltspace.dtx16
1 files changed, 13 insertions, 3 deletions
diff --git a/Master/texmf-dist/source/latex/base/ltspace.dtx b/Master/texmf-dist/source/latex/base/ltspace.dtx
index feb82730ece..30bda278fbf 100644
--- a/Master/texmf-dist/source/latex/base/ltspace.dtx
+++ b/Master/texmf-dist/source/latex/base/ltspace.dtx
@@ -32,7 +32,7 @@
%<*driver>
% \fi
\ProvidesFile{ltspace.dtx}
- [2020/05/06 v1.3n LaTeX Kernel (spacing)]
+ [2022/11/28 v1.3o LaTeX Kernel (spacing)]
% \iffalse
\documentclass{ltxdoc}
\GetFileInfo{ltspace.dtx}
@@ -438,12 +438,13 @@
% \cs{setlength}. This way the \texttt{calc} package can operate on
% the argument value.
% \changes{v1.3m}{2020/04/21}{Support calc syntax (gh/152)}
+% \changes{v1.3o}{2022/11/28}{Support calc syntax without a group (gh/967)}
% \begin{macrocode}
%</2ekernel>
%<*2ekernel|latexrelease>
%<latexrelease>\IncludeInRelease{2020/10/01}%
%<latexrelease> {\@vspace@calcify}{Add calc support}%
-\def\@vspace@calcify#1{\begingroup\setlength\skip@{#1}\vskip\skip@\endgroup}
+\def\@vspace@calcify#1{\setlength\sp@ce@skip{#1}\vskip\sp@ce@skip}
%</2ekernel|latexrelease>
%<latexrelease>\EndIncludeInRelease
% \end{macrocode}
@@ -1261,12 +1262,21 @@
% {(RmS) Removed superfluous \cs{leavevmode} in \cs{@hspace} and
% \cs{@hspacer}, as suggested by CAR.}
% \changes{v1.3m}{2020/04/21}{Support calc syntax (gh/152)}
+% \changes{v1.3o}{2022/11/28}{Support calc syntax correctly (gh/967)}
% \begin{macrocode}
%</2ekernel>
%<*2ekernel|latexrelease>
%<latexrelease>\IncludeInRelease{2020/10/01}%
%<latexrelease> {\@hspace}{Support calc with \hspace}%
-\def\@hspace#1{\begingroup\setlength\skip@{#1}\hskip\skip@\endgroup}
+% \end{macrocode}
+% 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}
+\newskip\sp@ce@skip
+\def\@hspace#1{\setlength\sp@ce@skip{#1}\hskip\sp@ce@skip}
%</2ekernel|latexrelease>
%<latexrelease>\EndIncludeInRelease
% \end{macrocode}