diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex-dev/tools/array.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex-dev/tools/array.sty | 103 |
1 files changed, 83 insertions, 20 deletions
diff --git a/Master/texmf-dist/tex/latex-dev/tools/array.sty b/Master/texmf-dist/tex/latex-dev/tools/array.sty index cd6eee6a0fc..c2fc16814a8 100644 --- a/Master/texmf-dist/tex/latex-dev/tools/array.sty +++ b/Master/texmf-dist/tex/latex-dev/tools/array.sty @@ -13,7 +13,7 @@ %% (but please observe conditions on bug reports sent to that address!) %% %% -%% Copyright (C) 1993-2023 +%% Copyright (C) 1993-2024 %% The LaTeX Project and any individual authors listed elsewhere %% in this file. %% @@ -43,13 +43,17 @@ \DeclareRelease{}{2016-10-06}{array-2016-10-06.sty} \DeclareRelease{v2.4}{2020-02-10}{array-2020-02-10.sty} -\DeclareCurrentRelease{}{2020-10-01} +\DeclareRelease{v2.5}{2023-11-01}{array-2023-11-01.sty} +\DeclareCurrentRelease{}{2024-06-01} +\NeedsTeXFormat{LaTeX2e}[2024/06/01] \ProvidesPackage{array} - [2023/10/16 v2.5g Tabular extension package (FMi)] + [2023/12/11 v2.6a Tabular extension package (FMi)] %% +\ExplSyntaxOn \def\@addtopreamble#1{\xdef\@preamble{\@preamble #1}} +\ExplSyntaxOff \def\@testpach{\@chclass \ifnum \@lastchclass=6 \@ne \@chnum \@ne \else \ifnum \@lastchclass=7 5 \else @@ -70,11 +74,12 @@ \if \@nextchar >9 \else 10 \@chnum - \if \@nextchar m\thr@@\else + \if \@nextchar m\thr@@ \else \if \@nextchar p4 \else \if \@nextchar b5 \else \z@ \@chclass \z@ \@preamerr \z@ \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi} +\ExplSyntaxOn \def\@xexpast#1*#2#3#4\@@{% \@tempcnta #2 \toks@={#1}\@temptokena={#3}% @@ -91,9 +96,27 @@ \toks\count@{}} \def\save@decl{\toks\count@ \expandafter{\@nextchar}} \def\insert@column{% + \UseTaggingSocket{tbl/cell/begin}% \the@toks \the \@tempcnta \ignorespaces \@sharp \unskip - \the@toks \the \count@ \relax} + \the@toks \the \count@ \relax + \UseTaggingSocket{tbl/cell/end}% +} +\def\insert@pcolumn{% + \UseTaggingSocket{tbl/pcell/begin}% + \the@toks \the \@tempcnta + \ignorespaces \@sharp \unskip + \the@toks \the \count@ \relax + \UseTaggingSocket{tbl/pcell/end}% +} +\def\@addamp { + \if@firstamp + \@firstampfalse + \else + \edef\@preamble{\@preamble & + \noexpand\tbl_update_cell_data: } + \fi +} \newdimen\col@sep \def\@acol{\@addtopreamble{\hskip\col@sep}} \def\@classx{% @@ -117,11 +140,11 @@ \hskip1sp\d@llarbegin \insert@column \d@llarend \do@row@strut \hfil \or \hfil\hskip1sp\d@llarbegin \insert@column \d@llarend \do@row@strut \or \setbox\ar@mcellbox\vbox - \@startpbox{\@nextchar}\insert@column \@endpbox + \@startpbox{\@nextchar}\insert@pcolumn \@endpbox \ar@align@mcell \do@row@strut \or - \vtop \@startpbox{\@nextchar}\insert@column \@endpbox\do@row@strut \or - \vbox \@startpbox{\@nextchar}\insert@column \@endpbox\do@row@strut + \vtop \@startpbox{\@nextchar}\insert@pcolumn \@endpbox\do@row@strut \or + \vbox \@startpbox{\@nextchar}\insert@pcolumn \@endpbox\do@row@strut \fi}\prepnext@tok} \newbox\ar@mcellbox @@ -159,18 +182,25 @@ \everypar{}}% } \def\@endpbox{\@finalstrut\@arstrutbox \par \color@endgroup \egroup\hfil} -\def\@array[#1]#2{% +\def\@array[#1]#2{ \@tempdima \ht \strutbox \advance \@tempdima by\extrarowheight \setbox \@arstrutbox \hbox{\vrule \@height \arraystretch \@tempdima \@depth \arraystretch \dp \strutbox \@width \z@}% + \tbl_save_outer_table_cols: \begingroup \@mkpream{#2}% - \xdef\@preamble{\noexpand \ialign \@halignto - \bgroup \@arstrut \@preamble - \tabskip \z@ \cr}% + \tbl_count_table_cols: + \xdef\@preamble{ + \noexpand \ar@ialign + \@halignto + \bgroup \@arstrut + \UseTaggingSocket{tbl/row/begin} + \tbl_init_cell_data_for_row: + \@preamble + \tabskip \z@ \cr} \endgroup \@arrayleft \if #1t\vtop \else \if#1b\vbox \else \vcenter \fi \fi @@ -178,14 +208,29 @@ \let \@sharp ##\let \protect \relax \lineskip \z@ \baselineskip \z@ - \m@th - \let\\\@arraycr \let\tabularnewline\\\let\par\@empty \@preamble} + \mathsurround \z@ + \let\\\@arraycr \let\tabularnewline\\\let\par\@empty + \UseTaggingSocket{tbl/init} + \@preamble +} +\def\ar@ialign{% + \tbl_init_cell_data_for_table: + \everycr{% + \noalign{% + \tbl_if_row_was_started:T { \UseTaggingSocket{tbl/row/end} } + \tbl_update_cell_data_for_next_row: + }% + }% + \tabskip\z@skip\halign} \def\arraybackslash{\let\\\tabularnewline} \newdimen \extrarowheight \extrarowheight=0pt \def\@arstrut{\unhcopy\@arstrutbox} -\protected\def\@arraycr{\relax\iffalse{\fi\ifnum 0=`}\fi +\protected\def\@arraycr { + \tbl_count_missing_cells:n {@arraycr} + \iffalse{\fi\ifnum 0=`}\fi \@ifstar \@xarraycr \@xarraycr} + \def\@xarraycr{\@ifnextchar [% \@argarraycr {\ifnum 0=`{}\fi\cr}} \def\@argarraycr[#1]{\ifnum0=`{}\fi\ifdim #1>\z@ @@ -199,10 +244,12 @@ \let\do@row@strut\relax \long\def\multicolumn#1#2#3{% \multispan{#1}\begingroup + \tbl_update_multicolumn_cell_data:n {#1} \def\@addamp{\if@firstamp \@firstampfalse \else \@preamerr 5\fi}% \@mkpream{#2}\@addtopreamble\@empty \endgroup + \UseTaggingSocket{tbl/colspan}{#1}% \def\@sharp{#3}% \@arstrut \@preamble \null @@ -218,10 +265,20 @@ \edef\@halignto{to\the\dimen@}\@tabular} \def\@tabular{% \leavevmode + \UseTaggingSocket{tbl/hmode/begin}% \hbox \bgroup $\col@sep\tabcolsep \let\d@llarbegin\begingroup \let\d@llarend\endgroup \@tabarray} -\def\endtabular{\endarray\m@th $\egroup} +\def\endarray { + \tbl_crcr:n{endarray} \egroup + \UseTaggingSocket{tbl/finalize} + \tbl_restore_outer_cell_data: + \egroup + \@arrayright \gdef\@preamble{}% +} +\def\endtabular{\endarray\m@th $\egroup + \UseTaggingSocket{tbl/hmode/end}% +} \expandafter\let\csname endtabular*\endcsname=\endtabular \let\@ampacol=\relax \let\@expast=\relax \let\@arrayclassiv=\relax \let\@arrayclassz=\relax @@ -237,6 +294,7 @@ >\@tempd token ignored\or %3 <\@tempd changed to !{..}\or %4 Only one column-spec. allowed.\fi}\@ehc} %5 +\ExplSyntaxOff % this is really oldstyle using \@tfor := \def\newcolumntype#1{% \edef\NC@char{\string#1}% \@ifundefined{NC@find@\NC@char}% @@ -249,6 +307,7 @@ {\PackageWarning{array}{Column \NC@char\space is already defined}}% \@namedef{NC@find@\NC@char}##1#1{\NC@{##1}}% \@ifnextchar[{\newcol@{\NC@char}}{\newcol@{\NC@char}[0]}} +\ExplSyntaxOn \def\newcol@#1[#2]#3{\expandafter\@reargdef \csname NC@rewrite@#1\endcsname[#2]{\NC@find#3}} \def\NC@#1{% @@ -265,9 +324,11 @@ \expandafter\NC@find\the\@temptokena#1\relax} \def\showcols{{\def\NC@do##1{\let\NC@do\NC@show}\the\NC@list}} \def\NC@show#1{% - \typeout{Column #1\expandafter\expandafter\expandafter\NC@strip + \typeout{Column~ #1\expandafter\expandafter\expandafter\NC@strip \expandafter\meaning\csname NC@rewrite@#1\endcsname\@@}} +\ExplSyntaxOff \def\NC@strip#1:#2->#3 #4\@@{#2 -> #4} +\ExplSyntaxOn \newtoks\NC@list \newcolumntype{*}[2]{} \long\@namedef{NC@rewrite@*}#1#2{% @@ -282,6 +343,7 @@ \let\@xexnoop\relax \def\save@decl{\toks \count@ = \expandafter\expandafter\expandafter {\expandafter\@nextchar\the\toks\count@}} +\ExplSyntaxOff % really oldstyle using \@tfor := \def\@mkpream#1{\gdef\@preamble{}\@lastchclass 4 \@firstamptrue \let\@sharp\relax \def\@startpbox##1{\unexpanded\expandafter{\expandafter @@ -311,18 +373,18 @@ \or \else \@preamerr \@ne \fi \def\the@toks{\the\toks}} +\ExplSyntaxOn \let\@classix\relax \def\@classviii{\ifnum \@lastchclass >\z@\ifnum\@lastchclass=\tw@\else \@preamerr 4\@chclass 6 \@classvi \fi\fi} \def\@classv{\save@decl - \expandafter\NC@ecs\@nextchar\extracolsep{}\extracolsep\@@@ + \expandafter\NC@ecs\@nextchar\extracolsep{}\extracolsep\@@__tbl \@addtopreamble{\d@llarbegin\the@toks\the\count@\relax\d@llarend}% \prepnext@tok} -\def\NC@ecs#1\extracolsep#2#3\extracolsep#4\@@@{\def\@tempa{#2}% +\def\NC@ecs#1\extracolsep#2#3\extracolsep#4\@@__tbl{\def\@tempa{#2}% \ifx\@tempa\@empty\else\toks\count@={#1\tabskip#2\relax#3}\fi} \def\@tabarray{\@ifnextchar[{\@@array}{\@@array[c]}} \let\@@array\@array -\def\endarray{\crcr \egroup \egroup \@arrayright \gdef\@preamble{}} \let\@arrayleft\@empty \let\@arrayright\@empty \newlength{\extratabsurround} @@ -370,6 +432,7 @@ <{\d@llarend\end{lrbox}% \let\hss\hfil \makebox[#2][#1]{\unhbox\ar@cellbox}}} +\ExplSyntaxOff \endinput %% %% End of file `array.sty'. |