[latex3-commits] [git/LaTeX3-latex3-latex2e] hotfix/gh962-et-al: hotfix for #967 (d60f89ff)
Frank Mittelbach
frank.mittelbach at latex-project.org
Mon Nov 28 20:13:33 CET 2022
Repository : https://github.com/latex3/latex2e
On branch : hotfix/gh962-et-al
Link : https://github.com/latex3/latex2e/commit/d60f89ff349f98edf62d68a037868d8987a76287
>---------------------------------------------------------------
commit d60f89ff349f98edf62d68a037868d8987a76287
Author: Frank Mittelbach <frank.mittelbach at latex-project.org>
Date: Mon Nov 28 20:13:33 2022 +0100
hotfix for #967
>---------------------------------------------------------------
d60f89ff349f98edf62d68a037868d8987a76287
base/changes.txt | 10 ++++++++++
base/ltspace.dtx | 11 +++++++++--
base/testfiles/github-0967.lvt | 32 ++++++++++++++++++++++++++++++++
base/testfiles/github-0967.tlg | 9 +++++++++
4 files changed, 60 insertions(+), 2 deletions(-)
diff --git a/base/changes.txt b/base/changes.txt
index 685f2129..4e69cb0e 100644
--- a/base/changes.txt
+++ b/base/changes.txt
@@ -10,6 +10,16 @@ are not part of the distribution.
All changes above are only part of the development branch for the next release.
================================================================================
+#########################
+# 2022-11-01 PL1 Release
+#########################
+
+2022-11-28 Frank Mittelbach <Frank.Mittelbach at latex-project.org>
+
+ * ltspace.dtx (subsection{Horizontal space (and breaks)}):
+ We start with \hspace with \leavevmode 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 at latex-project.org>
* ltxdoc.dtx:
diff --git a/base/ltspace.dtx b/base/ltspace.dtx
index feb82730..f9a956b8 100644
--- a/base/ltspace.dtx
+++ b/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}
@@ -1261,12 +1261,19 @@
% {(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 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 do not provide rollback to the incorrect intermediate version.
+% \begin{macrocode}
+\def\@hspace#1{\leavevmode
+ \begingroup\setlength\skip@{#1}\hskip\skip@\endgroup}
%</2ekernel|latexrelease>
%<latexrelease>\EndIncludeInRelease
% \end{macrocode}
diff --git a/base/testfiles/github-0967.lvt b/base/testfiles/github-0967.lvt
new file mode 100644
index 00000000..c9dd79e0
--- /dev/null
+++ b/base/testfiles/github-0967.lvt
@@ -0,0 +1,32 @@
+
+\documentclass{article}
+
+\input{test2e}
+
+\newcommand\mytest[1]{\typeout{original definition: #1}}
+
+\AddToHook{para/before}{\renewcommand\mytest[1]{\typeout{before para definition: #1}}}
+\AddToHook{para/end}{\renewcommand\mytest[1]{\typeout{original definition: #1}}}
+
+\begin{document}
+
+\START
+
+\mytest{-}
+
+aaaa
+
+\mytest{-}
+
+bb\mytest{1}bb
+
+\mytest{-}
+
+
+\hspace{5pt} cc\mytest{2}cc
+
+\mytest{-}
+
+\hspace*{5pt} dd\mytest{3}dd
+
+\END
diff --git a/base/testfiles/github-0967.tlg b/base/testfiles/github-0967.tlg
new file mode 100644
index 00000000..c2ed46de
--- /dev/null
+++ b/base/testfiles/github-0967.tlg
@@ -0,0 +1,9 @@
+This is a generated file for the LaTeX2e validation system.
+Don't change this file in any respect.
+original definition: -
+original definition: -
+before para definition: 1
+original definition: -
+before para definition: 2
+original definition: -
+before para definition: 3
More information about the latex3-commits
mailing list.