blob: fdd57cc787e41e26b797c6bcbd80ef925640857b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
<head>
<title>UK TeX FAQ -- question label vertspacefloat</title>
</head><body>
<h3>Extra vertical space in floats</h3>
<p>A common complaint is that extra vertical space has crept into
<code>figure</code> or <code>table</code> floating environments.
More common still are users who post code that introduces this extra
space, and <em>haven't noticed the problem</em>!
<p>The trouble arises from the fact that the <code>center</code>
environment (and its siblings <code>flushleft</code> and
<code>flushright</code>) 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:
<pre>
\begin{figure}
\begin{center}
\includegraphics{...}
\caption{...}
\end{center}
\end{figure}
</pre>
or worse still:
<pre>
\begin{figure}
\begin{center}
\includegraphics{...}
\end{center}
\caption{...}
\end{figure}
</pre>
unwarranted vertical space is going to appear.
<p>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.
<pre>
\begin{figure}
\centering \includegraphics{...}
\caption{...}
\end{figure}
</pre>
(which even involves less typing).
<p>This alternative code will work with any LaTeX package. It will
not work with obsolete (pre-LaTeX2e) packages such as
<i>psfig</i> or <i>epsf</i> - see
<a href="FAQ-impgraph.html">graphics inclusion</a> for discussion of the
genesis of <code>\</code><code>includegraphics</code>.
<p><p>This question on the Web: <a href="http://www.tex.ac.uk/cgi-bin/texfaq2html?label=vertspacefloat">http://www.tex.ac.uk/cgi-bin/texfaq2html?label=vertspacefloat</a>
</body>
|