XFig Sketches

XFig

How to create sketches involving LaTeX symbols using XFig

Here I list out the steps one needs to follow to draw sketches in XFig involving LaTeX symbols and generate publishable quality eps images.

1. Start xfig with:

xfig -specialtext -latexfonts -startlatexFont default&

2. Start from default.fig (file -> open)

3. Zoom in to get desired size (important because of font sizes)

4. In xfig add LaTeX between $ $, e.g. $lambda_i$

5. When done; export from xfig as figA.pstex, using Language: Combined PS/LaTeX this will generate figA.pstex_t

6. To generate png/eps images from the saved figA.pstex_t file I use the following latex template file fig2eps.tex:

\documentclass[12pt]{article}
\usepackage[dvips]{graphicx}
\usepackage[dvips]{color}
\usepackage{epsfig}

\begin{document}

\thispagestyle{empty}
\begin{center}
% Set the required size here
\resizebox{12cm}{!}{ \input{figA.pstex_t} }
\end{center}

\end{document}

7. Finally, to build the eps image use buildeps shell script which calls the required commands latex->dvips->ps2eps

buildeps fig2eps.tex

ICE-PIC 

Example sketch created using XFig explaining the ICE-PIC algorithm.

Thanks to Prof. Stephen B. Pope and Dr. Zhuyin Ren for all the inputs.