[Tex/LaTex] psfrag equivalent for pdflatex

pdftexpsfrag

I am currently updating my workflow from the old tex2ps2dvi workflow (needs a lot of time and matplotlib and other stuff etc. hasn't a EPS output (only PDF, SVG, PS, PNG, etc…).

I am trying to adopt the font in my picture to the rest of my document. Normally I use:

\psfrag{old text in old font}[l][l]{new text in new font}
\psfrag{old text in old font}[90][l][l]{90 deg rot new text in new font}

But I always have to save it as pdf and then open it with Illustrator and modify it and save it as EPS then include it…

Is there a native implementation of psfrag in LaTeX, which can handle the text-replacement with pdflatex?

Best Answer

No pdffrag as you learned. I suggest the following "solution":

  1. Create a minimal tex document which uses psfrag to insert the appropiate labels and fonts, and use it to include all your eps figures. Use also preview package which will produce a document with a single figure per page, and with a page size fitted to the figure size.
  2. Compile that document with your habitual chain latex->dvips
  3. Convert the resulting PostScript file to pdf. Let say that the result is the file myfigures.pdf
  4. In your main document, include each figure at the appropriate point with \includegraphics[page=n]{myfigures.pdf}, being n 1, 2, 3... for each figure.

Alternatively, and I'm not joking, you may consider using TikZ to redo all your figures, specially if they are few and simple.