summaryrefslogtreecommitdiff
path: root/macros/latex/required/tools/array.dtx
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2020-10-03 03:01:09 +0000
committerNorbert Preining <norbert@preining.info>2020-10-03 03:01:09 +0000
commit0e644e6805342838052f46e6af93f81644d0390b (patch)
tree26169230ce62dc353013ad08fb824f46d9511980 /macros/latex/required/tools/array.dtx
parent37f9a57b2f39142fbccb20b758af8e0502499671 (diff)
CTAN sync 202010030301
Diffstat (limited to 'macros/latex/required/tools/array.dtx')
-rw-r--r--macros/latex/required/tools/array.dtx83
1 files changed, 61 insertions, 22 deletions
diff --git a/macros/latex/required/tools/array.dtx b/macros/latex/required/tools/array.dtx
index acfa560937..ff963d7f51 100644
--- a/macros/latex/required/tools/array.dtx
+++ b/macros/latex/required/tools/array.dtx
@@ -29,10 +29,11 @@
%<+package>\providecommand\DeclareCurrentRelease[2]{}
%<+package>
%<+package>\DeclareRelease{}{2016-10-06}{array-2016-10-06.sty}
-%<+package>\DeclareCurrentRelease{}{2019-10-01}
+%<+package>\DeclareRelease{v2.4}{2020-02-10}{array-2020-02-10.sty}
+%<+package>\DeclareCurrentRelease{}{2020-10-01}
%<+package>
%<+package>\ProvidesPackage{array}
-%<+package> [2019/08/31 v2.4l Tabular extension package (FMi)]
+%<+package> [2020/10/01 v2.5c Tabular extension package (FMi)]
%
% \fi
%
@@ -551,14 +552,16 @@
% \item rules can be placed between columns or rows thereby enlarging
% the table.
% \end{enumerate}
-% \texttt{array.sty} implements the second possibility while the
-% default implementation in the \LaTeX{} kernel implements the first
-% concept. Both concepts have their merits but one has to be aware of
-% the individual implications.
+% For vertical rules \texttt{array.sty} implements the second
+% possibility while the default implementation in the \LaTeX{} kernel
+% implements the first concept.
+% Both concepts have their merits but
+% one has to be aware of the individual implications.
% \begin{itemize}
% \item
-% With standard \LaTeX{} adding rules to a table will not affect the
-% width or height of the table (unless double rules are used), e.g.,
+% With standard \LaTeX{} adding vertical rules to a table will
+% not affect the
+% width of the table (unless double rules are used), e.g.,
% changing a preamble from \verb=lll= to \verb=l|l|l= does not
% affect the document other than adding rules to the table. In
% contrast, with \texttt{array.sty} a table that just fit the
@@ -601,6 +604,12 @@
% \end{center}
% \end{itemize}
%
+% Horizontal rules produced with \cs{hline} add to the table height in
+% both implementations but they differ in handling double \cs{hline}s.
+% In contrast a \cs{cline} does not change the table
+% height.\footnote{All a bit inconsistent, but nothing that can be
+% changed after being 30+ years in existence.}
+%
% \subsection{Comparisons with older versions of \texttt{array.sty}}
%
% There are some differences in the way version 2.1 treats incorrect
@@ -730,7 +739,11 @@
\NeedsTeXFormat{LaTeX2e}[1995/12/01]
\documentclass{ltxdoc}
-\AtBeginDocument{\DeleteShortVerb{\|}} % undo the default is not used
+% undo the default is not used:
+
+\IfFormatAtLeastTF {2020/10/01}
+ {\AtBeginDocument[ltxdoc]{\DeleteShortVerb{\|}} }
+ {\AtBeginDocument{\DeleteShortVerb{\|}} }
\usepackage{array}
@@ -746,6 +759,7 @@
%\OnlyDescription % comment out for implementation details
%\OldMakeindex % use if your MakeIndex is pre-v2.9
+
\begin{document}
\DocInput{array.dtx}
\end{document}
@@ -2206,8 +2220,13 @@
\let\do@row@strut\relax
% \end{macrocode}
%
+% \cs{@yargarraycr} is the same as in the \LaTeX{} kernel
+% (depending on the date of the kernel with one of the two
+% definitions below). We therefore do not define it again.
+% \changes{v2.5b}{2020/04/22}{Don't define \cs{@yargarraycr} unnecessarily}
% \begin{macrocode}
-\def\@yargarraycr#1{\cr\noalign{\vskip #1}}
+%\def\@yargarraycr#1{\cr\noalign{\@vspace@calcify{#1}}} % 2020-10-01
+%\def\@yargarraycr#1{\cr\noalign{\vskip #1}}
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -2916,10 +2935,13 @@
%
% We start by producing a single tabular row without any visible
% content that will produce the external reference point in case
-% "[t]" is used.
+% "[t]" is used. We need to suppress the \cs{tabcolsep} in the
+% \cs{multicolumn} in case there wasn't any in the real column.
+%
+% \changes{v2.5c}{2020/07/20}{Suppress all column space (gh/322)}
% \begin{macrocode}
\newcommand{\firsthline}{%
- \multicolumn1c{%
+ \multicolumn1{@{}c@{}}{%
% \end{macrocode}
% Within this row we calculate "\backup@length" to be the height
% plus depth of a standard line. In addition we have to add the
@@ -2936,6 +2958,10 @@
% \begin{macrocode}
\raise\extratabsurround\copy\@arstrutbox
% \end{macrocode}
+% And we should also cancel the guard otherwise we end up with two.
+% \begin{macrocode}
+ \kern-1sp%
+% \end{macrocode}
% Having done all this we end the line and back up by the value of
% "\backup@length" and then finally place our "\hline". This should
% place the line exactly at the right place but keep the reference
@@ -2957,9 +2983,12 @@
% depth of this last line increased by "\extratabsurround" without
% changing the placement "\hline".
%
-% We start by placing the rule followed by an invisible row.
+% We start by placing the rule followed by an invisible row. We
+% need to suppress the \cs{tabcolsep} in the multicol in case there
+% wasn't any in the real column.
+% \changes{v2.5c}{2020/07/20}{Suppress all column space (gh/322)}
% \begin{macrocode}
-\newcommand{\lasthline}{\hline\multicolumn1c{%
+\newcommand{\lasthline}{\hline\multicolumn1{@{}c@{}}{%
% \end{macrocode}
% We now calculate "\backup@length" to be the height and depth of
% two lines plus the width of the rule.
@@ -2977,8 +3006,9 @@
% reference for the whole tabular). Since this row is invisible we
% can enlarge its depth by the desired amount.
% \begin{macrocode}
- \multicolumn1c{%
+ \multicolumn1{@{}c@{}}{%
\lower\extratabsurround\copy\@arstrutbox
+ \kern-1sp%
}%
}
% \end{macrocode}
@@ -3034,14 +3064,18 @@
% alignment which is either "l", "c", or "r" and the second is the
% nominal width of the column.
% \changes{v2.4f}{2017/11/07}{Column type added}
+% \changes{v2.5a}{2020/04/06}{Use \cs{d@llarbegin} and \cs{d@llarend} so
+% that cell is typeset in math mode inside \texttt{array} (gh/297)}
% \begin{macrocode}
\newcolumntype{w}[2]{%
% \end{macrocode}
% Before the cell content we start an "lrbox"-environment to
% collect the cell material into the previously allocated box
-% "\ar@cellbox".
+% "\ar@cellbox". We add \cs{d@llarbegin} (and later \cs{d@llarend})
+% so that the content is typeset in math mode if we are in an
+% \texttt{array} environment.
% \begin{macrocode}
- >{\begin{lrbox}\ar@cellbox}%
+ >{\begin{lrbox}\ar@cellbox\d@llarbegin}%
% \end{macrocode}
% Then comes a specifier for the cell content. We use "c", but
% that doesn't matter as in the end we will always put a box of a
@@ -3056,10 +3090,13 @@
% of the cell content is now in box "\ar@cellbox". As a final step we
% put that box into a "\makebox" using the optional arguments of
% that command to achieve the correct width and the desired
-% alignment within that width.
+% alignment within that width. We unbox the collected material so
+% that any stretchable glue inside can interact with the alignment.
+% \changes{v2.4m}{2020/02/10}{Unbox collected material so that
+% stretchable glue inside can act (gh/270)}
% \begin{macrocode}
- <{\end{lrbox}%
- \makebox[#2][#1]{\usebox\ar@cellbox}}}
+ <{\d@llarend \end{lrbox}%
+ \makebox[#2][#1]{\unhbox\ar@cellbox}}}
% \end{macrocode}
% \end{macro}
@@ -3069,11 +3106,13 @@
% The \texttt{W} is similar but in this case we want a warning if
% the cell content is too wide.
% \changes{v2.4f}{2017/11/07}{Column type added}
+% \changes{v2.5a}{2020/04/06}{Use \cs{d@llarbegin} and \cs{d@llarend} so
+% that cell is typeset in mathmode inside \texttt{array} (gh/297)}
% \begin{macrocode}
\newcolumntype{W}[2]
- {>{\begin{lrbox}\ar@cellbox}%
+ {>{\begin{lrbox}\ar@cellbox\d@llarbegin}%
c%
- <{\end{lrbox}%
+ <{\d@llarend\end{lrbox}%
\let\hss\hfil
\makebox[#2][#1]{\unhbox\ar@cellbox}}}
% \end{macrocode}