Debian Codegraph @

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