FormaTeX
FatalFiles & Resources

Cannot Determine Size of Graphic (No BoundingBox)

! LaTeX Error: Cannot determine size of graphic (no BoundingBox).

What this error means

LaTeX could not determine the dimensions of an included graphic because the file lacks a BoundingBox comment. This happens when EPS files are included in pdfLaTeX mode, or when an image file is corrupted.

FormaTeX smart compile

FormaTeX smart compile detects EPS files included with pdfLaTeX and automatically converts them using epstopdf before compiling.

Common causes

  • Including an .eps file with pdflatex (which requires .pdf, .png, or .jpg)
  • An EPS file missing its %%BoundingBox: header comment
  • A corrupted or zero-byte image file
  • Using the dvips workflow but trying to include a PDF

How to fix it

Convert EPS files to PDF using epstopdf (run epstopdf figure.eps to get figure.pdf). For pdflatex, use .pdf, .png, or .jpg files. Load the epstopdf package to automate this conversion on-the-fly.

Code examples

Causes the error
\documentclass{article}
\usepackage{graphicx}
\begin{document}

% pdflatex cannot use EPS without conversion
\includegraphics{figure.eps}

\end{document}
Fixed
\documentclass{article}
\usepackage{graphicx}
\usepackage{epstopdf}  % auto-converts EPS to PDF
\begin{document}

\includegraphics{figure.eps}  % epstopdf converts it on-the-fly

% Or manually convert first:
% \includegraphics{figure.pdf}

\end{document}

Related errors

Test the fix live

Paste your LaTeX into the playground and compile instantly.

One quick thing

We track anonymous usage — page views, feature usage, compilation events — to understand what works and what doesn't. No ads, no personal data, no third-party sharing.

Cookie policy