Graphics, Figures & Tablespstool | External Graphics File not found

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
BlackPhoenix
Posts: 5
Joined: Fri Dec 07, 2012 12:42 pm

pstool | External Graphics File not found

Post by BlackPhoenix »

Hey everybody,

while writing my thesis I have encountered the following problem. First of all, I'm using Miktex 2.9, if that is relevant.

Since I'm using PDFLatex and would like to change captions in my graphics via psfrag (which is obviously not compatible), I found the package pstool, which allows the combination of PDFLaTeX and the use of psfrag commands.

However, it doesn't seem to work for me. I have reduced the problematic file to the following minimum file.

Code: Select all

\documentclass{article}
\usepackage{pstool}
\begin{document}
randomtext
\pstool{testeps}{\psfrag{test}{blabla1}}
\end{document}
The file "testeps.eps" is in the same directory. It was exported using the program "Dia", which produces EPS files that are compatible with psfrag and includes a caption "test".

The above source code leads to this error

Code: Select all

! LaTeX Error: File `testeps' not found.
Now I am sort of clueless and would appreciate any help. I have already looked for comparable problems and answers, but the results were rather limited and none of the answers helped me. So it would be great, if you could help me here. If there is another practicable workaround for the issue with PDFLaTeX and psfrag, let me know.

Thanks in advance,
Alex
Last edited by cgnieder on Fri Dec 07, 2012 1:02 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

pstool | External Graphics File not found

Post by cgnieder »

Hi and welcome to the LaTeX community!

I can't help with the actual issue as your MWE works for me (with one of my EPS files, of course). I do have an alternative solution, though. I found auto-pst-pdf a working solution for using psfrag with pdfLaTeX. Your MWE would then look as follows:

Code: Select all

\documentclass{article}
\usepackage[runs=2]{auto-pst-pdf}
\usepackage{psfrag}

\begin{document}
random text
\psfrag{test}{blabla1}
\includegraphics{testeps}
\end{document}
As before it needs to be compiled with shell-escape enabled.

Regards
site moderator & package author
BlackPhoenix
Posts: 5
Joined: Fri Dec 07, 2012 12:42 pm

Re: pstool | External Graphics File not found

Post by BlackPhoenix »

Okay, my bad... I had previously enabled shell-escape via the command line, and assumed that this was permanent... I have now found out how to permanently enable it and now it seems to work perfectly, at least in my minimal example. I assume that it will now also work in the original file.

Thank you and sorry for the superfluous question.

Anyway, I also have some information in return :)

I tried out the auto-pst-pdf package before but as the author writes in the intro here
http://mirror.hmc.edu/ctan/macros/latex ... st-pdf.pdf
pstool seems to be a more efficient successor of auto-pst-pdf. So in case anybody is considering one of the two packages, pstool is probably the better choice.

Alex
User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

pstool | External Graphics File not found

Post by cgnieder »

BlackPhoenix wrote:Thank you and sorry for the superfluous question.
Don't mind. Maybe it'll still help someone else. :)
BlackPhoenix wrote:I tried out the auto-pst-pdf package before but as the author writes in the intro here
http://mirror.hmc.edu/ctan/macros/latex ... st-pdf.pdf
pstool seems to be a more efficient successor of auto-pst-pdf. So in case anybody is considering one of the two packages, pstool is probably the better choice.
This really depends on the use case. There are packages which use \psfrag internally (e.g. chemstyle or chemnum) in which case pstool's benefits are rather limited but auto-pst-pdf works quite well.

Regards
site moderator & package author
BlackPhoenix
Posts: 5
Joined: Fri Dec 07, 2012 12:42 pm

Re: pstool | External Graphics File not found

Post by BlackPhoenix »

Okay, I'm sure you are right. Just wanted to mention that comment as I thought it might be useful for someone.

However, I'm back with a, hopefully easily solvable, related problem:

When I said that enabling the shell-escape worked, it worked when I used "pdflatex" as compiling option. However, if I use "PdfLatex+MakeIndex+Bibtex", the same problem as before occurs, despite having allowed shell-escape for pdflatex. I could also change the settings for "PdfLatex+MakeIndex+Bibtex", but it doesn't accept the --shell-escape command there...("unknown option")

Of course I could compile all graphics with in an extra pdflatex-only file and import them into the main file afterwards, but that seems like a suboptimal choice. So how do I activate shell-escape for the "PdfLatex+MakeIndex+Bibtex" option? As said, I'm using Miktex/Texworks.

So I guess I just lack the proper command that might be different for "PdfLatex+MakeIndex+Bibtex" but that I couldn't find out googling...

Thanks again!
User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

pstool | External Graphics File not found

Post by cgnieder »

BlackPhoenix wrote:When I said that enabling the shell-escape worked, it worked when I used "pdflatex" as compiling option. However, if I use "PdfLatex+MakeIndex+Bibtex", the same problem as before occurs, despite having allowed shell-escape for pdflatex. I could also change the settings for "PdfLatex+MakeIndex+Bibtex", but it doesn't accept the --shell-escape command there...("unknown option")

Of course I could compile all graphics with in an extra pdflatex-only file and import them into the main file afterwards, but that seems like a suboptimal choice. So how do I activate shell-escape for the "PdfLatex+MakeIndex+Bibtex" option? As said, I'm using Miktex/Texworks.

So I guess I just lack the proper command that might be different for "PdfLatex+MakeIndex+Bibtex" but that I couldn't find out googling...
This seems to be a separate question concerning especially the TeXworks editor and should probably be asked independently in the corresponding forum. As I have never used TeXworks I have no clue...

Regards
site moderator & package author
BlackPhoenix
Posts: 5
Joined: Fri Dec 07, 2012 12:42 pm

Re: pstool | External Graphics File not found

Post by BlackPhoenix »

I'll do so, thanks!
CrazyHorse
Posts: 351
Joined: Sat Aug 02, 2008 8:47 am

pstool | External Graphics File not found

Post by CrazyHorse »

BlackPhoenix wrote:I tried out the auto-pst-pdf package before but as the author writes in the intro here
http://mirror.hmc.edu/ctan/macros/latex ... st-pdf.pdf
pstool seems to be a more efficient successor of auto-pst-pdf. So in case anybody is considering one of the two packages, pstool is probably the better choice.
No, pstool is _not_ the succesasor of auto-pst-pdf
Post Reply