# Small default distance between the caption and the table

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}

• 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.

-

The article class sets \belowcaptionskip to zero; so you don't get any vertical space between the caption and the table. The caption 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 is c.

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.

1. 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.

2. 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.

-
Thank you! Just curious, how did you get the values "15.09999pt" and "8.9pt"? Probably it can be printed to the log file, but how? –  e-birk Mar 25 '13 at 17:19
@e-birk I did \sbox0{\begin{tabular}...}\showthe\ht0 –  egreg Mar 25 '13 at 19:05