[Tex/LaTex] PSfrag does not change the text

psfrag

I want to practice psfrag but it does not work! I don't know what to do.

Here is my LaTeX document,

\documentclass[12pt]{amsart}
\usepackage[foot]{amsaddr}
\usepackage{mathrsfs}
\usepackage{graphics}
\usepackage{latexsym}
\usepackage{cite}
\usepackage{graphicx,psfrag}
\usepackage{amsmath,amssymb,amsthm,mathtools}
\begin{document}
  \begin{figure}
    \psfrag{a}{$x_{n-2}$}\psfrag{b}{$x_{n-1}$}
    \includegraphics[width=5cm]{edge.eps}
  \end{figure}
\end{document}

and here is my edge.eps file

ps. I installed TeX Live last week on tug.org and I use WinEdt 10.1.

ps 2. I'm not familiar to TeX, so I didn't touch any setting in WinEdt. I would appreciate if you would explain what to do.(sorry for bad English)

Best Answer

psfrag needs latex to compile (due to the .eps support).

However, with auto-pst-pdf package and the \includegraphics wrapper \psfragfig, it's possible to use pdflatex as well.

Make sure, that --shell-escape is enabled!

If graphicx is loaded, graphics don't needs to be loaded as well (because it's loaded by graphicx)

\documentclass[12pt]{amsart}
\usepackage[foot]{amsaddr}
\usepackage{mathrsfs}
\usepackage{latexsym}
\usepackage{cite}
\usepackage{graphicx,psfrag}
\usepackage{amsmath,amssymb,amsthm,mathtools}
\usepackage{auto-pst-pdf}
\begin{document}
  \begin{figure}
    \psfrag{a}{$x_{n-2}$}\psfrag{b}{$x_{n-1}$}
%    \includegraphics[width=5cm]{edge.eps}
    \psfragfig[width=5cm]{edge.eps}
  \end{figure}
\end{document}

enter image description here

Related Question