[latex3-commits] [git/LaTeX3-latex3-latex2e] master: fix for github issue #72 (45a7f99)

Frank Mittelbach frank.mittelbach at latex-project.org
Thu Sep 13 17:52:45 CEST 2018


Repository : https://github.com/latex3/latex2e
On branch  : master
Link       : https://github.com/latex3/latex2e/commit/45a7f99bc5bbef1e2eda57305b550622a6b5fe4e

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

commit 45a7f99bc5bbef1e2eda57305b550622a6b5fe4e
Author: Frank Mittelbach <frank.mittelbach at latex-project.org>
Date:   Thu Sep 13 17:52:45 2018 +0200

    fix for github issue #72


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

45a7f99bc5bbef1e2eda57305b550622a6b5fe4e
 required/tools/array.dtx                 |   11 +-
 required/tools/changes.txt               |    5 +
 required/tools/testfiles/github-0072.lvt |   33 +++++
 required/tools/testfiles/github-0072.tlg |  229 ++++++++++++++++++++++++++++++
 4 files changed, 273 insertions(+), 5 deletions(-)

diff --git a/required/tools/array.dtx b/required/tools/array.dtx
index d8f3687..d766d78 100644
--- a/required/tools/array.dtx
+++ b/required/tools/array.dtx
@@ -32,7 +32,7 @@
 %<+package>\DeclareCurrentRelease{}{2018-04-30}
 %<+package>
 %<+package>\ProvidesPackage{array}
-%<+package>         [2018/04/30 v2.4h Tabular extension package (FMi)]
+%<+package>         [2018/09/13 v2.4i Tabular extension package (FMi)]
 %
 % \fi
 %
@@ -1593,7 +1593,6 @@
 %    mode. Therefore we start with a~=$=.
 % \changes{v2.4f}{2017/11/04}{Managing m-cells without \cs{vcenter}}
 %    \begin{macrocode}
-%   $\vcenter
     \setbox\ar at mcellbox\vbox 
 %    \end{macrocode}
 %    The part of the templates which is the same in all three cases
@@ -1608,9 +1607,8 @@
 % \changes{v2.4e}{2016/10/07}{Fixing SX68732}
 % \changes{v2.4f}{2017/11/04}{Managing m-cells without \cs{vcenter}}
 %    \begin{macrocode}
-       \@startpbox{\@nextchar}\insert at column \@endpbox 
+    \@startpbox{\@nextchar}\insert at column \@endpbox 
     \ar at align@mcell
-%$
     \do at row@strut \or
 %    \end{macrocode}
 %    The templates for \texttt{p} and \texttt{b} are generated in the
@@ -1868,8 +1866,10 @@
 %    The width of the \textsf{parbox} is passed as an argument.
 %    =\vcenter=, =\vtop= or =\vbox= are already in the
 %    preamble. So we start with the braces for the wanted box.
+% \changes{v2.4i}{2018/09/13}{Add group to prevent color leak (gh/72)}
 %    \begin{macrocode}
 \def\@startpbox#1{\bgroup
+  \color at begingroup
 %    \end{macrocode}
 %    The argument is the width of the box. This information has to be
 %    assigned to =\hsize=.
@@ -1917,8 +1917,9 @@
 %    =\@startpbox=.
 % \changes{v2.2d}{1994/05/16}{Use \LaTeXe \cs{@finalstrut}}
 % \changes{v2.3g}{1996/05/07}{Add \cs{hfil} for tools/2120}
+% \changes{v2.4i}{2018/09/13}{Add group to prevent color leak (gh/72)}
 %    \begin{macrocode}
-\def\@endpbox{\@finalstrut\@arstrutbox \egroup\hfil}
+\def\@endpbox{\@finalstrut\@arstrutbox \color at endgroup \egroup\hfil}
 %    \end{macrocode}
 % \end{macro}
 %
diff --git a/required/tools/changes.txt b/required/tools/changes.txt
index 5f1af86..fbf8d19 100644
--- a/required/tools/changes.txt
+++ b/required/tools/changes.txt
@@ -5,6 +5,11 @@ completeness or accuracy and it contains some references to files that
 are not part of the distribution.
 =======================================================================
 
