Graphics, Figures & TablesContinued caption with captions and longtable

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
ricardo
Posts: 1
Joined: Sun Mar 07, 2010 12:37 am

Continued caption with captions and longtable

Post by ricardo »

Hi there,

I've got a table that spans three pages...I haven't been able to produce the "Table (continued)" caption after the 1st page...any help is much appreciated.

Regards,
Desperate Doctoral Student

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\documentclass[11pt]{article}
\usepackage{fullpage}
\usepackage[pdftex]{graphicx}
\usepackage{rotating}
\usepackage{lscape}
\usepackage{booktabs}
\usepackage{caption}
\usepackage{threeparttable}
\usepackage{longtable}
\date{}
\begin{document}

\begin{center}
\captionsetup{type=table,labelsep=newline,singlelinecheck=false}
\caption{\textit{Q sample}}
\begin{longtable}[p]{c p{14cm}} \toprule
\textit{No.} & \multicolumn{1}{c}{\textit{Statements}} \\ \midrule
\endfirsthead
\caption[]{(continued)}
\multicolumn{2}{c}%\\
\toprule\textit{No.} & \multicolumn{1}{c}{\textit{Statements}} \\ \midrule
\endhead

\bottomrule
\multicolumn{2}{r}{{(\textit{table continues})}} \\
\endfoot
\endlastfoot
1 & It is respectable for academic chemists to be founders of new start-ups based on their research. \\
2 & A key goal for our Center is to effectively translate research into innovations. \\
3 & Academic chemistry ...\\ \bottomrule
\end{longtable}
\end{center}

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

sommerfee
Posts: 503
Joined: Mon Apr 09, 2007 4:20 pm

Continued caption with captions and longtable

Post by sommerfee »

ricardo wrote: \captionsetup{type=table}
\caption{\textit{Q sample}}
The longtable has it's very own \caption command so there is no need for the code above. Put the \caption inside the longtable head instead, like here:

Code: Select all

\documentclass[11pt]{article}
\usepackage{longtable}
\usepackage{booktabs}
\usepackage[textfont=it]{caption}
\begin{document}

\begin{longtable}[p]{c p{14cm}}
\caption{Q sample}\\
\toprule
\textit{No.} & \multicolumn{1}{c}{\textit{Statements}} \\
\midrule
\endfirsthead
\caption[]{Q sample (continued)}\\
%\multicolumn{2}{c}%\\
\toprule
\textit{No.} & \multicolumn{1}{c}{\textit{Statements}} \\
\midrule
\endhead

\bottomrule
\multicolumn{2}{r}{{(\textit{table continues})}} \\ 
\endfoot
\endlastfoot
1 & It is respectable for academic chemists to be founders of new start-ups based on their research. \\ 
2 & A key goal for our Center is to effectively translate research into innovations. \\ 
3 & Academic chemistry ...\\
\bottomrule
\end{longtable}
\end{document}
Post Reply