Instructions for Creating Xfig figures in latex


Assume you have the macro package myMac.sty (ask me for it).

1. Create your latex file as usual.  Say the latex file is "foo.tex".
	Whenever you need a figure, insert this line
	in the latex file:

	\myfig{label}{Caption}{label}

	where label.fig is the name of your fig file.

	To refer to this figure, you can type "\refFig{label}"
	and it would produce "Figure 1"  (or whatever the number
	of this figure).

2. Create a subdirectory named "figs"
	in the current directory of the latex file.


3. In figs subdirectory, use "xfig" to create your file named "label.fig".
	When done, just save it (it will be in the fig format).

	SOME HINTS:  
		-- Use property editor extensively!
		-- Depth of object is useful
		-- If you use labels that require latex processing,
			then make sure that you select the "special"
			flag for fonts, and choose "latex fonts".
			E.g., if you want to label a node "x_1", then
			type the label "$x_1$".


4. Now we must process this label.fig file:

	> transfig -L pstex \
		-m 0.8 label.fig \
		-m 0.7 label2.fig

		(NOTE: this creates a Makefile)

	> make
		(NOTE: make will create label.tex and label.eps)

	Now, use your favorite editor to edit a line in label.tex.
	The second line of label.tex should look like this:

		\includegraphics{tree.eps}%

	Change it to look like this:

		\includegraphics{figs/tree.eps}%

	I.e., insert "figs/" in front of the name tree.eps.

5. Go back to the directory with the latex file:

	> cd ..
	> latex foo

		(This will produce foo.dvi which has your figure)

6. If you do this a lot, you should consider automating these steps: 
	
	-- step 4 can be put in a shell script (you can ask me
		for a shell script that automatically inserts the
		string "figs/" into the tex file).
	-- xfig should be startup up automatically with
		standard default of "special" flag and "latex" fonts 

--Chee (yap@cs.nyu.edu, Mar 2003)