In the document class amsart
, I get different vertical spacing around the caption in tables and figures. For instance, compare the difference:
\documentclass{amsart}
\begin{document}
\begin{figure}
\begin{center}
\begin{tabular}{c}
Figure
\end{tabular}
\caption{Caption}
\end{center}
\end{figure}
\begin{table}
\begin{center}
\begin{tabular}{c}
Table
\end{tabular}
\caption{Caption}
\end{center}
\end{table}
\end{document}
Is this a bug? More to the point, is there some way of getting the figure spacing in tables? If I change the document class to article
, then the spacings become the same.
Best Answer
Im amsart captions are usually positioned above a table and below a figure. It's very common in typesetting. That means, position the
\caption
command before you begin the tabular environment. Then there will be the appropriate space between the caption and the table. Or do you want to use the intended style?If needed, a quick fix would be to add the missing space manually before the caption:
In that case, consider to remove the space after the caption by this line in the preamble:
Or set it to the space you like. Similar you can change the value of \abovecaptionskip.
Alternatively, you could use the very fine
caption
package. It offers many ways of customizing caption format and justification. For instance, if you just writethen you may put \caption above the tabular environment and get the correct spacing.
However, if you don't want to use the caption package, you could redefine the internal
\@makecaption
command of amsart by writing in your preamble:I just removed the different handling of figures and other floats. The original code has the difference here:
just before the last
\relax
. Note, it's usually not a good idea to redefine internal commands like this. Such commands might be changed later. It's just a workaround for the moment.And doing it with
caption
package features is much more easier.Finally, note: using
\begin{center} ... \end{center}
inside a figure or float environment causes additional space since the center environment is a list environment internally, bringing some space before and after it. I recommend to use the command\centering
instead. Perhaps seecenter
vs.\centering
.