[Tex/LaTex] PSfrag isn’t working to add LaTeX symbols to eps figures

epspsfrag

I have converted a jgraph file to eps, and am trying to replace text in the eps figure with LaTeX symbols. I have followed the instructions listed in this question but the solution suggested does not seem to work for me.

Here is my short snippet:

\documentclass{article}

\usepackage{graphicx}
\usepackage{psfrag}
\usepackage{auto-pst-pdf}

\begin{document}

\title{Sample PSFrag}
\maketitle

Hi there.

{
  \psfrag{rmax}{$r_{max}$}
  \includegraphics[width=0.5\textwidth]{lusearch9}
}

\end{document}

The string occurs in the eps file: \(rmax = 0%\)) but still no substitution happens in the final pdf file produced. I am using pdflatex --shell-escape sample.tex.

Any suggestions, especially using the pdflatex mechanism, would be appreciated.

Best Answer

According to section 8 of the psfrag package manual,

PSfrag can only replace entire strings, not just parts of one.

Hence, the problem is that you are trying to replace part of a string. Try replacing the whole string instead.