[latex3-commits] [git/LaTeX3-latex3-latex2e] gh614: added fix and documentation (6898bb2a)

Frank Mittelbach frank.mittelbach at latex-project.org
Mon Jul 12 19:02:14 CEST 2021


Repository : https://github.com/latex3/latex2e
On branch  : gh614
Link       : https://github.com/latex3/latex2e/commit/6898bb2a785ca80e4b41f1d1e3c212166b07e879

>---------------------------------------------------------------

commit 6898bb2a785ca80e4b41f1d1e3c212166b07e879
Author: Frank Mittelbach <frank.mittelbach at latex-project.org>
Date:   Mon Jul 12 19:02:14 2021 +0200

    added fix and documentation


>---------------------------------------------------------------

6898bb2a785ca80e4b41f1d1e3c212166b07e879
 base/doc/ltnews34.tex                    | 14 ++++++++++++++
 required/tools/array.dtx                 |  8 +++++---
 required/tools/changes.txt               |  6 ++++++
 required/tools/testfiles/github-0614.tlg |  8 ++++----
 4 files changed, 29 insertions(+), 7 deletions(-)

diff --git a/base/doc/ltnews34.tex b/base/doc/ltnews34.tex
index 1430fed6..0992180e 100644
--- a/base/doc/ltnews34.tex
+++ b/base/doc/ltnews34.tex
@@ -222,6 +222,20 @@ been changed to avoid these errors.
 \sxissue{603948}
 
 
+\subsection{\pkg{array}: Cancel  \cs{mathsurround} for \env{tabular}}
+
+A \env{tabular} environment is internally typeset as an \env{array}
+environment with special settings and therefore in math mode. This
+math group should not get any \cs{mathsuround} added as it isn't a
+real formula because otherwise the spacing around the \env{tabular}
+changes. This bug has been there forever (which means not many people
+use \cs{mathsurround} or noticed the difference). Anyhow, this now got
+fixed.
+%
+\githubissue{614}
+
+
+
 \subsection{???}
 
 %
diff --git a/required/tools/array.dtx b/required/tools/array.dtx
index 84376a48..eab451fc 100644
--- a/required/tools/array.dtx
+++ b/required/tools/array.dtx
@@ -33,7 +33,7 @@
 %<+package>\DeclareCurrentRelease{}{2020-10-01}
 %<+package>
 %<+package>\ProvidesPackage{array}
-%<+package>         [2021/04/20 v2.5e Tabular extension package (FMi)]
+%<+package>         [2021/07/12 v2.5f Tabular extension package (FMi)]
 %
 % \fi
 %
@@ -2489,9 +2489,11 @@
 % \begin{macro}{\endtabular*}
 %    To end a \textsf{tabular} or \textsf{tabular$*$} environment we
 %    call up =\endarray=, close the math mode and then the surrounding
-%    =\hbox=.
+%    =\hbox=. This math mode around the tabular should not be surrounded by
+%    any =\mathsurround= so we cancel that with =\m at th=.
+% \changes{v2.5f}{2021/07/12}{Cancel any outside \cs{mathsurround} (gh/614)}
 %    \begin{macrocode}
-\def\endtabular{\endarray $\egroup}
+\def\endtabular{\endarray\m at th $\egroup}
 \expandafter\let\csname endtabular*\endcsname=\endtabular
 %    \end{macrocode}
 % \end{macro}
diff --git a/required/tools/changes.txt b/required/tools/changes.txt
index 048478b8..fd82ec3b 100644
--- a/required/tools/changes.txt
+++ b/required/tools/changes.txt
@@ -5,6 +5,12 @@ completeness or accuracy and it contains some references to files that
 are not part of the distribution.
 =======================================================================
 
+2021-07-12  Frank Mittelbach  <Frank.Mittelbach at latex-project.org>
+
+	* array.dtx (section{The Environment Definitions}):
+	Cancel any outside \mathsurround on the outside of tabular which is
+	internally execuded in math mode (gh/614)
+
 2021-07-07  Frank Mittelbach  <Frank.Mittelbach at latex-project.org>
 
 	* varioref.dtx (subsubsection{Supporting ranges}):
diff --git a/required/tools/testfiles/github-0614.tlg b/required/tools/testfiles/github-0614.tlg
index 6319eba7..5ddd899a 100644
--- a/required/tools/testfiles/github-0614.tlg
+++ b/required/tools/testfiles/github-0614.tlg
@@ -50,11 +50,11 @@ Completed box being shipped out [1]
 ...\glue(\parskip) 0.0 plus 1.0
 ...\glue(\parskip) 0.0
 ...\glue(\baselineskip) 3.5
-...\hbox(8.5+3.5)x345.0, glue set 181.48466fil
+...\hbox(8.5+3.5)x345.0, glue set 281.48466fil
 ....\hbox(0.0+0.0)x15.0
 ....\OT1/cmr/m/n/10 X
-....\hbox(8.5+3.5)x133.5153
-.....\mathon, surrounded 50.0
+....\hbox(8.5+3.5)x33.5153
+.....\mathon
 .....\vbox(8.5+3.5)x33.5153
 ......\hbox(8.39996+3.60004)x33.5153
 .......\glue(\tabskip) 0.0
@@ -73,7 +73,7 @@ Completed box being shipped out [1]
 ........\glue 6.0
 ........\rule(*+*)x0.4
 .......\glue(\tabskip) 0.0
-.....\mathoff, surrounded 50.0
+.....\mathoff
 ....\OT1/cmr/m/n/10 X
 ....\penalty 10000
 ....\glue(\parfillskip) 0.0 plus 1.0fil





More information about the latex3-commits mailing list.