Transfig: Portable Figures For L Tex
Transfig: Portable Figures For L Tex
Version 2.1.5
Micah Beck
Department of Computer Science
Ayers Hall, University of Tennessee
Knoxville, TN 37996
TransFig is a mechanism for integrating figures into LATEX documents. Sev-
eral “graphics languages” exist which achieve such integration, but none is widely
enough used to be called a standard. TransFig’s goal is to maintain the portabil-
ity of LATEX documents across printers and operating environments. The central
mechanism in TransFig is Fig code, the graphics description format of the Fig
interactive graphics editor. TransFig provides an automatic and uniform way to
Trans late Fig code into various graphics languages and to integrate that code into
a LATEX document.
1 TransFig
The TransFig package consists of the fig2dev program, which translates be-
tween Fig code and other graphics languages, and the transfig command
which can be used to invoke it. The available translations are illustrated in Fig-
ure 1 (which was included using TransFig). Fig2dev can be used directly to
translate from Fig code to the various graphics languages. However each graphics
language requires the user to load a particular set of TeX macros and use particular
commands to include the figure. TransFig allows these differences to be hidden.
When the graphics language is specified to the transfig command, it cre-
ates a macro file and a makefile. The macro file loads any appropriate TeX macros,
and the makefile specifies the appropriate commands to create LATEX files which
load the figures. The user simply \input the macro file and the names of the
files for loading the figures. To switch graphics languages, it is necessary only to
rerun transfig, and then make. Make can also be used to keep the translated
code up to date when figures change.
❄
tpic
specials
The Fig code produced by these programs can be viewed and edited using the Fig
graphics editor.
EEPIC is a further enhancement of EPIC which uses tpic specials (see below)
to implement general graphics objects. It is subject to the same software
requirements as tpic, although there is an “emulation package” which
will implement most of EEPIC using the same facilities as EPIC. EEPIC was
developed by Conrad Kwok at the University of California at Davis, and is
available via anonymous FTP from SUN.SOE.CLARKSON.EDU
Fig is an interactive graphics editor in the style of MacDraw which runs under
the Suntools/SunView windowing system. It produces intermediate code
which can be translated into a variety of graphics languages, including PIC,
Postscript, and PiCTEX.
Fig was developed by Supoj Sutanthavibul at the University of Texas at
Austin, ([email protected]), and is available via anonymous
FTP from SALLY.
Fig 2.1 is a version of Fig which implements various enhancements to the user
interface, and uses Fig code V2.1 Fig 2.1 was developed by various contrib-
utors. It is available via anonymous FTP from FTP.CS.CORNELL.EDU.
Fig2dev translates from Fig code to PiCTEX macros, Postscript, LATEX picture
environment commands, ( E ) EPIC macros, TEXtyl, and the PIC graphics lan-
guage. It is part of the TransFig package, and supports Fig code V2.1.
Fig2tex, Fig2ps, Fig2latex, Fig2epic, Fig2pic are Fig code translation programs
which were distributed as part of earlier versions of the TransFig package.
They have been replaced by fig2dev (see above).
F2p, F2ps are the original Fig code translation programs. These programs are
out of date and have been subsumed by fig2dev (see above).
LATEX is a standard macro package used for describing documents in TEX. Part
of this package is the LATEX picture environment, a restricted graphics facil-
ity. The capabilities of this facility are described in section 5.5 of LATEX, A
Document Preparation System by Leslie Lamport.
Plot2fig translates figures from the Unix plot file format to Fig code. Plot2fig was
developed by Richard Murphy of Rice University ([email protected]), and
is available via anonymous FTP from QED.RICE.EDU.
TransFig was developed by Micah Beck with major contributions by Frank Schmuck,
now of IBM, and Conrad Kwok of UC Davis. It is available via anonymous
FTP from FTP.CS.CORNELL.EDU.
Xfig is a version of the Fig graphics editor which can be compiled for either the
Suntools or X Windows Version 11 windowing systems. Xfig is part of the
contributed software distributed with the X Windowing System, and can be
obtained by anonymous FTP from EXPO.LCS.MIT.EDU.
Xpic is a graphical editor similar to Fig which runs under X Windows Version
11. Xpic was developed by Mark Moraes at the University of Toronto
([email protected]) and is available via anonymous FTP
from ai.toronto.edu.
#FIG 2.1
global parameters
object description
object description
..
.
Fields in a line of a Fig file are separated by blanks or tabs; newlines terminate
object descriptions. The fields of lines in Fig files are described throughout this
guide by tables like the one below. The fields must appear in the order given in
the table.
Type Field Units (values)
int fig resolution pixels/inch
Fig value: 80
int coordinate system 1: origin at lower left corner
2: origin at upper left corner
Fig value: 2
The Type column specifies the type of the field, and is either int(eger), float,
or string. The notation + following the type indicates that the values 0 or -1 are
1. Ellipse.
4. Text.
5. Circular Arc.
• For the dashed line style, the style val specifies the length of a dash.
For dotted lines it indicates the gap between consecutive dots.
• Depth determines which filled objects will obscure other objects, with the
objects of greater depth being obscured. If two objects at the same depth
overlap, the object which occurs first in the Fig file is obscured.
• The values between WHITE FILL and BLACK FILL define a gray scale;
many graphics languages cannot fully implement area fill.
• The color field will be extended in the future to an encoding of two three-
byte RGB specifiers: one for line color and one for fill color.
Arrow lines are used to describe optional arrows at the ends of Arc, Polyline,
and Spline objects. If an object has a forward arrow, then an arrow line describing
it follows the object description. If an object has a backward arrow, then an arrow
The pen field can only take the value DEFAULT. It is intended that future
extensions to Fig code will define other values for this field. Its intended use is
to define the shape of the pen used in drawing objects. It will also includes the
stipple pattern for line filling. The default pen is a circular pen with black filling.
The Ellipse object describes an ellipse (or circle) centered at the point
(center x, center y) with radii radius x and radius y, and whose x-
axis is rotated by angle from the horizontal. If the object describes a circle, then
radius x and radius y must be equal.
The fields start x, start y, end x and end y are used only by Fig,
and are not used in drawing the object. If the ellipse is specified by radius, then
The Spline object description has a points line following any arrow line which
has the same format as described above for the Polyline object description. If the
sub type of the spline is T OPEN INTERPOLATED or
T CLOSED INTERPOLATED, then an additional control points line follows the
points line. The line consists of a sequence of coordinate pairs, two coordinate
pairs for each point in the points line. Note that whereas the points line contains
integers, the control line consists of floating point numbers.
lx1 ly1 rx1 ry1 lx2 ly2 rx2 ry2 . . . lxn lyn rxn ryn
The interpretation of Spline objects is more complex than of other object descrip-
tions, and is discussed in section A.4.
The positioning of the string is specified by the sub type. The values T LEFT JUSTIFIED,
T CENTER JUSTIFIED, and T RIGHT JUSTIFIED specify that (x, y) is the
left end, center and right end of the baseline, respectively. The height and
length fields specify the box that the text fits into. These specifications are
accurate only for the fonts used by Fig.
The string field is an ASCII string terminated by the character ’\01’. This
terminating character is not a part of the string. Note that the string may contain
the new-line character ’\n’. Some output modes will interpret ISO encoded
European accents not found in the ASCII character set.
The text flags field is a bit vector which specifies various settable prop-
erties of the text object. Each flag corresponds to a bit position in the field; the
default value of each flag is FALSE.
The RIGID TEXT flag is used to preserve the absolute size of text objects
when inside compound and that compound is scaled (xfig only). The SPECIAL TEXT
flag is used to inhibit the “escaping” of formatting commands when translating
text to LATEXor Troff, in order to allow the user to inject such commands directly
into the figure. The PSFONT TEXT flag changes the interpretation of the font
field. Rather than selecting from the limited set of generic fonts shown in the table
above, the field is interpreted as selecting from the following table of PostScript
fonts. A text object with the PSFONT TEXT flag set may not be fully translatable
into output forms other than PostScript. Finally, the HIDDEN TEXT field is mean-
ingful only to graphics editors, and specifies that the full text should not displayed
on the screen. This is most useful for special text objects which may include very
long formatting command strings.
It consists of all the objects following it until an object whose object type field
is O END COMPOUND (-6) is encountered. Compound objects may be nested.