I recently updated from mathematica 7.0 to 8.0, and have now encountered problem with replacing my plot labels with LaTeX code using the psfrag package. Everything worked perfectly with the earlier version and the exact same plots, but now psfrag leaves all the labels unchanged. I use Kile on Ubuntu 11.04 for LaTeX editing.
For example, in Mathematica:
plot = Plot[x, {x, -0.1, 0.1},
AxesLabel -> {eps, SUM}, BaseStyle -> {FontSize -> 10}]
Export["plot.eps", plot]
and then in LaTeX:
\begin{figure}
\psfrag{eps}{$\epsilon$}
\psfrag{SUM}{$\Sigma$}
\includegraphics{plot.eps}
\end{figure}
This should now replace labels with LaTeX typesetting, but nothing happens. Any suggestions how to solve this? Does anyone know if there is a difference in how Mathematica 8 encodes text in eps files compared to earlier versions?
There’s no difference in how the EPS is encoded. The problem is that the PS code that makes the text in the v7 output (note that Mma uses
bind defto create shortcuts for a lot of PS code, see the top of the generated EPS files for details):has been replaced in v8 with
This means that
psfragcan not grab hold of the tags.I can’t find how to fix this in the Mma export options.
At the moment, the only work-around I can think of (and I’ve tested that works) is to use single letter tags for the axes labels, e.g.
Note:
The reasons for maybe wanting to use
psfragare well stated in http://www.reimeika.ca/marco/prettyplots/Addendum:
The package
psfragonly works withEPSgraphics and thus only withlatex.If you want to use
psfragandpdflatex, then see the tex.SE questionUsing psfrag with pdflatex