Tables & Figures
How to Position Figures in LaTeX
LaTeX treats figures as 'floats' that it positions automatically. You can influence (but not fully control) placement.
Float Specifiers
Use [htbp] to suggest placement:
\begin{figure}[htbp]
% h = here (current position)
% t = top of page
% b = bottom of page
% p = separate page
% ! = override defaults
\end{figure}Force Position with float Package
Use [H] to force exact position:
\usepackage{float}
\begin{figure}[H]
\centering
\includegraphics{image.png}
\caption{This figure stays exactly here}
\end{figure}Wrap Text Around Figure
Use wrapfig package for text wrapping:
\usepackage{wrapfig}
\begin{wrapfigure}{r}{0.4\textwidth}
\centering
\includegraphics[width=0.35\textwidth]{image.png}
\caption{A wrapped figure}
\end{wrapfigure}
Text flows around this figure...Side by Side Figures
Use subfig or subcaption package:
\usepackage{subcaption}
\begin{figure}[htbp]
\centering
\begin{subfigure}{0.45\textwidth}
\includegraphics[width=\linewidth]{fig1.png}
\caption{First}
\end{subfigure}
\hfill
\begin{subfigure}{0.45\textwidth}
\includegraphics[width=\linewidth]{fig2.png}
\caption{Second}
\end{subfigure}
\caption{Both figures together}
\end{figure}💡 Tips
- •[htbp] tries positions in order: here → top → bottom → page
- •Add ! for more aggressive placement: [!htbp]
- •Don't fight LaTeX's float placement too much—it usually knows best
Try This in Bibby AI
Write LaTeX faster with AI auto-complete and instant compilation.
Start Writing Free