Consider the following script.tex:


When calling pdflatex script.tex a file epsfig-eps-converted-to.pdf gets generated in the folder ./fig.

The affairs get complicated when the eps file is stored in a repository outside the working directory.

The options how to include an external directory were nicely discussed in How to specify absolute paths

1. Specifying the absolute path

In case I write like this:


the eps file (in contrast to a png file) is not found:

!!! Error: Cannot open ~/repo/epsfig.eps: No such file or directory
system returned with code 512

2. Specifying TEXINPUTS

The job gets done when calling:

TEXINPUTS=.:~/repo: pdflatex script.tex

and using


but the -eps-converted-to.pdf file is created in my working directory. Imagine I use 100 eps files.

3. Specifying \graphicspath

When using the


as described in

Multiple graphics directory

the complaint of not finding the eps file disappears but the eps-converted-to-pdf file is not found:

! Package pdftex.def Error: File `\unhbox\voidb@x \penalty \@M \ {}epsfig-eps-c
onverted-to.pdf' not found: using draft setting. 

Is there an elegant solution?

Your Answer

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

Browse other questions tagged or ask your own question.