latexpsfrag

Using \psfrag with \mathcal


I am trying to replace

\mathcal{R}

in a figure by

\left |\mathcal{R} \right |

using \psfrag as follows

\psfrag{$\mathcal{R}$}{$\left |\mathcal{R} \right |$}

However, it doesn't work. Apparently, the stylish R is not recognized. Do you know how can I solve this problem? The \mathcal{R} is on an axis and the figure was produced using MATLAB.


Solution

  • \psfrag{<tag>}{<LaTeX>} searches for an exact use of \tag. So, if you have \mathcal{R} in your MATLAB figure, you need to use

    \psfrag{\mathcal{R}}{$\lvert \mathcal{R} \rvert$}
    

    not

    \psfrag{$\mathcal{R}$}{$\lvert \mathcal{R} \rvert$}
    

    Note that I'm not using extensible \left...\right delimiters, as it's not needed here.