Debian Codegraph @

texmf-dist/source/latex/base/lttab.dtx

raw
1 % \iffalse meta-comment
2 %
3 % Copyright (C) 1993-2025
4 % The LaTeX Project and any individual authors listed elsewhere
5 % in this file.
6 %
7 % This file is part of the LaTeX base system.
8 % -------------------------------------------
9 %
10 % It may be distributed and/or modified under the
11 % conditions of the LaTeX Project Public License, either version 1.3c
12 % of this license or (at your option) any later version.
13 % The latest version of this license is in
14 % https://www.latex-project.org/lppl.txt
15 % and version 1.3c or later is part of all distributions of LaTeX
16 % version 2008 or later.
17 %
18 % This file has the LPPL maintenance status "maintained".
19 %
20 % The list of all files belonging to the LaTeX base distribution is
21 % given in the file `manifest.txt'. See also `legal.txt' for additional
22 % information.
23 %
24 % The list of derived (unpacked) files belonging to the distribution
25 % and covered by LPPL is defined by the unpacking scripts (with
26 % extension .ins) which are part of the distribution.
27 %
28 % \fi
29 %
30 % \iffalse
31 %%% From File: lttab.dtx
32 %<*driver>
33 % \fi
34 \ProvidesFile{lttab.dtx}[2025/09/24 v1.1t LaTeX Kernel (Columns)]
35 % \iffalse
36 \documentclass{ltxdoc}
37 \GetFileInfo{lttab.dtx}
38 \title{\filename}
39 \date{\filedate}
40 \author{%
41 Johannes Braams\and
42 David Carlisle\and
43 Alan Jeffrey\and
44 Leslie Lamport\and
45 Frank Mittelbach\and
46 Chris Rowley\and
47 Rainer Sch\"opf}
48
49 \begin{document}
50 \MaintainedByLaTeXTeam{latex}
51 \maketitle
52 \DocInput{\filename}
53 \end{document}
54 %</driver>
55 % \fi
56 %
57 %
58 %
59 % \changes{v1.0l}{1995/05/07}{Use \cs{hb@xt@}}
60 % \changes{v1.1a}{1995/05/22}{Support autoloading feature}
61 % \changes{v1.1b}{1995/06/14}{Use \cs{ProvidesFile} in autoload}
62 % \changes{v1.1d}{1995/10/04}{Modify autoload support}
63 % \changes{v1.1k}{1998/06/18}{Small addition to documentation}
64 % \changes{v1.1l}{1998/07/06}{Small correction to documentation}
65 % \changes{v1.1n}{2015/02/21}{Removed autoload code}
66 %
67 % \section{Tabbing, Tabular and Array Environments}
68 % This section deals with `Lining It Up in Columns'. First the
69 % |tabbing| environment is defined, and then in second part, |tabular|
70 % together with its variants, |tabular*| and |array|.
71 %
72 % Note that the |tabular| defined here is essentially the original
73 % \LaTeX~2.09 version, not the extended version described in \emph{The
74 % \LaTeX\ Companion}. Use the |array| package to obtain the extended
75 % version.
76 %
77 % \MaybeStop{}
78 %
79 %
80 % \changes{v1.0a}{1994/03/04}{Initial version, split from latex.dtx}
81 % \changes{v1.0a}{1994/03/07}{Long lines wrapped to 72 columns}
82 % \changes{v1.0b}{1994/03/28}{Improve documentation}
83 % \changes{v1.0c}{1994/05/07}{Removed definition of \cs{+}}
84 % \changes{v1.0c}{1994/05/07}{Removed surplus braces from
85 % \cs{@ifnextchar} constructs}
86 % \changes{v1.0f}{1994/05/21}{Use new error commands}
87 % \changes{v1.0j}{1994/11/17}{\cs{@tempa} to \cs{reserved@a}}
88 % \changes{v1.1q}{2019/08/27}{Remove several unnecessary \cs{gdef} definitions}
89 % \changes{v1.1q}{2019/08/27}{Make various commands robust}
90 %
91 % \subsection{tabbing}
92 %
93 % \begin{oldcomments}
94 %
95 % \dimen(\@firsttab + i) = distance of tab stop i from left margin
96 % 0 <= i <= 15 (?).
97 %
98 % \dimen\@firsttab is initialized to \@totalleftmargin, so it starts
99 % at the prevailing left margin.
100 %
101 % \@maxtab = number of highest defined tab register
102 % probably = \@firsttab + 12
103 % \@nxttabmar = tab stop number of next line's left margin
104 % \@curtabmar = tab stop number of current line's left margin
105 % \@curtab = number of the current tab. At start of line,
106 % it equals \@curtabmar
107 % \@hightab = largest tab number currently defined.
108 % \@tabpush = depth of \pushtab's
109 %
110 % \box\@curline = contents of current line, excluding left margin
111 % skip, and excluding contents of current field
112 % \box\@curfield = contents of current field
113 %
114 % @rjfield = switch: T iff the last field of the line should
115 % be right-justified at the right margin.
116 %
117 % \tabbingsep = distance left by the \' command between the
118 % current position and the field that is
119 % ``left-shifted''.
120 %
121 % UTILITY MACROS
122 % \@stopfield : closes the current field
123 % \@addfield : adds the current field to the current line.
124 % \@contfield : continues the current field
125 % \@startfield : begins the next field
126 % \@stopline : closes the current line and outputs it
127 % \@startline : starts the next line
128 % \@ifatmargin : an \if that is true iff the current line.
129 % has width zero
130 %
131 % \@startline ==
132 % BEGIN
133 % \@curtabmar :=G \@nxttabmar
134 % \@curtab :=G \@curtabmar
135 % \box\@curline :=G null
136 % \@startfield
137 % \strut
138 % END
139 %
140 % \@stopline ==
141 % BEGIN
142 % \unskip
143 % \@stopfield
144 % if @rjfield = T
145 % then @rjfield :=G F
146 % \@tempdima := \@totalleftmargin + \linewidth
147 % \hb@xt@ \@tempdima{\@itemfudge
148 % \hskip \dimen\@curtabmar
149 % \box\@curline
150 % \hfil
151 % \box\@curfield}
152 % else \@addfield
153 % \hbox {\@itemfudge
154 % \hskip \dimen\@curtabmar
155 % \box\@curline}
156 % fi
157 % END
158 %
159 % \@startfield ==
160 % BEGIN
161 % \box\@curfield :=G \hbox {
162 % END
163 %
164 % \@stopfield ==
165 % BEGIN
166 % }
167 % END
168 %
169 % \@contfield ==
170 % BEGIN
171 % \box\@curfield :=G \hbox { \unhbox\@currfield %%} brace matching
172 % END
173 % \@addfield ==
174 % BEGIN
175 % \box\@curline :=G \unbox\@curline * \unbox\@curfield
176 % END
177 %
178 % \@ifatmargin ==
179 % BEGIN
180 % if dim of box\@curline = 0pt then
181 % END
182 %
183 %
184 % \tabbing ==
185 % BEGIN
186 % \lineskip :=L 0pt
187 % \> == \@rtab
188 % \< == \@ltab
189 % \= == \@settab
190 % \+ == \@tabplus
191 % \- == \@tabminus
192 % \` == \@tabrj
193 % \' == \@tablab
194 % \\ == BEGIN \@stopline \@startline END
195 % \\[DIST] == BEGIN
196 % \@stopline \vskip DIST \@startline\ignorespaces END
197 % \\* == BEGIN \@stopline \penalty 10000 \@startline END
198 % \\*[DIST] == BEGIN \@stopline \penalty 10000 \vskip DIST
199 % \@startline\ignorespaces END
200 % \@hightab := \@nxttabmar :=G \@firsttab
201 % \@tabpush :=G 0
202 % \dimen\@firsttab := \@totalleftmargin
203 % @rjfield :=G F
204 % \trivlist \item\relax
205 % if @minipage = F then \vskip \parskip fi
206 % \box\@tabfbox = \rlap{\indent\the\everypar}
207 % % note: \the\everypar sets @inlabel :=G F
208 % \@itemfudge == BEGIN \box\@tabfbox END
209 % \@startline
210 % \ignorespaces
211 % END
212 %
213 % \@endtabbing ==
214 % BEGIN
215 % \@stopline
216 % if \@tabpush > 0 then error message: ''unmatched \poptabs'' fi
217 % \endtrivlist
218 % END
219 %
220 % \@rtab ==
221 % BEGIN
222 % \@stopfield
223 % \@addfield
224 % if \@curtab < \@hightab
225 % then \@curtab :=G \@curtab + 1
226 % else error message ``Undefined Tab'' fi
227 % \@tempdima := \dimen\@curtab - \dimen\@curtabmar
228 % - width of box \@curline
229 % \box\@curline :=G \hbox{\unhbox\@curline + \hskip\@tempdima}
230 % \@startfield
231 % END
232 %
233 % \@settab ==
234 % BEGIN
235 % \@stopfield
236 % \@addfield
237 % if \@curtab < \@maxtab
238 % then \@curtab :=G \@curtab+1
239 % else error message: ``Too many tabs'' fi
240 % if \@curtab > \@hightab
241 % then \@hightab :=L \@curtab fi
242 % \dimen\@curtab :=L \dimen\@curtabmar + width of \box\@curline
243 % \@startfield
244 % END
245 %
246 % \@ltab ==
247 % BEGIN
248 % \@ifatmargin
249 % then if \@curtabmar > \@firsttab
250 % then \@curtab :=G \@curtab - 1
251 % \@curtabmar :=G \@curtabmar - 1
252 % else error message ``Too many untabs'' fi
253 % else error message ``Left tab in middle of line''
254 % fi
255 % END
256 %
257 % \@tabplus ==
258 % BEGIN
259 % if \@nxttabmar < \@hightab
260 % then \@nxttabmar :=G \@nxttabmar+1
261 % else error message ``Undefined tab''
262 % fi
263 % END
264 %
265 % \@tabminus ==
266 % BEGIN
267 % if \@nxttabmar > \@firsttab
268 % then \@nxttabmar :=G \@nxttabmar-1
269 % else error message ``Too many untabs''
270 % fi
271 % END
272 %
273 % \@tabrj ==
274 % BEGIN \@stopfield
275 % \@addfield
276 % @rjfield :=G T
277 % \@startfield
278 % END
279 %
280 % \@tablab ==
281 % BEGIN \@stopfield
282 % \box\@curline G:= \hbox{\box\@curline %% `G' added 17 Jun 86
283 % \hskip - width of \box\@curfield
284 % \hskip -\tabbingsep
285 % \box\@curfield
286 % \hskip \tabbingsep }
287 % \@startfield
288 % END
289 %
290 % \pushtabs ==
291 % BEGIN
292 % \@stopfield
293 % \@tabpush :=G \@tabpush + 1
294 % \begingroup
295 % \@contfield
296 % END
297 %
298 % \poptabs ==
299 % BEGIN
300 % \@stopfield
301 % if \@tabpush > 0
302 % then \endgroup
303 % \@tabpush :=G \@tabpush - 1
304 % else error message: ``Too many \poptabs''
305 % fi
306 % \@contfield
307 % END
308 %
309 % \end{oldcomments}
310 %
311 % \begin{macro}{\a}
312 % The accents |\`| , |\'| , and |\=| that have been redefined inside a
313 % tabbing environment can be called by typing |\a`| , |\a'| , and |\a=|.
314 % The macro |\a| is defined in |ltoutenc.dtx|.
315 % \changes{v1.0d}{1994/05/13}
316 % {moved to ltoutenc}
317 % \end{macro}
318 %
319 %
320 % The `2ekernel' code ensures that a |\usepackage{autotabg}| is
321 % essentially ignored if a `full' format is being used that has
322 % picture mode already in the format.
323 % \begin{macrocode}
324 %<2ekernel>\expandafter\let\csname [email protected]\endcsname\fmtversion
325 % \end{macrocode}
326 %
327 % \begin{macro}{\@firsttab}
328 % \begin{macro}{\@maxtab}
329 % \changes{v1.0c}{1994/05/07}{Changed \cs{@firsttab} to \cs{chardef}}
330 % \changes{v1.0c}{1994/05/07}{Changed \cs{@maxtab} to \cs{chardef}}
331 % \begin{macrocode}
332 %<*2ekernel>
333 \newdimen\@gtempa
334 \chardef\@firsttab=\the\allocationnumber
335 \newdimen\@gtempa\newdimen\@gtempa\newdimen\@gtempa\newdimen\@gtempa
336 \newdimen\@gtempa\newdimen\@gtempa\newdimen\@gtempa\newdimen\@gtempa
337 \newdimen\@gtempa\newdimen\@gtempa\newdimen\@gtempa\newdimen\@gtempa
338 \newdimen\@gtempa
339 \chardef\@maxtab=\the\allocationnumber
340 \dimen\@firsttab=0pt
341 % \end{macrocode}
342 % \end{macro}
343 % \end{macro}
344 %
345 % \begin{macro}{\@nxttabmar}
346 % \begin{macro}{\@curtabmar}
347 % \begin{macro}{\@curtab}
348 % \begin{macro}{\@hightab}
349 % \begin{macro}{\@tabpush}
350 % \begin{macrocode}
351 \newcount\@nxttabmar
352 \newcount\@curtabmar
353 \newcount\@curtab
354 \newcount\@hightab
355 \newcount\@tabpush
356 % \end{macrocode}
357 % \end{macro}
358 % \end{macro}
359 % \end{macro}
360 % \end{macro}
361 % \end{macro}
362 %
363 % \begin{macro}{\@curline}
364 % \begin{macro}{\@curfield}
365 % \begin{macro}{\@tabfbox}
366 % \begin{macrocode}
367 \newbox\@curline
368 \newbox\@curfield
369 \newbox\@tabfbox
370 % \end{macrocode}
371 % \end{macro}
372 % \end{macro}
373 % \end{macro}
374 %
375 %
376 % \begin{macro}{\if@rjfield}
377 % \begin{macrocode}
378 \newif\if@rjfield
379 % \end{macrocode}
380 % \end{macro}
381 %
382 % \begin{macro}{\@startline}
383 % \changes{v1.1f}{1995/10/23}{(CAR)Ensure that \cs{@nxttabmar} is never
384 % larger than \cs{@hightab}}
385 % It is, in some sense, an error if the current margin
386 % tab setting is higher than the value of |\@hightab| (which is
387 % a local variable). That this is allowed is a fundamental design
388 % flaw which is not going to be corrected now.
389 % \begin{macrocode}
390 \def\@startline{%
391 \ifnum \@nxttabmar >\@hightab
392 \@badtab
393 \global\@nxttabmar \@hightab
394 \fi
395 \global\@curtabmar \@nxttabmar
396 \global\@curtab \@curtabmar
397 \global\setbox\@curline \hbox {}%
398 \@startfield
399 \strut}
400 % \end{macrocode}
401 % \end{macro}
402 %
403 % \begin{macro}{\@stopline}
404 % \begin{macrocode}
405 \def\@stopline{%
406 \unskip
407 \@stopfield
408 \if@rjfield
409 \global\@rjfieldfalse
410 \@tempdima\@totalleftmargin
411 \advance\@tempdima\linewidth
412 \hb@xt@\@tempdima{%
413 \@itemfudge\hskip\dimen\@curtabmar
414 \box\@curline
415 \hfil
416 \box\@curfield}%
417 \else
418 \@addfield
419 \hbox{\@itemfudge\hskip\dimen\@curtabmar\box\@curline}%
420 \fi}
421 % \end{macrocode}
422 % \end{macro}
423 %
424 % \begin{macro}{\@startfield}
425 % \changes{v1.0d}{1994/05/13}
426 % {Colour support}
427 % \begin{macrocode}
428 \def\@startfield{%
429 \global\setbox\@curfield\hbox\bgroup\color@begingroup}
430 % \end{macrocode}
431 % \end{macro}
432 %
433 % \begin{macro}{\@stopfield}
434 % \changes{v1.0d}{1994/05/13}
435 % {Colour support}
436 % \begin{macrocode}
437 \def\@stopfield{%
438 \color@endgroup\egroup}
439 % \end{macrocode}
440 % \end{macro}
441 %
442 % \begin{macro}{\@contfield}
443 % \changes{v1.0d}{1994/05/13}
444 % {Colour support}
445 % \begin{macrocode}
446 \def\@contfield{%
447 \global\setbox\@curfield\hbox\bgroup\color@begingroup
448 \unhbox\@curfield}
449 % \end{macrocode}
450 % \end{macro}
451 %
452 % \begin{macro}{\@addfield}
453 % \begin{macrocode}
454 \def\@addfield{\global\setbox\@curline\hbox{\unhbox
455 \@curline\unhbox\@curfield}}
456 % \end{macrocode}
457 % \end{macro}
458 %
459 % \begin{macro}{\@ifatmargin}
460 % \begin{macrocode}
461 \def\@ifatmargin{\ifdim \wd\@curline =\z@}
462 % \end{macrocode}
463 % \end{macro}
464 %
465 % \begin{macro}{\@tabcr}
466 % \begin{macrocode}
467 \protected\def\@tabcr{\@stopline \@ifstar{\penalty \@M \@xtabcr}\@xtabcr}
468 % \end{macrocode}
469 % \end{macro}
470 %
471 % \begin{macro}{\@xtabcr}
472 % \begin{macrocode}
473 \def\@xtabcr{\@ifnextchar[\@itabcr{\@startline\ignorespaces}}
474 % \end{macrocode}
475 % \end{macro}
476 %
477 % \begin{macro}{\@itabcr}
478 % \changes{v1.1r}{2020/04/21}{Support calc syntax (gh/152)}
479 % \begin{macrocode}
480 %</2ekernel>
481 %<*2ekernel|latexrelease>
482 %<latexrelease>\IncludeInRelease{2020/10/01}%
483 %<latexrelease> {\@itabcr}{Tabbing calc syntax}%
484 \def\@itabcr[#1]{\@vspace@calcify{#1}\@startline\ignorespaces}
485 %</2ekernel|latexrelease>
486 % \end{macrocode}
487 %
488 % \begin{macrocode}
489 %<latexrelease>\EndIncludeInRelease
490 %<latexrelease>\IncludeInRelease{0000/00/00}%
491 %<latexrelease> {\@itabcr}{Tabbing calc syntax}%
492 %<latexrelease>
493 %<latexrelease>\def\@itabcr[#1]{\vskip #1\@startline\ignorespaces}
494 %<latexrelease>\EndIncludeInRelease
495 %<*2ekernel>
496 % \end{macrocode}
497 %
498 %
499 % \begin{environment}{tabbing}
500 % \begin{macro}{\tabbing}
501 % \changes{v1.1f}{1995/10/23}{(CAR)Make \cs{@hightab} consistently a
502 % local variable}
503 % \changes{latex2e}{1993/12/13}{Removed optional argument of \cs{item}}
504 % We use |\relax| to prevent |\item| from scanning too far.
505 % \begin{macrocode}
506 \def\tabbing{\lineskip \z@skip\let\>\@rtab\let\<\@ltab\let\=\@settab
507 \let\+\@tabplus\let\-\@tabminus\let\`\@tabrj\let\'\@tablab
508 \let\\=\@tabcr
509 \@hightab\@firsttab
510 \global\@nxttabmar\@firsttab
511 \dimen\@firsttab\@totalleftmargin
512 \global\@tabpush\z@ \global\@rjfieldfalse
513 \trivlist \item\relax
514 \if@minipage\else\vskip\parskip\fi
515 % \end{macrocode}
516 % \changes{v1.1i}{1996/10/21}{Moved the \cs{indent} so that the
517 % \cs{everypar} can remove it when necessary; this is needed because
518 % the code for items in lists has changed (see pr/22111)}
519 % \begin{macrocode}
520 \setbox\@tabfbox\hbox{%
521 \rlap{\hskip\@totalleftmargin\indent\the\everypar}}%
522 \def\@itemfudge{\box\@tabfbox}%
523 \@startline\ignorespaces}
524 % \end{macrocode}
525 % \end{macro}
526 %
527 % \begin{macro}{\endtabbing}
528 % \begin{macrocode}
529 \def\endtabbing{%
530 \@stopline\ifnum\@tabpush >\z@ \@badpoptabs \fi\endtrivlist}
531 % \end{macrocode}
532 % \end{macro}
533 % \end{environment}
534 %
535 %
536 % \begin{macro}{\@rtab}
537 % Omitted |\global| added to |\@rtab| 17 Jun 86
538 % \begin{macrocode}
539 \def\@rtab{\@stopfield\@addfield\ifnum \@curtab<\@hightab
540 \global\advance\@curtab \@ne \else\@badtab\fi
541 \@tempdima\dimen\@curtab
542 \advance\@tempdima -\dimen\@curtabmar
543 \advance\@tempdima -\wd\@curline
544 \global\setbox\@curline\hbox{\unhbox\@curline\hskip\@tempdima}%
545 \@startfield\ignorespaces}
546 % \end{macrocode}
547 % \end{macro}
548 %
549 % \begin{macro}{\@settab}
550 % \changes{v1.1f}{1995/10/23}{(CAR)Ensure that \cs{@hightab} increases
551 % by at most one}
552 % \begin{macrocode}
553 \def\@settab{\@stopfield\@addfield
554 \ifnum \@curtab <\@maxtab
555 \ifnum\@curtab =\@hightab
556 \advance\@hightab \@ne
557 \fi
558 \global\advance\@curtab \@ne
559 \else
560 \@latex@error{Tab overflow}\@ehd
561 \fi
562 \dimen\@curtab \dimen\@curtabmar
563 \advance\dimen\@curtab \wd\@curline
564 \@startfield
565 \ignorespaces}
566 % \end{macrocode}
567 % \end{macro}
568 %
569 % \begin{macro}{\@ltab}
570 % \begin{macrocode}
571 \def\@ltab{\@ifatmargin\ifnum\@curtabmar >\@firsttab
572 \global\advance\@curtab \m@ne \global\advance\@curtabmar\m@ne\else
573 \@badtab\fi\else
574 \@latex@error{\string\<\space in mid line}\@ehd\fi\ignorespaces}
575 % \end{macrocode}
576 % \end{macro}
577 %
578 % \begin{macro}{\@tabplus}
579 % \begin{macrocode}
580 \def\@tabplus{%
581 \ifnum\@nxttabmar<\@hightab
582 \global\advance\@nxttabmar\@ne
583 \else
584 \@badtab
585 \fi
586 \ignorespaces}
587 % \end{macrocode}
588 % \end{macro}
589 %
590 % \begin{macro}{\@tabminus}
591 % \begin{macrocode}
592 \def\@tabminus{%
593 \ifnum\@nxttabmar>\@firsttab
594 \global\advance\@nxttabmar\m@ne
595 \else
596 \@badtab
597 \fi
598 \ignorespaces}
599 % \end{macrocode}
600 % \end{macro}
601 %
602 % \begin{macro}{\@tabrj}
603 % \begin{macrocode}
604 \def\@tabrj{%
605 \@stopfield\@addfield\global\@rjfieldtrue\@startfield\ignorespaces}
606 % \end{macrocode}
607 % \end{macro}
608 %
609 % \begin{macro}{\@tablab}
610 % |\setbox\@curline| made |\global| in |\@tablab|. 17 Jun 86
611 % \begin{macrocode}
612 \def\@tablab{%
613 \@stopfield
614 \global\setbox\@curline\hbox{%
615 \box\@curline
616 \hskip-\wd\@curfield \hskip-\tabbingsep
617 \box\@curfield
618 \hskip\tabbingsep}%
619 \@startfield
620 \ignorespaces}
621 % \end{macrocode}
622 % \end{macro}
623 %
624 % \begin{macrocode}
625 %</2ekernel>
626 %<*2ekernel|latexrelease>
627 %<latexrelease>\IncludeInRelease{2019/10/01}%
628 %<latexrelease> {\pushtabs}{Make commands robust}%
629 % \end{macrocode}
630 %
631 % \begin{macro}{\pushtabs}
632 % \begin{macrocode}
633 \DeclareRobustCommand\pushtabs{%
634 \@stopfield\@addfield\global\advance\@tabpush \@ne \begingroup
635 \@contfield}
636 % \end{macrocode}
637 % \end{macro}
638 %
639 % \begin{macro}{\poptabs}
640 % \changes{v1.1f}{1995/10/23}{(CAR)Ensure that \cs{@curtab} is never
641 % larger than \cs{@hightab}}
642 % It is, in some sense, an error if, after the endgroup, the current
643 % tab setting is higher than the new value of |\@hightab| (which is
644 % a local variable). That this is allowed is a fundamental design
645 % flaw which is not going to be corrected now.
646 % \begin{macrocode}
647 \DeclareRobustCommand\poptabs{\@stopfield\@addfield
648 \ifnum \@tabpush >\z@
649 \endgroup
650 \global\advance\@tabpush \m@ne
651 \ifnum \@curtab >\@hightab
652 \global \@curtab \@hightab
653 \@badtab
654 \fi
655 \else
656 \@badpoptabs
657 \fi
658 \@contfield}
659 % \end{macrocode}
660 % \end{macro}
661 %
662 % \begin{macrocode}
663 \DeclareRobustCommand\kill{\@stopfield\@startline\ignorespaces}
664 % \end{macrocode}
665 % \end{macro}
666 %
667 % \begin{macrocode}
668 %</2ekernel|latexrelease>
669 %<latexrelease>\EndIncludeInRelease
670 %<latexrelease>\IncludeInRelease{0000/00/00}%
671 %<latexrelease> {\pushtabs}{Make commands robust}%
672 %<latexrelease>
673 %<latexrelease>\kernel@make@fragile\pushtabs
674 %<latexrelease>\kernel@make@fragile\poptabs
675 %<latexrelease>\kernel@make@fragile\kill
676 %<latexrelease>
677 %<latexrelease>\EndIncludeInRelease
678 %<*2ekernel>
679 % \end{macrocode}
680 %
681 % \begin{macro}{\tabbingsep}
682 % \begin{macrocode}
683 \newdimen\tabbingsep
684 % \end{macrocode}
685 % \end{macro}
686 %
687 %
688 %
689 % \subsection{array and tabular environments}
690 %
691 % \begin{oldcomments}
692 %
693 % ARRAY PARAMETERS:
694 % \arraycolsep
695 % : half the width separating columns in an array environment
696 % \tabcolsep
697 % : half the width separating columns in a tabular environment
698 % \arrayrulewidth
699 % : width of rules
700 % \doublerulesep
701 % : space between adjacent rules in array or tabular
702 % \arraystretch
703 % : line spacing in array and tabular environments is done by
704 % placing a strut in every row of height and depth
705 % \arraystretch times the height and depth of the strut
706 % produced by an ordinary \strut command.
707 %
708 % PREAMBLE:
709 % The PREAMBLE argument of an array or tabular environment can
710 % contain the following:
711 % l,r,c : indicate where entry is to be placed.
712 % | : for vertical rule
713 % @{EXP} : inserts the text EXP in every column.
714 % \arraycolsep or \tabcolsep spacing is suppressed.
715 % *{N}{PRE} : equivalent to writing N copies of PRE in the preamble.
716 % PRE may contain *{N'}{EXP'} expressions.
717 % p{LEN} : makes entry in parbox of width LEN.
718 %
719 % SPECIAL ARRAY COMMANDS:
720 % \multicolumn{N}{FORMAT}{ITEM} : replaces the next N column
721 % items by ITEM, formatted according to FORMAT.
722 % FORMAT should contain at most one l,r or c.
723 % If it contains none, then ITEM is ignored.
724 %
725 % \vline : draws a vertical line the height of the current row. May
726 % appear in an array element entry.
727 % \hline : draws a horizontal line between rows. Must appear either
728 % before the first entry (to appear above the first row) or
729 % right after a \\ command. If followed by another \hline,
730 % then adds a \vskip of \doublerulesep.
731 %
732 % \cline{i-j} : draws horizontal lines between rows covering columns
733 % i through j, inclusive. Multiple commands may follow
734 % one another to provide lines covering several disjoint
735 % columns
736 % \extracolsep{WIDTH} : for use inside an @ in the preamble. Causes
737 % a WIDTH space to be added between columns for the rest
738 % of the columns. This is in addition to the ordinary
739 % intercolumn space.
740 %
741 % \array ==
742 % BEGIN
743 % \@acol == \@arrayacol
744 % \@classz == \@arrayclassz
745 % \@classiv == \@arrayclassiv
746 % \\ == \@arraycr
747 % \@halignto == NULL
748 % \@tabarray
749 % END
750 %
751 % \endarray{NAME} == BEGIN \crcr }} END
752 %
753 % \tabular ==
754 % BEGIN
755 % \@halignto == NULL
756 % \@tabular
757 % END
758 %
759 % \tabular*{WIDTH} ==
760 % BEGIN
761 % \@halignto == to WIDTH
762 % \@tabular
763 % END
764 %
765 % \@tabular ==
766 % BEGIN
767 % \leavevmode
768 % \hbox { $
769 % \@acol == \@tabacol
770 % \@classz == \@tabclassz
771 % \@classiv == \@tabclassiv
772 % \\ == \@tabularcr
773 % \@tabarray
774 % END
775 %
776 % \endtabular == BEGIN \crcr}} $} END
777 %
778 % \@tabarray == if next char = [ then \@array else \@array[c] fi
779 %
780 % \@array[POS]{PREAMBLE} ==
781 % BEGIN
782 % define \@arstrutbox to make \@arstrut produce strut of height
783 % and depth \arraystretch times the height and
784 % depth of a normal strut.
785 % \@mkpream{PREAMBLE}
786 % \@preamble == \halign \@halignto {\tabskip=0pt\@arstrut
787 % eval{\@preamble}\tabskip = 0pt\cr %%}
788 % \@startpbox == \@@startpbox
789 % \@endpbox == \@@endpbox
790 % if POS = t then \vtop
791 % else if POS = b then \vbox
792 % else \vcenter
793 % fi fi
794 % {
795 % \par ==L {} % changed 92/09/18
796 % \@sharp == #
797 % \protect == \relax
798 % \lineskip :=L 0pt
799 % \baselineskip :=L 0pt
800 % \@preamble
801 % END
802 %
803 %
804 % \@arraycr ==
805 % BEGIN
806 % $ %% Prevents extra space at end of row's last entry.
807 % if next char = [
808 % then \@argarraycr
809 % else $ \cr %% Needed to balance $
810 % END
811 %
812 % \@argarraycr[LENGTH] ==
813 % BEGIN
814 % $ %% Needed to balance $ of \@arraycr
815 % if LENGTH > 0
816 % then \@tempdima := depth of \@arstrutbox + LENGTH
817 % \vrule height 0pt width 0pt depth \@tempdima
818 % \cr
819 % else \cr \noalign{\vskip LENGTH}
820 % END
821 %
822 % \@tabularcr and \@argtabularcr same as \@arraycr and \@argarraycr
823 % except without the extra $'s.
824 % \end{oldcomments}
825 %
826 %
827 % \begin{macro}{\extracolsep}
828 % This command needs to expand during the tabular preamble construction
829 % so can't be robust.
830 %
831 % \changes{v1.1q}{2019/10/07}{This needs to expand}
832 % \begin{macrocode}
833 \def\extracolsep#1{\tabskip #1\relax}
834 % \end{macrocode}
835 % \end{macro}
836 %
837 % \begin{environment}{array}
838 % \begin{macro}{\array}
839 % \begin{macrocode}
840 \def\array{\let\@acol\@arrayacol \let\@classz\@arrayclassz
841 \let\@classiv\@arrayclassiv
842 \let\\\@arraycr\let\@halignto\@empty\@tabarray}
843 % \end{macrocode}
844 % \end{macro}
845 % \end{environment}
846 %
847 % \begin{macro}{\endarray}
848 % \begin{macro}{\endtabular}
849 % \begin{macro}{\endtabular*}
850 % \begin{macrocode}
851 \def\endarray{\crcr\egroup\egroup}
852 \def\endtabular{\crcr\egroup\egroup $\egroup}
853 \expandafter \let \csname endtabular*\endcsname = \endtabular
854 % \end{macrocode}
855 % \end{macro}
856 % \end{macro}
857 % \end{macro}
858 %
859 % \begin{environment}{tabular}
860 % \begin{macro}{\tabular}
861 % \begin{macrocode}
862 \def\tabular{\let\@halignto\@empty\@tabular}
863 % \end{macrocode}
864 % \end{macro}
865 % \end{environment}
866 %
867 % \begin{macro}{\tabular*}
868 % \changes{v1.1j}{1998/05/18}{Use \cs{setlength}, so that
869 % calc extensions apply.}
870 % Note that the change to use |\setlength| slightly alters the
871 % timing of the expansion and use of the length in |#1| but this is
872 % very unlikely to have any practical effect.
873 % \changes{latex2e}{1993/08/05}{Replaced \cs{expandafter}\cs{def}
874 % by \cs{@namedef}.}
875 % \begin{macrocode}
876 \@namedef{tabular*}#1{%
877 \setlength\dimen@{#1}%
878 \edef\@halignto{to\the\dimen@}\@tabular}
879 % \end{macrocode}
880 % \end{macro}
881 %
882 % \begin{macro}{\@tabular}
883 % \begin{macrocode}
884 \def\@tabular{\leavevmode \hbox \bgroup $\let\@acol\@tabacol
885 \let\@classz\@tabclassz
886 \let\@classiv\@tabclassiv \let\\\@tabularcr\@tabarray}
887 % \end{macrocode}
888 % \end{macro}
889 %
890 % \begin{macro}{\@tabarray}
891 % RmS 91/11/04 added |\m@th|.
892 % \begin{macrocode}
893 \def\@tabarray{\m@th\@ifnextchar[\@array{\@array[c]}}
894 % \end{macrocode}
895 % \end{macro}
896 %
897 % RmS 1993/11/03 changed |\halign| to |\ialign| and removed superfluous
898 % |\tabskip| assignment
899 %
900 %
901 % \changes{v1.1i}{1996/10/21}{Moved the code associated with
902 % \cs{@mkpream} into the group provided by the box, for robustness
903 % (latex/2183)}
904 % \begin{macro}{\@array}
905 % \begin{macrocode}
906 \def\@array[#1]#2{%
907 \if #1t\vtop \else \if#1b\vbox \else \vcenter \fi\fi
908 % \end{macrocode}
909 % \changes{LaTeX2.09}{1992/09/18}
910 % {Changed \cs{par} to \cs{@empty} to avoid starting new row
911 % e.g. after \cs{hline}}
912 % \begin{macrocode}
913 \bgroup
914 % \end{macrocode}
915 % This next bit of code sets up the strut and then builds the halign
916 % and its preamble according to the specification in the second
917 % argument.
918 %
919 % This code has been moved inside the box.
920 % A side effect of this has been to expose what was a buglet in the
921 % previous version: since the |\@arstrut| below is expanded and
922 % contains an |\ifmmode| then it could produce an unnecessary extra
923 % box in every row, thus wasting `lots of' main memory.
924 % \begin{macrocode}
925 \setbox\@arstrutbox\hbox{%
926 \vrule \@height\arraystretch\ht\strutbox
927 \@depth\arraystretch \dp\strutbox
928 \@width\z@}%
929 \@mkpream{#2}%
930 \edef\@preamble{%
931 \ialign \noexpand\@halignto
932 \bgroup \@arstrut \@preamble \tabskip\z@skip \cr}%
933 % \end{macrocode}
934 % That is the end of setting up the preamble; now we reset
935 % things before executing the halign built-up in |\@preamble|.
936 % The restorations could be done by introducing an extra group,
937 % thus saving tokens.
938 % \changes{v1.0k}{1994/12/08}{Add \cs{tabularnewline}}
939 % \changes{v1.1i}{1996/10/21}{Use \cs{set@typeset@protect}}
940 % \changes{v1.1t}{2025/09/24}{Check \cs{currentgrouptype} in \cs{par} (gh1864)}
941 % \begin{macrocode}
942 \let\@startpbox\@@startpbox \let\@endpbox\@@endpbox
943 \let\tabularnewline\\%
944 \def\par{\ifnum\currentgrouptype=6 \else\@@par\fi}%
945 \let\@sharp##%
946 \set@typeset@protect
947 \lineskip\z@skip\baselineskip\z@skip
948 % \end{macrocode}
949 % If the parsing of the preamble goes wrong there my be some
950 % characters left which \TeX{} then tries to typeset, i.e., we
951 % would be in horizontal mode. That would produce an endless loop
952 % because the |\halign| expects vertical mode thus issues a |\par|
953 % but that is a no-op at this point. So we better test this case
954 % issue some error message and make a crude recovery by ending that
955 % horizontal mode with force.
956 % A better fix would be to ensure that we never pick up more than a
957 % single character token (not done).
958 % \changes{v1.1m}{1998/11/13}{Check for hmode to see if something
959 % went wrong during parsing (pr/2884)}
960 % \begin{macrocode}
961 \ifhmode \@preamerr\z@ \@@par\fi
962 \@preamble}
963 % \end{macrocode}
964 % \end{macro}
965 %
966 % \begin{macro}{\@arraycr}
967 % Array version of |\\|.
968 % \changes{v1.1s}{2021/04/20}{Use \cs{protected} for \cs{\bslash} variant (gh/548)}
969 % \begin{macrocode}
970 \protected\def\@arraycr{%
971 ${\ifnum0=`}\fi\@ifstar\@xarraycr\@xarraycr}
972 % \end{macrocode}
973 % \end{macro}
974 %
975 % \begin{macro}{\@arraycr}
976 % \begin{macrocode}
977 \def\@xarraycr{\@ifnextchar[\@argarraycr{\ifnum0=`{\fi}${}\cr}}
978 % \end{macrocode}
979 % \end{macro}
980 %
981 % \begin{macro}{\@argarraycr}
982 % \begin{macrocode}
983 \def\@argarraycr[#1]{%
984 \ifnum0=`{\fi}${}\ifdim #1>\z@ \@xargarraycr{#1}\else
985 \@yargarraycr{#1}\fi}
986 % \end{macrocode}
987 % \end{macro}
988 %
989 % \begin{macro}{\tabularnewline}
990 % \changes{v1.0i}{1994/11/14}{(DPC) Macro added}
991 % \changes{v1.0k}{1994/12/08}{(DPC) Made it \cs{relax}}
992 % Tabular version of |\\|.
993 % \begin{macrocode}
994 \let\tabularnewline\relax
995 % \end{macrocode}
996 % \end{macro}
997 %
998 % \begin{macro}{\@tabularcr}
999 % \changes{v1.1s}{2021/04/20}{Use \cs{protected} for \cs{\bslash} variant (gh/548)}
1000 % \begin{macrocode}
1001 \protected\def\@tabularcr{%
1002 {\ifnum0=`}\fi\@ifstar\@xtabularcr\@xtabularcr}
1003 % \end{macrocode}
1004 % \end{macro}
1005 %
1006 % \begin{macro}{\@xtabularcr}
1007 % \begin{macrocode}
1008 \def\@xtabularcr{\@ifnextchar[\@argtabularcr{\ifnum0=`{\fi}\cr}}
1009 % \end{macrocode}
1010 % \end{macro}
1011 %
1012 % \begin{macro}{\@argtabularcr}
1013 % \begin{macrocode}
1014 \def\@argtabularcr[#1]{%
1015 \ifnum0=`{\fi}%
1016 \ifdim #1>\z@
1017 \unskip\@xargarraycr{#1}%
1018 \else
1019 \@yargarraycr{#1}%
1020 \fi}
1021 % \end{macrocode}
1022 % \end{macro}
1023 %
1024 % \begin{macro}{\@xargarraycr}
1025 % \begin{macrocode}
1026 \def\@xargarraycr#1{\@tempdima #1\advance\@tempdima \dp \@arstrutbox
1027 \vrule \@height\z@ \@depth\@tempdima \@width\z@ \cr}
1028 % \end{macrocode}
1029 % \end{macro}
1030 %
1031 % \begin{macro}{\@yargarraycr}
1032 % \changes{v1.1r}{2020/04/21}{Support calc syntax (gh/152)}
1033 % \begin{macrocode}
1034 %</2ekernel>
1035 %<*2ekernel|latexrelease>
1036 %<latexrelease>\IncludeInRelease{2020/10/01}%
1037 %<latexrelease> {\@yargarraycr}{tabular support calc syntax}%
1038 \def\@yargarraycr#1{\cr\noalign{\@vspace@calcify{#1}}}
1039 %</2ekernel|latexrelease>
1040 %<latexrelease>\EndIncludeInRelease
1041 % \end{macrocode}
1042 %
1043 % \begin{macrocode}
1044 %<latexrelease>\IncludeInRelease{0000/00/00}%
1045 %<latexrelease> {\@yargarraycr}{tabular support calc syntax}%
1046 %<latexrelease>
1047 %<latexrelease>\def\@yargarraycr#1{\cr\noalign{\vskip #1}}
1048 %<latexrelease>\EndIncludeInRelease
1049 %<*2ekernel>
1050 % \end{macrocode}
1051 % \end{macro}
1052 %
1053 % \begin{macro}{\multicolumn}
1054 % \begin{oldcomments}
1055 % \multicolumn{NUMBER}{FORMAT}{ITEM} ==
1056 % BEGIN
1057 % \multispan{NUMBER}
1058 % \begingroup
1059 % \@addamp == null
1060 % \@mkpream{FORMAT}
1061 % \@sharp == ITEM
1062 % \protect == \relax
1063 % \@startpbox == \@@startpbox
1064 % \@endpbox == \@@endpbox
1065 % \@arstrut
1066 % \@preamble
1067 % \endgroup
1068 % END
1069 % \end{oldcomments}
1070 %
1071 % The command |\def\@addamp{}| was removed from |\multicolumn| on
1072 % 6 Dec 86 because it caused embedded array environments not to work. I
1073 % think that it was included originally to prevent an error message if
1074 % the 2nd argument to the |\multicolumn| command had two column
1075 % specifiers.
1076 %
1077 % 8 Feb 89 --- |\hbox{}| added after |\@preamble| to correct bug that
1078 % occurred if |\multicolumn| preceded |\\[D]| with |D > 0|,
1079 % caused by |\\[]| command doing an |\unskip|, which removed
1080 % |\tabcolsep| glue inserted by |\multicolumn|.
1081 %
1082 %
1083 % \changes{v1.0h}{1994/11/04}{(ASAJ) added \cs{set@typeset@protect}.}
1084 % \changes{v1.1i}{1996/10/21}{Make \cs{multicolumn} long (latex/2180)}
1085 % This has been made long so that, for example, a |p|-column can
1086 % contain multiple paragraphs; maybe the arguments of |@|-expressions
1087 % should also be able to contain multiple paragraphs.
1088 % \begin{macrocode}
1089 \long\def\multicolumn#1#2#3{\multispan{#1}\begingroup
1090 \@mkpream{#2}%
1091 \def\@sharp{#3}\set@typeset@protect
1092 \let\@startpbox\@@startpbox\let\@endpbox\@@endpbox
1093 \@arstrut \@preamble\hbox{}\endgroup\ignorespaces}
1094 % \end{macrocode}
1095 % \end{macro}
1096 %
1097 % \begin{oldcomments}
1098 % Codes for classes and character numbers of array, tabular and
1099 % multicolumn arguments.
1100 %
1101 % Character Class Number
1102 % --------- ----- ------
1103 % c 0 0
1104 % l 0 1
1105 % r 0 2
1106 %
1107 % | 1 -
1108 % @ 2 -
1109 % p 3 -
1110 % {@-exp} 4 -
1111 % {p-arg} 5 -
1112 %
1113 % \@testpach \foo : expands \foo, which should be an array parameter
1114 % token, and sets \@chclass and \@chnum to its class and
1115 % number. Uses \@lastchclass to distinguish 4 and 5
1116 %
1117 % Preamble error codes
1118 % 0: 'illegal character'
1119 % 1: 'Missing @-exp'
1120 % 2: 'Missing p-arg'
1121 %
1122 % \@addamp ==
1123 % BEGIN if @firstamp = true then @firstamp := false
1124 % else & fi
1125 % END
1126 %
1127 % \@mkpream TOKENLIST ==
1128 % BEGIN
1129 % @firstamp := T
1130 % \@lastchclass := 6
1131 % \@preamble == null
1132 % \@sharp == \relax
1133 % \protect == BEGIN \noexpand\protect\noexpand END
1134 % \@startpbox == \relax
1135 % \@endpbox == \relax
1136 % \@expast{TOKENLIST}
1137 % for \@nextchar := expand(\reserved@a)
1138 % do \@testpach{\@nextchar}
1139 % case of \@chclass
1140 % 0 -> \@classz
1141 % 1 -> \@classi
1142 % ...
1143 % 5 -> \@classv
1144 % end case
1145 % \@lastchclass := \@chclass
1146 % od
1147 % case of \@lastchclass
1148 % 0 -> \hskip \arraycolsep % lrc
1149 % 1 -> % |
1150 % 2 -> \@preamerr1 % 'Missing @-exp' % @
1151 % 3 -> \@preamerr2 % 'Missing p-arg' % p
1152 % 4 -> % @-exp
1153 % 5 -> \hskip \arraycolsep % p-exp
1154 % end case
1155 % END
1156 %
1157 % \@arrayclassz ==
1158 % BEGIN
1159 % \@preamble := \@preamble *
1160 % case of \@lastchclass
1161 % 0 -> \hskip \arraycolsep \@addamp \hskip \arraycolsep
1162 % 1 -> \@addamp \hskip \arraycolsep
1163 % 2 -> % impossible
1164 % 3 -> % impossible
1165 % 4 -> \@addamp
1166 % 5 -> \hskip \arraycolsep \@addamp \hskip \arraycolsep
1167 % 6 -> \@addamp \hskip \arraycolsep
1168 % end case
1169 % * case of \@chnum
1170 % 0 -> \hfil$\relax\@sharp$\hfil
1171 % 1 -> $\relax\@sharp$\hfil
1172 % 2 -> \hfil$\relax\@sharp$
1173 % end case
1174 % END
1175 %
1176 % \@tabclassz == similar to \@arrayclassz
1177 %
1178 % \@classi ==
1179 % BEGIN
1180 % \@preamble := \@preamble *
1181 % case of \@lastchclass
1182 % 0 -> \hskip \arraycolsep \@arrayrule
1183 % 1 -> \hskip \doublerulesep \@arrayrule
1184 % 2 -> % impossible
1185 % 3 -> % impossible
1186 % 4 -> \@arrayrule
1187 % 5 -> \hskip \arraycolsep \@arrayrule
1188 % 6 -> \@arrayrule
1189 % end case
1190 % END
1191 %
1192 % \@classii ==
1193 % BEGIN
1194 % \@preamble := \@preamble *
1195 % case of \@lastchclass
1196 % 0 ->
1197 % 1 -> \hskip .5\arrayrulewidth
1198 % 2 -> % impossible
1199 % else ->
1200 % end case
1201 % END
1202 %
1203 % \@classiii ==
1204 % BEGIN
1205 % \@preamble := \@preamble *
1206 % case of \@lastchclass
1207 % 0 -> \hskip \arraycolsep \@addamp \hskip \arraycolsep
1208 % 1 -> \@addamp \hskip \arraycolsep
1209 % 2 -> % impossible
1210 % 3 -> % impossible
1211 % 4 -> \@addamp
1212 % 5 -> \hskip \arraycolsep \@addamp \hskip \arraycolsep
1213 % 6 -> \@addamp \hskip \arraycolsep
1214 % end case
1215 % END
1216 %
1217 % \@arrayclassiv ==
1218 % BEGIN \@preamble := \@preamble * $ \@nextchar$ END
1219 %
1220 % \@tabclassiv == same as \@arrayclassv except without the $ ... $
1221 %
1222 % \@classv ==
1223 % BEGIN
1224 % \@preamble :=
1225 % \@preamble * \@startpbox{\@nextchar}\ignorespaces\@sharp
1226 % \@endpbox
1227 % END
1228 %
1229 % \@expast{S}:
1230 % Sets \reserved@a := S with all instances of *{N}{STRING}
1231 % replaced by N copies of STRING, where N > 0. An *
1232 % appearing inside braces is ignored, but *-expressions
1233 % inside STRING are expanded, so nested *-expressions are
1234 % handled properly.
1235 %
1236 % \@expast{S} == BEGIN \@xexpast S *0x\@@ END
1237 %
1238 % \@xexpast S1 *{N}{S2} S3 \@@ ==
1239 % BEGIN
1240 % \reserved@a := S1
1241 % \@tempcnta := N
1242 % if \@tempcnta > 0
1243 % then while \@tempcnta > 0 do \reserved@a := \reserved@a S2
1244 % \@tempcnta := \@tempcnta - 1 od
1245 % \reserved@b == \@xexpast
1246 % else \reserved@b == \@xexnoop
1247 % fi
1248 % \expandafter \reserved@b \reserved@a S3 \@@
1249 % END
1250 % \end{oldcomments}
1251 %
1252 %
1253 % \begin{macro}{\@xexnoop}
1254 % \begin{macrocode}
1255 \def\@xexnoop #1\@@{}
1256 % \end{macrocode}
1257 % \end{macro}
1258 %
1259 % \begin{macro}{\@expast}
1260 % \begin{macrocode}
1261 \def\@expast#1{\@xexpast #1*0x\@@}
1262 % \end{macrocode}
1263 % \end{macro}
1264 %
1265 % \begin{macro}{\@xexpast}
1266 % \begin{macrocode}
1267 \def\@xexpast#1*#2#3#4\@@{%
1268 \edef\reserved@a{#1}%
1269 \@tempcnta#2\relax
1270 \ifnum\@tempcnta>\z@
1271 \@whilenum\@tempcnta>\z@\do
1272 {\edef\reserved@a{\reserved@a#3}\advance\@tempcnta \m@ne}%
1273 \let\reserved@b\@xexpast
1274 \else
1275 \let\reserved@b\@xexnoop
1276 \fi
1277 \expandafter\reserved@b\reserved@a #4\@@}
1278 % \end{macrocode}
1279 % \end{macro}
1280 %
1281 % \begin{macro}{\if@firstamp}
1282 % \begin{macro}{\@addamp}
1283 % \begin{macrocode}
1284 \newif\if@firstamp
1285 % \end{macrocode}
1286 %
1287 % \begin{macrocode}
1288 \def\@addamp{%
1289 \if@firstamp
1290 \@firstampfalse
1291 \else
1292 \edef\@preamble{\@preamble &}%
1293 \fi}
1294 % \end{macrocode}
1295 % \end{macro}
1296 % \end{macro}
1297 %
1298 % \begin{macro}{\@arrayacol}
1299 % \begin{macro}{\@tabacol}
1300 % \begin{macro}{\@ampacol}
1301 % \begin{macro}{\@acolampacol}
1302 % \begin{macrocode}
1303 \def\@arrayacol{\edef\@preamble{\@preamble \hskip \arraycolsep}}
1304 \def\@tabacol{\edef\@preamble{\@preamble \hskip \tabcolsep}}
1305 \def\@ampacol{\@addamp \@acol}
1306 \def\@acolampacol{\@acol\@addamp\@acol}
1307 % \end{macrocode}
1308 % \end{macro}
1309 % \end{macro}
1310 % \end{macro}
1311 % \end{macro}
1312 %
1313 % \begin{macro}{\@mkpream}
1314 % \changes{v1.0h}{1994/11/04}{(ASAJ) Added \cs{@unexpandable@protect}
1315 % to \cs{@mkpream}.}
1316 % \begin{macrocode}
1317 \def\@mkpream#1{\@firstamptrue\@lastchclass6
1318 \let\@preamble\@empty
1319 \let\protect\@unexpandable@protect
1320 \let\@sharp\relax
1321 \let\@startpbox\relax\let\@endpbox\relax
1322 \@expast{#1}%
1323 \expandafter\@tfor \expandafter
1324 \@nextchar \expandafter:\expandafter=\reserved@a\do
1325 {\@testpach\@nextchar
1326 \ifcase \@chclass \@classz \or \@classi \or \@classii \or \@classiii
1327 \or \@classiv \or\@classv \fi\@lastchclass\@chclass}%
1328 \ifcase \@lastchclass \@acol
1329 \or \or \@preamerr \@ne\or \@preamerr \tw@\or \or \@acol \fi}
1330 % \end{macrocode}
1331 % \end{macro}
1332 %
1333 % \begin{macro}{\@arrayclassz}
1334 % \begin{macrocode}
1335 \def\@arrayclassz{\ifcase \@lastchclass \@acolampacol \or \@ampacol \or
1336 \or \or \@addamp \or
1337 \@acolampacol \or \@firstampfalse \@acol \fi
1338 \edef\@preamble{\@preamble
1339 \ifcase \@chnum
1340 \hfil$\relax\@sharp$\hfil \or $\relax\@sharp$\hfil
1341 \or \hfil$\relax\@sharp$\fi}}
1342 % \end{macrocode}
1343 % \end{macro}
1344 %
1345 % \begin{macro}{\@tabclassz}
1346 % RmS 91/08/14 inserted extra braces around entry for NFSS
1347 % \begin{macrocode}
1348 \def\@tabclassz{%
1349 \ifcase\@lastchclass
1350 \@acolampacol
1351 \or
1352 \@ampacol
1353 \or
1354 \or
1355 \or
1356 \@addamp
1357 \or
1358 \@acolampacol
1359 \or
1360 \@firstampfalse\@acol
1361 \fi
1362 \edef\@preamble{%
1363 \@preamble{%
1364 \ifcase\@chnum
1365 \hfil
1366 % \end{macrocode}
1367 % \changes{v1.1p}{2018/12/30}{Add extra \cs{hskip} to guard against an
1368 % \cs{unskip} at the start of a c-column cell (gh/102)}
1369 % \begin{macrocode}
1370 \hskip1sp%
1371 \ignorespaces\@sharp\unskip\hfil
1372 \or
1373 % \end{macrocode}
1374 % \changes{v1.1g}{1996/04/22}
1375 % {(DPC) Extra \cs{hskip} keeps tabcolsep in empty columns
1376 % internal/2122}
1377 % \changes{v1.1h}{1996/06/14}
1378 % {(DPC) Change both\cs{z@skip} to 1sp for latex/2160}
1379 % \begin{macrocode}
1380 \hskip1sp\ignorespaces\@sharp\unskip\hfil
1381 \or
1382 \hfil\hskip1sp\ignorespaces\@sharp\unskip
1383 \fi}}}
1384 % \end{macrocode}
1385 % \end{macro}
1386 %
1387 % \begin{macro}{\@classi}
1388 % \begin{macrocode}
1389 \def\@classi{%
1390 \ifcase\@lastchclass
1391 \@acol\@arrayrule
1392 \or
1393 \@addtopreamble{\hskip \doublerulesep}\@arrayrule
1394 \or
1395 \or
1396 \or
1397 \@arrayrule
1398 \or
1399 \@acol\@arrayrule
1400 \or
1401 \@arrayrule
1402 \fi}
1403 % \end{macrocode}
1404 % \end{macro}
1405 %
1406 % \begin{macro}{\@classii}
1407 % \begin{macrocode}
1408 \def\@classii{%
1409 \ifcase\@lastchclass
1410 \or
1411 \@addtopreamble{\hskip .5\arrayrulewidth}%
1412 \fi}
1413 % \end{macrocode}
1414 % \end{macro}
1415 %
1416 % \begin{macro}{\@classiii}
1417 % \begin{macrocode}
1418 \def\@classiii{\ifcase \@lastchclass \@acolampacol \or
1419 \@addamp\@acol \or
1420 \or \or \@addamp \or
1421 \@acolampacol \or \@ampacol \fi}
1422 % \end{macrocode}
1423 % \end{macro}
1424 %
1425 % \begin{macro}{\@tabclassiv}
1426 % \begin{macrocode}
1427 \def\@tabclassiv{\@addtopreamble\@nextchar}
1428 % \end{macrocode}
1429 % \end{macro}
1430 %
1431 % \begin{macro}{\@arrayclassiv}
1432 % \begin{macrocode}
1433 \def\@arrayclassiv{\@addtopreamble{$\@nextchar$}}
1434 % \end{macrocode}
1435 % \end{macro}
1436 %
1437 % \begin{macro}{\@classv}
1438 % \begin{macrocode}
1439 \def\@classv{\@addtopreamble{\@startpbox{\@nextchar}\ignorespaces
1440 \@sharp\@endpbox}}
1441 % \end{macrocode}
1442 % \end{macro}
1443 %
1444 % \begin{macro}{\@addtopreamble}
1445 % \begin{macrocode}
1446 \def\@addtopreamble#1{\edef\@preamble{\@preamble #1}}
1447 % \end{macrocode}
1448 % \end{macro}
1449 %
1450 % \begin{macro}{\@chclass}
1451 % \begin{macro}{\@lastchclass}
1452 % \begin{macro}{\@chnum}
1453 % \begin{macrocode}
1454 \newcount\@chclass
1455 \newcount\@lastchclass
1456 \newcount\@chnum
1457 % \end{macrocode}
1458 % \end{macro}
1459 % \end{macro}
1460 % \end{macro}
1461 %
1462 % \begin{macro}{\arraycolsep}
1463 % \begin{macro}{\tabcolsep}
1464 % \begin{macro}{\arrayrulewidth}
1465 % \begin{macro}{\doublerulesep}
1466 % \begin{macrocode}
1467 \newdimen\arraycolsep
1468 \newdimen\tabcolsep
1469 \newdimen\arrayrulewidth
1470 \newdimen\doublerulesep
1471 % \end{macrocode}
1472 % \end{macro}
1473 % \end{macro}
1474 % \end{macro}
1475 % \end{macro}
1476 %
1477 % \begin{macro}{\arraystretch}
1478 % \begin{macrocode}
1479 \def\arraystretch{1} % Default value.
1480 % \end{macrocode}
1481 % \end{macro}
1482 %
1483 % \begin{macro}{\@arstrutbox}
1484 % \begin{macro}{\@arstrut}
1485 % \begin{macrocode}
1486 \newbox\@arstrutbox
1487 % \end{macrocode}
1488 %
1489 % \begin{macrocode}
1490 \def\@arstrut{%
1491 \relax\ifmmode\copy\@arstrutbox\else\unhcopy\@arstrutbox\fi}
1492 % \end{macrocode}
1493 % \end{macro}
1494 % \end{macro}
1495 %
1496 % \begin{macro}{\@arrayrule}
1497 % \begin{macrocode}
1498 \def\@arrayrule{\@addtopreamble{\hskip -.5\arrayrulewidth
1499 \vrule \@width \arrayrulewidth\hskip -.5\arrayrulewidth}}
1500 % \end{macrocode}
1501 % \end{macro}
1502 %
1503 % \begin{macro}{\@testpach}
1504 % \begin{macrocode}
1505 \def\@testpach#1{\@chclass \ifnum \@lastchclass=\tw@ 4 \else
1506 \ifnum \@lastchclass=3 5 \else
1507 \z@ \if #1c\@chnum \z@ \else
1508 \if #1l\@chnum \@ne \else
1509 \if #1r\@chnum \tw@ \else
1510 \@chclass \if #1|\@ne \else
1511 \if #1@\tw@ \else
1512 \if #1p3 \else \z@ \@preamerr 0\fi
1513 \fi \fi \fi \fi \fi \fi
1514 \fi}
1515 % \end{macrocode}
1516 % \end{macro}
1517 %
1518 % \begin{macro}{\hline}
1519 % \begin{macrocode}
1520 \def\hline{%
1521 \noalign{\ifnum0=`}\fi\hrule \@height \arrayrulewidth \futurelet
1522 \reserved@a\@xhline}
1523 % \end{macrocode}
1524 % \end{macro}
1525 %
1526 % \begin{macro}{\@xhline}
1527 % \begin{macrocode}
1528 \def\@xhline{\ifx\reserved@a\hline
1529 \vskip\doublerulesep
1530 % \end{macrocode}
1531 % Measure from the middle of the rules.
1532 % \changes{latex2e}{1993/12/16}{Measure from middle of vertical rules}
1533 % \begin{macrocode}
1534 \vskip-\arrayrulewidth
1535 \fi
1536 \ifnum0=`{\fi}}
1537 % \end{macrocode}
1538 % \end{macro}
1539 %
1540 % \begin{macro}{\vline}
1541 % \begin{macrocode}
1542 \def\vline{\vrule \@width \arrayrulewidth}
1543 % \end{macrocode}
1544 % \end{macro}
1545 %
1546 % \begin{macro}{\cline}
1547 % \changes{v1.1c}{1995/09/14}
1548 % {(DPC) New implementation}
1549 % \begin{macro}{\@cline}
1550 % The old \LaTeX2.09 implementation of |\cline| used up quite
1551 % a lot of memory and two precious count registers.
1552 % This new (1995/09/14) implementation does not use any count registers.
1553 % It is coded in a way that depends heavily on the definition of
1554 % |\multispan| so that command has been moved here from the file
1555 % |ltplain.dtx|.
1556 %
1557 % These counters are no longer declared.
1558 %\begin{verbatim}
1559 % \newcount\@cla
1560 % \newcount\@clb
1561 %\end{verbatim}
1562 %
1563 % \begin{macrocode}
1564 \def\cline#1{\@cline#1\@nil}
1565 % \end{macrocode}
1566 %
1567 % \changes{v1.1e}{1995/10/17}
1568 % {(DPC) Use \cs{@multicnt}}
1569 % \begin{macrocode}
1570 \def\@cline#1-#2\@nil{%
1571 \omit
1572 % \end{macrocode}
1573 % Use the counter from |\multispan|.
1574 % \begin{macrocode}
1575 \@multicnt#1%
1576 \advance\@multispan\m@ne
1577 \ifnum\@multicnt=\@ne\@firstofone{&\omit}\fi
1578 \@multicnt#2%
1579 \advance\@multicnt-#1%
1580 \advance\@multispan\@ne
1581 % \end{macrocode}
1582 % The original had |\unskip| at this point,
1583 % but how could a skip get here ???
1584 % \begin{macrocode}
1585 \leaders\hrule\@height\arrayrulewidth\hfill
1586 \cr
1587 % \end{macrocode}
1588 % This is back spacing is fairly horrible,
1589 % but it is what happened in the old version\ldots\
1590 % An alternative would be to make |\cline| look ahead for a following
1591 % |\cline| as does |\hline|. This would alter the spacing in existing
1592 % documents so keep the old version in the kernel. Perhaps a package
1593 % should do this differently.
1594 % \begin{macrocode}
1595 \noalign{\vskip-\arrayrulewidth}}
1596 % \end{macrocode}
1597 % \end{macro}
1598 % \end{macro}
1599 %
1600 % \begin{macro}{\mscount}
1601 % The |\mscount| counter is no longer declared, saving a csname and a
1602 % register. It is declared in compatibility mode.
1603 % \end{macro}
1604 %
1605 % \begin{macro}{\multispan}
1606 % \begin{macro}{\@multispan}
1607 % \changes{v1.1e}{1995/10/17}
1608 % {(DPC) Macro added.}
1609 % \begin{macro}{\sp@n}
1610 % Modify |\multispan| slightly from its plain \TeX\ definition
1611 % to allow more efficient code sharing with |\multicolumn|.
1612 % Also share a count register with |\multiput|.
1613 % \begin{macrocode}
1614 \def\multispan{\omit\@multispan}
1615 % \end{macrocode}
1616 %
1617 % \begin{macrocode}
1618 \def\@multispan#1{%
1619 \@multicnt#1\relax
1620 \loop\ifnum\@multicnt>\@ne \sp@n\repeat}
1621 % \end{macrocode}
1622 %
1623 % \begin{macrocode}
1624 \def\sp@n{\span\omit\advance\@multicnt\m@ne}
1625 % \end{macrocode}
1626 % \end{macro}
1627 % \end{macro}
1628 % \end{macro}
1629 %
1630 %
1631 % \begin{macro}{\@startpbox}
1632 % \begin{macro}{\@endpbox}
1633 % Helper macros for `p' columns.
1634 %
1635 % |\@startpbox|\marg{width} \emph{text} |\egroup| is essentially
1636 % |\parbox|\marg{width}\marg{text}
1637 %
1638 % |\@endpbox| is essentially |\unskip \strut \par \egroup\hfil|
1639 % (Changed 14 Jan 89) (changed again 1994/05/13)
1640 %
1641 % \changes{v1.0d}{1994/05/03}
1642 % {Use \cs{@finalstrut} based on depth of \cs{@arstrutbox}}
1643
1644 % \changes{v1.1j}{1998/05/18}{Use \cs{setlength} to set \cs{hsize},
1645 % so that the changes in the calc package apply here.}
1646 % \begin{macrocode}
1647 \def\@startpbox#1{\vtop\bgroup \setlength\hsize{#1}\@arrayparboxrestore}
1648 % \end{macrocode}
1649 %
1650 % \begin{macrocode}
1651 \def\@endpbox{\@finalstrut\@arstrutbox\par\egroup\hfil}
1652 % \end{macrocode}
1653 %
1654 % 14 Jan 89: Def of |\@endpbox| changed from\\
1655 % |\def\@endpbox{\par\vskip\dp\@arstrutbox\egroup\hfil}|\\
1656 % so vertical spacing works out right if the last line of a `p' entry
1657 % has a descender.
1658 % \end{macro}
1659 % \end{macro}
1660 %
1661 % \begin{macro}{\@@startpbox}
1662 % \begin{macro}{\@@endpbox}
1663 % \begin{macrocode}
1664 \let\@@startpbox=\@startpbox
1665 \let\@@endpbox=\@endpbox
1666 % \end{macrocode}
1667 % \end{macro}
1668 % \end{macro}
1669 %
1670 % \begin{macrocode}
1671 %</2ekernel>
1672 % \end{macrocode}
1673 %
1674 % \Finale
1675 %