Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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!!!

share|improve this question
    
Welcome to TeX.sx! Please add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. And which distribution on what OS are you using? –  Martin Schröder Jan 31 '13 at 7:34
    
Hi, @MartinSchröder! Thanks for your warmly reply. Unfortunately, I didn't know the basic usage of the \pstoolcommand. So, what I am asking is a simple example that use this command with the psfrag command. I tried to google it. But I didn't get a simple but useful one. –  datcn Jan 31 '13 at 8:13
1  
As far as I understand it, your current question is requesting an example of using psfrag and pstool with pdflatex. If so, can you edit the question so that it focuses on that question (and not the solved issue of a space in the filename)? –  Matthew Leingang Jan 31 '13 at 13:25
    
why do you need psfrag? You can have the right font already in your image. –  Herbert Jan 31 '13 at 18:56
    
Hi, @MatthewLeingang. Many thx for your detailed reply. I tried the short example as your given. But I failed to generate a pdf output. The error information is as below. ./pstest.tex:10: Package pstool Error: No graphic "gandl.eps.eps" or "gandl.eps -psfrag.eps" found. Here, the gandl.eps is the name of my eps file. –  datcn Jan 31 '13 at 23:04
show 1 more comment

1 Answer 1

Here is a short example of psfrag and pstool in action. I took this from the package's example directory on CTAN:

\documentclass{article}
\usepackage{color}
\usepackage{pstool}
\def\a{A}
\EndPreamble
\begin{document}

\psfragfig*[mode=nonstop]{trial}{%
  \color{red}
  \tiny
  \psfrag{[Mp]}{$M_\a$!}%
}

\end{document}

sample output

(The red mark is what's added with \psfrag.)

As egreg notes below, the -shell-escape option must be specified to pdflatex at run time.

share|improve this answer
2  
To be run with the -shell-escape option. –  egreg Jan 31 '13 at 13:28
    
Hi, @egreg and @MatthewLeingang , I am using the TexShop v3.11, in which the -shell-escape option was removed. I don't know if this is the reason that why I cannot run this simple example in my TexShop. –  datcn Feb 4 '13 at 7:25
    
@datcn That's quite probable. –  egreg Feb 4 '13 at 9:48
    
@datcn: Go to TexShop Preferences and look at the Engine tab. Add --shell-escape to the lines with pdftex and pdflatex. –  Matthew Leingang Feb 4 '13 at 19:01
    
@MatthewLeingang After I adding those commands, when I run the code as above, it still cannot work. –  datcn Feb 5 '13 at 0:23
show 1 more comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.