Debian Codegraph @

texmf-dist/tex/latex-dev/tools/array-2020-02-10.sty

raw
1 %%
2 %% This is an old release of `array.sty' used during rollback operations.
3 %% Do not use this file directly.
4 %% ==============================
5 %%
6 %% This is file `array.sty',
7 %% generated with the docstrip utility.
8 %%
9 %% The original source files were:
10 %%
11 %% array.dtx (with options: `package,ncols')
12 %%
13 %% This is a generated file.
14 %%
15 %% The source is maintained by the LaTeX Project team and bug
16 %% reports for it can be opened at https://latex-project.org/bugs/
17 %% (but please observe conditions on bug reports sent to that address!)
18 %%
19 %%
20 %% Copyright (C) 1993-2020
21 %% The LaTeX Project and any individual authors listed elsewhere
22 %% in this file.
23 %%
24 %% This file was generated from file(s) of the Standard LaTeX `Tools Bundle'.
25 %% --------------------------------------------------------------------------
26 %%
27 %% It may be distributed and/or modified under the
28 %% conditions of the LaTeX Project Public License, either version 1.3c
29 %% of this license or (at your option) any later version.
30 %% The latest version of this license is in
31 %% https://www.latex-project.org/lppl.txt
32 %% and version 1.3c or later is part of all distributions of LaTeX
33 %% version 2005/12/01 or later.
34 %%
35 %% This file may only be distributed together with a copy of the LaTeX
36 %% `Tools Bundle'. You may however distribute the LaTeX `Tools Bundle'
37 %% without such generated files.
38 %%
39 %% The list of all files belonging to the LaTeX `Tools Bundle' is
40 %% given in the file `manifest.txt'.
41 %%
42 %% Package `array' to use with LaTeX 2e
43 %% Copyright (C) 1989-1998 Frank Mittelbach, all rights reserved.
44 \NeedsTeXFormat{LaTeX2e}[1995/06/01]
45
46 \ProvidesPackage{array}
47 [2020/02/10 v2.4m Tabular extension package (FMi)]
48 %%
49
50 \def\@addtopreamble#1{\xdef\@preamble{\@preamble #1}}
51 \def\@testpach{\@chclass
52 \ifnum \@lastchclass=6 \@ne \@chnum \@ne \else
53 \ifnum \@lastchclass=7 5 \else
54 \ifnum \@lastchclass=8 \tw@ \else
55 \ifnum \@lastchclass=9 \thr@@
56 \else \z@
57 \ifnum \@lastchclass = 10 \else
58 \edef\@nextchar{\expandafter\string\@nextchar}%
59 \@chnum
60 \if \@nextchar c\z@ \else
61 \if \@nextchar l\@ne \else
62 \if \@nextchar r\tw@ \else
63 \z@ \@chclass
64 \if\@nextchar |\@ne \else
65 \if \@nextchar !6 \else
66 \if \@nextchar @7 \else
67 \if \@nextchar <8 \else
68 \if \@nextchar >9 \else
69 10
70 \@chnum
71 \if \@nextchar m\thr@@\else
72 \if \@nextchar p4 \else
73 \if \@nextchar b5 \else
74 \z@ \@chclass \z@ \@preamerr \z@ \fi \fi \fi \fi
75 \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi}
76 \def\@xexpast#1*#2#3#4\@@{%
77 \@tempcnta #2
78 \toks@={#1}\@temptokena={#3}%
79 \let\the@toksz\relax \let\the@toks\relax
80 \def\@tempa{\the@toksz}%
81 \ifnum\@tempcnta >0 \@whilenum\@tempcnta >0\do
82 {\edef\@tempa{\@tempa\the@toks}\advance \@tempcnta \m@ne}%
83 \let \@tempb \@xexpast \else
84 \let \@tempb \@xexnoop \fi
85 \def\the@toksz{\the\toks@}\def\the@toks{\the\@temptokena}%
86 \edef\@tempa{\@tempa}%
87 \expandafter \@tempb \@tempa #4\@@}
88 \def\prepnext@tok{\advance \count@ \@ne
89 \toks\count@{}}
90 \def\save@decl{\toks\count@ \expandafter{\@nextchar}}
91 \def\insert@column{%
92 \the@toks \the \@tempcnta
93 \ignorespaces \@sharp \unskip
94 \the@toks \the \count@ \relax}
95 \newdimen\col@sep
96 \def\@acol{\@addtopreamble{\hskip\col@sep}}
97 \def\@classx{%
98 \ifcase \@lastchclass
99 \@acolampacol \or
100 \@addamp \@acol \or
101 \@acolampacol \or
102 \or
103 \@acol \@firstampfalse \or
104 \@addamp
105 \fi}
106 \def\@classz{\@classx
107 \@tempcnta \count@
108 \prepnext@tok
109 \@addtopreamble{\ifcase \@chnum
110 \hfil
111 \hskip1sp%
112 \d@llarbegin
113 \insert@column
114 \d@llarend \do@row@strut \hfil \or
115 \hskip1sp\d@llarbegin \insert@column \d@llarend \do@row@strut \hfil \or
116 \hfil\hskip1sp\d@llarbegin \insert@column \d@llarend \do@row@strut \or
117 \setbox\ar@mcellbox\vbox
118 \@startpbox{\@nextchar}\insert@column \@endpbox
119 \ar@align@mcell
120 \do@row@strut \or
121 \vtop \@startpbox{\@nextchar}\insert@column \@endpbox\do@row@strut \or
122 \vbox \@startpbox{\@nextchar}\insert@column \@endpbox\do@row@strut
123 \fi}\prepnext@tok}
124
125 \newbox\ar@mcellbox
126 \def\ar@align@mcell{%
127 \ifdim \ht\ar@mcellbox > \ht\@arstrutbox
128 \begingroup
129 \dimen@\ht\ar@mcellbox
130 \advance\dimen@-\ht\@arstrutbox
131 \advance\dimen@\baselineskip
132 \lower.5\dimen@\box\ar@mcellbox
133 \endgroup
134 \else % assume one line and align at baseline
135 \box\ar@mcellbox
136 \fi}
137
138 \def\@arrayrule{\@addtopreamble \vline}
139 \def\@classvii{\ifnum \@lastchclass = \thr@@
140 \@preamerr \thr@@ \fi}
141 \def\@classvi{\ifcase \@lastchclass
142 \@acol \or
143 \@addtopreamble{\hskip \doublerulesep}\or
144 \@acol \or
145 \@classvii
146 \fi}
147 \def\@classii{\advance \count@ \m@ne
148 \save@decl\prepnext@tok}
149 \def\@classi{\@classvi
150 \ifcase \@chnum \@arrayrule \or
151 \@classv \fi}
152 \def\@startpbox#1{\bgroup
153 \color@begingroup
154 \setlength\hsize{#1}\@arrayparboxrestore
155 \everypar{%
156 \vrule \@height \ht\@arstrutbox \@width \z@
157 \everypar{}}%
158 }
159 \def\@endpbox{\@finalstrut\@arstrutbox \color@endgroup \egroup\hfil}
160 \def\@array[#1]#2{%
161 \@tempdima \ht \strutbox
162 \advance \@tempdima by\extrarowheight
163 \setbox \@arstrutbox \hbox{\vrule
164 \@height \arraystretch \@tempdima
165 \@depth \arraystretch \dp \strutbox
166 \@width \z@}%
167 \begingroup
168 \@mkpream{#2}%
169 \xdef\@preamble{\noexpand \ialign \@halignto
170 \bgroup \@arstrut \@preamble
171 \tabskip \z@ \cr}%
172 \endgroup
173 \@arrayleft
174 \if #1t\vtop \else \if#1b\vbox \else \vcenter \fi \fi
175 \bgroup
176 \let \@sharp ##\let \protect \relax
177 \lineskip \z@
178 \baselineskip \z@
179 \m@th
180 \let\\\@arraycr \let\tabularnewline\\\let\par\@empty \@preamble}
181 \def\arraybackslash{\let\\\tabularnewline}
182 \newdimen \extrarowheight
183 \extrarowheight=0pt
184 \def\@arstrut{\unhcopy\@arstrutbox}
185 \def\@arraycr{\relax\iffalse{\fi\ifnum 0=`}\fi
186 \@ifstar \@xarraycr \@xarraycr}
187 \def\@xarraycr{\@ifnextchar [%
188 \@argarraycr {\ifnum 0=`{}\fi\cr}}
189 \def\@argarraycr[#1]{\ifnum0=`{}\fi\ifdim #1>\z@
190 \expandafter\@xargarraycr\else
191 \expandafter\@yargarraycr\fi{#1}}
192 \def\@xargarraycr#1{\unskip\gdef\do@row@strut
193 {\@tempdima #1\advance\@tempdima \dp\@arstrutbox
194 \vrule \@depth\@tempdima \@width\z@\global\let\do@row@strut\relax}%
195 % \begin{macrocode}
196 \ifnum\@multicnt >\z@ \do@row@strut \fi
197 \cr}
198 \let\do@row@strut\relax
199 \def\@yargarraycr#1{\cr\noalign{\vskip #1}}
200 \long\def\multicolumn#1#2#3{%
201 \multispan{#1}\begingroup
202 \def\@addamp{\if@firstamp \@firstampfalse \else
203 \@preamerr 5\fi}%
204 \@mkpream{#2}\@addtopreamble\@empty
205 \endgroup
206 \def\@sharp{#3}%
207 \@arstrut \@preamble
208 \null
209 \ignorespaces}
210 \let\d@llarbegin\begingroup
211 \let\d@llarend\endgroup
212 \def\array{\col@sep\arraycolsep
213 \def\d@llarbegin{$}\let\d@llarend\d@llarbegin\def\@halignto{}%
214 \@tabarray}
215 \def\tabular{\def\@halignto{}\@tabular}
216 \expandafter\def\csname tabular*\endcsname#1{%
217 \setlength\dimen@{#1}%
218 \edef\@halignto{to\the\dimen@}\@tabular}
219 \def\@tabular{%
220 \leavevmode
221 \hbox \bgroup $\col@sep\tabcolsep \let\d@llarbegin\begingroup
222 \let\d@llarend\endgroup
223 \@tabarray}
224 \def\endtabular{\endarray $\egroup}
225 \expandafter\let\csname endtabular*\endcsname=\endtabular
226 \let\@ampacol=\relax \let\@expast=\relax
227 \let\@arrayclassiv=\relax \let\@arrayclassz=\relax
228 \let\@tabclassiv=\relax \let\@tabclassz=\relax
229 \let\@arrayacol=\relax \let\@tabacol=\relax
230 \let\@tabularcr=\relax \let\@@endpbox=\relax
231 \let\@argtabularcr=\relax \let\@xtabularcr=\relax
232 \def\@preamerr#1{\def\@tempd{{..} at wrong position: }%
233 \PackageError{array}{%
234 \ifcase #1 Illegal pream-token (\@nextchar): `c' used\or %0
235 Missing arg: token ignored\or %1
236 Empty preamble: `l' used\or %2
237 >\@tempd token ignored\or %3
238 <\@tempd changed to !{..}\or %4
239 Only one column-spec. allowed.\fi}\@ehc} %5
240 \def\newcolumntype#1{%
241 \edef\NC@char{\string#1}%
242 \@ifundefined{NC@find@\NC@char}%
243 {\@tfor\next:=<>clrmbp@!|\do
244 {%
245 \if\expandafter\noexpand\next\NC@char
246 \PackageWarning{array}%
247 {Redefining primitive column \NC@char}\fi}%
248 \NC@list\expandafter{\the\NC@list\NC@do#1}}%
249 {\PackageWarning{array}{Column \NC@char\space is already defined}}%
250 \@namedef{NC@find@\NC@char}##1#1{\NC@{##1}}%
251 \@ifnextchar[{\newcol@{\NC@char}}{\newcol@{\NC@char}[0]}}
252 \def\newcol@#1[#2]#3{\expandafter\@reargdef
253 \csname NC@rewrite@#1\endcsname[#2]{\NC@find#3}}
254 \def\NC@#1{%
255 \@temptokena\expandafter{\the\@temptokena#1}\futurelet\next\NC@ifend}
256 \def\NC@ifend{%
257 \ifx\next\relax
258 \else\@tempswatrue\expandafter\NC@rewrite\fi}
259 \def\NC@do#1{%
260 \expandafter\let\expandafter\NC@rewrite
261 \csname NC@rewrite@\string#1\endcsname
262 \expandafter\let\expandafter\NC@find
263 \csname NC@find@\string#1\endcsname
264 \expandafter\@temptokena\expandafter{\expandafter}%
265 \expandafter\NC@find\the\@temptokena#1\relax}
266 \def\showcols{{\def\NC@do##1{\let\NC@do\NC@show}\the\NC@list}}
267 \def\NC@show#1{%
268 \typeout{Column #1\expandafter\expandafter\expandafter\NC@strip
269 \expandafter\meaning\csname NC@rewrite@#1\endcsname\@@}}
270 \def\NC@strip#1:#2->#3 #4\@@{#2 -> #4}
271 \newtoks\NC@list
272 \newcolumntype{*}[2]{}
273 \long\@namedef{NC@rewrite@*}#1#2{%
274 \count@#1\relax
275 \loop
276 \ifnum\count@>\z@
277 \advance\count@\m@ne
278 \@temptokena\expandafter{\the\@temptokena#2}%
279 \repeat
280 \NC@find}
281 \let\@xexpast\relax
282 \let\@xexnoop\relax
283 \def\save@decl{\toks \count@ = \expandafter\expandafter\expandafter
284 {\expandafter\@nextchar\the\toks\count@}}
285 \def\@mkpream#1{\gdef\@preamble{}\@lastchclass 4 \@firstamptrue
286 \let\@sharp\relax
287 \def\@startpbox##1{\unexpanded\expandafter{\expandafter
288 \@startpbox\expandafter{##1}}}\let\@endpbox\relax
289 \let\do@row@strut\relax
290 \let\ar@align@mcell\relax
291 \@temptokena{#1}\@tempswatrue
292 \@whilesw\if@tempswa\fi{\@tempswafalse\the\NC@list}%
293 \count@\m@ne
294 \let\the@toks\relax
295 \prepnext@tok
296 \expandafter \@tfor \expandafter \@nextchar
297 \expandafter :\expandafter =\the\@temptokena \do
298 {\@testpach
299 \ifcase \@chclass \@classz \or \@classi \or \@classii
300 \or \save@decl \or \or \@classv \or \@classvi
301 \or \@classvii \or \@classviii
302 \or \@classx
303 \or \@classx \fi
304 \@lastchclass\@chclass}%
305 \ifcase\@lastchclass
306 \@acol \or
307 \or
308 \@acol \or
309 \@preamerr \thr@@ \or
310 \@preamerr \tw@ \@addtopreamble\@sharp \or
311 \or
312 \else \@preamerr \@ne \fi
313 \def\the@toks{\the\toks}}
314 \let\@classix\relax
315 \def\@classviii{\ifnum \@lastchclass >\z@\ifnum\@lastchclass=\tw@\else
316 \@preamerr 4\@chclass 6 \@classvi \fi\fi}
317 \def\@classv{\save@decl
318 \expandafter\NC@ecs\@nextchar\extracolsep{}\extracolsep\@@@
319 \@addtopreamble{\d@llarbegin\the@toks\the\count@\relax\d@llarend}%
320 \prepnext@tok}
321 \def\NC@ecs#1\extracolsep#2#3\extracolsep#4\@@@{\def\@tempa{#2}%
322 \ifx\@tempa\@empty\else\toks\count@={#1\tabskip#2\relax#3}\fi}
323 \def\@tabarray{\@ifnextchar[{\@@array}{\@@array[c]}}
324 \let\@@array\@array
325 \def\endarray{\crcr \egroup \egroup \@arrayright \gdef\@preamble{}}
326 \let\@arrayleft\@empty
327 \let\@arrayright\@empty
328 \newlength{\extratabsurround}
329 \setlength{\extratabsurround}{2pt}
330 \newlength{\backup@length}
331 \newcommand{\firsthline}{%
332 \multicolumn1c{%
333 \global\backup@length\ht\@arstrutbox
334 \global\advance\backup@length\dp\@arstrutbox
335 \global\advance\backup@length\arrayrulewidth
336 \raise\extratabsurround\copy\@arstrutbox
337 }\\[-\backup@length]\hline
338 }
339 \newcommand{\lasthline}{\hline\multicolumn1c{%
340 \global\backup@length2\ht\@arstrutbox
341 \global\advance\backup@length2\dp\@arstrutbox
342 \global\advance\backup@length\arrayrulewidth
343 }\\[-\backup@length]%
344 \multicolumn1c{%
345 \lower\extratabsurround\copy\@arstrutbox
346 }%
347 }
348 \CheckCommand*\@xhline{\ifx\reserved@a\hline
349 \vskip\doublerulesep
350 \vskip-\arrayrulewidth
351 \fi
352 \ifnum0=`{\fi}}
353 \renewcommand*\@xhline{\ifx\reserved@a\hline
354 \vskip\doublerulesep
355 \fi
356 \ifnum0=`{\fi}}
357
358 \newsavebox\ar@cellbox
359 \newcolumntype{w}[2]{%
360 >{\begin{lrbox}\ar@cellbox}%
361 c%
362 <{\end{lrbox}%
363 \makebox[#2][#1]{\unhbox\ar@cellbox}}}
364
365 \newcolumntype{W}[2]
366 {>{\begin{lrbox}\ar@cellbox}%
367 c%
368 <{\end{lrbox}%
369 \let\hss\hfil
370 \makebox[#2][#1]{\unhbox\ar@cellbox}}}
371 \endinput
372 %%
373 %% End of file `array.sty'.