當要包含的圖形位於輸出目錄內時 epstopdf 套件失敗

當要包含的圖形位於輸出目錄內時 epstopdf 套件失敗

要重現該錯誤:

  1. 建立b.eps包含任何內容的文件。例如,以下命令將建立b.eps

    asy -noV -o b -c 'draw((0, 0)--(1, 1));'
    
  2. 建立資料夾./d/,放入b.eps其中。

  3. ./a.tex在目前目錄中建立內容:

    \documentclass{article}
    \usepackage{graphicx}
    \begin{document}
    \graphicspath{{d/}}
    \includegraphics{b}
    \end{document}
    
  4. 編譯用pdflatex --shell-escape --recorder --output-directory=d/ a.tex.

  5. 請參閱錯誤。


我相信發生錯誤的原因是:當圖形位於輸出目錄中時,LaTeX 無法正確確定文件.eps相對於當前目錄的路徑,以便傳遞到epstopdf--- 因此,它無法轉換為pdf.

這個問題有可能解決嗎?


作為解決方法,可以明確指定圖形的路徑:

\includegraphics{d/b}

但我也想知道是否有適當的解決方案。

上下文是我正在使用asypictureB帶有一些補丁的包,以使其能夠與任意一起工作--output-directory,並且該.asy文件當然是在 中創建的output-directory,這使得.eps也在那裡生成。

相關內容