fig2ps, fig2eps,fig2pdf − Convert xfig files in ps│pdf, processing all the text marked as special with LaTeX.


fig2ps [−h│−−help]

fig2ps [−−[no]gv] [−−packages=pack1,pack2,...] [−−add=pack1,pack2,...] [−k│−−keep] [−−bbox=dvips│gs│a,b,c,d] [−−input=file] [−−[no]pdf] [−−dvips=s] [−−eps] [−−[no]forcespecial] file1.fig {file2.fig ...} [−−preamble=s]


fig2ps is a little perl script which takes advantage of the pstex and pstext_t export formats of fig2dev to format the text inside a Xfig figure using LaTeX. fig2pdf does the same, but ensures that the ps file producted converts nicely to pdf and actually performs the conversion.



Tells wether to run gv at the end of the script to see the result. On by default.


Use this option if you want to keep the intermediate files used by fig2ps. May be useful for debugging...


Sets the package list to be used to pack1,pack2,.... For packages taking arguments, you can use the syntax [arg]package, which so far does recognise only one argument, or the newer syntax arg1:arg2:arg...:package, which allows for an arbitrary number of arguments.


Adds pack1,pack2,... to the existing list of packages. The same recommandation applies for packages with arguments.


Chooses the method to determine the Bounding Box:


Tells fig2ps to run divps with option −E to generate a fitting bounding box. This will work on many cases, but might fail if there is not a lot of text.


Tells fig2ps to use gs with option −sDEVICE=bbox to get the bounding box. I never saw it fail so far.


Specify your bounding box by hand.


Uses file as a template for the Tex file, that is, do not print out a list of packages, but instead include file using \input file. There is only two exceptions: color is always included (after \input), and aeguill is used for pdf output.


Whether the output of fig2ps will be pdf or ps. On when the program names includes "pdf", as for instance fig2pdf.


Change the output default extension from .ps to .eps. This is on by default if the program is called as fig2eps.


Passes s as options when running dvips.


Tells fig2pdf to keep the intermediary ps file after converting to pdf. It is by default removed.


Forces the special flag of text in the fig file, so that every single text is processed through LaTeX.


Adds the string s in the preamble of the LaTeX file generated, that is, before the \begin{document};


Many of the command-line options are pre-definable in either the global or the user configuration file. Global configuration is overridden by users’ configuration which is overridden by the command line options. Here is a list of the variables you can define:


Defines the basic list of packages. See the −−package command-line argument for the handling of packages arguments.


Defines the supplementary packages. This option doesn’t make any sense in the global configuration file. Be careful that this option will be overridden by the command line, thus, a ADD=something and a −−add=somethingelse will add only somethingelse to the package list, and not something+somethingelse.


Sets the document class used by LaTeX.

DOC_OPTIONS =options

Sets the options for the document class.


Sets or unsets the default for option −−forcespecial.

GV =0│1

Wether to run "gv" at the end of the conversion or not.

INPUT =file

See the −−input=file option. Especially comes in useful in the users’ configuration files.

PREAMBLE =string

Identical to the −−preamble=s option.

KEEP_PS =0│1

See the −−keepps option.


/etc/fig2ps/fig2ps.rc, $HOME/.fig2ps.rc

You can also give a look at /usr/share/doc/fig2ps/examples to give you few ideas. For now, the example(s) are quite limited...


xfig(1), fig2dev(1), latex(1), gv(1), gs(1)...


This little script has been written by Vincent Fourmond, from on an original idea of Seb Desreux (the first script is for private use, and used the eepic export of xfig, which is severely limitated), improved by a few others...


Send bugs or comments to Vincent Fourmond <>