Home Contact Research Tools LaTeX

FIGTools Manual


FIG Tools (version 2015/08/01)


fig2eps [options] figfile(s)
fig2pdf [options] figfile(s)

The shell scripts fig2eps and fig2pdf convert the FIG files specified on the command line to EPS or PDF files, respectively. The files to be converted must have the extension .fig, but you do not have to specify the extension on the command line explicitly. That is, fig2pdf foo has the same effect as fig2pdf foo.fig.

By default, text objects in the input file foo.fig that have the special flag set, will be included in the output files foo.eps and foo.pdf by running latex, dvips and/or pdflatex. Alternatively, when the -t or -T option is used, fig2eps or fig2pdf will not include the special text objects in the output files, but will instead generate separate tex code which can be used to include the EPS or PDF file in a LaTeX document and overlay it with the special text.

Fonts in the EPS files produced by fig2eps are converted to bitmaps by default to reduce the file size. However, although the output should look fine in print, bitmapped fonts tend to render very onto a computer screen. If this is a concern, the option -r0 can be used to prevent font bitmapping, at the cost of creating a bigger EPS file.



This option makes fig2pdf assume that \unitlength is equal to 1bp (a PostScript point), rather than TeX's unit of 1pt. This will affect the picture coordinates when you use the -t or -T option.

-c class

With this option you can specify the document class to be used when the script invokes latex or pdflatex. The document class must be specified as follows: any class options must be given first as a comma-separated list between square brackets, and the class options must be followed immediately by a (optional) class name (no space between the right bracket and the class name, and no braces). If you leave out the class name, the default document class article will be used with the specified options.


Force fig2eps or fig2pdf to overwrite existing files, instead of pausing and prompting you.


This causes fig2eps or fig2pdf to respect the font sizes specified in the FIG file, which are normally ignored in favor of the LaTeX fonts specified by the document class and packages.

-i "tex code"

Use this option to insert tex code into the document preamble before the latex or pdflatexrun. You can use more than one instance of -i if you like. The code is inserted in the order given on the command line, and after any code specified in the FIG2EPS_CODE or FIG2PDF_CODE environment variables (see below).


Keep temporary files created by fig2eps for debugging purposes.

-p packages

This tells the script which packages you would like it to include when running latex or pdflatex. This allows you to change the document fonts, use your personal LaTeX macros, et cetera. The packages must be specified as a comma-separated list. Package options can be specified directly in front of the package name to which they apply, as a comma-separated list between square brackets (similarly to the syntax of the -c class option discussed above). The fig2eps and fig2pdf scripts always include the graphicx and color packages.

-r res

This option is only available in fig2eps. It specifies the font resolution used by dvips to generate the EPS file. The default resolution is 600dpi. A warning message will report missing fonts. Font bitmapping can be prevented by setting the resolution to 0.


This will make the scripts treat every text object in the fig file as if it has the special flag set.


This will make fig2eps and fig2pdf produce EPS and PDF files without embedded special text objects. Instead, LaTeX code is sent to the terminal which can be copied into a LaTeX document to include the EPS or PDF file and overlay it with the special text objects.


Similar to -t above, except that the LaTeX code is sent to a TEX file which can then be \input into a LaTeX document.


At the time of writing, the Postscript output of transfig has all fill patterns upside down. The FIGTools scripts correct this, but you can use the -u to prevent this correction from taking place.

Environment Variables

You can use the FIG2EPS_CODE and FIG2PDF_CODE environment variables to include extra tex code in the document preamble before the latex or pdflatex run. The expansion of FIG2EPS_CODE will be used in the creation of the EPS file, and the expansion of FIG2PDF_CODE will be used for the PDF file. Additional tex code specified with the -i option will be inserted after the code of the environment variable, and can hence be used to override this code, when desired.


When an error occurs, fig2eps and fig2pdf try to trap this error and return an error report. Common mistakes like forgotten dollar signs, forgotten braces, and undefined commands detected during the latex run can easily be corrected this way. The fig2eps and fig2pdf scripts do not check for the correct syntax of the arguments to the -c and -p options.


Suppose that you are preparing a document which uses the txfonts at a size of 12pt. You have several FIG files in the current working directory containing figures for this document. Suppose that the special text in these files contains some macros that are defined in your own package mysty.sty, that should be included with the options one and two. To convert all these FIG files to EPS and PDF, using the correct fonts and macros, type

fig2pdf -c [12pt] -p txfonts,[one,two]mysty *.fig

If you quickly want to change the fonts of your figures to sans-serif, you could type

fig2pdf -i "\renewcommand{\familydefault}{\sfdefault}" *.fig