Normally, my captions stay with the table
(cannot remember my exact example - couldn't replicate it - but I am now using the booktabs package anyway so let us take this one just in case this one is easy to solve...)

Can you see any reason here why the caption may not be "glued" to the table?
I want the caption to definitely stay on the same page (and in this case above the table)

\caption{Investment overview}\label{tab:Invest}
\textit{Alternative 1}  &  Time of     & Year\\[-2pt]
                        &  investment  & 2006 & 2007 & 2008 & 2008 & 2010 \\ \bottomrule
  • 2
    When you say you "couldn't replicate it", does that mean you could not replicate any example where the described behaviour appears? In that case, it will be very difficult to help, I think. Also, with problems like this it's really important to add what documentclass you are using (that line is missing in your example). – Jake Mar 23 '11 at 16:28
  • Might be an idea to also include the class. As it stands here any normal class would not break this across a page break. BTW: why do you use \hline as well? replace it with \bottomrule. You the following might also be useful \usepackage[tablelocation=top]{caption} (or something like that) – daleif Mar 23 '11 at 16:30
  • @daleif @Jake just added \documentclass[a4paper,10pt]{scrartcl} – user3992 Mar 23 '11 at 16:37
  • @daleif now using \bottomrule instead of \hline - thanks – user3992 Mar 23 '11 at 16:39

In the shown example the caption will always be on the same page as the table (tabular) because they are inside a table float which doesn't allow page breaks.

Possibilities why the caption could move:

  • You do not place them into a table float, e.g. because you want to place them at a specific position and do not want them to float. In this case (actually all cases) it is a good idea to not have an empty line between \caption and \begin{tabular} because this adds a paragraph between both! Also you can place both then into a box, e.g. inside a minipage environment which will glue them together so that they are not split across pages.
  • You are using a special style for table, like the ones provided by the float package. Then the caption will be placed at the position defined by the style, not by your code. However, the caption would still be always at the same page as the content.
  • BTW: The use of the booktabs package should not have any influence on this. – Martin Scharrer Mar 23 '11 at 16:30
  • > a good idea to not have an empty line between \caption and \begin{tabular} -- do I need to move \centering then or just close the line gap? – user3992 Mar 23 '11 at 16:43
  • 1
    @Alex: \centering should come directly after \begin{tabular}. Also do not have empty lines around it as well. You can add lines with only % as visual separations if you like. The % makes LaTeX ignore them. – Martin Scharrer Mar 23 '11 at 17:52
  • > @Alex: \centering should come directly after \begin{tabular}. - Seems to us it should come before \begin{tabular} i.e. after \begin{table} – user3992 Mar 25 '11 at 6:25
  • @Alex: Yes, my mistake, I just wrote tabular but meant table. – Martin Scharrer Mar 25 '11 at 8:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy