# PSfrag isn't working to add LaTeX symbols to eps figures

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.

• What happens if you use LaTeX + dvips + ps2pdf? – Ian Thompson Sep 1 '14 at 9:21
• The original figure is produced, without the substitutions. So, rmax is not replaces with r_max. – Swarnendu Biswas Sep 1 '14 at 14:41
• I have not used jgraph so far, but does it really generate text as strings in .eps files? – user31729 Sep 1 '14 at 18:59
• I think the problem might be that you are trying to replace part of a string, rather than the whole string. Section 8 of the psfrag package manual might help you. Otherwise, please make the .eps file available for download and add a link to your question. – Ian Thompson Sep 1 '14 at 23:19
• @Ian: Your tip helped, I have now replaced the whole string in the eps file, instead of a substring and that solves the problem. – Swarnendu Biswas Sep 2 '14 at 18:39