Graphics, Figures & TablesInclusion of PNG Image fails

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
sjkiss
Posts: 30
Joined: Tue Nov 15, 2011 12:23 am

Inclusion of PNG Image fails

Post by sjkiss »

Hi,

I'm using Texshop 2.47 on a Mac OS 10.6.8 and I cannot, for the life of me get it to properly include the graphic that is attached. In the preferences, I've set 'Default Script' to pdfTeX because I've read somewhere that latex does not recognize PNG files while pdfLaTeX does. I'm not sure if that makes a difference or not.

I'm getting this error message:

Code: Select all

 pdftex.def Error: PDF mode expected, but DVI mode detected!
(pdftex.def)                If you are using `latex', then call `pdflatex'.
(pdftex.def)                Otherwise check and correct the driver options.
(pdftex.def)                Error recovery by switching to PDF mode.

See the pdftex.def package documentation for explanation.
The code below is working in that I get the document I'm supposed to, but I'd like to address this error message.

Grateful for any suggestions.

Code: Select all

\documentclass{article}
\usepackage[pdftex]{graphicx}
\begin{document}
test

\begin{figure}
\center
\includegraphics{~/directory/search_details.png}
\caption{This shows the picture}
\label{stuff}
\end{figure}
\end{document}
Attachments
File I'm trying to insert
File I'm trying to insert
search_details.png (31.67 KiB) Viewed 1951 times

Recommended reading 2024:

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

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Inclusion of PNG Image fails

Post by localghost »

What does the log file say other than the warning you mentioned? Could be helpful to attach it here.

By the way, driver options like pdftex are not necessary at all. And its preferable to abstain from special characters like underscores in file names.


Thorsten
Post Reply