Getting PSfrag-ged EPS files to work with Inkscape

2009-08-13

Normal version

When preparing figures for papers or other scientific content I routinely use PSfrag for inserting LaTeX commands. Sometimes I would like to edit the result with Inkscape to add some fancy stuff, but unfortunately most of the time Inkscape cannot open the created EPS file. I have written a short guide describing how to finally get it to work.

If you are reading this you probably have LaTeX, the PSfrag package, and Inkscape already installed. Additionally, you will need Scribus and optionally ps2pdf (part of Ghostscript) and pdftops (part of Xpdf). Other PostScript/PDF converters may work as well, but I have not tested them. Now do the following:

  1. Create the EPS file using LaTeX and PSFrag. You probably want to use dvips -E to create an E(ncapsulated)PS instead of a normal PostScript document.
  2. Optionally (use this if Inkscape still complains): Convert the EPS to PDF using ps2pdf psfrag.eps psfrag.pdf and back again with pdftops -eps psfrag.pdf psfrag-new.eps. Again, the -eps option is needed for EPS documents.
  3. Now open the (new) EPS file in Scribus. You do not need to save the file in the native Scribus format so you can hit "Cancel" in the "Save As" dialog.
  4. Create a SVG file using "File/Export/Save Page as SVG...".
  5. Open the resulting SVG file in Inkscape.

That should do the trick. If you run into any trouble, feel free to post a comment.

Copyright 2006--2011 Hendrik Weimer. This document is available under the terms of the GNU Free Documentation License. See the licensing terms for further details.