diff options
author | Karl Berry <karl@freefriends.org> | 2020-10-02 21:49:18 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2020-10-02 21:49:18 +0000 |
commit | 5255c37137345163348d22ab46af2304cf9f55a6 (patch) | |
tree | 88246497477ddcc26834e5708566ad4c1c862a19 /Master/texmf-dist/source/latex/tools/array.dtx | |
parent | 1922ba4684a59cde742dcef9ed152381d2d7b110 (diff) |
latex2e (2oct20)
git-svn-id: svn://tug.org/texlive/trunk@56514 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/tools/array.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/tools/array.dtx | 83 |
1 files changed, 61 insertions, 22 deletions
diff --git a/Master/texmf-dist/source/latex/tools/array.dtx b/Master/texmf-dist/source/latex/tools/array.dtx index acfa5609373..ff963d7f514 100644 --- a/Master/texmf-dist/source/latex/tools/array.dtx +++ b/Master/texmf-dist/source/latex/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} |