By default (in the article
class), a table caption (without letters with depth) is very close to a table with two or more rows. Only if the table has one row then the caption and the table will be at some distance (in this case letters with depth in the caption seem not to change anything).
- Why is the default distance so small (in Table 1)?
- Why does the distance increase if there is only one line (Table 2)?
The picture was created from the following MWE.
\documentclass{article}
\begin{document}
\begin{table}[h]\caption{aaaa}
\centering
\begin{tabular}{r@{ }l}
\hline
Hardly any & distance\\
\hline
between &caption and table;\\ %second row is essential!
\hline
\end{tabular}
\end{table}
\begin{table}[h]\caption{bbbb}
\centering
\begin{tabular}{r@{ }l}
\hline
Some distance between & caption and table;\\
\hline
%no second row!!
\end{tabular}
\end{table}
\end{document}
Of course, there are different "workarounds" (but that is not my question):
-
by using
\usepackage{caption} \captionsetup[table]{skip=5pt}
see: The space between the table and its caption is very small
-
by setting
\belowcaptionskip
to some value\setlength\belowcaptionskip{5pt}
see a similar question: A style prevents me from setting \belowcaptionskip, how do I change that?
-
or simply by putting
\strut
inside the caption of Table 1.
Best Answer
The
article
class sets\belowcaptionskip
to zero; so you don't get any vertical space between the caption and the table. Thecaption
package solves this by reversing the roles of\abovecaptionskip
and\belowcaptionskip
when the caption comes first, IIRC.Why the space is slightly bigger in the second case? This has to do with the interline glue computations performed by TeX and the fact that the default vertical alignment of
tabular
isc
.The two line
tabular
has a height of 15.09999pt, which triggers the insertion of the\lineskip
glue between the caption and the table. Conversely, the one line tabular has height 8.9pt, so the usual computation takes place.Two line tabular. The baseline skip is 12pt, the depth of the caption is zero; the tabular is too high, so
\lineskip
glue (1pt) is inserted.One line tabular. The baselineskip is 12pt, the depth of the caption is zero; glue
\baselineskip-8.9pt=3.1pt
is inserted.Curiously, if you used
\begin{tabular}[t]
you'd see a larger gap. Why is that? Because the top item in the tabular is\toprule
which has height 0.4pt; so interline glue 12-0.4=11.6pt is inserted.