55

I'm using TeXStudio on Mac OS X 10.7.4.

The problem is that the EPS to PDF conversion is somehow broken:

\usepackage[pdftex]{graphicx}
\graphicspath{{img/}}
\DeclareGraphicsExtensions{.pdf,.jpeg,.png}
...
\begin{figure}[!t]
\centering
\includegraphics[width=3.5in]{TCP_VC_TD_AVE_CONNS_ACT}
\caption{Simulation Results}
\label{fig_sim}
\end{figure}
...

I've got an EPS file in: img/TCP_VC_TD_AVE_CONNS_ACT.eps

Log:

Package epstopdf Info: Source file: <img/TCP_VC_TD_AVE_CONNS_ACT.eps>
(epstopdf)                    date: 2012-10-12 16:44:32
(epstopdf)                    size: 210073 bytes
(epstopdf)             Output file: <img/TCP_VC_TD_AVE_CONNS_ACT-eps-converted-
to.pdf>
(epstopdf)             Command: <epstopdf --outfile=img/TCP_VC_TD_AVE_CONNS_ACT
-eps-converted-to.pdf img/TCP_VC_TD_AVE_CONNS_ACT.eps>
(epstopdf)             \includegraphics on input line 94.
runsystem(epstopdf --outfile=img/TCP_VC_TD_AVE_CONNS_ACT-eps-converted-to.pdf i
mg/TCP_VC_TD_AVE_CONNS_ACT.eps)...executed.

Package epstopdf Info: Result file: <img/TCP_VC_TD_AVE_CONNS_ACT-eps-converted-
to.pdf>.

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

The required img/TCP_VC_TD_AVE_CONNS_ACT-eps-converted-to.pdf file is never created.

