# some obstacles to incorporating xfig into LaTeX and TeX into xfig

On a Linux machine, I wanted to incorporate a drawing created in xfig into a LaTeX document. But xfig wasn't allowing me to use any fonts except one microscopic one. Then I found this page (from which I quote below) saying TeX could be incorporated into and xfig document. I thought that might suffice, since I didn't want to use any text except mathematical notation, which isn't done well in xfig's usual fonts anyway. But then I found I could not adjust the size: it's still in that one beensy font. Other than that it looked very good.

I can also run TeXworks on a Windows machine. I found a web page saying it's possible to get xfig for Windows. Is that easy enough that I should consider that alternative? (I heard the manner of incorporating graphics into a LaTeX document is different in that situation, e.g. one must use pdf instead of eps or something like that.)

Appendix: quote from the cited web pave:

This document is shamelessly copy-pasted from http://web.math.auc.dk/~dethlef/Links/latex_figures.html......

Inside xfig, add the LaTeX expressions to the figure, using $...$ to switch to math-mode where necessary. Use the normal method in xfig for adding text, but set the "special text" mode using the "Text flags" menu at the bottom of the screen.

Export the figure from xfig twice: firstly using the format "Combined PS/LaTeX (PS part)" to a file such as fig1.pstex, secondly using "Combined PS/LaTeX (LaTeX part)" to a file such as fig1.pstex_t.

Create a driver file (e.g., fig1.tex) containing something like:

\documentclass{article}
\usepackage{epsfig}
\usepackage{color} (note: you might not might not need to do this)
\setlength{\textwidth}{100cm}
\setlength{\textheight}{100cm}
\begin{document}
\pagestyle{empty}
\input{fig1.pstex_t}
\end{document}

Run the commands:

latex fig1.tex
dvips -E fig1.dvi -o fig1.eps

You should now have a file named "fig1.eps" which can be included (with scaling and rotation if desired) in other LaTeX documents.

-
So your main question here is whether you can run Xfig on a Windows system? If so, then yes, this is possible, via CygWin/X. Another option, if you don't go the PDF route, is to use psfrag which should be able to replace your "beensy font size" with something that matches the document style. –  Werner Jul 25 '13 at 17:04
Nowadays, much more powerful tools that Xfig are available; with TikZ you can do much, possibly better than with Xfig and no problem with fonts arises. –  egreg Jul 25 '13 at 17:22
@egreg With all due respect that is not a constructive comment. Xfig is a vector graphics editor while TikZ is languages for producing vector graphics (comparing apple to oranges). Xfig has no fonts problem. The Warner gave a right pointer (psfrag). Comparing Xfig to Inkscape or similar would have been fair. Whether learning the new tool to accomplish a task is justified is subject to debate and I tend to argue that most productive thing in most cases is sticking to familiar tools. For the record I have been using Xfig circa 1990 as well as PSTricks. –  Predrag Punosevac Jul 25 '13 at 20:49
@PredragPunosevac psfrag requires using DVI format and EPS; this means, for instance, that microtype won't fully work. One could use psfrag for creating an EPS to be converted to PDF, but the workflow would be clumsy. If I had to choose, probably I'd go with Inkscape, rather than Xfig (a good program, by the way, but not as powerful as its modern successors). –  egreg Jul 25 '13 at 20:54
@egreg Of course:) Both of us know that psfrag and Xfig predate microtype and if one is just starting to learn she/he would be ill advised to pick up Xfig. However for those of us who has been using Xfig for a while learning new tool might not be the most productive thing to do. –  Predrag Punosevac Jul 25 '13 at 21:03