LaTeX content in parent/sibling directories

error: epstopdf Output filename not allowed in restricted mode

may occur if you include .eps files above the directory of the .tex file. LaTeX by default cannot traverse upwards from the current “*.tex” directory. This is generally a good security choice.

When necessary, it is possible to bypass this security.

fix

include the --shell-escape option in your pdflatex command:

pdflatex --shell-escape myfile.tex

TeXmaker / TeXstudio

Under Options → Configure → Commands add --shell-escape right after pdflatex in the PdfLaTeX command box.

Example

This example shows when --shell-escape is needed. Assuming files

~/work/report.tex
~/matlab/plot.eps

This LaTeX content triggers the error until --shell-escape is used.

\includegraphics{../matlab/plot.eps}