Adding LaTEX Fonts to Graphics

The psfrag package allows you to replace PostScript fonts with LaTeX fonts in PostScript graphics (for example, pi with the symbol $\pi$). The package uses a LaTeX syntax for defining the diagram and the PostScript language for rendering the diagram. It is very powerful, but can be a bit tedious.

To install psfrag on your system:

  1. Go to the psfrag distribution folder (alternate site), and download psfrag.ins and psfrag.dtx to a temporary location. Note that Windows may try to give them .txt extension, in which case you will have to rename them.
  2. Run latex psfrag.ins, which should create psfrag.sty and psfrag.pro
  3. Make a folder called psfrag under the existing c:\texmf\dvips folder. Copy the psfrag.pro file there.
  4. Make a folder called psfrag under the existing c:\usr\latex\texinputs folder which you made on installation.
  5. Select "Start-Programs-MiKTeX-MiKTeX Options" and press "Refresh Now" to update the filename database.
  6. Download both the example psfdemo.tex and graphics file matlab.eps Note: make sure you save the latter file with .eps extension
  7. Run latex psfrageg then dvips psfrageg This should produce psfrageg.ps which can be viewed with GhostView.