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.

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

output of MWE

  • 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):

share|improve this question

1 Answer 1

up vote 6 down vote accepted

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.

share|improve this answer
    
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

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.