Graphics, Figures & Tablespstool FUN

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
hairyson
Posts: 8
Joined: Sun Apr 05, 2009 6:32 am

pstool FUN

Post by hairyson »

I have just spent some time learning how to operate pstool. I should say I haven't used psfrag before this, knowledge of which may have decreased my amount of stuffing about with pstool. In case this might help others, here is what I went through.

First was getting a new user-defined processing tool configured in TeXworks:

Code: Select all

Program: pdflatex
Arguments: -shell-escape
           $fullname
Next was working out that I had to re-create my figures with very simple text labels and titles, i.e. instead of an axis label like "Very long axis label", I need to have one word, no spaces, and no characters apart from A-Za-z0-9 and maybe simple punctuation, e.g.: "density" or perhaps "d". By the way, I was RTFMing, yet I still couldn't understand the author's meaning. This sadly makes the figures unusable for anything else.

Finally I could not work out why my MWE would compile, yet my full paper wouldn't. The clue was in the instruction not to use a driver specification if the graphicx package was declared in the preamble:
You also do not need to load graphicx separately, but if you do so, ensure that you do not include driver information (such as [pdftex]); this will play havoc with pstool’s automatic processing stage.
What I didn't realise was that I was specifying pdftex in my declaration of package hyperref. Once I removed that option from hyperref the compilation worked. Error messages weren't really telling me anything, just that pstool execution failed, and on occasion that a graphics file couldn't be found (even though it was there). Weirder was that the file would compile if I had graphics files in the same dir as my tex file, but would fail if they were in a subdir.

I am still not sure why I would use pstool command or psfragfig command, but perhaps this makes more sense to users experienced with the psfrag package than it can to me.

I also did not grasp at first or second or third reading that Package options (meant for the package declaration with \usepackage) can also be used in the pstool command.

I have read and re-read section 4.1 of the current (ver 3.1) manual, and still cannot make sense of it. Do I need to include the \EndPreamble command or not? How will I know? Where should it go?

However, now that I have it working, it's great! Thanks to the developer, Will.

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

Post Reply