I am not even sure what is wrong here. I have a table I would like the caption to be at bottom, marked with (continued) from 2nd page onwards. I would like the table to break at certain places by using \\
instead of \\*
. Finally, the booktab
command \toprule
and \bottomrule
should be used at top and bottom at each page.
What surprises me is even with \pagebreak
or \newpage
the table still refuse to break across pages.
The example table, with desired breakpoints marked with red arrows.
Code
\documentclass[11pt,a4paper]{report}
\usepackage{rotating,multirow,longtable,booktabs}
%Add \endfirstfoot support http://tex.stackexchange.com/questions/68439/caption-at-foot-of-long-tables-longtable-package
\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
\advance\LT@footdiff\ht\LT@firstfoot
\dimen@\pagetotal
\advance\dimen@ \ht\ifvoid\LT@firsthead\LT@head\else\LT@firsthead\fi
\advance\dimen@ \dp\ifvoid\LT@firsthead\LT@head\else\LT@firsthead\fi
\advance\dimen@ \ht\ifvoid\LT@firstfoot\LT@foot\else\LT@firstfoot\fi
\dimen@ii\vfuzz
\vfuzz\maxdimen
\setbox\tw@\copy\z@
\setbox\tw@\vsplit\tw@ to \ht\@arstrutbox
\setbox\tw@\vbox{\unvbox\tw@}%
\vfuzz\dimen@ii
\advance\dimen@ \ht
\ifdim\ht\@arstrutbox>\ht\tw@\@arstrutbox\else\tw@\fi
\advance\dimen@\dp
\ifdim\dp\@arstrutbox>\dp\tw@\@arstrutbox\else\tw@\fi
\advance\dimen@ -\pagegoal
\ifdim \dimen@>\z@\vfil\break\fi
\global\@colroom\@colht
\ifvoid\LT@firstfoot
\ifvoid\LT@foot
\else
\advance\vsize-\ht\LT@foot
\global\advance\@colroom-\ht\LT@foot
\dimen@\pagegoal\advance\dimen@-\ht\LT@foot\pagegoal\dimen@
\maxdepth\z@
\fi
\else
\advance\vsize-\ht\LT@firstfoot
\global\advance\@colroom-\ht\LT@firstfoot
\dimen@\pagegoal\advance\dimen@-\ht\LT@firstfoot\pagegoal\dimen@
\maxdepth\z@
\fi
\ifvoid\LT@firsthead\copy\LT@head\else\box\LT@firsthead\fi\nobreak
\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
\advance\dimen@-\ht\LT@lastfoot
\ifdim\dimen@<\ht\z@
\setbox\@cclv\vbox{\unvbox\z@\copy\LT@foot\vss}%
\@makecol
\@outputpage
\setbox\z@\vbox{\box\LT@head}%
\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\advance\@colroom\LT@footdiff
\global\vsize\@colroom
\fi
\copy\LT@head\nobreak
\fi
}
\makeatother
\begin{document}
% Table generated by Excel2LaTeX from sheet 'Sheet1'
\begin{table}[!hp]
\centering
\begin{longtable}{rrrrrrrrrrrrrrrrr}
\toprule \endfirsthead
\toprule \endhead
\bottomrule
\caption{Add caption}\label{tbl:ch7a_config}\\%
\endfirstfoot
\bottomrule
\caption[]{(continued)}\\%
\endfoot
\bottomrule
\caption[]{(continued)}\\%
\endlastfoot
\multicolumn{2}{r}{\textbf{ID}} & \begin{sideways}\textbf{1}\end{sideways} & \begin{sideways}\textbf{2}\end{sideways} & \begin{sideways}\textbf{3}\end{sideways} & \begin{sideways}\textbf{4}\end{sideways} & \begin{sideways}\textbf{5}\end{sideways} & \begin{sideways}\textbf{6}\end{sideways} & \begin{sideways}\textbf{7}\end{sideways} & \begin{sideways}\textbf{8}\end{sideways} & \begin{sideways}\textbf{9}\end{sideways} & \begin{sideways}\textbf{10}\end{sideways} & \begin{sideways}\textbf{11}\end{sideways} & \begin{sideways}\textbf{12}\end{sideways} & \begin{sideways}\textbf{13}\end{sideways} & \begin{sideways}\textbf{14}\end{sideways} & \begin{sideways}\textbf{15}\end{sideways} \\*
\midrule
\multicolumn{1}{c}{\multirow{4}[0]{*}{\begin{sideways}\textbf{Zeros}\end{sideways}}} & \textit{z1} & 1 & 1 & 1 & 2 & 1 & 1 & 2 & 2 & 1 & 2 & 1 & 2 & 1 & 1 & 1 \\*
\multicolumn{1}{c}{} & \textit{z2} & 1 & 1 & 2 & 1 & 2 & 2 & 1 & 1 & 2 & 1 & 1 & 2 & 1 & 1 & 1 \\*
\multicolumn{1}{c}{} & \textit{z34} & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 2 & 1 & 1 \\*
\multicolumn{1}{c}{} & \textit{z56} & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 2 & 1 & 1 & 2 & 2 \\*
\multicolumn{1}{c}{\multirow{4}[0]{*}{\begin{sideways}\textbf{Poles}\end{sideways}}} & \textit{p1} & 1 & 2 & 1 & 1 & 1 & 2 & 1 & 2 & 2 & 2 & 1 & 1 & 1 & 1 & 1 \\*
\multicolumn{1}{c}{} & \textit{p2} & 1 & 2 & 1 & 1 & 2 & 1 & 2 & 1 & 2 & 2 & 1 & 1 & 1 & 1 & 1 \\*
\multicolumn{1}{c}{} & \textit{p34} & 1 & 2 & 1 & 1 & 1 & 1 & 1 & 1 & 2 & 2 & 1 & 1 & 1 & 1 & 2 \\*
\multicolumn{1}{c}{} & \textit{p56} & 1 & 2 & 1 & 1 & 1 & 1 & 1 & 1 & 2 & 2 & 1 & 1 & 1 & 2 & 1 \\ \midrule
\multicolumn{2}{r}{\textbf{ID}} & \begin{sideways}\textbf{16}\end{sideways} & \begin{sideways}\textbf{17}\end{sideways} & \begin{sideways}\textbf{18}\end{sideways} & \begin{sideways}\textbf{19}\end{sideways} & \begin{sideways}\textbf{20}\end{sideways} & \begin{sideways}\textbf{21}\end{sideways} & \begin{sideways}\textbf{22}\end{sideways} & \begin{sideways}\textbf{23}\end{sideways} & \begin{sideways}\textbf{24}\end{sideways} & \begin{sideways}\textbf{25}\end{sideways} & \begin{sideways}\textbf{26}\end{sideways} & \begin{sideways}\textbf{27}\end{sideways} & \begin{sideways}\textbf{28}\end{sideways} & \begin{sideways}\textbf{29}\end{sideways} & \begin{sideways}\textbf{30}\end{sideways} \\* \midrule
\multicolumn{1}{c}{\multirow{4}[0]{*}{\begin{sideways}\textbf{Zeros}\end{sideways}}} & \textit{z1} & 1 & 1 & 2 & 2 & 2 & 1 & 1 & 1 & 2 & 1 & 1 & 2 & 1 & 2 & 1 \\*
\multicolumn{1}{c}{} & \textit{z2} & 1 & 1 & 2 & 2 & 2 & 1 & 1 & 1 & 2 & 1 & 2 & 1 & 2 & 1 & 2 \\*
\multicolumn{1}{c}{} & \textit{z34} & 1 & 2 & 1 & 1 & 1 & 2 & 2 & 1 & 1 & 2 & 1 & 1 & 2 & 2 & 1 \\*
\multicolumn{1}{c}{} & \textit{z56} & 2 & 1 & 1 & 1 & 1 & 1 & 1 & 2 & 1 & 1 & 2 & 2 & 1 & 1 & 2 \\*
\multicolumn{1}{c}{\multirow{4}[0]{*}{\begin{sideways}\textbf{Poles}\end{sideways}}} & \textit{p1} & 2 & 2 & 1 & 1 & 2 & 1 & 1 & 2 & 2 & 2 & 1 & 1 & 1 & 1 & 1 \\*
\multicolumn{1}{c}{} & \textit{p2} & 2 & 2 & 1 & 1 & 2 & 1 & 1 & 2 & 2 & 2 & 1 & 1 & 1 & 1 & 2 \\*
\multicolumn{1}{c}{} & \textit{p34} & 1 & 1 & 1 & 2 & 1 & 1 & 2 & 2 & 2 & 2 & 1 & 1 & 1 & 1 & 1 \\*
\multicolumn{1}{c}{} & \textit{p56} & 1 & 1 & 2 & 1 & 1 & 2 & 1 & 2 & 2 & 2 & 1 & 1 & 1 & 1 & 2 \\ \midrule
\multicolumn{2}{r}{\textbf{ID}} & \begin{sideways}\textbf{31}\end{sideways} & \begin{sideways}\textbf{32}\end{sideways} & \begin{sideways}\textbf{33}\end{sideways} & \begin{sideways}\textbf{34}\end{sideways} & \begin{sideways}\textbf{35}\end{sideways} & \begin{sideways}\textbf{36}\end{sideways} & \begin{sideways}\textbf{37}\end{sideways} & \begin{sideways}\textbf{38}\end{sideways} & \begin{sideways}\textbf{39}\end{sideways} & \begin{sideways}\textbf{40}\end{sideways} & \begin{sideways}\textbf{41}\end{sideways} & \begin{sideways}\textbf{42}\end{sideways} & \begin{sideways}\textbf{43}\end{sideways} & \begin{sideways}\textbf{44}\end{sideways} & \begin{sideways}\textbf{45}\end{sideways} \\* \midrule
\multicolumn{1}{c}{\multirow{4}[0]{*}{\begin{sideways}\textbf{Zeros}\end{sideways}}} & \textit{z1} & 1 & 1 & 1 & 2 & 2 & 2 & 2 & 1 & 1 & 1 & 1 & 2 & 2 & 2 & 2 \\*
\multicolumn{1}{c}{} & \textit{z2} & 2 & 2 & 2 & 1 & 1 & 1 & 1 & 2 & 2 & 2 & 2 & 1 & 1 & 1 & 1 \\*
\multicolumn{1}{c}{} & \textit{z34} & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 2 & 2 & 2 & 2 & 2 & 2 & 2 & 2 \\*
\multicolumn{1}{c}{} & \textit{z56} & 2 & 2 & 2 & 2 & 2 & 2 & 2 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 \\*
\multicolumn{1}{c}{\multirow{4}[0]{*}{\begin{sideways}\textbf{Poles}\end{sideways}}} & \textit{p1} & 2 & 1 & 2 & 1 & 2 & 1 & 2 & 1 & 2 & 1 & 2 & 1 & 2 & 1 & 2 \\*
\multicolumn{1}{c}{} & \textit{p2} & 1 & 2 & 1 & 2 & 1 & 2 & 1 & 2 & 1 & 2 & 1 & 2 & 1 & 2 & 1 \\*
\multicolumn{1}{c}{} & \textit{p34} & 1 & 2 & 2 & 1 & 1 & 2 & 2 & 1 & 1 & 2 & 2 & 1 & 1 & 2 & 2 \\*
\multicolumn{1}{c}{} & \textit{p56} & 2 & 1 & 1 & 2 & 2 & 1 & 1 & 2 & 2 & 1 & 1 & 2 & 2 & 1 & 1 \\ \midrule
\multicolumn{2}{r}{\textbf{ID}} & \begin{sideways}\textbf{46}\end{sideways} & \begin{sideways}\textbf{47}\end{sideways} & \begin{sideways}\textbf{48}\end{sideways} & \begin{sideways}\textbf{49}\end{sideways} & \begin{sideways}\textbf{50}\end{sideways} & \begin{sideways}\textbf{51}\end{sideways} & \begin{sideways}\textbf{52}\end{sideways} & \begin{sideways}\textbf{53}\end{sideways} & \begin{sideways}\textbf{54}\end{sideways} & \begin{sideways}\textbf{55}\end{sideways} & \begin{sideways}\textbf{56}\end{sideways} & \begin{sideways}\textbf{57}\end{sideways} & \begin{sideways}\textbf{58}\end{sideways} & \begin{sideways}\textbf{59}\end{sideways} & \begin{sideways}\textbf{60}\end{sideways} \\* \midrule
\multicolumn{1}{c}{\multirow{4}[0]{*}{\begin{sideways}\textbf{Zeros}\end{sideways}}} & \textit{z1} & 1 & 2 & 1 & 2 & 1 & 2 & 2 & 1 & 1 & 1 & 2 & 2 & 2 & 2 & 2 \\*
\multicolumn{1}{c}{} & \textit{z2} & 2 & 1 & 2 & 1 & 1 & 2 & 2 & 1 & 1 & 1 & 2 & 2 & 2 & 2 & 2 \\*
\multicolumn{1}{c}{} & \textit{z34} & 1 & 1 & 2 & 2 & 2 & 1 & 2 & 2 & 2 & 2 & 1 & 2 & 1 & 1 & 2 \\*
\multicolumn{1}{c}{} & \textit{z56} & 2 & 2 & 1 & 1 & 2 & 2 & 1 & 2 & 2 & 2 & 2 & 1 & 2 & 2 & 1 \\*
\multicolumn{1}{c}{\multirow{4}[0]{*}{\begin{sideways}\textbf{Poles}\end{sideways}}} & \textit{p1} & 2 & 2 & 2 & 2 & 1 & 1 & 1 & 1 & 2 & 2 & 1 & 1 & 2 & 2 & 2 \\*
\multicolumn{1}{c}{} & \textit{p2} & 2 & 2 & 2 & 2 & 1 & 1 & 1 & 1 & 2 & 2 & 1 & 1 & 2 & 2 & 2 \\*
\multicolumn{1}{c}{} & \textit{p34} & 2 & 2 & 2 & 2 & 1 & 1 & 1 & 2 & 1 & 2 & 2 & 2 & 1 & 2 & 1 \\*
\multicolumn{1}{c}{} & \textit{p56} & 2 & 2 & 2 & 2 & 1 & 1 & 1 & 2 & 2 & 1 & 2 & 2 & 2 & 1 & 2 \\ \midrule
\multicolumn{2}{r}{\textbf{ID}} & \begin{sideways}\textbf{61}\end{sideways} & \begin{sideways}\textbf{62}\end{sideways} & \begin{sideways}\textbf{63}\end{sideways} & \begin{sideways}\textbf{64}\end{sideways} & \begin{sideways}\textbf{65}\end{sideways} & \begin{sideways}\textbf{66}\end{sideways} & \begin{sideways}\textbf{67}\end{sideways} & \begin{sideways}\textbf{68}\end{sideways} & \begin{sideways}\textbf{69}\end{sideways} & \begin{sideways}\textbf{70}\end{sideways} & \begin{sideways}\textbf{71}\end{sideways} & \begin{sideways}\textbf{72}\end{sideways} & \begin{sideways}\textbf{73}\end{sideways} & \begin{sideways}\textbf{74}\end{sideways} & \\ \midrule
\multicolumn{1}{c}{\multirow{4}[0]{*}{\begin{sideways}\textbf{Zeros}\end{sideways}}} & \textit{z1} & 2 & 1 & 2 & 2 & 1 & 2 & 1 & 1 & 2 & 2 & 1 & 2 & 2 & 2 & \\*
\multicolumn{1}{c}{} & \textit{z2} & 2 & 1 & 2 & 2 & 2 & 1 & 2 & 2 & 1 & 1 & 2 & 1 & 2 & 2 & \\*
\multicolumn{1}{c}{} & \textit{z34} & 2 & 2 & 1 & 2 & 2 & 2 & 2 & 2 & 2 & 2 & 2 & 2 & 2 & 2 & \\*
\multicolumn{1}{c}{} & \textit{z56} & 1 & 2 & 2 & 1 & 2 & 2 & 2 & 2 & 2 & 2 & 2 & 2 & 2 & 2 & \\*
\multicolumn{1}{c}{\multirow{4}[0]{*}{\begin{sideways}\textbf{Poles}\end{sideways}}} & \textit{p1} & 2 & 2 & 2 & 2 & 1 & 1 & 1 & 2 & 1 & 2 & 2 & 2 & 1 & 2 & \\*
\multicolumn{1}{c}{} & \textit{p2} & 2 & 2 & 2 & 2 & 1 & 1 & 2 & 1 & 2 & 1 & 2 & 2 & 1 & 2 & \\*
\multicolumn{1}{c}{} & \textit{p34} & 2 & 2 & 2 & 2 & 1 & 1 & 2 & 2 & 2 & 2 & 2 & 2 & 1 & 2 & \\*
\multicolumn{1}{c}{} & \textit{p56} & 1 & 2 & 2 & 2 & 1 & 1 & 2 & 2 & 2 & 2 & 2 & 2 & 1 & 2 &
\end{longtable}%
\end{table}%
\end{document}
\begin{table}
\end{table}
pair it will break.