Graphics, Figures & TablesFigures not inserted with pdflatex; works fine with latex

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
BudBoman
Posts: 4
Joined: Sat Dec 06, 2014 9:29 pm

Figures not inserted with pdflatex; works fine with latex

Post by BudBoman »

First, I'm new to the LaTeX Community and this is my first post. Please let me know if I'm doing it wrong, or just impolitely. I don't intend to.

Second, I've been using LaTeX for many years, but I only learn the minimum necessary to accomplish the the task at hand so I'm probably best treated as a novice.

I'm using MikTeX on a Windows 7 computer. In the directory I'm working in are three files: "dum.tex" (the MWE -- see below), "T.eps" and "T.pdf." Both of these last two contain the same image.

When I compile the following using "latex dum.tex" it works fine. T.eps is found and I can view it using yap.

When I try "pdflatex dum.tex" I get no errors and the pdf file is created but there is nothing in it when I try to view it with Adobe Reader.

Here is the relevant part of the log file:

Code: Select all

<T.pdf, id=1, 147.4308pt x 190.7928pt>
File: T.pdf Graphic file (type pdf)
 <use T.pdf>
Package pdftex.def Info: T.pdf used on input line 5.
(pdftex.def)             Requested size: 147.43044pt x 190.79231pt.
 [1{C:/Users/ecb5/AppData/Local/MiKTeX/2.9/pdftex/config/pdftex.map}
and here is the MWE:

Code: Select all

\documentclass{book}
\usepackage{graphicx}

\begin{document}
\includegraphics{T}
\end{document}
I'm hoping this is easily fixed by filling the gaping hole in my knowledge base, but I'll gratefully accept any help I can get.
Last edited by Stefan Kottwitz on Sat Dec 06, 2014 11:47 pm, edited 1 time in total.

Recommended reading 2024:

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

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

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

Figures not inserted with pdflatex; works fine with latex

Post by Stefan Kottwitz »

Welcome to the forum!

pdfLaTeX doesn't directly support EPS files, it can only include PDF, JPG and PNG files.

There's a package which can do conversion on-the-fly. Try in your preamble:

Code: Select all

\usepackage{epstopdf}
If it doesn't work, you may have to enable the shell-escape feature.

Stefan
LaTeX.org admin
BudBoman
Posts: 4
Joined: Sat Dec 06, 2014 9:29 pm

Re: Figures not inserted with pdflatex; works fine with late

Post by BudBoman »

Thank you, Stephan_K.

I should have mentioned that it compiles without error either way and, as you can see in the snippet of the log file that I posted, when I run "pdflatex dum.tex" the compiler is finding the .pdf file in the directory just fine. But it isn't visible in dum.pdf compilation.

I tried \usepackage{epstopdf} per your suggestion. No effect.

I'm very puzzled. ;)
User avatar
Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

Re: Figures not inserted with pdflatex; works fine with late

Post by Stefan Kottwitz »

Ok, I read EPS and pdflatex and stopped thinking further. :D

Perhaps post your T.pdf file here, as attachment, so we can test it.

Stefan
LaTeX.org admin
BudBoman
Posts: 4
Joined: Sat Dec 06, 2014 9:29 pm

Re: Figures not inserted with pdflatex; works fine with late

Post by BudBoman »

Sure. Here it is.
Attachments
T.PDF
(10.38 KiB) Downloaded 185 times
User avatar
Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

Re: Figures not inserted with pdflatex; works fine with late

Post by Stefan Kottwitz »

When I opened the file, my Adobe Reader crashed :shock: then I opened again, both with the Adobe Reader and the Mac OS X preview program, they showed an empty page. I guess the PDF file is broken, that would explain why it doesn't show up in your TeX output as well.

What do you see if you open T.pdf with the Adobe Reader?

Perhaps also attach T.eps so we can see the original file.

Stefan
LaTeX.org admin
BudBoman
Posts: 4
Joined: Sat Dec 06, 2014 9:29 pm

Re: Figures not inserted with pdflatex; works fine with late

Post by BudBoman »

:shock: Ack! Sorry. The problem is elsewhere. It seems a bunch of my .pdf files are now suddenly empty. Never occurred to me to check that cuz I've been using them for, literally, years.

When I used a pdf that actually had an image in it, pdflatex worked as expected. Sorry to take up your time with this.

One final question: Can I make this thread go away and if so, how? I'd rather not waste anyone else's time with my stupidity.

Thank you for your attempts to help. I'll try to make my next post a little less silly. :oops:
User avatar
Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

Re: Figures not inserted with pdflatex; works fine with late

Post by Stefan Kottwitz »

No problem, my time was ok :-) I'm glad to help.

I marked the thread as solved, that's enough. Still somebody may arrive here via google, either being reminded to check the PDF content or invited to post a new question.

Best regards,

Stefan
LaTeX.org admin
Post Reply