# Caption at foot of long tables ('longtable' package)

I would like to ask a question about longtable package. I've already posted it in other forums.

I have a long table (a several-pages-long one) using longtable package and I would like to add a table caption at the bottom of every piece of table, but a different one in the FIRST page.

longtable package allows a different "header" in the first page of the table (\endfirsthead) and/or a different "footer" in the LAST page of the table (\endlastfoot). What I would like to do is a different foot caption in the FIRST page of the table.

My example would be something like this:

First page table foot caption: "Table 1.2: Table description and so, and so...".

Following page table foot captions: "Table 1.2 (contd.): Table description and so, and so...".

It is similar to the example available at the documentation of longtable package about the usage of \endfirsthead, but I want to put it at the bottom of the tables because captions for all figures and tables in my document are at the foot, not at the head.

Is it so strange what I want to do?? How can I do it with longtable?

I would be very grateful if you could give me any hint or tip.

-

You can try the following example. That adds \endfirstfoot.

\documentclass{article}
\usepackage[a6paper,showframe]{geometry}

\usepackage{longtable}
\makeatletter
\newbox\LT@firstfoot
\def\endfirstfoot{\LT@end@hd@ft\LT@firstfoot}
\newdimen\LT@footdiff
\def\LT@start{%
\let\LT@start\endgraf
\endgraf\penalty\z@
\vskip\LTpre
\LT@footdiff-\ht\LT@foot
\dimen@\pagetotal
\dimen@ii\vfuzz
\vfuzz\maxdimen
\setbox\tw@\copy\z@
\setbox\tw@\vsplit\tw@ to \ht\@arstrutbox
\setbox\tw@\vbox{\unvbox\tw@}%
\vfuzz\dimen@ii
\ifdim\ht\@arstrutbox>\ht\tw@\@arstrutbox\else\tw@\fi
\ifdim\dp\@arstrutbox>\dp\tw@\@arstrutbox\else\tw@\fi
\ifdim \dimen@>\z@\vfil\break\fi
\global\@colroom\@colht
\ifvoid\LT@firstfoot
\ifvoid\LT@foot
\else
\maxdepth\z@
\fi
\else
\maxdepth\z@
\fi
\output{\LT@output}%
}
\def\LT@output{%
\ifnum\outputpenalty <-\@Mi
\ifnum\outputpenalty > -\LT@end@pen
\LT@err{floats and marginpars not allowed in a longtable}\@ehc
\else
\setbox\z@\vbox{\unvbox\@cclv}%
\ifdim \ht\LT@lastfoot>\ht\LT@foot
\dimen@\pagegoal
\ifdim\dimen@<\ht\z@
\setbox\@cclv\vbox{\unvbox\z@\copy\LT@foot\vss}%
\@makecol
\@outputpage
\fi
\fi
\global\@colroom\@colht
\global\vsize\@colht
\vbox
{\unvbox\z@\box\ifvoid\LT@lastfoot\LT@foot\else\LT@lastfoot\fi}%
\fi
\else
\ifvoid\LT@firstfoot
\setbox\@cclv\vbox{\unvbox\@cclv\copy\LT@foot\vss}%
\@makecol
\@outputpage
\global\vsize\@colroom
\else
\setbox\@cclv\vbox{\unvbox\@cclv\box\LT@firstfoot\vss}%
\@makecol
\@outputpage
\global\vsize\@colroom
\fi
\fi
}
\makeatother

\begin{document}
\begin{longtable}{l}