With your current settings, the caption will appear before the last rule is typeset (the last thing that is typeset is what you declare for \endlastfoot
which is a horizontal rule while the caption is simply treated as the last row of the table and will then appear before the rule). To get the expected position for the caption, move the \caption
to the proper location, for example, after the \bottomrule
used in \endlastfoot
:
\documentclass{article}
\usepackage{longtable}
\usepackage{booktabs}
\begin{document}
\begin{longtable}{ccccc}
\toprule
1&2&3&&\\
\midrule
\endfirsthead
\toprule
1&2&3&&\\
\midrule
\endhead
\hline
\bottomrule
\multicolumn{5}{r}{Continued on next page...}\\
\endfoot
\bottomrule
\caption{Caption numbered as 1 and below horizontal line.}\\
\endlastfoot
8.8024 &8.8024 &8.8024 &7.2679 &1.3161e+01\\
%A lot more lines here.
9.0364 &9.0364 &9.0364 &7.2678 &1.4124e+01\\
\end{longtable}
\end{document}
I did a similar modification to the text "Continued on next page..." so it appears below the horizontal rule at a page break, but you can revert this if desired.
If you want the caption and continuation text at the top (sometimes table captions are required to be before the actual tabel contents), then you can use the \endfirsthead
, \endhead
commands:
\documentclass{article}
\usepackage{longtable}
\usepackage{booktabs}
\begin{document}
\begin{longtable}{ccccc}
\caption{Caption numbered as 1 and above horizontal line.}\\
\toprule
1&2&3&&\\
\midrule
\endfirsthead
\multicolumn{5}{r}{Table~\thetable (Continued)}\\
\toprule
1&2&3&&\\
\midrule
\endhead
\hline
\bottomrule
\endfoot
\bottomrule
\endlastfoot
8.8024 &8.8024 &8.8024 &7.2679 &1.3161e+01\\
%A lot more lines here.
9.0364 &9.0364 &9.0364 &7.2678 &1.4124e+01\\
\end{longtable}
\end{document}
\caption
. If you put it as the last row of the table, that's where it will appear.\begin{longtable}{...}
.