2 %% This is file `longtable.sty',
4 %% Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003
5 %% The LaTeX3 Project and any individual authors listed elsewhere
8 %% This file was forked from file(s) of the Standard LaTeX `Tools Bundle'.
9 %% This file includes a new length LTextracouponspace which modifies
10 %% the behavior of the package at the end of a page. This feature
11 %% and package is not supported or acknowledged by Dave Carlisle.
12 %% Do not contact him for such support.
13 %% --------------------------------------------------------------------------
15 %% It may be distributed and/or modified under the
16 %% conditions of the LaTeX Project Public License, either version 1.3
17 %% of this license or (at your option) any later version.
18 %% The latest version of this license is in
19 %% http://www.latex-project.org/lppl.txt
20 %% and version 1.3 or later is part of all distributions of LaTeX
21 %% version 2003/12/01 or later.
23 %% File: longtable.dtx Copyright (C) 1990-2001 David Carlisle
24 %% File: fslongtable.sty Copyright (C) 2008 Jeff Finucane
25 \NeedsTeXFormat{LaTeX2e}[1995/06/01]
26 \ProvidesPackage{longtable}
27 [2004/02/01 v4.11 Multi-page Table package (DPC)]
28 \def\LT@err{\PackageError{longtable}}
29 \def\LT@warn{\PackageWarning{longtable}}
32 \LT@warn{Table \@width s have changed. Rerun LaTeX.\@gobbletwo}}%
33 \global\let\LT@final@warn\relax}
34 \DeclareOption{errorshow}{%
35 \def\LT@warn{\PackageInfo{longtable}}}
36 \DeclareOption{pausing}{%
38 \LT@err{#1}{This is not really an error}}}
40 \DeclareOption{final}{}
42 \newskip\LTleft \LTleft=\fill
43 \newskip\LTright \LTright=\fill
44 \newskip\LTpre \LTpre=\bigskipamount
45 \newskip\LTpost \LTpost=\bigskipamount
46 \newcount\LTchunksize \LTchunksize=20
47 \let\c@LTchunksize\LTchunksize
48 \newdimen\LTcapwidth \LTcapwidth=4in
49 \newlength\LTextracouponspace
56 \newcounter{LT@tables}
57 \newcounter{LT@chunks}[LT@tables]
58 \ifx\c@table\undefined
60 \def\fnum@table{\tablename~\thetable}
62 \ifx\tablename\undefined
66 \mathchardef\LT@end@pen=30000
69 \ifx\multicols\@undefined
71 \ifnum\col@number>\@ne
76 \LT@err{longtable not in 1-column mode}\@ehc
79 \@ifnextchar[\LT@array{\LT@array[x]}}
81 \refstepcounter{table}\stepcounter{LT@tables}%
83 \LTleft\z@ \LTright\fill
85 \LTleft\fill \LTright\z@
87 \LTleft\fill \LTright\fill
89 \let\LT@mcol\multicolumn
90 \let\LT@@tabarray\@tabarray
95 \let\\\LT@tabularcr\let\tabularnewline\\%
96 \def\newpage{\noalign{\break}}%
97 \def\pagebreak{\noalign{\ifnum`}=0\fi\@testopt{\LT@no@pgbk-}4}%
98 \def\nopagebreak{\noalign{\ifnum`}=0\fi\@testopt\LT@no@pgbk4}%
99 \let\hline\LT@hline \let\kill\LT@kill\let\caption\LT@caption
100 \@tempdima\ht\strutbox
101 \let\@endpbox\LT@endpbox
102 \ifx\extrarowheight\@undefined
104 \let\@classz\@tabclassz \let\@classiv\@tabclassiv
105 \def\@startpbox{\vtop\LT@startpbox}%
106 \let\@@startpbox\@startpbox
107 \let\@@endpbox\@endpbox
108 \let\LT@LL@FM@cr\@tabularcr
110 \advance\@tempdima\extrarowheight
112 \let\@startpbox\LT@startpbox\let\LT@LL@FM@cr\@arraycr
114 \setbox\@arstrutbox\hbox{\vrule
115 \@height \arraystretch \@tempdima
116 \@depth \arraystretch \dp \strutbox
118 \let\@sharp##\let\protect\relax
122 \global\advance\c@LT@chunks\@ne
123 \global\LT@rows\z@\setbox\z@\vbox\bgroup
125 \tabskip\LTleft \noexpand\halign to\hsize\bgroup
126 \tabskip\z@ \@arstrut \@preamble \tabskip\LTright \cr}%
128 \expandafter\LT@nofcols\LT@bchunk&\LT@nofcols
131 \everycr{}\lineskip\z@\baselineskip\z@
133 \def\LT@no@pgbk#1[#2]{\penalty #1\@getpen{#2}\ifnum`{=0\fi}}
135 \let\LT@start\endgraf
136 \endgraf\penalty\z@\vskip\LTpre
138 \advance\dimen@ \ht\ifvoid\LT@firsthead\LT@head\else\LT@firsthead\fi
139 \advance\dimen@ \dp\ifvoid\LT@firsthead\LT@head\else\LT@firsthead\fi
140 \advance\dimen@ \ht\LT@foot
144 \setbox\tw@\vsplit\tw@ to \ht\@arstrutbox
145 \setbox\tw@\vbox{\unvbox\tw@}%
148 \ifdim\ht\@arstrutbox>\ht\tw@\@arstrutbox\else\tw@\fi
150 \ifdim\dp\@arstrutbox>\dp\tw@\@arstrutbox\else\tw@\fi
151 \advance\dimen@ -\pagegoal
152 \ifdim \dimen@>\z@\vfil\break\fi
153 \global\@colroom\@colht
155 \advance\vsize-\LTextracouponspace
156 \dimen@\pagegoal\advance\dimen@-\LTextracouponspace\pagegoal\dimen@
159 \advance\vsize-\ht\LT@foot
160 \global\advance\@colroom-\ht\LT@foot
161 \dimen@\pagegoal\advance\dimen@-\ht\LT@foot\pagegoal\dimen@
164 \ifvoid\LT@firsthead\copy\LT@head\else\box\LT@firsthead\fi\nobreak
169 \let\LT@entry\LT@entry@chop
170 \xdef\LT@save@row{\LT@save@row}}%
176 {\let\LT@entry\LT@entry@write\immediate\write\@auxout{%
177 \gdef\expandafter\noexpand
178 \csname LT@\romannumeral\c@LT@tables\endcsname
181 \ifx\LT@save@row\LT@@save@row
183 \LT@warn{Column \@width s have changed\MessageBreak
187 \endgraf\penalty -\LT@end@pen
189 \global\@mparbottom\z@
191 \endgraf\penalty\z@\addvspace\LTpost
192 \ifvoid\footins\else\insert\footins{}\fi}
194 \futurelet\@let@token\LT@n@fcols}
197 \ifx\@let@token\LT@nofcols
200 \expandafter\LT@nofcols
203 \relax\iffalse{\fi\ifnum0=`}\fi
205 {\def\crcr{\LT@crcr\noalign{\nobreak}}\let\cr\crcr
209 \let\LT@setprevdepth\relax
211 \global\advance\LT@rows\@ne
212 \ifnum\LT@rows=\LTchunksize
213 \gdef\LT@setprevdepth{%
215 \global\let\LT@setprevdepth\relax}%
216 \expandafter\LT@xtabularcr
219 \expandafter\LT@LL@FM@cr
222 \@ifnextchar[\LT@argtabularcr\LT@ntabularcr}
230 \def\LT@argtabularcr[#1]{%
233 \unskip\@xargarraycr{#1}%
243 \crcr\LT@save@row\cr\egroup
244 \global\setbox\@ne\lastbox
248 \ifhmode\@firstofone{&}\fi\omit
249 \ifnum#1=\c@LT@chunks
253 \def\LT@entry@chop#1#2{%
255 {\ifnum#1>\c@LT@chunks
260 \def\LT@entry@write{%
261 \noexpand\LT@entry^^J%
266 \expandafter\LT@rebox\LT@bchunk}
267 \def\LT@rebox#1\bgroup{%
273 \xdef\LT@save@row{\expandafter\LT@build@blank
274 \romannumeral\number\LT@cols 001 }}
275 \def\LT@build@blank#1{%
277 \noexpand\LT@entry{1}{0pt}%
278 \expandafter\LT@build@blank
281 \global\expandafter\let\expandafter\LT@save@row
282 \csname LT@\romannumeral\c@LT@tables\endcsname
283 \ifx\LT@save@row\relax
288 \ifcase\expandafter\expandafter\expandafter\LT@cols
289 \expandafter\@gobble\LT@save@row
296 \aftergroup\LT@blank@row
299 \let\setlongtables\relax
303 \let\LT@old@row\LT@save@row
304 \global\let\LT@save@row\@empty
313 \ifx\LT@@save@row\@undefined
314 \let\LT@@save@row\LT@save@row
319 \ifcase\expandafter\count@\LT@old@row
326 \expandafter\LT@max@sel\@tempa
328 \def\LT@max@sel#1#2{%
336 \noalign{\ifnum0=`}\fi
338 \futurelet\@let@token\LT@@hline}
340 \ifx\@let@token\hline
341 \global\let\@gtempa\@gobble
342 \gdef\LT@sep{\penalty-\@medpenalty\vskip\doublerulesep}%
344 \global\let\@gtempa\@empty
345 \gdef\LT@sep{\penalty-\@lowpenalty\vskip-\arrayrulewidth}%
349 \unskip\leaders\hrule\@height\arrayrulewidth\hfill\cr
352 \unskip\leaders\hrule\@height\arrayrulewidth\hfill\cr
353 \noalign{\penalty\@M}%
357 \@ifnextchar[{\egroup\LT@c@ption\@firstofone}\LT@capti@n}
358 \def\LT@c@ption#1[#2]#3{%
359 \LT@makecaption#1\fnum@table{#3}%
361 \ifx\@tempa\@empty\else
363 \addcontentsline{lot}{table}{\protect\numberline{\thetable}{#2}}}%
367 {\egroup\LT@c@ption\@gobble[]}%
368 {\egroup\@xdblarg{\LT@c@ption\@firstofone}}}
369 \def\LT@makecaption#1#2#3{%
370 \LT@mcol\LT@cols c{\hbox to\z@{\hss\parbox[t]\LTcapwidth{%
371 \sbox\@tempboxa{#1{#2: }#3}%
372 \ifdim\wd\@tempboxa>\hsize
375 \hbox to\hsize{\hfil\box\@tempboxa\hfil}%
377 \endgraf\vskip\baselineskip}%
380 \ifnum\outputpenalty <-\@Mi
381 \ifnum\outputpenalty > -\LT@end@pen
382 \LT@err{floats and marginpars not allowed in a longtable}\@ehc
384 \setbox\z@\vbox{\unvbox\@cclv}%
385 \ifdim \ht\LT@lastfoot>\ht\LT@foot
387 \advance\dimen@-\ht\LT@lastfoot
389 \setbox\@cclv\vbox{\unvbox\z@\copy\LT@foot\vss}%
392 \setbox\z@\vbox{\box\LT@head}%
395 \global\@colroom\@colht
398 {\unvbox\z@\box\ifvoid\LT@lastfoot\LT@foot\else\LT@lastfoot\fi}%
401 \setbox\@cclv\vbox{\unvbox\@cclv\copy\LT@foot\vss}%
404 \global\vsize\@colroom
405 \copy\LT@head\nobreak
407 \def\LT@end@hd@ft#1{%
409 \ifx\LT@start\endgraf
411 {Longtable head or foot not at start of table}%
412 {Increase LTchunksize}%
417 \def\endfirsthead{\LT@end@hd@ft\LT@firsthead}
418 \def\endhead{\LT@end@hd@ft\LT@head}
419 \def\endfoot{\LT@end@hd@ft\LT@foot}
420 \def\endlastfoot{\LT@end@hd@ft\LT@lastfoot}
421 \def\LT@startpbox#1{%
423 \let\@footnotetext\LT@p@ftntext
424 \setlength\hsize{#1}%
426 \vrule \@height \ht\@arstrutbox \@width \z@}
428 \@finalstrut\@arstrutbox
433 \def\LT@p@ftntext#1{%
434 \edef\@tempa{\the\LT@p@ftn\noexpand\footnotetext[\the\c@footnote]}%
435 \global\LT@p@ftn\expandafter{\@tempa{#1}}}%
438 %% End of file `longtable.sty'.