Fix figure overflow in LaTeX
A figure that spills past the text column or bleeds into the margin is one of the most common reasons a LaTeX paper looks broken even though it compiles cleanly. It almost always comes from an image set wider than the column it lives in.
Quick answer
To fix figure overflow in LaTeX, change the image width from \textwidth to \columnwidth (or cap it at 0.95\columnwidth) so it scales to a single column. In two-column layouts, \textwidth is the full page width, which overflows the column. LaTeX Formatter measures each figure against your venue's real column width and rewrites the over-wide ones automatically.
What causes figure overflow
In a two-column layout, \textwidth is the full page width while \columnwidth is the width of a single column. Using width=\textwidth (or a fixed width in cm larger than the column) inside a two-column document makes the image extend past the column boundary into the gutter or margin.
A second common cause is a hard-coded width such as width=1.2\linewidth or width=15cm copied from a single-column draft and never adjusted for the target venue.
How to fix it manually
Replace \textwidth with \columnwidth (or \linewidth) so the image scales to the current column.
Cap the width at a safe fraction: width=\columnwidth, or width=0.95\columnwidth to leave breathing room.
Recompile and check the right margin on every page the figure appears on - overflow often only shows on the page where the float finally lands.
How LaTeX Formatter fixes it automatically
LaTeX Formatter parses your actual \includegraphics calls, compares each requested width against the real column width for your detected template, and rewrites over-wide figures to fit. It does not guess - it measures against venue specs (for example, an IEEE column is ~88 mm; NeurIPS is 154 mm single-column).
You get back a compiled-ready .tex with the width corrected and a changelog line for every figure it touched.
Before and after
Two-column figure overflowing the column
Before
\includegraphics[width=\textwidth]{plot.pdf}After
\includegraphics[width=\columnwidth]{plot.pdf}Hard-coded over-wide image
Before
\includegraphics[width=1.2\linewidth]{arch.png}After
\includegraphics[width=0.95\linewidth]{arch.png}Who this helps
- Conference authors fighting strict page limits
- Journal authors with multi-column layouts
- Anyone reusing a figure from a single-column draft
Frequently asked questions
Why does my figure overflow even though the image file is small?+
Overflow is about the requested width in your LaTeX source, not the file's pixel size. width=\textwidth in a two-column document asks LaTeX to draw the image at full page width, which is wider than one column.
What is the difference between \textwidth, \columnwidth and \linewidth?+
\textwidth is the full text block width. \columnwidth is the width of the current column (half the text block in two-column mode). \linewidth is the width of the current line context, which usually equals \columnwidth inside a figure.
Can ChatGPT detect figure overflow?+
Not reliably. A language model reads your source text but does not render the PDF, so it cannot see that a figure visually crosses the margin. LaTeX Formatter measures requested widths against the actual column geometry of your venue.
Check your paper before reviewers do
Upload your .tex or .zip and get a corrected file plus a plain-English changelog in under 60 seconds.
Check My Paper - Free