15

As from 2010, TexLive has been converting .eps files directly to pdf file if the compilation is done with PDFLaTeX. Thus a file named

coilsans.eps

will be automatically be converted to a file named

coilsans-eps-converted-to.pdf

However I find that the conversion is done if the .eps file is located in the root directory as the main .tex file. If the .eps files happen to be located in another folder, then PdfLaTeX complains e.g.

! Package pdftex.def Error: File `../test/classi-eps-converted-to.pdf' not  found.

See the pdftex.def package documentation for explanation.
Type  H <return>  for immediate help.
 ...                                              

l.130 ...ludegraphics[scale=1]{../test/classi.eps}
                                              }
? 

Process has been terminated ...

How to instruct PDFLaTeX to search in the right directories?

9

Add the option -shell-escape to your compilation options.

Alternatively, instead of having the EPS images in a folder at the same level (but in a different subdirectory), you could just place it in a subdirectory of your root .tex file. Then pdflatex will not complain about the conversion and inclusion of EPS files.

  • @ Werner Thanks. Does -shell-escape is to be put after pdfLaTeX.exe like in pdfLaTeX -shell-escape myfile.tex ? Actually I have the file in a folder in my tex root directory. Even if I have {/test/classi.eps}, PdfLaTeX still complains. 1 vote up. – yCalleecharan Dec 28 '11 at 7:52
  • @yCalleecharan: Yes, pdflatex -shell-escape myfile.tex. I was able to reproduce your error if I included ../test/XX.eps, but had no problems with inclusion of test/XX.eps under pdflatex. The -shell-escape option solved it in both cases. The problem deals with "restricted mode," which led me to this thread. I found that I had the shell_escape = p setting in my texmf.cnf file. – Werner Dec 28 '11 at 8:00
  • @ Werner I have the texmf.cnf file also as yours with shell_escape = p in C:\texlive\2011\texmf\web2c. My mistake was to put {/test/classi.eps} and not just {test/classi.eps}. Thanks. It works now. – yCalleecharan Dec 28 '11 at 8:13
  • (Old question, but...) Can anybody explain why shell-escape is necessary only if eps files are in subdirectories? – Ross Sep 4 '18 at 3:00
  • @Ross: You mean it works if the EPS files are in the main folder, but not in subfolders? – Werner Sep 4 '18 at 5:10
1

Try this kind of folder structure. I had the same error but overcome by using like this.

\chapter{Introduction}
\ifpdf
    \graphicspath{{Introduction/IntroductionFigs/PNG/}{Introduction/IntroductionFigs/PDF/}{Introduction/IntroductionFigs/}}
\else
    \graphicspath{{Introduction/IntroductionFigs/EPS/}{Introduction/IntroductionFigs/}}
\fi

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.