# Xfigfrag, v.1.1

Author: Éric Colin de Verdière , 2006.06.06.

Note: (2009.11.28) I do not plan to update this tool in the future. Feel free to contact me if you use it and want to improve it.

## Introduction

Xfigfrag is a tool for inserting arbitrary LaTeX code in figures created by xfig. It is used in a similar way as the psfrag package but, unlike the latter, xfigfrag also works with pdflatex; it can thus be used as a `pdffrag' package. As a drawback, xfigfrag only works with figures created by xfig.

## Why Xfigfrag?

There are several methods for inserting LaTeX code in figures. Natural requirements for this are:
• that the figures can be scaled easily, e.g. to have the same width as the current page;
• that the scaling does not affect the size of the text (which must be of the same size as the text of the whole LaTeX document, regardless of the magnification of the figure).
• The second requirement is not met when using special text in xfig figures, exporting the figure in .pstex and .pstex_t formats, or using MetaPost. It is still possible to export xfig figures directly into LaTeX format, but there are severe restrictions in terms of drawing capabilities. Finally, the psfrag package is adequate with respect to the two criteria above, but it inherently uses the structure of the eps files, so it only works with latex, not pdflatex.
The xfigfrag tool is designed to overcome these difficulties. The user draws the figure using xfig, exports it into two special formats using (a patched version of) fig2dev, includes the figure in the LaTeX document using the graphicx package (\includegraphics command) and inserts text in the figure using the same syntax as the psfrag package.