# Exporting Xfig picture

I have drawn a figure in Xfig and then I tried to export it into LaTeX picture so I can include it with my LaTeX code. Among the forms, I have plotted circles, which have been exported as ... rectangles with rounded boxes (so the figure now in my LaTeX looks really ugly).

I have read over the internet that "Angle Geometry" option may solve the problem, but this functionality is only for some line forms.

Any help.

PS: Other exports format (EPS, SVG, ...) work fine.

I tried drawing some concentric circles in xfig and exporting as a LaTeX picture.

\documentclass{article}
\usepackage{color}
% \usepackage{pict2e}
\begin{document}
%Begin xfig output
\setlength{\unitlength}{3947sp}%
%
\begingroup\makeatletter\ifx\SetFigFont\undefined%
\gdef\SetFigFont#1#2#3#4#5{%
\reset@font\fontsize{#1}{#2pt}%
\fontfamily{#3}\fontseries{#4}\fontshape{#5}%
\selectfont}%
\fi\endgroup%
\begin{picture}(1966,1966)(4418,-4944)
{\color[rgb]{0,0,0}\thinlines
\put(5401,-3961){\circle{900}}
}%
{\color[rgb]{0,0,0}\put(5401,-3961){\oval(1500,1500)}
}%
{\color[rgb]{0,0,0}\put(5401,-3961){\circle{450}}
}%
{\color[rgb]{0,0,0}\put(5401,-3961){\oval(1950,1950)}
}%
\end{picture}%
%end xfig output
\end{document}


The issue lies with the picture environment, which is severely restricted. In particular, there is a limited set of circle sizes that can be drawn; see chapter 5 of the Not so short guide to LaTeX, or chapter 7 of Leslie Lamport's own book for more details. Indeed, in the log file, one finds the following:

LaTeX Warning: \oval, \circle, or \line size unavailable on input line 16.
LaTeX Warning: \oval, \circle, or \line size unavailable on input line 18.
LaTeX Warning: \oval, \circle, or \line size unavailable on input line 22.


Now, following @egreg's suggestion, one might try loading the pict2e package, but there is another complication. It seems that if one exceeds the maximum circle size in the original picture environment, then xfig uses an \oval command instead, so loading pict2e won't help (though it can change the result). Looking at the xfig manual, it appears there is no support for pict2e.

However, xfig can export graphics in many more modern formats, including eps and pdf. You can use these in your document instead; see chapter 4 of the Not so short guide to LaTeX for details. It is possible to use eps or pdf graphics in a picture environment and place other items on top of them (details here).

• You probably avoid the warnings by loading pict2e. Nov 27 '13 at 22:06
• @egreg --- Indeed, but the shapes still aren't circles. Quite why xfig chooses to draw a circle with the \oval command is a mystery that I am too tired to solve now. Nov 27 '13 at 22:12
• @egreg --- Actually, I couldn't resist ... who needs sleep anyway? Nov 27 '13 at 22:39