0

Why is there so little space between my table and its caption? Is this normal?

\documentclass{article}
\begin{document}

\begin{table}
\caption{Some words ...}
\begin{tabular}{lll}
and yet some & more words & to see the space problem \\
Here is a & second row. & It is a table.
\end{tabular}
\end{table}

\end{document}

enter image description here

I found The space between the table and its caption is very small where the OP faced the same problem, but did not provide a full MWE.

  • 1
    I think that \usepackage{caption} will solve your problem. Edit: this is also the solution to the problem of the question you linked. – Phelype Oleinik Mar 12 '18 at 15:50
  • as mentioned @PhelypeOleinik, \documentclass{article} \usepackage{caption} \begin{document} \begin{table} \caption{Some words ...} \begin{tabular}{lll} and yet some & more words & to see the space problem \\ Here is a & second row. & It is a table. \end{tabular} \end{table} \end{document} will add space between caption and table. size of space you can adjust with caption option skip=... – Zarko Mar 12 '18 at 15:53
  • @Zarko Should this question be marked as a duplicate? – Phelype Oleinik Mar 12 '18 at 15:57
  • 1
    @Joe Oh, sorry. Well... normal it is, you aren't using any packages and I got the same result. Why, I guess that's because when TeX is typesetting paragraphs, a \baselineskip separates one line from another, but in this case you can a \caption right on top of a \begin{tabular}, and possibly they don't have (without the caption package) an amount of space that should separate them, so TeX puts one box right on top of the other, making the "space" between them so narrow. Someone who knows stuff will tell you if I just wrote a lot of garbage or not :) – Phelype Oleinik Mar 12 '18 at 16:07
  • 1
    Put some letter with a descender, like qypgj in the caption to see the space grow :) – Phelype Oleinik Mar 12 '18 at 16:10
4

the space between caption and table depends on the document class.

article (and all the basic latex classes) assume that captions in floats are always below the content, and insert space above it, not below it. that's appropriate for figures, but not for tables.

other document classes (e.g. amsart) make a different assumption, that in a figure environment, the caption is below the figure, but in a table environment, the caption is at the top and space is inserted between caption and table proper.

|improve this answer|||||
1

This is a workaround for the standard classes such as article:

\documentclass{article}
\usepackage{etoolbox}

\makeatletter
\appto\@floatboxreset{\check@table}
\newcommand{\check@table}{%
  \expandafter\ifstrequal\expandafter{\@captype}{table}
   {% exchange \abovecaptionskip with \belowcaptionskip
    \dimen@=\abovecaptionskip
    \abovecaptionskip=\belowcaptionskip
    \belowcaptionskip=\dimen@
   }
   {}%
}
\makeatother

\begin{document}

\begin{table}
\centering

\caption{Some words ...}

\begin{tabular}{lll}
and yet some & more words & to see the space problem \\
Here is a & second row. & It is a table.
\end{tabular}

\end{table}

\end{document}

enter image description here

|improve this answer|||||

Your Answer

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

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