FormaTeX
FatalFiles & Resources

Unknown Graphics Extension

! LaTeX Error: Unknown graphics extension: .XXX.

What this error means

You tried to include an image with a file format that the current LaTeX engine doesn't support. Different engines support different image formats.

FormaTeX smart compile

FormaTeX smart compile detects EPS images and automatically switches to an engine with epstopdf support, or converts the image format before compiling.

Common causes

  • Using .eps images with pdflatex (which doesn't support EPS natively)
  • Using a format like .bmp, .tiff, or .psd that no engine supports
  • Typo in the file extension

How to fix it

For pdflatex: use .pdf, .png, or .jpg images. For XeLaTeX/LuaLaTeX: same plus .eps via epstopdf. Convert unsupported formats beforehand. You can also omit the extension and let LaTeX pick the best format automatically.

Code examples

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

% pdflatex doesn't support .eps
\includegraphics{figure.eps}

\end{document}
Fixed
\documentclass{article}
\usepackage{graphicx}
\begin{document}

% Use PDF, PNG, or JPG with pdflatex
\includegraphics{figure.pdf}

% Or let LaTeX choose:
% \includegraphics{figure}

\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