Last active
August 2, 2022 12:34
-
-
Save danmosergist/be01fd352deb52b624fe to your computer and use it in GitHub Desktop.
Latex: longtable example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% \usepackage{longtable} % Problem: longtable do not work on twocolumns mode | |
\begin{center} | |
\begin{longtable}{|l|l|l|} | |
\caption[Short caption]{Long captions for the long table.} \label{tab:long1} \\ | |
% First head | |
\hline | |
\multicolumn{1}{|c|}{\textbf{Time (s)}} & | |
\multicolumn{1}{c|}{\textbf{Triple chosen}} & | |
\multicolumn{1}{c|}{\textbf{Other feasible triples}} \\ \hline | |
\endfirsthead | |
% Standard head | |
\multicolumn{3}{c} | |
{{\tablename\ \thetable{} -- continued from previous page.}} \\ | |
\hline | |
\multicolumn{1}{|c|}{\textbf{Time (s)}} & | |
\multicolumn{1}{c|}{\textbf{Triple chosen}} & | |
\multicolumn{1}{c|}{\textbf{Other feasible triples}} \\ \hline | |
\endhead | |
% Footnote | |
\hline \multicolumn{3}{|r|}{{Continued on next page...}} \\ \hline | |
\endfoot | |
% Last footnote | |
\hline | |
\endlastfoot | |
% The table | |
col1 & col2 & col3 \\ | |
col1 & col2 & col3 \\ | |
col1 & col2 & col3 \\ | |
col1 & col2 & col3 \\ | |
col1 & col2 & col3 \\ | |
col1 & col2 & col3 \\ | |
col1 & col2 & col3 \\ | |
col1 & col2 & col3 \\ | |
col1 & col2 & col3 \\ | |
col1 & col2 & col3 \\ | |
col1 & col2 & col3 \\ | |
col1 & col2 & col3 \\ | |
col1 & col2 & col3 \\ | |
col1 & col2 & col3 \\ | |
col1 & col2 & col3 \\ | |
col1 & col2 & col3 \\ | |
col1 & col2 & col3 \\ | |
col1 & col2 & col3 \\ | |
col1 & col2 & col3 \\ | |
col1 & col2 & col3 \\ | |
col1 & col2 & col3 \\ | |
col1 & col2 & col3 \\ | |
col1 & col2 & col3 \\ | |
col1 & col2 & col3 \\ | |
col1 & col2 & col3 \\ | |
col1 & col2 & col3 \\ | |
col1 & col2 & col3 \\ | |
col1 & col2 & col3 \\ | |
col1 & col2 & col3 \\ | |
col1 & col2 & col3 \\ | |
col1 & col2 & col3 \\ | |
col1 & col2 & col3 \\ | |
col1 & col2 & col3 | |
\end{longtable} | |
\end{center} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello,
Would it be possible to maintain the table caption on all pages and to have the word continued in parenthesis on all but the first page?
the above code generates this:
1st page: "Table no: Long captions for the long table."
2nd page: "Table no - continued from previous page "
...
what would be great to have is:
1st page: "Table no: Long captions for the long table."
2nd page: "Table no: Long captions for the long table (Continued)."