[h], [t], [b], [p], and [H] do not mean “put the image exactly here” in the way many beginners expect. This guide explains what each option actually does, why figures move, and how to get cleaner layouts without fighting the compiler.
Key concept: Figures are “floats” in LaTeX - they can move to optimize page layout. Understanding this behavior is essential for controlling positioning.
Understanding Floats
What Are Floats?
Floats are elements (figures, tables) that LaTeX can move to avoid awkward page breaks and maintain good typography. LaTeX uses sophisticated algorithms to determine optimal placement.Why Floats Move
LaTeX moves floats to:- Avoid large white spaces
- Prevent awkward page breaks
- Keep related content together
- Maintain consistent page density
Positioning Options
Basic Float Specifiers
Positioning Priority
Forcing Exact Placement
Advanced Positioning Control
Float Parameters
Clearing Floats
Multiple Figures Layout
Side-by-Side Positioning
Custom Arrangements
Page-Wide Figures
Full Width in Two-Column
Landscape Figures
Precise Positioning
Absolute Positioning
Margin Figures
Float Management Strategies
Document-Wide Settings
Managing Many Figures
Debugging Float Issues
Common Problems and Solutions
How to Force a Figure to Stay in Its Own Section
A float can drift several pages past the point where it was declared, which often means it appears under the wrong heading. This is normal float behaviour, not a bug: LaTeX moves floats to wherever they fit. The reliable fix is a float barrier.\usepackage{placeins} provides
\FloatBarrier, which forces every pending float to be placed before the document
continues. Put it at the end of a section, and no figure can escape into the next
one.
\usepackage[section]{placeins} does this automatically at every \section, which
is usually what people want when they ask this question.
\clearpage also flushes floats, but it starts a new page, so it is a heavier tool.
Reach for \FloatBarrier first.
Forcing exact placement with [H] from float is a different thing and a worse
default — it disables floating entirely and tends to leave large gaps.
Best Practices
Quick Reference
Placement Options
Key Commands
Next: Learn about Creating tables to present structured data effectively. Tables use similar positioning concepts to figures. You might also be interested in Cross-referencing to link to your figures and tables.
