ARRAY.STY 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362
  1. %%
  2. %% This is file `array.sty', generated
  3. %% on <1992/11/6> with the docstrip utility (2.0q).
  4. %%
  5. %% The original source files were:
  6. %%
  7. %% array.doc (with options: `style,ncols')
  8. %%
  9. %% Copyright (C) 1989-1992 by Frank Mittelbach. All rights reserved.
  10. %%
  11. %% This file is part of the array package.
  12. %%
  13. %% IMPORTANT NOTICE:
  14. %%
  15. %% You are not allowed to change this file. You may however copy
  16. %% this file to a file with a different name and then change the copy
  17. %% if you obey the restrictions on file changes described in
  18. %% readme.mz.
  19. %%
  20. %% You are NOT ALLOWED to distribute this file alone. You are NOT
  21. %% ALLOWED to take money for the distribution or use of this file (or
  22. %% a changed version) except for a nominal charge for copying etc.
  23. %%
  24. %% You are allowed to distribute this file under the condition that
  25. %% it is distributed together with all files mentioned in readme.mz5.
  26. %%
  27. %% If you receive only some of these files from someone, complain!
  28. %%
  29. %% However, if these files are distributed by established suppliers
  30. %% as part of a complete TeX distribution, and the structure of the
  31. %% distribution would make it difficult to distribute the whole set
  32. %% of files, *those parties* are allowed to distribute only some of
  33. %% the files provided that it is made clear that the user will get a
  34. %% complete distribution-set upon request to that supplier (not me).
  35. %% Notice that this permission is not granted to the end user.
  36. %%
  37. %%
  38. %% For error reports in case of UNCHANGED versions see readme.mz
  39. %%
  40. \def\fileversion{v2.1b}
  41. \def\filedate{92/07/06}
  42. \def\docdate {92/09/12}
  43. %% \CheckSum{1070}
  44. %% \CharacterTable
  45. %% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
  46. %% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
  47. %% Digits \0\1\2\3\4\5\6\7\8\9
  48. %% Exclamation \! Double quote \" Hash (number) \#
  49. %% Dollar \$ Percent \% Ampersand \&
  50. %% Acute accent \' Left paren \( Right paren \)
  51. %% Asterisk \* Plus \+ Comma \,
  52. %% Minus \- Point \. Solidus \/
  53. %% Colon \: Semicolon \; Less than \<
  54. %% Equals \= Greater than \> Question mark \?
  55. %% Commercial at \@ Left bracket \[ Backslash \\
  56. %% Right bracket \] Circumflex \^ Underscore \_
  57. %% Grave accent \` Left brace \{ Vertical bar \|
  58. %% Right brace \} Tilde \~}
  59. %%
  60. %% Style-option `array' to use with LaTeX v2.09
  61. %% Copyright (C) 1989-1992 Frank Mittelbach, all rights reserved.
  62. \@ifundefined{d@llarbegin}{}{\endinput}
  63. \typeout{Style-Option: `array' \fileversion
  64. \space\space <\filedate> (F.M.)}
  65. \typeout{English documentation dated \space <\docdate> (F.M.)}
  66. \def\@addtopreamble#1{\xdef\@preamble{\@preamble #1}}
  67. \def\@testpach{\@chclass
  68. \ifnum \@lastchclass=6 \@ne \@chnum \@ne \else
  69. \ifnum \@lastchclass=7 5 \else
  70. \ifnum \@lastchclass=8 \tw@ \else
  71. \ifnum \@lastchclass=9 \thr@@
  72. \else \z@
  73. \ifnum \@lastchclass = 10 \else
  74. \edef\@nextchar{\expandafter\string\@nextchar}%
  75. \@chnum
  76. \if \@nextchar c\z@ \else
  77. \if \@nextchar l\@ne \else
  78. \if \@nextchar r\tw@ \else
  79. \z@ \@chclass
  80. \if\@nextchar |\@ne \else
  81. \if \@nextchar !6 \else
  82. \if \@nextchar @7 \else
  83. \if \@nextchar <8 \else
  84. \if \@nextchar >9 \else
  85. 10
  86. \@chnum
  87. \if \@nextchar m\thr@@\else
  88. \if \@nextchar p4 \else
  89. \if \@nextchar b5 \else
  90. \z@ \@chclass \z@ \@preamerr \z@ \fi \fi \fi \fi
  91. \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi}
  92. \def\@xexpast#1*#2#3#4\@@{%
  93. \@tempcnta #2
  94. \toks@={#1}\@temptokena={#3}%
  95. \let\the@toksz\relax \let\the@toks\relax
  96. \def\@tempa{\the@toksz}%
  97. \ifnum\@tempcnta >0 \@whilenum\@tempcnta >0\do
  98. {\edef\@tempa{\@tempa\the@toks}\advance \@tempcnta \m@ne}%
  99. \let \@tempb \@xexpast \else
  100. \let \@tempb \@xexnoop \fi
  101. \def\the@toksz{\the\toks@}\def\the@toks{\the\@temptokena}%
  102. \edef\@tempa{\@tempa}%
  103. \expandafter \@tempb \@tempa #4\@@}
  104. \def\prepnext@tok{\advance \count@ \@ne
  105. \toks\count@{}}
  106. \def\save@decl{\toks\count@ \expandafter{\@nextchar}}
  107. \def\insert@column{%
  108. \the@toks \the \@tempcnta
  109. \ignorespaces \@sharp \unskip
  110. \the@toks \the \count@ \relax}
  111. \newdimen\col@sep
  112. \def\@acol{\@addtopreamble{\hskip\col@sep}}
  113. \def\@mkpream#1{\gdef\@preamble{}\@lastchclass 4 \@firstamptrue
  114. \let\@sharp\relax \let\@startpbox\relax \let\@endpbox\relax
  115. \@xexpast #1*0x\@@
  116. \count@\m@ne
  117. \let\the@toks\relax
  118. \prepnext@tok
  119. \expandafter \@tfor \expandafter \@nextchar
  120. \expandafter :\expandafter =\@tempa \do
  121. {\@testpach
  122. \ifcase \@chclass \@classz \or \@classi \or \@classii
  123. \or \save@decl \or \or \@classv \or \@classvi
  124. \or \@classvii \or \@classviii \or \@classix
  125. \or \@classx \fi
  126. \@lastchclass\@chclass}%
  127. \ifcase\@lastchclass
  128. \@acol \or
  129. \or
  130. \@acol \or
  131. \@preamerr \thr@@ \or
  132. \@preamerr \tw@ \@addtopreamble\@sharp \or
  133. \or
  134. \else \@preamerr \@ne \fi
  135. \def\the@toks{\the\toks}}
  136. \def\@classx{%
  137. \ifcase \@lastchclass
  138. \@acolampacol \or
  139. \@addamp \@acol \or
  140. \@acolampacol \or
  141. \or
  142. \@acol \@firstampfalse \or
  143. \@addamp
  144. \fi}
  145. \def\@classz{\@classx
  146. \@tempcnta \count@
  147. \prepnext@tok
  148. \@addtopreamble{\ifcase \@chnum
  149. \hfil
  150. \d@llarbegin
  151. \insert@column
  152. \d@llarend \hfil \or
  153. \d@llarbegin \insert@column \d@llarend \hfil \or
  154. \hfil\kern\z@ \d@llarbegin \insert@column \d@llarend \or
  155. $\vcenter
  156. \@startpbox{\@nextchar}\insert@column \@endpbox $\or
  157. \vtop \@startpbox{\@nextchar}\insert@column \@endpbox \or
  158. \vbox \@startpbox{\@nextchar}\insert@column \@endpbox
  159. \fi}\prepnext@tok}
  160. \def\@classix{\ifnum \@lastchclass = \thr@@
  161. \@preamerr \thr@@ \fi
  162. \@classx}
  163. \def\@classviii{\ifnum \@lastchclass >\z@
  164. \@preamerr 4\@chclass 6 \@classvi \fi}
  165. \def\@arrayrule{\@addtopreamble \vline}
  166. \def\@classvii{\ifnum \@lastchclass = \thr@@
  167. \@preamerr \thr@@ \fi}
  168. \def\@classvi{\ifcase \@lastchclass
  169. \@acol \or
  170. \@addtopreamble{\hskip \doublerulesep}\or
  171. \@acol \or
  172. \@classvii
  173. \fi}
  174. \def\@classii{\advance \count@ \m@ne
  175. \save@decl\prepnext@tok}
  176. \def\@classv{\save@decl
  177. \@addtopreamble{\d@llarbegin\the@toks\the\count@\relax\d@llarend}%
  178. \prepnext@tok}
  179. \def\@classi{\@classvi
  180. \ifcase \@chnum \@arrayrule \or
  181. \@classv \fi}
  182. \def\@startpbox#1{\bgroup
  183. \hsize #1 \@arrayparboxrestore
  184. \vrule \@height \ht\@arstrutbox \@width \z@}
  185. \def\@endpbox{\vrule \@width \z@ \@depth \dp \@arstrutbox \egroup}
  186. \def\@array[#1]#2{%
  187. \@tempdima \ht \strutbox
  188. \advance \@tempdima by\extrarowheight
  189. \setbox \@arstrutbox \hbox{\vrule
  190. \@height \arraystretch \@tempdima
  191. \@depth \arraystretch \dp \strutbox
  192. \@width \z@}%
  193. \begingroup
  194. \@mkpream{#2}%
  195. \xdef\@preamble{\ialign \@halignto
  196. \bgroup \@arstrut \@preamble
  197. \tabskip \z@ \cr}%
  198. \endgroup
  199. \@arrayleft
  200. \if #1t\vtop \else \if#1b\vbox \else \vcenter \fi \fi
  201. \bgroup
  202. \let \@sharp ##\let \protect \relax
  203. \lineskip \z@
  204. \baselineskip \z@
  205. \m@th
  206. \let\\ \@arraycr \let\par\@empty \@preamble}
  207. \newdimen \extrarowheight
  208. \extrarowheight=0pt
  209. \def\@arstrut{\unhcopy\@arstrutbox}
  210. \def\@arraycr{{\ifnum 0=`}\fi
  211. \@ifstar \@xarraycr \@xarraycr}
  212. \def\@xarraycr{\@ifnextchar [%
  213. \@argarraycr {\ifnum 0=`{\fi}\cr}}
  214. \def\@argarraycr[#1]{\ifnum0=`{\fi}\ifdim #1>\z@
  215. \@xargarraycr{#1}\else \@yargarraycr{#1}\fi}
  216. \def\@xargarraycr#1{\unskip
  217. \@tempdima #1\advance\@tempdima \dp\@arstrutbox
  218. \vrule \@depth\@tempdima \@width\z@ \cr}
  219. \def\@yargarraycr#1{\cr\noalign{\vskip #1}}
  220. \def\multicolumn#1#2#3{%
  221. \multispan{#1}\begingroup
  222. \def\@addamp{\if@firstamp \@firstampfalse \else
  223. \@preamerr 5\fi}%
  224. \@mkpream{#2}\@addtopreamble\@empty
  225. \endgroup
  226. \def\@sharp{#3}%
  227. \@arstrut \@preamble \ignorespaces}
  228. \let\d@llarbegin\begingroup
  229. \let\d@llarend\endgroup
  230. \def\array{\col@sep\arraycolsep
  231. \def\d@llarbegin{$}\let\d@llarend\d@llarbegin\gdef\@halignto{}%
  232. \@tabarray}
  233. \def\@tabarray{\@ifnextchar[{\@array}{\@array[c]}}
  234. \def\tabular{\gdef\@halignto{}\@tabular}
  235. \expandafter\def\csname tabular*\endcsname#1{%
  236. \gdef\@halignto{to#1}\@tabular}
  237. \def\@tabular{%
  238. \leavevmode
  239. \hbox \bgroup $\col@sep\tabcolsep \let\d@llarbegin\begingroup
  240. \let\d@llarend\endgroup
  241. \@tabarray}
  242. \def\endarray{\crcr \egroup \egroup \gdef\@preamble{}}
  243. \def\endtabular{\endarray $\egroup}
  244. \expandafter\let\csname endtabular*\endcsname=\endtabular
  245. \let\@ampacol=\relax \let\@expast=\relax
  246. \let\@arrayclassiv=\relax \let\@arrayclassz=\relax
  247. \let\@tabclassiv=\relax \let\@tabclassz=\relax
  248. \let\@arrayacol=\relax \let\@tabacol=\relax
  249. \let\@tabularcr=\relax \let\@@endpbox=\relax
  250. \let\@argtabularcr=\relax \let\@xtabularcr=\relax
  251. \def\@preamerr#1{\def\@tempd{{..} at wrong position: }%
  252. \@latexerr{%
  253. \ifcase #1 Illegal pream-token (\@nextchar): `c' used\or %0
  254. Missing arg: token ignored\or %1
  255. Empty preamble: `l' used\or %2
  256. >\@tempd token ignored\or %3
  257. <\@tempd changed to !{..}\or %4
  258. Only one column-spec. allowed.\fi}\@ehc} %5
  259. \def\@tempa#1:=#2\do#3{\def\@fortmp{#2}\ifx\@fortmp\@empty
  260. \else\@tforloop#2\@nil\@nil\@@#1{#3}\fi}
  261. \ifx\@tempa\@tfor
  262. \else
  263. \errhelp{The bug fix for \@tfor was removed from
  264. array.sty because it was^^J%
  265. corrected in latex.tex <dec91>.^^J^^J%
  266. Please update to a newer LaTeX release.}
  267. \errmessage{Obsolete LaTeX release (older than Dec.91)}
  268. \let\@tfor\@tempa
  269. \fi
  270. \let\@tempa\@empty
  271. \def\newcolumn{%
  272. \typeout{*** Obsolete command \string\newcolumn!
  273. Please use \noexpand\newcolumntype ***}%
  274. \newcolumntype
  275. }
  276. \def\newcolumntype#1{%
  277. \edef\NC@char{\string#1}%
  278. \@ifundefined{NC@find@\NC@char}%
  279. {\@tfor\next:=<>clrmbp@!|\do{\if\next\NC@char
  280. \@warning{Redefining primitive column \NC@char}\fi}%
  281. \NC@list\expandafter{\the\NC@list\NC@do#1}}%
  282. {\@warning{Column \NC@char\space is already defined}}%
  283. \@namedef{NC@find@\NC@char}##1#1{\NC@{##1}}%
  284. \@ifnextchar[{\newcol@{\NC@char}}{\newcol@{\NC@char}[0]}}
  285. \def\newcol@#1[#2]#3{\expandafter\@reargdef
  286. \csname NC@rewrite@#1\endcsname[#2]{\NC@find#3}}
  287. \def\NC@#1{%
  288. \@temptokena\expandafter{\the\@temptokena#1}\futurelet\next\NC@ifend}
  289. \def\NC@ifend{%
  290. \ifx\next\relax
  291. \else\@tempswatrue\expandafter\NC@rewrite\fi}
  292. \def\NC@do#1{%
  293. \expandafter\let\expandafter\NC@rewrite
  294. \csname NC@rewrite@\string#1\endcsname
  295. \expandafter\let\expandafter\NC@find
  296. \csname NC@find@\string#1\endcsname
  297. \expandafter\@temptokena\expandafter{\expandafter}%
  298. \expandafter\NC@find\the\@temptokena#1\relax}
  299. \def\showcols{{\def\NC@do##1{\let\NC@do\NC@show}\the\NC@list}}
  300. \def\NC@show#1{%
  301. \typeout{Column #1\expandafter\expandafter\expandafter\NC@strip
  302. \expandafter\meaning\csname NC@rewrite@#1\endcsname\@@}}
  303. \def\NC@strip#1:#2->#3 #4\@@{#2 -> #4}
  304. \newtoks\NC@list
  305. \newcolumntype{*}[2]{}
  306. \long\@namedef{NC@rewrite@*}#1#2{%
  307. \count@#1
  308. \loop
  309. \ifnum\count@>\z@
  310. \advance\count@\m@ne
  311. \@temptokena\expandafter{\the\@temptokena#2}%
  312. \repeat
  313. \NC@find}
  314. \let\@xexpast\relax
  315. \let\@xexnoop\relax
  316. \def\save@decl{\toks \count@ = \expandafter\expandafter\expandafter
  317. {\expandafter\@nextchar\the\toks\count@}}
  318. \def\@mkpream#1{\gdef\@preamble{}\@lastchclass 4 \@firstamptrue
  319. \let\@sharp\relax \let\@startpbox\relax \let\@endpbox\relax
  320. \@temptokena{#1}\@tempswatrue
  321. \@whilesw\if@tempswa\fi{\@tempswafalse\the\NC@list}%
  322. \count@\m@ne
  323. \let\the@toks\relax
  324. \prepnext@tok
  325. \expandafter \@tfor \expandafter \@nextchar
  326. \expandafter :\expandafter =\the\@temptokena \do
  327. {\@testpach
  328. \ifcase \@chclass \@classz \or \@classi \or \@classii
  329. \or \save@decl \or \or \@classv \or \@classvi
  330. \or \@classvii \or \@classviii
  331. \or \@classx
  332. \or \@classx \fi
  333. \@lastchclass\@chclass}%
  334. \ifcase\@lastchclass
  335. \@acol \or
  336. \or
  337. \@acol \or
  338. \@preamerr \thr@@ \or
  339. \@preamerr \tw@ \@addtopreamble\@sharp \or
  340. \or
  341. \else \@preamerr \@ne \fi
  342. \def\the@toks{\the\toks}}
  343. \let\@classix\relax
  344. \def\@classviii{\ifnum \@lastchclass >\z@\ifnum\@lastchclass=\tw@\else
  345. \@preamerr 4\@chclass 6 \@classvi \fi\fi}
  346. \def\@classv{\save@decl
  347. \expandafter\NC@ecs\@nextchar\extracolsep{}\extracolsep\@@@
  348. \@addtopreamble{\d@llarbegin\the@toks\the\count@\relax\d@llarend}%
  349. \prepnext@tok}
  350. \def\NC@ecs#1\extracolsep#2#3\extracolsep#4\@@@{\def\@tempa{#2}%
  351. \ifx\@tempa\@empty\else\toks\count@={#1\tabskip#2\relax#3}\fi}
  352. \def\@tabarray{\@ifnextchar[{\@@array}{\@@array[c]}}
  353. \let\@@array\@array
  354. \def\endarray{\crcr \egroup \egroup \@arrayright \gdef\@preamble{}}
  355. \let\@arrayleft\@empty
  356. \let\@arrayright\@empty
  357. \endinput
  358. %%
  359. %% End of file `array.sty'.