I am using the longtable package to accomodate for a table that streches over multiple pages. Hence I specify the header twice, once for the original table head, once for the forthcoming head(s) (on the other page(s)), but actually for most tables, this will be the same, apart from some addition as 'continued from previous page' or the like. Therefore, I created the following command to generate this header for me:
Code: Select all
\newcommand{\longtablehead}[1]{
\hline
#1
\hline
\endfirsthead
\multicolumn{7}{c}{\tablename\ \thetable\ -- \textit{Continued from previous page}} \\
\hline
#1 %TODO filter out \footnote{...} instances
\hline
\endhead
\hline \multicolumn{7}{r}{\textit{Continued on next page}} \\
\endfoot
\hline
\endlastfoot
}
Code: Select all
\begin{longtable}{lll}
\caption{A long table}
\longtablehead{col1 & col2 & col3}
...
\end{longtable}
I'm not familiar with writing such functions in latex, so I would appreciate it if someone can get me started on this. Thanks in advance.