Graphics, Figures & Tableslongtable caption

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
a_modelska
Posts: 1
Joined: Mon Aug 06, 2012 12:33 pm

longtable caption

Post by a_modelska »

I have a very long table that is placed horizonatlly and spanning several pages. I have a problem with the first caption that is is not centered but aligns to the left and overrides the side of the table (below:{Table caption; adapted from \citep{citation}.}). My script looks like this..

Code: Select all

\begin{landscape}
\begin{center}
\begin{longtable}{|p{1.25cm} | p{3cm} |p{7cm} |p{3.5cm} |p{4.5cm}|}[ht]

   
\centering

\caption[Table caption] {Table caption; adapted from \citep{citation}.} \label{tab:test} 
\tabularnewline
                
                                               
\hline



\multicolumn{1}{|p{1.25cm}|}{\textbf{Name}} & \multicolumn{1}{p{3cm}|}{\textbf{one}} & \multicolumn{1}{p{7cm}|}{\textbf{two}} & \multicolumn{1}{p{3.5cm}|}{\textbf{three}} & \multicolumn{1}{p{4.5cm}|}{\textbf{four}} \\


\hline\hline
\endfirsthead



\multicolumn{5}{|c|}%
{{\bfseries \tablename\ \thetable{} -- continued from previous page}} \\

\hline
\multicolumn{1}{|p{1.25cm}|}{\textbf{one}} & \multicolumn{1}{p{3cm}|}{\textbf{two}} & \multicolumn{1}{p{7cm}|}{\textbf{three}} & \multicolumn{1}{p{3.5cm}|}{\textbf{four}} & \multicolumn{1}{p{4.5cm}|}{\textbf{five}} \\
\hline\hline

\endhead
\hline


\multicolumn{5}{|c|}{\textit{Continued on next page}} \\
\hline
\endfoot
\hline 
\endlastfoot

table content & table content & table content & table content & table content


\end{longtable}
\end{center}
\end{landscape}


Can anyone help me center the caption?

Thank you!
Last edited by Stefan Kottwitz on Mon Aug 06, 2012 12:58 pm, edited 1 time in total.

Recommended reading 2024:

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

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

kriss
Posts: 3
Joined: Fri Jul 27, 2012 5:15 pm

longtable caption

Post by kriss »

You might try using the following line:

Code: Select all

\usepackage[justification=raggedright,singlelinecheck=false]{caption}
Last edited by cgnieder on Thu Aug 30, 2012 5:37 pm, edited 1 time in total.
Post Reply