TCM
UoC crest

LaTeX in xfig

It is possible to use LaTeX fonts, and fragments of LaTeX, in xfig figures. It is not at all WYSIWYG, but, for a quick greek letter or piece of maths it can be useful. The recipe is as follows:

If you forget to set the "text flags" property for those bits of text which need interpreting by LaTEX, you can use xfig's edit tool to correct the flag. In practice selecting a LaTeX font is unnecessary, the important bit is setting the special flag and exporting to the correct format.

You should now have a .pstex file containing EPS without the special text, and a .pstex_t file containing the LaTeX. In theory one can keep both, and then use "\input{foo.pstex_t}" in a LaTeX document to include the whole figure (in place of \includegraphics). Alternatively, one can convert both to a single .eps file, and use that in the normal way. The pstex2eps command (a TCM special) will do this.

The pstex2eps command automatically includes the amstex and color packages. If you require another package, such as times, it can be specified as

pstex2eps -package times foo.pstex

which will create foo.eps from foo.pstex and foo.pstex_t.

If you want both PDF and risks, I am currently writing a program called fig2pdf, which can be called as

fig2pdf foo.fig foo.pdf
It does not support the whole of xfig's syntax, but does currently support the includion of LaTeX text (by running pdflatex). Unlike the "combined PS/LaTeX (both parts)" route, it honours depth information for the LaTeX text too. Bugs / comments to the obvious place.