[latex3-commits] [git/LaTeX3-latex3-latex2e] gh776: fix for #776 (4dc2cb9b)

Frank Mittelbach frank.mittelbach at latex-project.org
Sun Sep 4 13:25:49 CEST 2022


Repository : https://github.com/latex3/latex2e
On branch  : gh776
Link       : https://github.com/latex3/latex2e/commit/4dc2cb9bea4cbd91c35f68a886668caabb19a1ca

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

commit 4dc2cb9bea4cbd91c35f68a886668caabb19a1ca
Author: Frank Mittelbach <frank.mittelbach at latex-project.org>
Date:   Sun Sep 4 13:25:49 2022 +0200

    fix for #776


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

4dc2cb9bea4cbd91c35f68a886668caabb19a1ca
 required/tools/array.dtx                 |  12 +-
 required/tools/changes.txt               |   6 +
 required/tools/testfiles/github-0776.lvt |  49 +++++
 required/tools/testfiles/github-0776.tlg | 351 +++++++++++++++++++++++++++++++
 4 files changed, 415 insertions(+), 3 deletions(-)

diff --git a/required/tools/array.dtx b/required/tools/array.dtx
index c9f77d77..8ed4fc3f 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>         [2022/03/10 v2.5f Tabular extension package (FMi)]
+%<+package>         [2022/09/04 v2.5g Tabular extension package (FMi)]
 %
 % \fi
 %
@@ -1727,14 +1727,20 @@
 %
 %    For that reason the new implementation does the centering
 %    manually: First we check the height of the cell and if that is
-%    less or equal to =\ht\@arstrutbox= we assume that this is a
+%    less or equal to =\ht\strutbox= we assume that this is a
 %    single line cell. In that case  we don't do any vertical maneuvre
 %    and simply output the box, i.e., make it behave like a single
 %    line p-cell.
+%
+%    We use the height of \cs{strutbox} not \cs{@arstrutbox} in the comparison,
+%    because \cs{box}\cs{ar at mcellbox} does not have any strut
+%    incorporated and if \cs{arraystretch} is made very
+%    small the test would otherwise incorrectly assume a multi-line cell.
 % \changes{v2.4f}{2017/11/04}{Managing m-cells without \cs{vcenter}}
