LaTeX forum ⇒ Graphics, Figures & Tablespstool | External Graphics File not found Topic is solved

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

pstool | External Graphics File not found

Postby BlackPhoenix » Fri Dec 07, 2012 12:55 pm

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.

  1. \documentclass{article}
  2. \usepackage{pstool}
  3. \begin{document}
  4. randomtext
  5. \pstool{testeps}{\psfrag{test}{blabla1}}
  6. \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
  1. ! 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.

Link:
BBcode:
HTML:
Hide post links
Show post links

User avatar
cgnieder
Site Moderator
Posts: 1948
Joined: Sat Apr 16, 2011 7:27 pm
Location: Germany
Contact:

Postby cgnieder » Fri Dec 07, 2012 1:16 pm

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:

  1. \documentclass{article}
  2. \usepackage[runs=2]{auto-pst-pdf}
  3. \usepackage{psfrag}
  4.  
  5. \begin{document}
  6. random text
  7. \psfrag{test}{blabla1}
  8. \includegraphics{testeps}
  9. \end{document}


As before it needs to be compiled with shell-escape enabled.

Regards
Clemens
------------------------------
New German Q&A site about TeX: http://texwelt.de/wissen

Link:
BBcode: Topic is solved[/url]" title="Click to select post's link in BBcode format" onclick="this.focus();this.select();" />
HTML: Topic is solved</a>" title="Click to select post's link in HTML format" onclick="this.focus();this.select();" />
Hide post links
Show post links

BlackPhoenix
Posts: 5
Joined: Fri Dec 07, 2012 12:42 pm

Postby BlackPhoenix » Fri Dec 07, 2012 2:01 pm

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

Link:
BBcode:
HTML:
Hide post links
Show post links

User avatar
cgnieder
Site Moderator
Posts: 1948
Joined: Sat Apr 16, 2011 7:27 pm
Location: Germany
Contact:

Postby cgnieder » Fri Dec 07, 2012 2:09 pm

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
Clemens
------------------------------
New German Q&A site about TeX: http://texwelt.de/wissen

Link:
BBcode:
HTML:
Hide post links
Show post links

BlackPhoenix
Posts: 5
Joined: Fri Dec 07, 2012 12:42 pm

Postby BlackPhoenix » Fri Dec 07, 2012 2:45 pm

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!

Link:
BBcode:
HTML:
Hide post links
Show post links

User avatar
cgnieder
Site Moderator
Posts: 1948
Joined: Sat Apr 16, 2011 7:27 pm
Location: Germany
Contact:

Postby cgnieder » Fri Dec 07, 2012 2:57 pm

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
Clemens
------------------------------
New German Q&A site about TeX: http://texwelt.de/wissen

Link:
BBcode:
HTML:
Hide post links
Show post links

BlackPhoenix
Posts: 5
Joined: Fri Dec 07, 2012 12:42 pm

Postby BlackPhoenix » Fri Dec 07, 2012 3:02 pm

I'll do so, thanks!

Link:
BBcode:
HTML:
Hide post links
Show post links

CrazyHorse
Posts: 350
Joined: Sat Aug 02, 2008 8:47 am

Postby CrazyHorse » Fri Dec 07, 2012 5:32 pm

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

Link:
BBcode:
HTML:
Hide post links
Show post links


Return to “Graphics, Figures & Tables”

Who is online

Users browsing this forum: Bing [Bot] and 1 guest