This post introduces the optional parameters to fine tune the placement of tables and figures in LaTeX.
If you are using LaTeX, you have seen figure examples like the following
\begin{figure}[ht]
...
\end{figure}
These are optional parameters to fine tune the placement of tables and figures, the term is Float placement specifiers (introduced in detail below). LaTeX will try to honor the placement with respect to the actual place, the top or bottom of the page, or a separate page of floats coming immediately after the present insertion point.
Float placement specifiers
To direct a float to be placed into one of these areas, a float placement specifier has to be provided as an optional argument to the float.
If no such optional argument is given then a default placement specifier is used, which depends on the float class. Each float in LaTeX belongs to a class. By default, LaTeX knows about two classes,figure
and table
. A float placement specifier can contain the following characters in any order and combination:
!
— indicates that some restrictions should be ignoredh
— indicates that the float is allowed to be placed inline (i.e., here)t
— indicates that the float is allowed to go into a top areab
— indicates that the float is allowed to go into a bottom areap
— indicates the the float is allowed to go on a float page or column area
The order in which these characters are stated does NOT influence how the algorithm tries to place the float (e.g., [ht] or [th] will make no difference)! This is one of the common misunderstandings, for instance when people think that bt
means that the bottom area should be tried first. You may also force LaTeX to “insist” on these specifications by adding an exclamation mark (!) before the placement parameters, e.g. \begin{figure}[!htb]
.
However, if a letter is not present then the corresponding area will not be tried at all.
For more detailed intro about this topic, check out How to influence the position of float environments like figure and table in LaTeX?
References:
- What does [t] and [ht] mean?
- How to influence the position of float environments like figure and table in LaTeX? (pdf)