I used to to use MathPSFrag in Mathematica to export graphics to EPS for inclusion in $\LaTeX$ files.

However, with recent versions of Mathematica this does not seem to work very well anymore, see for example mathematica 8.0 and psfrag or LATEX and Mathematica.

In the latter thread it was suggested to use Mathematica's native Export function and then replace text, labels etc. using the pstool package.

However, when I create and export a simple plot via

plot = Plot[x, {x, 0, 1}, AxesLabel -> {"x", "y"}]
Export[NotebookDirectory[] <> "plot.eps", plot]

and then run pdflatex --shell-escape on the file


I obtain a two-page PDF document with the lower part of the plot on the top of the second page and the top part missing; the first page is completely empty.

I'd be grateful if somebody could point out what's going on. Also, the restriction to one-letter labels can be quite problematic. Have there been any developments since the two quoted threads about the best way to export graphics from Mathematica into $\LaTeX$?

Edit: What I described above applies to Mma 9.0 on a 64-bit Linux Mint 15.

When I export the plot on a Windows 7 computer, the PDF is created correctly. From this I infer that the problem does not lie with my latex installation, but with the way Mathematica exports the plot to EPS. Is this known to be platform-dependent?

  • $\begingroup$ In version 10 psfrag is completely dead, since even one letter symbols do not help, which is also acknowledged by WRI. However, in version 10 pdf export itself has improved significantly and treats latex quality fonts relatively smoothly, with a possible exception of linux users. $\endgroup$ Commented Feb 18, 2015 at 22:14
  • $\begingroup$ This is not a direct solution to your problem, but you might be interested in exporting the data in a csv, dat or txt file and have it read by $\LaTeX$ using tikz, pgfplots and/or even Asymptote. This has many advantages and the workflow is usually smoother and simpler. $\endgroup$
    – anderstood
    Commented Feb 18, 2015 at 22:29

1 Answer 1


Have you tried converting the eps to pdf first? The epstopdf package is nice for this.






I've run into the same sort of problem. I can't currently confirm for your set up because I'm not running a Linux box at the moment. I believe what's going on is not an issue with Mathematica at all. I think it might still be an issue with your LaTeX distribution. MikTeX (the Windows LaTeX distribution) includes an eps converter that will automatically convert the eps to pdf and then include it in the PDFLaTeX document. As hinted at in the articles you yourself referenced it's really only an issue with EPS and PDFLaTeX.

If that's not the case then it might be that your EPS bounding boxes are too big. For a solution to that problem see the second answer in this article.

Another useful article is here.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.