TeXStudio compiles with (I've added -shell-escape, from other posts):

/usr/texbin/pdflatex -synctex=1 -interaction=nonstopmode -shell-escape %.tex

Can anybody assist?

EDIT - A minimal file breaks as well:

\documentclass{article}
\usepackage{graphicx}
\begin{document}
\includegraphics{img/TCP_VC_TD_AVE_CONNS_ACT.eps}
\end{document}

Log:

Package epstopdf Info: Source file: <img/TCP_VC_TD_AVE_CONNS_ACT.eps>
(epstopdf)                    date: 2012-10-12 16:44:32
(epstopdf)                    size: 210073 bytes
(epstopdf)             Output file: <img/TCP_VC_TD_AVE_CONNS_ACT-eps-converted-
to.pdf>
(epstopdf)             Command: <epstopdf --outfile=img/TCP_VC_TD_AVE_CONNS_ACT
-eps-converted-to.pdf img/TCP_VC_TD_AVE_CONNS_ACT.eps>
(epstopdf)             \includegraphics on input line 4.
runsystem(epstopdf --outfile=img/TCP_VC_TD_AVE_CONNS_ACT-eps-converted-to.pdf i
mg/TCP_VC_TD_AVE_CONNS_ACT.eps)...executed.

Package epstopdf Info: Result file: <img/TCP_VC_TD_AVE_CONNS_ACT-eps-converted-
to.pdf>.

! Package pdftex.def Error: File `img/TCP_VC_TD_AVE_CONNS_ACT-eps-converted-to.
pdf' not found.
11
  • 1
    Welcome to TeX.sx! Just a wild guess: Have you tried it without \graphicspath{{img/}}? On an unrelated note: specifying pdftex for graphicx is usually not necessary; it can figure that out by itself.
    – doncherry
    Commented Oct 12, 2012 at 16:26
  • I have no problem. Can you try with no other package other than graphicx? Just the \includegraphics command should be in the test file. The -shell-escape option is not needed.
    – egreg
    Commented Oct 12, 2012 at 16:29
  • @doncherry Tried that - same problem.
    – Nic
    Commented Oct 12, 2012 at 16:39
  • @egreg Tried with a minimal file as well, still the same problem.
    – Nic
    Commented Oct 12, 2012 at 16:41
  • 1
    UPDATE: This looks like a TeXStudio issue, everything works fine in Texpad!
    – Nic
    Commented Oct 12, 2012 at 17:24

9 Answers 9

43

epstopdf is sometimes trying to write in the wrong directory and then fails to create the file (on certain editors at least, I had a similar problem with WinEDT). Place the following code in the header:

\epstopdfsetup{outdir=./}

Or add it as an option to epstopdf:

\usepackage[outdir=./]{epstopdf}
7
  • 4
    This worked for me - but don't forget (as I did initially) that you still need to add \usepackage{epstopdf} first.
    – drstevok
    Commented Feb 22, 2013 at 14:12
  • 3
    \usepackage[outdir=./]{epstopdf} also works and saves you one line :)
    – Trefex
    Commented Apr 17, 2014 at 8:11
  • If you use the \graphicspath option, you may find it useful to designate (as an option to the subject \usepackage callout) the same paths for both...
    – Digger
    Commented Apr 28, 2017 at 23:17
  • 3
    This works for me but I am not able to go to a parent directory. I mean that if I do : \usepackage[outdir=../]{epstopdf} It does not work
    – desmond13
    Commented Jun 29, 2017 at 21:58
  • 1
    Basically, no, you can't go upwards in the directory tree. It's a safety issue preventing unauthorized access to your system.
    – yo'
    Commented Dec 3, 2019 at 20:38
39

OK, I spent weeks fighting this problem (well, with intermittent bouts of rage quitting). None of the answers here worked exactly.

I'm running Linux Mint 17.1 and compiling through latexmk through SublimeText 3.

@caesar0301 pointed me on the right track.

Here's what I found in my log:

[20 <./time_series_pct_ever_paid_act-eps-converted-to.pdf>] [21]
Package epstopdf Info: Source file: <images/analysis/act/time_series_pct_paid_f
ull_act.eps>
(epstopdf)                    date: 2015-03-03 18:16:06
(epstopdf)                    size: 7097 bytes
(epstopdf)             Output file: <./time_series_pct_paid_full_act-eps-conver
ted-to.pdf>
(epstopdf)             Command: <repstopdf --outfile=./time_series_pct_paid_ful
l_act-eps-converted-to.pdf images/analysis/act/time_series_pct_paid_full_act.ep
s>
(epstopdf)             \includegraphics on input line 773.
runsystem(repstopdf --outfile=./time_series_pct_paid_full_act-eps-converted-to.
pdf images/analysis/act/time_series_pct_paid_full_act.eps)...executed safely (a
llowed).

Turns out repstopdf comes with texlive-font-utils, which I didn't have installed.

Combined with the other nudges mentioned in this thread (I guess mainly [outdir=./]), I can now finally (finally, finally, finally) compile .tex files with .eps graphics in them.

Leaving this here for any other Googlers at their wit's end with this venture.

7
  • In Debian, I can verify that (for Squeeze, Wheezy, and Jessie, at least) that epstopdf is the desired routine, NOT repstopdf.
    – Digger
    Commented Apr 29, 2017 at 2:25
  • 1
    Could you explain exactly what you did? I'm on Linux Mint 18.3 and I have the same problem. The same file on Windows (With MiKTeX) worked perfectly.
    – Royi
    Commented May 26, 2018 at 19:10
  • 7
    I can verify this on Ubuntu using LyX. I installed texlive-font-utils and the error disappeared. Turns out that texlive-font-utils installs --- among other things --- epstopdf -- Convert EPS to PDF using Ghostscript. I guess this means that I didn't have epstopdf to begin with! No wonder I was facing these errors.
    – Jishnu
    Commented Oct 4, 2018 at 6:44
  • 2
    Thanks, this also fixed it on Ubuntu 18.04.1 LTS. (Interestingly I didn't have any problems on Ubuntu 16.10...) Commented Dec 5, 2018 at 14:22
  • 6
    With Ubuntu 18.04 and TeXstudio 2.12.6 I just installed the package: sudo apt install texlive-font-utils and everything works without any other modifications Commented Sep 16, 2019 at 14:48
6

I encountered a similar problem when using gnuplottex within TeXstudio. Depending on the TeX compiler I used, I got errors like

Package pdftex.def Error: File `example_epslatex-gnuplottex-fig1-eps-converted-to.pdf' not found. ...aphics{example_epslatex-gnuplottex-fig1}}

with pdflatex or when using xelatex:

xdvipdfmx:fatal: pdf_ref_obj(): passed invalid object. Output file removed.

However, calling the corresponding command manually via commandline worked fine - no errors.

After a little bit of investigation I found out that this was due to some missing folders in the PATH variable. In TeXstudio, go to Preferences > Build > Commands ($PATH) and add these there:

/Library/TeX/texbin:/opt/local/bin

First one is for the Latex environment (I'm using MacTex 2015 on El Capitan). For other version of OS X this path may look like /usr/local/texlive/2015/bin/x86_64-darwin. The second one is the path to MacPorts, with which I installed gnuplot. This may also depend on your installation or whether you use gnuplot at all or just want to import a generic .eps file. For e.g. I encountered this error every time I used gnuplot with the epslatex terminal.

1
  • 1
    After an update for TeXstudio on El Capitan I discovered exactly this error. Strangely the path was set to the TeX Live distribution 2012. Changing it to /usr/local/texlive/2015/bin/x86_64-darwin (year 2015) as suggested solved the problem. You could also mention in your answer that Show Advanced Options must be checked to have the mentioned textfield Commands ($PATH) accessible.
    – Matt
    Commented Mar 15, 2016 at 20:19
4

I have exactly the same problem as the poster's log. Common solutions around Internet have adding epstopdf or epsfig package, appending -shell-escape option to pdflatex commandline. But both methods failed to me. I post my solution on Mac OS X 10.09 + texlive2013 + TeXsdudio2.7.

By checking the tex's log, I found that epstopdf was not located in system searched PATH, so I created the link manully

ln -s /usr/local/texlive/2013/texmf-dist/scripts/epstopdf/epstopdf.pl /usr/local/bin/epstopdf

Also, the epstopdf complained that ghostscript is not installed. So I made it satisfied with

brew install ghostscript

WHooo, texstudio generated pdf as I expected.

PSPS: requiring epstopdfpackage declared and -shell-escape appended.

1
  • 1
    But on my linux/ubuntu, only epstopdf and -shell-escape are needed.
    – caesar0301
    Commented Apr 17, 2014 at 3:23
2

The following worked for me:

Open TeXstudio, go to 'Preferences' --> 'Build' (Somehow all my list entries are in german, so I only guess it should be named Build - in german it's 'Erzeugen', the third entry from the top). At the bottom you can specify additional search paths. Make sure the specified search path really exists. In my case the path pointed to a texlive 2012 directory even though I have only installed the 2013 version. After changing the path to the 2013 version everything worked fine! :-)

2

I encountered the same issue when utilizing esptopdf on a Windows 8.1 virtual machine running in Parallels on my Mac. Either TeXstudio or MiKTeX doesn't like UNC paths (ie \\psf\DropBox), which was how I had loaded my main *.tex. The included tex files used relative paths since I work across multiple machines, so that probably compounded the problem.

To remedy this I just needed to use a mapped drive name for the same shared network path (ie. Z:\DropBox). The only clue that this was the source of the problem came from the Messages tab that indicated:

... CMD.EXE was started with the above path as the current directory. 
UNC paths are not supported. Defaulting to Windows Directory.

Changing to a regular file path eliminated this message and allowed the new EPS files to be generated into PDF files that Pdflatex could interpret.

As a reference, I was using Windows 8.1, TeXstudio 2.8.4, and MiKTeX 2.9.4902.

You may also want to specify a directory other than the current folder for epstopdf to save pdf files to:

 \include[outdir=./(folder)/]{epstopdf}

This is optional, but if you only specify output=./ the directory with the .tex file will be the target for all of the generated PDF's even if you keep the *.eps files organized in another folder.

1
  • I had the same issue and I had the tex files saved on a network directory of my employer (which uses UNC paths). After copying the tex files on my local desktop, all compilations worked.
    – emcor
    Commented Oct 26, 2018 at 13:48
2

Just some additional info for Fedora users. (Fedora 24 and possibly other similar releases.)

I didn't install "absolutely all the tex packages" when I installed TexStudio because the download size is in the gigabytes and it takes quite a long time, and I wanted to quickly write a document without waiting around.

This keeps coming back to bite me in the a**, and yet again I have found myself with another seemingly mysterious error. (Same as the question OP.)

After following MichaelChirico's post I too found I was missing the command resptopdf. (Entered it to the command line, and command not found was printed.)

So I decided to sudo dnf install texlive-scheme-full (see also here: https://unix.stackexchange.com/questions/199638/how-to-fully-install-latex-in-fedora)

and this did take a few gigabytes and about half an hour to install, but it has installed the requirements for epstopdf for the use of eps figures in tex documents...

For several months now I have been installing small bits of the latex packages as and when I required them - this takes a long time as you have to google stuff to find out why your documents don't compile whenever you use a new feature - so I would recommend just installing everything and be done with it!

Summary: Install texlive-scheme-full on Fedora 24 and probably also similar versions and everything seems to work.

2
  • 1
    On Ubuntu 16.04 I installed texlive-font-utils which includes epstopdf: sudo apt install texlive-font-utils With that, building the document works. Commented May 21, 2018 at 17:22
  • texlive-collection-formatsextra for Fedora
    – Jot eN
    Commented Jul 13, 2018 at 1:31
0

Use

$ latex file.tex

This will result in output as file.dvi and then use

$ dvi2pdf file.dvi
3
  • 1
    The OP uses pdfTeX (pdflatex). A different driver might support a different set of image formats that does not fit the OPs need. Commented Sep 12, 2013 at 17:48
  • Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format. Commented Sep 12, 2013 at 17:50
  • ...and therefore I don't think this answers the question...
    – Werner
    Commented Sep 12, 2013 at 17:52
0
sudo dnf install texlive-epstopdf ghostscript

solved the issue for me.

Background: The command epstopdf has to work in terminal, as indicated in https://tex.stackexchange.com/a/171967/110064 this could be done using sudo dnf install texlive-scheme-full (installs many unneeded packages) as declared in https://tex.stackexchange.com/a/356206/110064 but texlive-epstopdf should be enough.

If you want to check if it epstopdf is working in terminal try which epstopdf and epstopdf in the command line and check the output.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .