A common complaint is that extra vertical space has crept into
figure
or table
floating environments.
More common still are users who post code that introduces this extra
space, and haven’t noticed the problem!
The trouble arises from the fact that the center
environment (and its siblings flushleft
and
flushright
) are actually based on LaTeX’s
list-handling code; and lists always separate themselves from the
material around them. Meanwhile, there are parameters provided to
adjust the spacing between floating environments and their
surroundings; so if we have:
or worse still:\begin{figure} \begin{center} \includegraphics{...} \caption{...} \end{center} \end{figure}
unwarranted vertical space is going to appear.\begin{figure} \begin{center} \includegraphics{...} \end{center} \caption{...} \end{figure}
The solution is to let the float and the objects in it position themselves, and to use “generic” layout commands rather than their list-based encapsulations.
(which even involves less typing).\begin{figure} \centering \includegraphics{...} \caption{...} \end{figure}
This alternative code will work with any LaTeX package. It will
not work with obsolete (pre-LaTeX 2e) packages such as
psfig or epsf — see
graphics inclusion for discussion of the
genesis of \includegraphics
.
This answer last edited: 2012-11-16
This question on the Web: http://www.tex.ac.uk/cgi-bin/texfaq2html?label=vertspacefloat