Theory Group, Institute of Physics, Jagiellonian University
(Thanks to the Max-Planck-Institut für Physik, München, for still hosting this site)

Jagiellonian University Logo

MPI / Johannes Große

MathPSfrag: Creating LaTeX Labels in Mathematica Plots

Have you ever had problems with Mathematica fonts in EPS graphics? Do you want to have the same fonts as in your LaTeX files?


MathPSfrag is a Mathematica package providing a graphics export function that automatically replaces Mathematica expressions in a graphic by the corresponding LaTeX constructs and positions them correctly. It thus facilitates the creation of publication-quality Enscapulated PostScript (EPS) graphics. It can also create LaTeX independent EPS and PDF files for processing with other programs or pdfLaTeX.

Original Plot

Example Plot from MathPSfrag

Improved Plot

Example Plot from MathPSfrag

Short Manual

To create the nicer plot, you have to add the following instructions:

myplot = Plot[ ... ];
PSfragExport["myfilename", myplot];

Simple, isn’t it?

Where is the Catch?

Admittedly, there are many fine-points I will not mention on this self-ad page. In particular, when you are not happy with Mathematica’s TeXForm output (quite likely), you will want to attach your own TeX code to each label. This is still easy, but you will actually have to read the manual.




As of January 15, 2008, the stable version is MathPSfrag-2.0. Development will proceed in version 2.1.
Do not forget to download CustomTicks, too.

Additional Information

All of the following files are included in the above package and are only separately provided for convenient direct access.


Another useful program (which can turn psfrag-based images into PGF code) is


Old versions

(only for archival purposes, no support)

last modified: johannes 2008-01-30 16:21 index.markdown
Valid XHTML 1.0 Valid CSS