Graphics, Figures & TablesEPS to PDF on the fly

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
jmoney
Posts: 3
Joined: Tue Jun 28, 2011 7:11 pm

EPS to PDF on the fly

Post by jmoney »

I know that I can use .eps figures and compile with pdflatex by including the epstopdf package but I have an issue when I compile. When I run the command:

Code: Select all

$ pdflatex sample
I receive the error:

Code: Select all

Error: pdflatex (file method1.pdf): cannot find image file
 ==> Fatal error occurred, the output PDF file is not finished!
The implementation in sample.tex is as follows:

Code: Select all

\documentclass[12pt]{article}
\usepackage[pdftex]{graphicx}
\usepackage{epstopdf} 

\begin{document}
   \begin{figure}[htbp]
      \centering
      \includegraphics{method1}
      \caption{Plot of function.}
      \label{fig:method1}
   \end{figure}
\end{document}
I have been able to get it to compile properly with:

Code: Select all

$ pdflatex -shell-escape sample
Is there a way to get it to compile using the former syntax?

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

Re: EPS to PDF on the fly

Post by localghost »

Where is the problem in compiling with the switch? The shell escape is needed to enable the compiler to execute external programs. With a modern TeX distribution like TeX Live 2010 you can drop this switch. It has a restricted shell escape by default.
jmoney
Posts: 3
Joined: Tue Jun 28, 2011 7:11 pm

EPS to PDF on the fly

Post by jmoney »

Here is the entire message when I run pdflatex sample:

Code: Select all

This is pdfeTeX, Version 3.141592-1.21a-2.2 (Web2C 7.5.4)
entering extended mode
(./sample.tex
LaTeX2e <2003/12/01>
Babel <v3.8d> and hyphenation patterns for american, french, german, ngerman, b
ahasa, basque, bulgarian, catalan, croatian, czech, danish, dutch, esperanto, e
stonian, finnish, greek, icelandic, irish, italian, latin, magyar, norsk, polis
h, portuges, romanian, russian, serbian, slovak, slovene, spanish, swedish, tur
kish, ukrainian, nohyphenation, loaded.
(/usr/share/texmf/tex/latex/base/article.cls
Document Class: article 2004/02/16 v1.4f Standard LaTeX document class
(/usr/share/texmf/tex/latex/base/size12.clo))
(/usr/share/texmf/tex/latex/graphics/graphicx.sty
(/usr/share/texmf/tex/latex/graphics/keyval.sty)
(/usr/share/texmf/tex/latex/graphics/graphics.sty
(/usr/share/texmf/tex/latex/graphics/trig.sty)
(/usr/share/texmf/tex/latex/graphics/graphics.cfg)
(/usr/share/texmf/tex/latex/graphics/pdftex.def)))
(/usr/share/texmf/tex/latex/oberdiek/epstopdf.sty) (./sample.aux)
(/usr/share/texmf/tex/context/base/supp-pdf.tex
(/usr/share/texmf/tex/context/base/supp-mis.tex
loading : Context Support Macros / Miscellaneous (2004.10.26)
)
loading : Context Support Macros / PDF (2004.03.26)
)
Error: pdflatex (file method1.pdf): cannot find image file
 ==> Fatal error occurred, the output PDF file is not finished!
I thought I had the Tex 2010 distribution but maybe not. How can I see what version I have?
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

EPS to PDF on the fly

Post by localghost »

jmoney wrote:[…] I thought I had the Tex 2010 distribution but maybe not. How can I see what version I have?
The very first line of the log file tells you which version you have. PDFTeX should be 1.40.11 now and Web2c 7.5.4 is about five years old. So your system is far from being up to date. I suggest to update your TeX distribution if you want to get rid of the command line switch.
jmoney
Posts: 3
Joined: Tue Jun 28, 2011 7:11 pm

Re: EPS to PDF on the fly

Post by jmoney »

Will do! Thanks for the help!
Post Reply