For example, export your figure to tikz and include the generated file into your document with \input{fig1.tikz}. In the document preamble, load \usepackage{tikz} or, with TeX, use \input tikz.tex. If the figure contains color, \usepackage{color} is required. If images were imported into the xfig-drawing, \usepackage{graphics} is necessary. It depends on the LaTeX engine, e.g., xelatex, lualatex, latex + dvips, latex + dvipdfmx, pdflatex or others, whether the imported image can be processed with the \includegraphics command.
Export the figure from xfig to eps or pdf (or both) and import the file with \includegraphics into your document. For instance, write \usepackage{graphics} into the preamble and use \includegraphics{fig1.eps} or \includegraphics{fig1}.
For methods A and C, the Text flag TeX Text must be set for text that should be typeset using TeX. For instance, to render the text $\beta$ in the xfig-drawing as β. Otherwise, characters special to TeX are quoted and $\beta$ prints as $\beta$. The choice of the font, namely, latex of postscript fonts, is irrelevant to the interpretation of text strings.
The most powerful method, in terms of capabilities and output quality, is to export the figure to tikz. The file can be processed using TeX or LaTeX, TeX and Postscript fonts can be freely used and even mixed in the same figure, and the typesetting capabilities of TeX can be used. If xelatex is used, eps and pdf graphics can be imported into the same drawing. The tikz-file can be embedded into the TeX-document, hence a single document can contain all text and graphics.
The postscript and pdf output languages support all capabilities of xfig, except that only postscript fonts can be used and text is not interpreted by TeX. With method C, all text which has the Text flag "TeX Text" set is exported to the LaTeX file and a TeX-font is used. Text without the "TeX Text" flag is printed using a Postscript-font. A variant of method B is to use the psfrag package and replace strings in the eps file from within LaTeX.
To set the Text flag TeX Text and use LaTeX-fonts for all text, use the commandline
xfig -specialtext -latexfonts -startlatexFont defaultTo start all drawings with LaTeX fonts and with TeX Text set, put the following in your X-resources file, probably .Xresources in your home directory,
Fig.latexfonts: true Fig.specialtext: true
With method A, other notable export formats are the pict2e and the pstricks output. The pict2e output language does not allow pattern fills and can not generate a background grid, but the macro package is much smaller and the document compiles faster than with the tikz macro package. The pstricks output language also generates graphics output which is on a par with the tikz or the postscript output.
If scaling cannot be avoided, the commands \scalebox and \resizebox from the graphics package can be used,
\scalebox{1.5}{\input{fig1.pstex_t}} % \scalebox{factor}{object} \resizebox{10cm}{!}{\input{fig1.latex}} % \resizebox{width}{height}{object}An exclamation mark in place of one of the dimensions retains the aspect ratio of the object.
To set the width of tikz-drawings produced by xfig, you can use
\newlength\XFigwidth\XFigwidth84mm \newlength\XFigheight\XFigheight56mmbefore input'ing your figure. This will scale the coordinates of the drawing, but not line widths or text. If only one of the two dimensions is given, the figure retains its aspect ratio. To render subsequent figures in their original size, both dimensions must be undefined or set to zero,
\XFigwidth0pt \XFigheight0pt
\input supp-pdf.tex \usepackage[pdftex]{graphicx}And to include your figure :
\convertMPtoPDF{foo.0}{1}{1}That's it. Quite simple, and you can put a bit TeX inside.
Circle at depth 51 \__first displayed layer Text at depth 50 / *** Nothing at depth 49 Square at depth 48 \ Text at depth 48 > Second displayed layer Curve at depth 47 / ... and so on.
\input supp-pdf.tex \usepackage[pdftex]{graphicx} \usepackage{pause,mpmulti}And to include your animation, just put:
\multiinclude{foo}You can adjust it to a defined size by using:
\multiinclude[graphics={width=5cm}]{foo}Compile your document, then ppower4 it. Nifty, isn't it?