Floats
Published on 30 Nov 2007Tags #LaTeX
Floating environments allow you to have Figures to be placed automatically in sensible places by LaTeX.
Standard Figures
This floating environment causes the figure to use the whole width of the page:
% ...
\begin{document}
% ...
\begin{figure}[PLACEMENT]
% ...
\end{figure}
% ...
\end{document}
Placement:
-
h
: here -
t
: Top -
b
: Bottom -
p
: On page containing floats -
!
: Force
Placing two figures next to each other inside a single figure environment including captions printed below and labels:
\begin{figure}[t]
\parbox[t]{7cm}{
\includegraphics[keepaspectratio=true,width=7cm]{figure1}
\caption{figure 1}
\label{fig.figure1}
}
\parbox[t]{7cm}{
\includegraphics[keepaspectratio=true,width=7cm]{figure2}
\caption{figure 2}
\label{fig.figure2}
}
\end{figure}
Floating Figures
This floating environment allows text to be printed next to the figure.
% ...
\usepackage[OPTIONS]{floatflt}
% ...
\begin{document}
% ...
\begin{floatingfigure}[PLACEMENT]{WIDTH}
% ...
\end{floatingfigure}
% ...
\end{document}
Options:
-
rflt
: Placed right in paragraph -
lflt
: Placed left in paragraph -
vflt
: Placed left on even-numbered pages and right on odd-numbered
Placement:
-
r
: See above -
l
: See above -
p
: See above -
v
: See the vflt package option
NOTE: Using this package, floating figures need to placed with care: They may disappear if placed too close to sectioning commands. They may overlap with list environments.
Referring to figures is referring to captions: See Caption
Stopping a floating environment to be moved to the end of the document:
% places all floats and starts a new page
\clearpage
% places all floats and starts a new double page
\cleardoublepage