Update: After I adding those --shell -escape commands, when I run the code as below, it still cannot work.
\documentclass[pdftex]{memoir}
\usepackage{color}
\usepackage{pstool}
\input macros.tex
\EndPreamble
\begin{document}
External macros: \a, \b, \c
\pstool{trial}{%
}
\psfragfig{subdir/trial2}{%
\psfrag{[Mp]}{$Z_\b$}%
}
\end{document}
Update: The question (described in the quotation as below) is solved by deleting the space between the name of my tex file.
But, I am still not clear of how to use the command of pstool combined with psfrag. Can anyone shed a light on this for me?
I tried to add the package at the very beginning of the document. But, there are some errors happened and the console said that
/usr/local/texlive/2012/texmf-dist/tex/latex/ifplatform/ifplatform.sty:93: Pack age catchfile Error: File"my files".w18' not found.`When I removed the sentence of
\usepackage{pstool}, the compiling runs well.Any suggestions will be great appreciated. Thanks!!!

\documentclass{...}and ending with\end{document}. And which distribution on what OS are you using? – Martin Schröder Jan 31 '13 at 07:34\pstoolcommand. So, what I am asking is a simple example that use this command with thepsfragcommand. I tried to google it. But I didn't get a simple but useful one. – datcn Jan 31 '13 at 08:13./pstest.tex:10: Package pstool Error: No graphic "gandl.eps.eps" or "gandl.eps -psfrag.eps" found.Here, thegandl.epsis the name of my eps file. – datcn Jan 31 '13 at 23:04