+% \changes{v2.5g}{2022/09/04}{Test against \cs{strutbox} height (gh/776)}
 %    \begin{macrocode}
 \def\ar at align@mcell{%
-  \ifdim \ht\ar at mcellbox > \ht\@arstrutbox
+  \ifdim \ht\ar at mcellbox > \ht\strutbox
 %    \end{macrocode}
 %    Otherwise we realign vertically by lowering the box. The question
 %    is how much do we need to move down? If there is any
diff --git a/required/tools/changes.txt b/required/tools/changes.txt
index 689d3f43..9351c0b2 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.
 =======================================================================
 
+2022-09-04  Frank Mittelbach  <Frank.Mittelbach at latex-project.org>
+
+	* array.dtx (section{The macros \texttt{\textbackslash @classz}):
+	Test against \strutbox height to determine if an m-cell contains
+	 only a single line (gh/776)
+
 ================================================================================
 All changes above are only part of the development branch for the next release.
 ================================================================================
diff --git a/required/tools/testfiles/github-0776.lvt b/required/tools/testfiles/github-0776.lvt
new file mode 100644
index 00000000..23ba7974
--- /dev/null
+++ b/required/tools/testfiles/github-0776.lvt
@@ -0,0 +1,49 @@
+% https://github.com/latex3/latex2e/issues/776
+
+\documentclass[a4paper]{article}
+\usepackage[colaction]{array}
+
+\input{test2e}
+
+
+\showoutput
+
+\begin{document}
+
+\START
+
+\def\arraystretch{2}
+\begin{tabular}{|p{1cm}|m{1cm}|b{2cm}|}
+\hline
+Alpha & Beta & Gamma \\
+\hline
+\end{tabular} 2
+
+\bigskip
+
+\def\arraystretch{1}
+\begin{tabular}{|p{1cm}|m{1cm}|b{2cm}|}
+\hline
+Alpha & Beta & Gamma \\
+\hline
+\end{tabular} 1
+
+\bigskip
+
+\def\arraystretch{0.5}
+\begin{tabular}{|p{1cm}|m{1cm}|b{2cm}|}
+\hline
+Alpha & Beta & Gamma \\
+\hline
+\end{tabular} 0.5
+
+\bigskip
+
+\def\arraystretch{0}
+\begin{tabular}{|p{1cm}|m{1cm}|b{2cm}|}
+\hline
+Alpha & Beta & Gamma \\
+\hline
+\end{tabular} 0
+
+\end{document}
diff --git a/required/tools/testfiles/github-0776.tlg b/required/tools/testfiles/github-0776.tlg
new file mode 100644
index 00000000..a11859e2
--- /dev/null
+++ b/required/tools/testfiles/github-0776.tlg
@@ -0,0 +1,351 @@
+This is a generated file for the LaTeX2e validation system.
+Don't change this file in any respect.
+LaTeX Font Info:    External font `cmex10' loaded for size
+(Font)              <7> on input line ....
+LaTeX Font Info:    External font `cmex10' loaded for size
+(Font)              <5> on input line ....
+Completed box being shipped out [1]
+\vbox(682.0+0.0)x398.0
+.\glue 17.0
+.\vbox(665.0+0.0)x345.0, shifted 53.0
+..\vbox(12.0+0.0)x345.0, glue set 12.0fil
+...\glue 0.0 plus 1.0fil
+...\hbox(0.0+0.0)x345.0
+....\hbox(0.0+0.0)x345.0
+..\glue 25.0
+..\glue(\lineskip) 0.0
+..\vbox(598.0+0.0)x345.0, glue set 503.24626fil
+...\write-{}
+...\glue(\topskip) 0.0
+...\hbox(14.9+9.9)x345.0, glue set 170.25569fil
+....\hbox(0.0+0.0)x15.0
+....\hbox(14.9+9.9)x151.41096
+.....\mathon
+.....\vbox(14.9+9.9)x151.41096
+......\rule(0.4+0.0)x151.41096
+......\hbox(16.79993+7.20007)x151.41096
+.......\glue(\tabskip) 0.0
+.......\hbox(16.79993+7.20007)x41.25273
+........\rule(16.79993+7.20007)x0.0
+........\rule(*+*)x0.4
+........\glue 6.0
+........\vbox(16.79993+7.20007)x28.45274
+.........\hbox(16.79993+7.20007)x28.45274, glue set 2.06378fil
+..........\hbox(0.0+0.0)x0.0
+..........\rule(16.79993+*)x0.0
+..........\OT1/cmr/m/n/10 A
+..........\OT1/cmr/m/n/10 l
+..........\OT1/cmr/m/n/10 p
+..........\OT1/cmr/m/n/10 h
+..........\OT1/cmr/m/n/10 a
+..........\penalty 10000
+..........\rule(0.0+7.20007)x0.0
+..........\penalty 10000
+..........\glue(\parfillskip) 0.0 plus 1.0fil
+..........\glue(\rightskip) 0.0
+........\glue 0.0 plus 1.0fil
+........\glue 6.0
+........\rule(*+*)x0.4
+.......\glue(\tabskip) 0.0
+.......\hbox(16.79993+7.20007)x40.85274
+........\glue 6.0
+........\glue 0.0 plus 1.0fil
+........\vbox(16.79993+7.20007)x28.45274
+.........\hbox(16.79993+7.20007)x28.45274, glue set 8.03603fil
+..........\hbox(0.0+0.0)x0.0
+..........\rule(16.79993+*)x0.0
+..........\OT1/cmr/m/n/10 B
+..........\OT1/cmr/m/n/10 e
+..........\OT1/cmr/m/n/10 t
+..........\OT1/cmr/m/n/10 a
+..........\penalty 10000
+..........\rule(0.0+7.20007)x0.0
+..........\penalty 10000
+..........\glue(\parfillskip) 0.0 plus 1.0fil
+..........\glue(\rightskip) 0.0
+........\glue 6.0
+........\rule(*+*)x0.4
+.......\glue(\tabskip) 0.0
+.......\hbox(16.79993+7.20007)x69.3055
+........\glue 6.0
+........\vbox(16.79993+7.20007)x56.9055
+.........\hbox(16.79993+7.20007)x56.9055, glue set 22.39153fil
+..........\hbox(0.0+0.0)x0.0
+..........\rule(16.79993+*)x0.0
+..........\OT1/cmr/m/n/10 G
+..........\OT1/cmr/m/n/10 a
+..........\OT1/cmr/m/n/10 m
+..........\OT1/cmr/m/n/10 m
+..........\OT1/cmr/m/n/10 a
+..........\penalty 10000
+..........\rule(0.0+7.20007)x0.0
+..........\penalty 10000
+..........\glue(\parfillskip) 0.0 plus 1.0fil
+..........\glue(\rightskip) 0.0
+........\glue 0.0 plus 1.0fil
+........\glue 6.0
+........\rule(*+*)x0.4
+.......\glue(\tabskip) 0.0
+......\rule(0.4+0.0)x151.41096
+.....\mathoff
+....\glue 3.33333 plus 1.66666 minus 1.11111
+....\OT1/cmr/m/n/10 2
+....\penalty 10000
+....\glue(\parfillskip) 0.0 plus 1.0fil
+....\glue(\rightskip) 0.0
+...\glue 12.0 plus 4.0 minus 4.0
+...\glue 0.0
+...\glue(\parskip) 0.0 plus 1.0
+...\glue(\parskip) 0.0
+...\glue(\lineskip) 1.0
+...\hbox(8.9+3.9)x345.0, glue set 170.25569fil
+....\hbox(0.0+0.0)x15.0
+....\hbox(8.9+3.9)x151.41096
+.....\mathon
+.....\vbox(8.9+3.9)x151.41096
+......\rule(0.4+0.0)x151.41096
+......\hbox(8.39996+3.60004)x151.41096
+.......\glue(\tabskip) 0.0
+.......\hbox(8.39996+3.60004)x41.25273
+........\rule(8.39996+3.60004)x0.0
+........\rule(*+*)x0.4
+........\glue 6.0
+........\vbox(8.39996+3.60004)x28.45274
+.........\hbox(8.39996+3.60004)x28.45274, glue set 2.06378fil
+..........\hbox(0.0+0.0)x0.0
+..........\rule(8.39996+*)x0.0
+..........\OT1/cmr/m/n/10 A
+..........\OT1/cmr/m/n/10 l
+..........\OT1/cmr/m/n/10 p
+..........\OT1/cmr/m/n/10 h
+..........\OT1/cmr/m/n/10 a
+..........\penalty 10000
+..........\rule(0.0+3.60004)x0.0
+..........\penalty 10000
+..........\glue(\parfillskip) 0.0 plus 1.0fil
+..........\glue(\rightskip) 0.0
+........\glue 0.0 plus 1.0fil
+........\glue 6.0
+........\rule(*+*)x0.4
+.......\glue(\tabskip) 0.0
+.......\hbox(8.39996+3.60004)x40.85274
+........\glue 6.0
+........\glue 0.0 plus 1.0fil
+........\vbox(8.39996+3.60004)x28.45274
+.........\hbox(8.39996+3.60004)x28.45274, glue set 8.03603fil
+..........\hbox(0.0+0.0)x0.0
+..........\rule(8.39996+*)x0.0
+..........\OT1/cmr/m/n/10 B
+..........\OT1/cmr/m/n/10 e
+..........\OT1/cmr/m/n/10 t
+..........\OT1/cmr/m/n/10 a
+..........\penalty 10000
+..........\rule(0.0+3.60004)x0.0
+..........\penalty 10000
+..........\glue(\parfillskip) 0.0 plus 1.0fil
+..........\glue(\rightskip) 0.0
+........\glue 6.0
+........\rule(*+*)x0.4
+.......\glue(\tabskip) 0.0
+.......\hbox(8.39996+3.60004)x69.3055
+........\glue 6.0
+........\vbox(8.39996+3.60004)x56.9055
+.........\hbox(8.39996+3.60004)x56.9055, glue set 22.39153fil
+..........\hbox(0.0+0.0)x0.0
+..........\rule(8.39996+*)x0.0
+..........\OT1/cmr/m/n/10 G
+..........\OT1/cmr/m/n/10 a
+..........\OT1/cmr/m/n/10 m
+..........\OT1/cmr/m/n/10 m
+..........\OT1/cmr/m/n/10 a
+..........\penalty 10000
+..........\rule(0.0+3.60004)x0.0
+..........\penalty 10000
+..........\glue(\parfillskip) 0.0 plus 1.0fil
+..........\glue(\rightskip) 0.0
+........\glue 0.0 plus 1.0fil
+........\glue 6.0
+........\rule(*+*)x0.4
+.......\glue(\tabskip) 0.0
+......\rule(0.4+0.0)x151.41096
+.....\mathoff
+....\glue 3.33333 plus 1.66666 minus 1.11111
+....\OT1/cmr/m/n/10 1
+....\penalty 10000
+....\glue(\parfillskip) 0.0 plus 1.0fil
+....\glue(\rightskip) 0.0
+...\glue 12.0 plus 4.0 minus 4.0
+...\glue 0.0
+...\glue(\parskip) 0.0 plus 1.0
+...\glue(\parskip) 0.0
+...\glue(\baselineskip) 0.75557
+...\hbox(7.34444+2.34444)x345.0, glue set 162.47789fil
+....\hbox(0.0+0.0)x15.0
+....\hbox(7.34444+2.34444)x151.41096
+.....\mathon
+.....\vbox(7.34444+2.34444)x151.41096
+......\rule(0.4+0.0)x151.41096
+......\hbox(6.94444+1.94444)x151.41096
+.......\glue(\tabskip) 0.0
+.......\hbox(6.94444+1.94444)x41.25273
+........\rule(4.19998+1.80002)x0.0
+........\rule(*+*)x0.4
+........\glue 6.0
+........\vbox(6.94444+1.94444)x28.45274
+.........\hbox(6.94444+1.94444)x28.45274, glue set 2.06378fil
+..........\hbox(0.0+0.0)x0.0
+..........\rule(4.19998+*)x0.0
+..........\OT1/cmr/m/n/10 A
+..........\OT1/cmr/m/n/10 l
+..........\OT1/cmr/m/n/10 p
+..........\OT1/cmr/m/n/10 h
+..........\OT1/cmr/m/n/10 a
+..........\penalty 10000
+..........\rule(0.0+1.80002)x0.0
+..........\penalty 10000
+..........\glue(\parfillskip) 0.0 plus 1.0fil
+..........\glue(\rightskip) 0.0
+........\glue 0.0 plus 1.0fil
+........\glue 6.0
+........\rule(*+*)x0.4
+.......\glue(\tabskip) 0.0
+.......\hbox(6.94444+1.94444)x40.85274
+........\glue 6.0
+........\glue 0.0 plus 1.0fil
+........\vbox(6.83331+1.80002)x28.45274
+.........\hbox(6.83331+1.80002)x28.45274, glue set 8.03603fil
+..........\hbox(0.0+0.0)x0.0
+..........\rule(4.19998+*)x0.0
+..........\OT1/cmr/m/n/10 B
+..........\OT1/cmr/m/n/10 e
+..........\OT1/cmr/m/n/10 t
+..........\OT1/cmr/m/n/10 a
+..........\penalty 10000
+..........\rule(0.0+1.80002)x0.0
+..........\penalty 10000
+..........\glue(\parfillskip) 0.0 plus 1.0fil
+..........\glue(\rightskip) 0.0
+........\glue 6.0
+........\rule(*+*)x0.4
+.......\glue(\tabskip) 0.0
+.......\hbox(6.94444+1.94444)x69.3055
+........\glue 6.0
+........\vbox(6.83331+1.80002)x56.9055
+.........\hbox(6.83331+1.80002)x56.9055, glue set 22.39153fil
+..........\hbox(0.0+0.0)x0.0
+..........\rule(4.19998+*)x0.0
+..........\OT1/cmr/m/n/10 G
+..........\OT1/cmr/m/n/10 a
+..........\OT1/cmr/m/n/10 m
+..........\OT1/cmr/m/n/10 m
+..........\OT1/cmr/m/n/10 a
+..........\penalty 10000
+..........\rule(0.0+1.80002)x0.0
+..........\penalty 10000
+..........\glue(\parfillskip) 0.0 plus 1.0fil
+..........\glue(\rightskip) 0.0
+........\glue 0.0 plus 1.0fil
+........\glue 6.0
+........\rule(*+*)x0.4
+.......\glue(\tabskip) 0.0
+......\rule(0.4+0.0)x151.41096
+.....\mathoff
+....\glue 3.33333 plus 1.66666 minus 1.11111
+....\OT1/cmr/m/n/10 0
+....\OT1/cmr/m/n/10 .
+....\OT1/cmr/m/n/10 5
+....\penalty 10000
+....\glue(\parfillskip) 0.0 plus 1.0fil
+....\glue(\rightskip) 0.0
+...\glue 12.0 plus 4.0 minus 4.0
+...\glue 0.0
+...\glue(\parskip) 0.0 plus 1.0
+...\glue(\parskip) 0.0
+...\glue(\baselineskip) 2.31113
+...\hbox(7.34444+2.34444)x345.0, glue set 170.25569fil
+....\hbox(0.0+0.0)x15.0
+....\hbox(7.34444+2.34444)x151.41096
+.....\mathon
+.....\vbox(7.34444+2.34444)x151.41096
+......\rule(0.4+0.0)x151.41096
+......\hbox(6.94444+1.94444)x151.41096
+.......\glue(\tabskip) 0.0
+.......\hbox(6.94444+1.94444)x41.25273
+........\rule(0.0+0.0)x0.0
+........\rule(*+*)x0.4
+........\glue 6.0
+........\vbox(6.94444+1.94444)x28.45274
+.........\hbox(6.94444+1.94444)x28.45274, glue set 2.06378fil
+..........\hbox(0.0+0.0)x0.0
+..........\rule(0.0+*)x0.0
+..........\OT1/cmr/m/n/10 A
+..........\OT1/cmr/m/n/10 l
+..........\OT1/cmr/m/n/10 p
+..........\OT1/cmr/m/n/10 h
+..........\OT1/cmr/m/n/10 a
+..........\penalty 10000
+..........\rule(0.0+0.0)x0.0
+..........\penalty 10000
+..........\glue(\parfillskip) 0.0 plus 1.0fil
+..........\glue(\rightskip) 0.0
+........\glue 0.0 plus 1.0fil
+........\glue 6.0
+........\rule(*+*)x0.4
+.......\glue(\tabskip) 0.0
+.......\hbox(6.94444+1.94444)x40.85274
+........\glue 6.0
+........\glue 0.0 plus 1.0fil
+........\vbox(6.83331+0.0)x28.45274
+.........\hbox(6.83331+0.0)x28.45274, glue set 8.03603fil
+..........\hbox(0.0+0.0)x0.0
+..........\rule(0.0+*)x0.0
+..........\OT1/cmr/m/n/10 B
+..........\OT1/cmr/m/n/10 e
+..........\OT1/cmr/m/n/10 t
+..........\OT1/cmr/m/n/10 a
+..........\penalty 10000
+..........\rule(0.0+0.0)x0.0
+..........\penalty 10000
+..........\glue(\parfillskip) 0.0 plus 1.0fil
+..........\glue(\rightskip) 0.0
+........\glue 6.0
+........\rule(*+*)x0.4
+.......\glue(\tabskip) 0.0
+.......\hbox(6.94444+1.94444)x69.3055
+........\glue 6.0
+........\vbox(6.83331+0.0)x56.9055
+.........\hbox(6.83331+0.0)x56.9055, glue set 22.39153fil
+..........\hbox(0.0+0.0)x0.0
+..........\rule(0.0+*)x0.0
+..........\OT1/cmr/m/n/10 G
+..........\OT1/cmr/m/n/10 a
+..........\OT1/cmr/m/n/10 m
+..........\OT1/cmr/m/n/10 m
+..........\OT1/cmr/m/n/10 a
+..........\penalty 10000
+..........\rule(0.0+0.0)x0.0
+..........\penalty 10000
+..........\glue(\parfillskip) 0.0 plus 1.0fil
+..........\glue(\rightskip) 0.0
+........\glue 0.0 plus 1.0fil
+........\glue 6.0
+........\rule(*+*)x0.4
+.......\glue(\tabskip) 0.0
+......\rule(0.4+0.0)x151.41096
+.....\mathoff
+....\glue 3.33333 plus 1.66666 minus 1.11111
+....\OT1/cmr/m/n/10 0
+....\penalty 10000
+....\glue(\parfillskip) 0.0 plus 1.0fil
+....\glue(\rightskip) 0.0
+...\glue -2.34444
+...\glue 0.0 plus 1.0fil
+...\glue 0.0
+...\glue 0.0 plus 0.0001fil
+..\glue(\baselineskip) 23.55556
+..\hbox(6.44444+0.0)x345.0
+...\hbox(6.44444+0.0)x345.0, glue set 170.0fil
+....\glue 0.0 plus 1.0fil
+....\OT1/cmr/m/n/10 1
+....\glue 0.0 plus 1.0fil
+(github-0776.aux)





More information about the latex3-commits mailing list.