Graphics, Figures & Tablespdflatex compiles but .jpg images do not appear

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
EndlessImpasse
Posts: 1
Joined: Wed Jul 21, 2010 5:41 am

pdflatex compiles but .jpg images do not appear

Post by EndlessImpasse »

Hello,

I am trying to compile a .tex file with a .jpg image to .pdf. I am using WinEdt with MiKTeX and viewing the .pdf file in Acrobat 9.2, running Windows 7. I include the graphics using the simple command:

Code: Select all

\begin{figure}[t]
\centering
\includegraphics[width=2.875in]{mainplot.jpg}
\label{fig:mainplot}
\end{figure}
I have a few graphics in .pdf format and a few in .jpg format. My preamble is as follows:

Code: Select all

\documentclass[twoside,11pt]{article}
\usepackage{epsfig}
\usepackage{amssymb}
\usepackage{graphicx}
I click on the button for compiling .pdf, so WinEdt automatically runs pdflatex. It compiles fine. However, when I view the .pdf, the .pdf figures show up fine, whereas the .jpg figures are replaced by solid gray boxes. These solid gray boxes are of the size that I specified for the figures, so it seems like the compiler found them fine. However, I cannot see the figures themselves.

Has anybody ever had this problem with .jpg figures being displayed as gray boxes? Is there anything you could suggest to me?

Thanks,
EI

Recommended reading 2024:

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

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

frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

Re: pdflatex compiles but .jpg images do not appear

Post by frabjous »

Are you sure you're compiling directly with pdflatex, rather than with the latex > dvips > ps2pdf route? If the former, then you can't use eps figures, so I don't understand what the epsfig package is doing in your preamble (--it's made redundant by graphicx anyway if I'm not mistaken--). If the latter, then jpeg images won't work. (If you need to include eps figures, I'd convert them to PDF so you can compile directly with pdflatex.)

Also make sure you are not using the draft option.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

pdflatex compiles but .jpg images do not appear

Post by localghost »

I wonder why you include the (obsolete) epsfig package when you are going to have JPG and PNG images in your document.


Best regards and welcome to the board
Thorsten
Post Reply