2

As the title states, I'm having trouble with the conversion of my eps files to pdf.

Minimal example:

\documentclass[letterpaper, 10pt, twoside]{article}

\usepackage{graphicx}
\usepackage{epstopdf}

\begin{document}
\includegraphics{images/USArmy.eps}
\end{document}

results in:

! Package pdftex.def Error: File `images/USArmy-eps-converted-to.pdf' not foun
.

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

l.7 \includegraphics{images/USArmy.eps}

Here's the odd part: the log says that it generated everything successfully:

Package epstopdf Info: Source file: <images/USArmy.eps>
(epstopdf)                    date: 2016-06-01 16:08:39
(epstopdf)                    size: 6728 bytes
(epstopdf)             Output file: <images/USArmy-eps-converted-to.pdf>
(epstopdf)             Command: <repstopdf --outfile=images/USArmy-eps-converte
d-to.pdf images/USArmy.eps>
(epstopdf)             \includegraphics on input line 7.
runsystem(repstopdf --outfile=images/USArmy-eps-converted-to.pdf images/USArmy.
eps)...executed safely (allowed).

Package epstopdf Info: Result file: <images/USArmy-eps-converted-to.pdf>.


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

Sure enough, I do not have the .pdf file in the images directory. Even more confusing, if I run repstopdf manually, the pdf file works fine:

repstopdf --outfile=images/USArmy-eps-converted-to.pdf images/USArmy.eps

Any suggestions? I have tried adding [outdir=./] and [outdir=./images/] to the epstopdf package as package options as well with the same results. I'm using the latest texlive portable, installed yesterday.

Edit: Reproduction steps:

  1. Install minimal texlive portable to c:\tex with epstopdf and graphics support

  2. Copy example with any eps file to c:\work and open a command prompt

  3. cd /d "c:\work"

  4. set PATH="C:\tex\bin\win32"

  5. pdflatex sample.tex

Note that the full texlive and miktex installs both work fine without having to set the path. Which makes it even more odd.

Mensch
  • 65,388
Jon
  • 474
  • 2
  • 11
  • Your code works fine for me when I copy the standard tiger.eps to images/USArmy.eps. No errors and output is as you'd expect - a too-big tiger on page 2. – cfr Jun 01 '16 at 22:49
  • 1
    I am able to reproduce this on another win 7 64bit machine. I'll update the question with reproduction steps. – Jon Jun 02 '16 at 00:07
  • Maybe it is a feature of Windows, then. I'm afraid I have no idea in that case. I know as close to nothing as it is possible to know about Windows and still survive. – cfr Jun 02 '16 at 00:10
  • Try not loading the eps topic package. The graphicx should be all you need. – Herb Schulz Jun 02 '16 at 01:32

2 Answers2

3

The big problem here is your point four! And that is a Windows problem not a LaTeX problem!

After a correct installation of MiKTeX you should find something like C:\Program Files\MiKTeX 2.9\miktex\bin\x64\; after typing path into your command line. MS-DOS command path shows you the value of Windows environment variable path. Same for TeX Live but I do not know the path it needs (I'm using MiKTeX). For your problem is is not important which tex distribution you use ...

If you want to change the setting of the variable, you have to use set path= and add your needed path so that Windows is able to start the needed programs because it can find the path to the binaries ...

But your command set PATH=C:\tex\bin\win32 resets the complete old settings to the new one. In other words: all old path settings are deleted!

To avoid this you have to use a special environment variable %PATH%, which contains the old setting. Note that several paths are divided by ;. So the command set PATH="C:\tex\bin\win32;%PATH% adds the new path to be found first! Think about the order you need: Should it be found first (okay this way) or last (then use set PATH="%PATH%;C:\tex\bin\win32;).

This way your MiKTeX system is able to find all needed files (because it can follow the given paths) and Windows is able to start needed programms (because it too can follow the given paths).

cfr
  • 198,882
Mensch
  • 65,388
  • Some people see only one path, where others see many paths. – cfr Jun 03 '16 at 01:05
  • That is correct, for both miktex and texlive. Thank you! I was trying to figure out what program external to texlive it was relying on, but the important thing is that it's working. – Jon Jun 03 '16 at 04:12
  • Just had the same error, and the path was ok. But my user didn't have permission to run repstopdf (other files on the folder were fine). – Lucas Soares Sep 12 '16 at 19:05
2

Everything started working when I changed:

 set PATH=C:\tex\bin\win32

to

 set PATH=C:\tex\bin\win32;%PATH%

Not sure what external pieces to texlive that it's trying to call, but that fixed it.

Jon
  • 474
  • 2
  • 11