0

Consider the following script.tex:

\documentclass{article}
\usepackage{graphicx}
\begin{document}
\begin{figure}
  \includegraphics{fig/epsfig.eps}
\end{figure}
\end{document}

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:

\includegraphics{\string~/repo/epsfig.eps}

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

\includegraphics{epsfig.eps}

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

\graphicspath{\string~/repo}

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?

Viesturs
  • 7,895

0 Answers0