Cette page appartient aux archives web de l'EPFL et n'est plus tenue à jour.
This page belongs to EPFL's web archive and is no longer updated.

Having latex math in ps figures.

If you want to have nice math display in the figures of your latex-generated document use the latex psfrag package.

Let's say you want to include an equation '\theta = 1' in your figure.

1. Generate the figure using your favorite figure-generating program (matlab, illustrator, xfig, or whatever)

2. place some reference text for, for exampe 'my_equation' where you want to put the maths

3. export your figure as .eps

4. In the .tex file use \psfrag right after inserting the figure (in the figure environment)
Use psfrag like this: \psfrag[c][c]{my_equation}{\Large$\theta=1$}
The two [c] arguments means you want to match the centers of of 'my_equation' and '$theta=1. 'You can also use l (for left) or r (right) instead.

5. the ps generated file will have your latex equation instead of 'my_equation' on the figure. You may have to have a \use{psfrag} command in your .tex file.


See http://www.usq.edu.au/users/leis/notes/latex/psfrag.html for a maybe better explanation.
Posted by Micha Hersch on Friday 1 September 2006 at 9:43