Xfig is a program used to create drawings with lines, arcs, and splines. LaTeX is a document preparation tool. How do you use them together? I'll discuss a technique which allows you to use LaTeX strings within your figures (for mathematics, Greek text, etc). The first thing you'll need is the following entries in your LaTeX preamble:
\usepackage[dvips]{graphicx}
\usepackage{color}
The first package is essential for working with graphics in LaTeX, the second is needed because Xfig enters colouring commands into its LaTeX output (even if all the output is black). Fire up Xfig with the following options:
xfig -specialtext -latexfonts -startlatexFont default
If you don't want to do this every time, just add the following entries to your .Xresources file:
Fig.latexfonts: true
Fig.specialtext: true
Go ahead and make your figure. You can enter LaTeX strings as text, these will later be converted by LaTeX into beautiful mathematics.
When you're done with the figure, save it in the same directory as your LaTeX file, let's suppose you name the figure myfig.fig. Export the file as "Combined PS/LaTeX (both parts)". This will make two new files, myfig.pstex and myfig.pstex_t. When you need to use the file in your LaTeX document, enter something like:
\begin{figure} [ht]
\input{myfig.pstex_t}
\caption{My figure}
\label{some_label}
\end{figure}
You might not be able to see the effects in the dvi file, but you should be able to see your figure if you run
dvips mytexfile.dvi to create a PostScript file.
Working with PDFLaTeX
Similar principles apply if you want to end up with a pdf. Of course one simple solution is to run ps2pdf on your ps file from the previous section, but you may end up losing some pdf-specific features, such as hyperlinks. The recommended alternative is to run pdflatex instead of LaTeX. You'll need some changes to the preamble:
\usepackage[pdftex]{graphicx,color}
\DeclareGraphicsRule{.pdftex}{pdf}{*}{}
You use Xfig much as before, but this time you export the figure to "Combined PDF/LaTeX". This will produce files myfig.pdftex and myfig.pdftex_t. The latter file replaces myfile.pstex_t in the body of your LaTeX document. When using pdflatex, make sure that your Xfig is in the correct orientation (usually portrait).
Most of the information is this post was gleaned from the
Xfig website, which contains much more information on using LaTeX with Xfig.