Graphics, Figures & TablesImage Insertion Error with pdftex

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
Neverspeak
Posts: 1
Joined: Wed Jan 06, 2010 11:35 am

Image Insertion Error with pdftex

Post by Neverspeak »

I'm using pdftex with TeXnicCenter. I cannot get the image file inserted into the document. When I build this:

\documentclass[12pt,titlepage]{article}
\usepackage[pdftex]{graphicx}
\begin{document}

What a bunch of crap?!

\begin{figure}[h]
\centering
\caption[Figure 1]
\includegraphics{valleyOfStability}
\end{figure}

\end{document}


I get the error

! Package pdftex.def Error: File `\color@endgroup .png' not found.

See the pdftex.def package documentation for explanation.


I have the image file saved in the same folder as the .tex file. I have a .png, .jpg, .pdf, and .eps version there, so the issue isn't the file type. I've tried adding each of these file extensions to the filename in the tex code.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

josephwright
Site Moderator
Posts: 814
Joined: Tue Jul 01, 2008 2:19 pm

Re: Image Insertion Error with pdftex

Post by josephwright »

Well, with a modern set up you don't need the option [pdftex] for the graphics package. Also, the \caption macro needs a mandatory argument, and you've only given an optional one. What will then happen is that \includegraphics gets sucked up by \caption, and then all sorts of things will go wrong!
Joseph Wright
Post Reply