# .eps files and pdflatex

I am trying to include an .eps figure in a document and build with pdflatex:

\documentclass[12pt,a4paper]{report}
\usepackage{graphicx}
\usepackage{epstopdf}
\begin{document}
\includegraphics{figure}
\end{document}


The error I get is:

sh: epstopdf: command not found

Package pdftex.def Error: File figure-eps-converted-to.pdf' not found. \includegraphics{figure}


Adding -shell-escape as mentioned in previous posts does not solve the issue. I have reinstalled epstopdf with TeX Live. I am using TeXstudio 2.10.2 on Mac OS X 10.10.5.

Edit:

Apparently, this is an editor-related issue since everything works fine if called from command line.

• (1) Welcome, (2) We need to know what LaTeX installation you are using. You mention TeX Live, which version? And since you are on Mac, why not MacTeX? – daleif Oct 16 '15 at 11:58
• @daleif Thanks. I have TeX Live version 1.23. I do not really have a justification for not using MacTeX except for my lack of experience. I have just downloaded and installed the 2015 distribution, but I still cannot compile the example above. – Smurf Oct 16 '15 at 12:25
• Erh, What exactly is version 1.23? The current TeX Live is version 2015. – daleif Oct 16 '15 at 12:26
• Sorry, I was referring to Tex Live Utility. – Smurf Oct 16 '15 at 12:30
• sh: epstopdf: command not found doesn't sound good. What happens if you call epstopdf --help in a command line? – Ulrike Fischer Oct 16 '15 at 12:35

With TeXLive 2015, eps files should be converted to pdf automatically when using pdflatex. There is no need to load the epstopdf package. The error you are getting suggests that the system is looking for the epstopdf script in the wrong place. According to the user manual, there are various settings that TeXStudio uses when looking for commands of this type. If there is a setting for epstopdf, then do

which epstopdf


in the terminal and paste the result in its place. Failing this, compile the following document with shell escape enabled:

\documentclass{article}
\begin{document}
\immediate\write18{echo $PATH > tmp1} \immediate\write18{which epstopdf > tmp2} \end{document}  (Note that this will destroy any existing files called tmp1 and tmp2 in the current directory.) Then edit your question by adding the contents of the files tmp1 and tmp2. EDIT Integrated development environments are the work of Satan. I just downloaded TeXStudio and reproduced exactly the same problem. Using the code above, I determined that it is searching for epstopdf in a nonexistent TeXLive2012 directory. In the file ~/.config/texstudio/texstudio.ini  I found the following: Tools\Search%20Paths=/usr/local/texlive/2012/bin/x86_64-darwin  I can't find an option to change this from within TeXStudio (someone else who knows the software better than me may know how to do it). I tried editing the file, since I think it should be Tools\Search%20Paths=/usr/texbin  but when I restarted TeXStudio the .ini file changed back automatically. Here is a workaround (which requires admin privileges). In the terminal: sudo tsch  and enter your password to make yourself root. Now create the missing directory as follows: cd /usr/local/texlive mkdir 2012 cd 2012 mkdir bin cd bin mkdir x86_64-darwin cd x86_64-darwin  Finally, create a symbolic link to the real location of epstopdf: ln -s which epstopdf ./epstopdf  Now when TeXStudio looks for epstopdf it will find the symbolic link leading to the proper location. • Sorry for not editing the question, but I do not really know what each of these paths are and what the context is so I am leaving the answer here. Compiling the above file in TeXstudio gives: tmp1: /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/git/bin:/Library/TeX/texbin :/usr/local/texlive/2012/bin/x86_64-darwin and an empty file for tmp2. Compiling from terminal gives tmp1: /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/git/bin:/Library/TeX/texbin and tmp2: /Library/TeX/texbin/epstopdf. – Smurf Oct 16 '15 at 15:47 • @Smurf --- see edit. – Ian Thompson Oct 16 '15 at 16:36 You can basically remove the \usepackage{epstopdf} and just leave the code as it is. So you will have: \documentclass[12pt,a4paper]{report} \usepackage{graphicx} \begin{document} \includegraphics{figure} \end{document}  Of course you have to be sure that the file figure.eps is in the same folder of the .tex file you are trying to compile. You need to use LaTex. I actually use : PdfLaTex. It works fine. Let me know if it works. • Perhaps you should mention that it's necessary to use latex then – user31729 Oct 16 '15 at 12:00 • figure.eps is in the same folder as the .tex file I am trying to compile. If I do not include epstopdf and use latex, the document compiles, but the figure is still not converted to .pdf, i.e. there is no file figure-eps-converted-to.pdf in the folder. – Smurf Oct 16 '15 at 12:29 • Smurf: As long as you don't have epstopdf as script available, usage of epstopdf package is quite useless and there will be no ...converted-to.pdf file at all – user31729 Oct 16 '15 at 12:38 • @ChristianHupfer The issue is that I believe that I do have epstopdf installed, but sh: epstopdf: command not found still happens. – Smurf Oct 16 '15 at 12:59 • @Smurf: I never used TeXStudio, TexMaker, etc and all those editors. Compiling from command line works 'always'. – user31729 Oct 16 '15 at 13:10 For any Linux user arriving here with the same problem, it might be that you did not install the package texlive-font-utils. Simply: sudo apt install texlive-font-utils  Thanks to @Ian Thompson I meet the same problem. This solution is to change the search path. Open option->configure->tick the Show Advanced Options, then in Build setting, you can find Build Options. This last line in Build Options is Commands($PATH), type /usr/local/texlive/2018/bin/x86_64-linux(depend on your texstudio edition and os)

Now texstudio can find epstopdf` automatically

• I don't know why someone votes down my answer. I solve my problem through this method : ) – Kaijian Li Aug 22 at 8:40
• Hi, and excuse me for this comment. It is my opinion: you try to explain better your answer, with images, or link, or screenshot, or with a code. :-) – Sebastiano Aug 22 at 9:57
• @Sebastiano I'm lazy – Kaijian Li Aug 26 at 4:39