+2018-09-13  Frank Mittelbach  <Frank.Mittelbach at latex-project.org>
+
+	* array.dtx (section{The macros \@classz):
+	Add group to prevent color leak (gh/72)
+
 2018-06-26  Frank Mittelbach  <Frank.Mittelbach at latex-project.org>
 
 	* multicol.dtx (subsection{Not balancing the columns}):
diff --git a/required/tools/testfiles/github-0072.lvt b/required/tools/testfiles/github-0072.lvt
new file mode 100644
index 0000000..bd99f1c
--- /dev/null
+++ b/required/tools/testfiles/github-0072.lvt
@@ -0,0 +1,33 @@
+% https://github.com/latex3/latex2e/issues/72
+%
+% no color leak please
+
+\documentclass[10pt]{article}
+
+\usepackage{color}
+\usepackage{array}
+
+\input{test2e}
+
+\showoutput
+
+\begin{document}
+
+\START
+
+    \begin{tabular}{|*{3}{>{\centering}p{1cm}|}}
+        \hline \leavevmode\color{red}A&B\linebreak B&C\tabularnewline \hline
+    \end{tabular}
+
+    Some blablah...
+
+    \begin{tabular}{|*{3}{>{\centering}m{1cm}|}}
+        \hline \leavevmode\color{blue}A&B\linebreak B&C\tabularnewline \hline
+    \end{tabular}
+
+    Some blablah...
+\end{document}
+
+
+
+
diff --git a/required/tools/testfiles/github-0072.tlg b/required/tools/testfiles/github-0072.tlg
new file mode 100644
index 0000000..708fba8
--- /dev/null
+++ b/required/tools/testfiles/github-0072.tlg
@@ -0,0 +1,229 @@
+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(633.0+0.0)x407.0
+.\glue 16.0
+.\vbox(617.0+0.0)x345.0, shifted 62.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
+....\special{color push  Black}
+....\hbox(0.0+0.0)x345.0
+....\special{color pop}
+..\glue 25.0
+..\glue(\lineskip) 0.0
+..\vbox(550.0+0.0)x345.0, glue set 483.4595fil
+...\write-{}
+...\glue(\topskip) 0.0
+...\hbox(14.9+9.9)x345.0, glue set 207.0418fil
+....\hbox(0.0+0.0)x15.0
+....\hbox(14.9+9.9)x122.9582
+.....\mathon
+.....\vbox(14.9+9.9)x122.9582
+......\rule(0.4+0.0)x122.9582
+......\hbox(8.39996+15.60004)x122.9582
+.......\glue(\tabskip) 0.0
+.......\hbox(8.39996+15.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 10.47636fil
+..........\glue(\leftskip) 0.0 plus 1.0fil
+..........\hbox(0.0+0.0)x0.0
+..........\rule(8.39996+*)x0.0
+..........\special{color push rgb 1 0 0}
+..........\OT1/cmr/m/n/10 A
+..........\penalty 10000
+..........\rule(0.0+3.60004)x0.0
+..........\penalty 10000
+..........\glue(\parfillskip) 0.0
+..........\glue(\rightskip) 0.0 plus 1.0fil
+.........\special{color pop}
+........\glue 0.0 plus 1.0fil
+........\glue 6.0
+........\rule(*+*)x0.4
+.......\glue(\tabskip) 0.0
+.......\hbox(8.39996+15.60004)x40.85274
+........\glue 6.0
+........\vbox(8.39996+15.60004)x28.45274
+.........\hbox(8.39996+0.0)x28.45274, glue set 10.6847fil
+..........\glue(\leftskip) 0.0 plus 1.0fil
+..........\hbox(0.0+0.0)x0.0
+..........\rule(8.39996+*)x0.0
+..........\OT1/cmr/m/n/10 B
+..........\penalty -10000
+..........\glue(\rightskip) 0.0 plus 1.0fil
+.........\penalty 300
+.........\glue(\baselineskip) 5.16669
+.........\hbox(6.83331+3.60004)x28.45274, glue set 10.6847fil
+..........\glue(\leftskip) 0.0 plus 1.0fil
+..........\OT1/cmr/m/n/10 B
+..........\penalty 10000
+..........\rule(0.0+3.60004)x0.0
+..........\penalty 10000
+..........\glue(\parfillskip) 0.0
+..........\glue(\rightskip) 0.0 plus 1.0fil
+........\glue 0.0 plus 1.0fil
+........\glue 6.0
+........\rule(*+*)x0.4
+.......\glue(\tabskip) 0.0
+.......\hbox(8.39996+15.60004)x40.85274
+........\glue 6.0
+........\vbox(8.39996+3.60004)x28.45274
+.........\hbox(8.39996+3.60004)x28.45274, glue set 10.61526fil
+..........\glue(\leftskip) 0.0 plus 1.0fil
+..........\hbox(0.0+0.0)x0.0
+..........\rule(8.39996+*)x0.0
+..........\OT1/cmr/m/n/10 C
+..........\penalty 10000
+..........\rule(0.0+3.60004)x0.0
+..........\penalty 10000
+..........\glue(\parfillskip) 0.0
+..........\glue(\rightskip) 0.0 plus 1.0fil
+........\glue 0.0 plus 1.0fil
+........\glue 6.0
+........\rule(*+*)x0.4
+.......\glue(\tabskip) 0.0
+......\rule(0.4+0.0)x122.9582
+.....\mathoff
+....\penalty 10000
+....\glue(\parfillskip) 0.0 plus 1.0fil
+....\glue(\rightskip) 0.0
+...\glue(\parskip) 0.0 plus 1.0
+...\glue(\lineskip) 1.0
+...\hbox(6.94444+0.0)x345.0, glue set 262.7776fil
+....\hbox(0.0+0.0)x15.0
+....\OT1/cmr/m/n/10 S
+....\OT1/cmr/m/n/10 o
+....\OT1/cmr/m/n/10 m
+....\OT1/cmr/m/n/10 e
+....\glue 3.33333 plus 1.66666 minus 1.11111
+....\OT1/cmr/m/n/10 b
+....\OT1/cmr/m/n/10 l
+....\OT1/cmr/m/n/10 a
+....\OT1/cmr/m/n/10 b
+....\OT1/cmr/m/n/10 l
+....\OT1/cmr/m/n/10 a
+....\OT1/cmr/m/n/10 h
+....\OT1/cmr/m/n/10 .
+....\OT1/cmr/m/n/10 .
+....\OT1/cmr/m/n/10 .
+....\penalty 10000
+....\glue(\parfillskip) 0.0 plus 1.0fil
+....\glue(\rightskip) 0.0
+...\glue(\parskip) 0.0 plus 1.0
+...\glue(\lineskip) 1.0
+...\hbox(14.9+9.9)x345.0, glue set 207.0418fil
+....\hbox(0.0+0.0)x15.0
+....\hbox(14.9+9.9)x122.9582
+.....\mathon
+.....\vbox(14.9+9.9)x122.9582
+......\rule(0.4+0.0)x122.9582
+......\hbox(14.39996+9.60004)x122.9582
+.......\glue(\tabskip) 0.0
+.......\hbox(14.39996+9.60004)x41.25273
+........\rule(8.39996+3.60004)x0.0
+........\rule(*+*)x0.4
+........\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 10.47636fil
+..........\glue(\leftskip) 0.0 plus 1.0fil
+..........\hbox(0.0+0.0)x0.0
+..........\rule(8.39996+*)x0.0
+..........\special{color push rgb 0 0 1}
+..........\OT1/cmr/m/n/10 A
+..........\penalty 10000
+..........\rule(0.0+3.60004)x0.0
+..........\penalty 10000
+..........\glue(\parfillskip) 0.0
+..........\glue(\rightskip) 0.0 plus 1.0fil
+.........\special{color pop}
+........\glue 6.0
+........\rule(*+*)x0.4
+.......\glue(\tabskip) 0.0
+.......\hbox(14.39996+9.60004)x40.85274
+........\glue 6.0
+........\glue 0.0 plus 1.0fil
+........\vbox(20.39996+3.60004)x28.45274, shifted 6.0
+.........\hbox(8.39996+0.0)x28.45274, glue set 10.6847fil
+..........\glue(\leftskip) 0.0 plus 1.0fil
+..........\hbox(0.0+0.0)x0.0
+..........\rule(8.39996+*)x0.0
+..........\OT1/cmr/m/n/10 B
+..........\penalty -10000
+..........\glue(\rightskip) 0.0 plus 1.0fil
+.........\penalty 300
+.........\glue(\baselineskip) 5.16669
+.........\hbox(6.83331+3.60004)x28.45274, glue set 10.6847fil
+..........\glue(\leftskip) 0.0 plus 1.0fil
+..........\OT1/cmr/m/n/10 B
+..........\penalty 10000
+..........\rule(0.0+3.60004)x0.0
+..........\penalty 10000
+..........\glue(\parfillskip) 0.0
+..........\glue(\rightskip) 0.0 plus 1.0fil
+........\glue 6.0
+........\rule(*+*)x0.4
+.......\glue(\tabskip) 0.0
+.......\hbox(14.39996+9.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 10.61526fil
+..........\glue(\leftskip) 0.0 plus 1.0fil
+..........\hbox(0.0+0.0)x0.0
+..........\rule(8.39996+*)x0.0
+..........\OT1/cmr/m/n/10 C
+..........\penalty 10000
+..........\rule(0.0+3.60004)x0.0
+..........\penalty 10000
+..........\glue(\parfillskip) 0.0
+..........\glue(\rightskip) 0.0 plus 1.0fil
+........\glue 6.0
+........\rule(*+*)x0.4
+.......\glue(\tabskip) 0.0
+......\rule(0.4+0.0)x122.9582
+.....\mathoff
+....\penalty 10000
+....\glue(\parfillskip) 0.0 plus 1.0fil
+....\glue(\rightskip) 0.0
+...\glue(\parskip) 0.0 plus 1.0
+...\glue(\lineskip) 1.0
+...\hbox(6.94444+0.0)x345.0, glue set 262.7776fil
+....\hbox(0.0+0.0)x15.0
+....\OT1/cmr/m/n/10 S
+....\OT1/cmr/m/n/10 o
+....\OT1/cmr/m/n/10 m
+....\OT1/cmr/m/n/10 e
+....\glue 3.33333 plus 1.66666 minus 1.11111
+....\OT1/cmr/m/n/10 b
+....\OT1/cmr/m/n/10 l
+....\OT1/cmr/m/n/10 a
+....\OT1/cmr/m/n/10 b
+....\OT1/cmr/m/n/10 l
+....\OT1/cmr/m/n/10 a
+....\OT1/cmr/m/n/10 h
+....\OT1/cmr/m/n/10 .
+....\OT1/cmr/m/n/10 .
+....\OT1/cmr/m/n/10 .
+....\penalty 10000
+....\glue(\parfillskip) 0.0 plus 1.0fil
+....\glue(\rightskip) 0.0
+...\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
+...\special{color push  Black}
+...\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
+...\special{color pop}
+(github-0072.aux)





More information about the latex3-commits mailing list