0

I am having problems to compile EPS files when they are in a different folder. It is strange because it was working fine a few days ago.

The \includegraphics below works for PDF and PNG files. That is, when epstopdf does not need to convert the EPS file.

How can I make epstopdf to work when the EPS file is in a different folder?

I receive the messages "Sorry, but miktex-epstopdf did not succeed" and "! Package pdftex.def Error: File ../TestFigsFolder//FigTest-eps-converted-to.pdf not found: using draft setting."

I am using TeXstudio 4.4.1 (git 4.4.1).

MWE:

\documentclass[11pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{graphicx}
\usepackage{geometry}

\graphicspath{{../TestFigsFolder/}}

\begin{document}
Text for figures \ref{fig:example-image-a}, \ref{fig:png}, \ref{fig:eps}.

\begin{figure}[h]
\centering
\includegraphics[width=0.3\linewidth]{example-image-a}
\caption{example-image-a}
\label{fig:example-image-a}
\end{figure}

\begin{figure}[h]
\centering
\includegraphics[width=0.3\linewidth]{FigTest1.png}
\caption{FigTest.png}
\label{fig:png}
\end{figure}

\begin{figure}[h]
\centering
\includegraphics[width=0.3\linewidth]{FigTest2.eps}
\caption{FigTest.eps}
\label{fig:eps}
\end{figure}

\end{document}

Log:

This is pdfTeX, Version 3.141592653-2.6-1.40.24 (MiKTeX 22.12)
[Loading MPS to PDF converter (version 2006.09.02).]

(pdftex.def)             Requested size: 125.47737pt x 94.14314pt.
Package epstopdf Info: Source file: <../TestFigsFolder//FigTest.eps>
(epstopdf)                    date: 2023-01-20 17:32:42
(epstopdf)                    size: 32991 bytes
(epstopdf)             Output file: <../TestFigsFolder//FigTest-eps-converted-to.pdf>
(epstopdf)             Command: <miktex-epstopdf --outfile=../TestFigsFolder//FigTest-eps-converted-to.pdf
../TestFigsFolder//FigTest.eps>
(epstopdf)             \includegraphics on input line 28.
runsystem(miktex-epstopdf --outfile=../TestFigsFolder//FigTest-eps-converted-to.pdf ../TestFigsFolder//FigTest.eps)...executed safely (allowed).

Package epstopdf Info: Result file: <../TestFigsFolder//FigTest-eps-converted-to.pdf>.

! Package pdftex.def Error: File `../TestFigsFolder//FigTest-eps-converted-to.pdf' not found: using draft setting.

Related question

Output

Update: According to the answer below, epstopdf should not write in a parent folder. If it was writing before, it could be a bug. The solution then is to create TestFigsFolder in a child folder or to use PNGs or pre-converted EPS to PDF files in a parent folder.

5
  • 1
    writing to parent folders is not allowed for security reasons. Jan 21, 2023 at 23:21
  • Has it changed? I had the same figures compiled fine only two days ago
    – Andre
    Jan 21, 2023 at 23:23
  • 2
    No idea, I never do that, but if worked then I would have regarded that as a bug. Tools shouldn't write in parent folders. Jan 21, 2023 at 23:39
  • It works if the eps file is in a child folder. However, I have different versions of the main tex file in different folders that use the figures of a common folder. Is there an epstopdf option that would allow to access this common folder?
    – Andre
    Jan 22, 2023 at 0:05
  • @UlrikeFischer : Do you want to write your comment on the parent directory and probable previous bug as an answer? Thank you for your comments
    – Andre
    Jan 22, 2023 at 0:07

1 Answer 1

3

The various tools in your tex system are not allowed to write to parent folders for security reasons. While it is possible to disable this security setting, it is not recommended.

If you have graphics that should be used by various documents, I suggest to convert them once by running in the folder on a command line

 epstopdf  FigTest.eps

Then you will have a FigTest.pdf and no on-the-fly conversion is needed anymore.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .