Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'm using longtable to spread my table over three pages. Unfortunately the caption is also added three times to the list of tables. Is is possible to have it displayed only once?

share|improve this question
    
How do you add the caption exactly? Please add minimal working example (MWE) that shows it. I probably use \caption several times. Try to replace it all but the first with \caption*. This might require the caption package. –  Martin Scharrer Aug 18 '11 at 11:59
    
i simply use only one time \caption{My Caption above Table} I'll try to make a MWE. But in fact I have \begin{longtable}{r r} \caption{xxx} .... –  adnc Aug 18 '11 at 12:02
    
@Martin: \caption* inside longtables is offered by the longtable package itself. So no need for the caption package. (This differs from \caption* inside floating environments, this one is offered by the caption package) –  Axel Sommerfeldt Aug 18 '11 at 12:02
    
axel: but this time the caption disappears totally from my toc. I would like to have it displayed only once, not three times. It prints the caption as much as the table takes space in pages here –  adnc Aug 18 '11 at 12:04
1  
@adnc: Then you used \endhead instead of \endfirsthead –  Herbert Aug 18 '11 at 12:06
show 1 more comment

2 Answers

up vote 7 down vote accepted

use for the \endfirsthead the default \caption and for \endhead the starred version of \caption.

share|improve this answer
1  
Same here, for the starred version of \caption inside longtables the caption package is not needed. –  Axel Sommerfeldt Aug 18 '11 at 12:03
    
did I said something different ... :-)) –  Herbert Aug 18 '11 at 12:05
add comment

In case you want a numbered caption on follow-up table pages, use

\caption{<Caption Text>}
\endfirsthead
\caption[]{<Caption Text>}
\endhead

Minimal working example:

\documentclass{article}

\usepackage{longtable}

\renewcommand*{\arraystretch}{5}% just for the example

\begin{document}

\listoftables

\section{foo}

\begin{longtable}{c}
\caption{A table}
\endfirsthead
\caption[]{A table}
\endhead
bar \\
bar \\
bar \\
bar \\
bar \\
bar \\
bar \\
bar \\
\end{longtable}

\end{document}
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.