Time for action – letting a figure float
Both the figure
and the table
environment take an optional argument affecting the final placement of the figure or the table. We shall test the effect in our graphics example:
Go back to the previous example. This time, add the options
h
andt
:\begin{figure}[ht] \centering \includegraphics{test} \caption{Test figure} \end{figure}
Typeset, notice the change in the output.
Change the options into
!b
:\begin{figure}[!b]
Typeset, the figure is now forced to float to the bottom. Compare both results:
What just happened?
Just by adding some characters standing for placement options, we could force the figure to appear where we wanted it to.
Understanding float placement options
The optional argument of the figure
and table
environment tells LaTeX where it's allowed to place the figure or the table. Four letters stand for four possible places:
h
stands for here. The float may appear where it's been written in the source code.t
stands for top. Placing at the top...