[latex3-commits] [latex3/latex2e] develop: fix for #1289 (#1290) (fef972e7)
github at latex-project.org
github at latex-project.org
Tue Mar 12 15:05:59 CET 2024
Repository : https://github.com/latex3/latex2e
On branch : develop
Link : https://github.com/latex3/latex2e/commit/fef972e71f4f511650e42b22148699a8b4d6c9b5
>---------------------------------------------------------------
commit fef972e71f4f511650e42b22148699a8b4d6c9b5
Author: Frank Mittelbach <frank.mittelbach at latex-project.org>
Date: Tue Mar 12 15:05:59 2024 +0100
fix for #1289 (#1290)
* fix for #1289
* new entry
>---------------------------------------------------------------
fef972e71f4f511650e42b22148699a8b4d6c9b5
base/doc/ltnews39.tex | 16 +++++++++++++++-
required/amsmath/amsmath.dtx | 8 +++++++-
required/amsmath/changes.txt | 6 ++++++
required/amsmath/testfiles/github1289.lvt | 27 +++++++++++++++++++++++++++
required/amsmath/testfiles/github1289.tlg | 4 ++++
5 files changed, 59 insertions(+), 2 deletions(-)
diff --git a/base/doc/ltnews39.tex b/base/doc/ltnews39.tex
index b4b93d35..e82cb145 100644
--- a/base/doc/ltnews39.tex
+++ b/base/doc/ltnews39.tex
@@ -517,7 +517,21 @@ missing and sub-encoding 5 as declared in the kernel is correct.
%\section{Bug fixes}
-%\section{Changes to packages in the \pkg{amsmath} category}
+\section{Changes to packages in the \pkg{amsmath} category}
+
+\subsection{\pkg{amsmath}: correct equation tag placement}
+
+If there is not enough space to place an equation tag on the same line
+as the equation \pkg{amsmath} calculates a suitable offset and then
+places the tag above (or below) the equation. In the case of the
+\env{gather} environment this offset was not reset at the end, with
+the result that it applied to a following environment as well
+resulting in incorrect spacing in certain situations. This has now
+been corrected.
+%
+\githubissue{1289}
+
+
%\section{Changes to packages in the \pkg{graphics} category}
diff --git a/required/amsmath/amsmath.dtx b/required/amsmath/amsmath.dtx
index f8a83874..ef199266 100644
--- a/required/amsmath/amsmath.dtx
+++ b/required/amsmath/amsmath.dtx
@@ -86,7 +86,7 @@ Bug reports can be opened (category \texttt{#1}) at\\%
% \end{macrocode}
%
% \begin{macrocode}
-\ProvidesPackage{amsmath}[2023/05/13 v2.17o AMS math features]
+\ProvidesPackage{amsmath}[2024/03/11 v2.17p AMS math features]
% \end{macrocode}
%
% \section{Catcode defenses}
@@ -4153,6 +4153,12 @@ and fix things up.}
% cause \cs{row@} to be advanced twice instead of once.
% \begin{macrocode}
\global\advance\row@\@ne
+% \end{macrocode}
+% Also reset \cs{lineht@} to avoid that this is incorrectly picked
+% up by a following environment, such as \env{align}.
+% \changes{v2.17p}{2024/03/11}{Reset \cs{lineht} (gh/1289)}
+% \begin{macrocode}
+ \global\lineht@\z@
\cr
}
% \end{macrocode}
diff --git a/required/amsmath/changes.txt b/required/amsmath/changes.txt
index 10ce2ec8..a15eab5b 100644
--- a/required/amsmath/changes.txt
+++ b/required/amsmath/changes.txt
@@ -1,3 +1,9 @@
+2024-03-11 Frank Mittelbach <Frank.Mittelbach at latex-project.org>
+
+ * amsmath.dtx (subsection{The \env{gather} environment}):
+ Reset \lineht@ to avoid that this is incorrectly picked
+ up by a following environment, such as align. (gh/1289)
+
================================================================================
All changes above are only part of the development branch for the next release.
================================================================================
diff --git a/required/amsmath/testfiles/github1289.lvt b/required/amsmath/testfiles/github1289.lvt
new file mode 100644
index 00000000..8b141f21
--- /dev/null
+++ b/required/amsmath/testfiles/github1289.lvt
@@ -0,0 +1,27 @@
+\documentclass{article}
+
+\input{test2e}
+
+\usepackage{amsmath}
+
+\begin{document}
+
+\twocolumn %Just for demonstration purpose
+
+ \START
+ \OMIT
+
+\paragraph{Current:}
+\begin{gather}
+ \text{a deep gather line}\quad\frac{a}{\frac{a}{\frac{a}{a}}}
+\end{gather}
+Text inbetween amsmath environments; the following tag “(2)” is set too low.
+\begin{align}
+ \TIMO
+ \typeout{-> \the\csname lineht@\endcsname \space should be zero and then 1.94444pt}%
+ \OMIT
+ \text{a loooooooooooooooong align line}
+\end{align}
+
+\end{document}
+
diff --git a/required/amsmath/testfiles/github1289.tlg b/required/amsmath/testfiles/github1289.tlg
new file mode 100644
index 00000000..c5781e42
--- /dev/null
+++ b/required/amsmath/testfiles/github1289.tlg
@@ -0,0 +1,4 @@
+This is a generated file for the LaTeX2e validation system.
+Don't change this file in any respect.
+-> 0.0pt should be zero and then 1.94444pt
+-> 1.94444pt should be zero and then 1.94444pt
More information about the latex3-commits
mailing list.