If I have an eps file in a subfolder and point to it with graphicspath, it can't seem to do the conversion, the log says:
(epstopdf) Output file: </path/to/image/img-eps-converted-to.pdf>
(epstopdf) Command: <repstopdf --outfile=/path/to/image/img-eps-converted-to.pdf /path/to/image/img.eps>
(epstopdf) \includegraphics on input line 72.
runsystem(repstopdf --outfile=/path/to/image/img-eps-converted-to.pdf /path/to/image/img.eps)...executed safely (allowed).
Package epstopdf Info: Result file: </path/to/image/img-eps-converted-to.pdf>.
./chapters/results2.tex:72: Package pdftex.def Error: File `/path/to/image/img-eps-converted-to.pdf' not found.
If I run epstopdf --outfile=/path/to/image/img-eps-converted-to.pdf /path/to/image/img.eps
it works fine. If I run the same command with repstopdf
, it returns:
!!! Error: Output filename '/path/to/image/img-eps-converted-to.pdf' not allowed in restricted mode.
Running ls -ld /path/to/image
returns:
drwxrwxr-x
Files for example:
test.tex:
\documentclass[maintest.tex]{subfiles}
\graphicspath{{/path/to/image/}}
\epstopdfsetup{outdir=/path/to/image/}
\begin{document}
\begin{figure}
\includegraphics{img.eps}
\end{figure}
\end{document}
%%% Local Variables:
%%% mode: latex
%%% TeX-master: t
%%% End:
maintest.tex:
\documentclass{book}
\usepackage{mystyle}
\begin{document}
\subfile{chapters/test}
\end{document}
%%% Local Variables:
%%% mode: latex
%%% TeX-master: t
%%% End:
mystyle.tex:
\usepackage[utf8x]{inputenc}
\usepackage{graphicx}
\usepackage{subfiles}
\usepackage{epstopdf}
Best Answer
Running external programs is a security risk. Therefore the default settings are a compromise. Some more or less secure programs (hopefully more "more") are allowed. This is called the restricted shell escape mode.
epstopdf
is too powerful, it can overwrite arbitrary files. Therefore, a restricted versionrepstopdf
was created, which follows the policy oftexmf.cnf
, which restricts the writing of output files, fromtexmf.cnf
of TeX Live 2015:In your case, the output file name starts with "/", thus it is an absolute file name and variable
TEXMFOUTPUT
is probably not set.Possible solutions/workarounds:
Since the files are in sub folders of the current working directory, try relative file names instead.
TeX Live's
epstopdf-sys.cfg
as provided by the package author (me) sets the program name torepstopdf
if restricted shell escape was detected. In case of full shell escape,epstopdf
is used. Thus you can also run your project withpdflatex -shell-escape
.