fig2dev(1)
๐ fig2dev(1) โ the manual, but make it make sense ๐
General Commands Manual ยท fig2dev ยท bestie edition ๐
โจ NAME โจ
fig2dev</purl> โ translates Fig code to various graphics languages ๐ฆ
๐ธ SYNOPSIS ๐ธ
fig2dev [-L language] [-m mag] [-s fsize] [-Z maxdimension
| <width>w | <height>h ] [-D +/-rangelist [-K]]
[other options] [fig-file [out-file]]
๐ DESCRIPTION ๐
okay so. fig2dev takes fig code from the file you name as fig-file and translates it into whatever graphics language you asked for, then drops the result into out-file. ๐ซถ
How does it know which language? It peeks at the suffix of out-file. Or you just tell it directly with the -L option. No guessing games if you don't want them.
The default fig-file is standard input and the default out-file is standard output. And if you write a minus (-) in place of fig-file or out-file, that also means standard input or standard output respectively. iconic, honestly. โจ
Now, a little lore: Xfig (Facility for Interactive Generation of figures) is a screen-oriented tool that runs under the X Window System, and it lets you draw and manipulate objects interactively. This version of fig2dev is compatible with xfig versions 1.3, 1.4, 2.0, 2.1, 3.0, 3.1 and 3.2. we love a backwards-compatible king ๐
Xfig version 3.2.3 and later saves and lets the user edit comments for each Fig object. Those comments get output with several of the output languages, such as PostScript, CGM, EMF, LaTeX, MetaFont, PicTeX, (as % comments), tk (as # comments), and pic (as .\" comments). the way that comments just... travel ๐ง
๐ฅ GENERAL OPTIONS (all drivers) ๐ฅ
like, these work no matter what driver you picked. main character options fr.
-Llanguage โ set the output graphics language. Valid languages arebox,cgm,dxf,epic,eepic,eepicemu,emf,eps,gbx(Gerber beta driver),gif,ibmgl,jpeg,latex,map(HTML image map),mf(MetaFont),mp(MetaPost),pcx,pdf,pdftex,pdftex_t,pic,pict2e,pictex,png,ppm,ps,pstex,pstex_t,pstricks,ptk(Perl/tk),shape(LaTeX shaped paragraphs),sld(AutoCad slide format),svg,textyl,tiff,tikz,tk(tcl/tk),tpic,xbmandxpm. that's the whole roster, bestie, count them if you want ๐
Notes: You must have ghostscript installed to get the pdf output, and ghostscript and one from the netpbm, the ImageMagick or the GraphicsMagick packages to get the bitmap formats (png, jpeg, etc.). so yes, dependencies. they're giving necessary ๐
-hโ print the help message with all options for all output languages, then exit. a lil menu, go off ๐-Vโ print the program version number and exit.-D +/-rangelistโ with+rangelist, keep only those depths in the list. With-rangelist, keep all depths except those in the list. The rangelist may be a list of comma-separated numbers or ranges separated by colon (:). For example,-D +10,40,55:70,80means keep only layers10,40,55through70, and80. filtering but make it fashion ๐-Kโ so, the selection of the depths with the-D +/-rangelistoption does normally not affect the calculation of the bounding box. Which means the generated document might have a much larger bounding box than necessary ๐ญ. If-Kis given, then the bounding box is adjusted to include only those objects in the selected depths. tiny box, no waste, periodt.-Eencoding โ specify the character encoding of the input file. Must be one of the strings listed byiconv --list, e.g.,ISO-8859-1orUTF-8. Defaults to the encoding of the current locale. It may be necessary to set this option if the input file was produced on a different computer, or in a different language environment. multilingual bestie behavior ๐ฆ-G minor[:major][:unit]โ draws a grid on the page ๐. Specify thin, or thin and thick line spacing in one of several units. For example,-G .25:1cmdraws a thin, gray line every.25cm and a thicker gray line every1cm. Specifying-G 1indraws a thin line every1inch. Fractions may be used, e.g.-G :1/2inwill draw a thick line every1/2inch. Allowable units are:i,in,inch,f,ft,feet,c,cm,mm, andm. Only allowed for PostScript, EPS, PDF, pstricks, tikz and bitmap (GIF, JPEG, etc) drivers. grid girlies rise โจ-mmag โ set the magnification at which the figure is rendered to mag. The default is1.0. This may not be used with the maxdimension option (-Z). pick one, bestie, you can't have both ๐-sfsize โ set the default font size (in points, 1/72 inch) for text objects to fsize. The default is11*mag, and thus is scaled by the-moption. If there is no scaling, the default font is eleven point Roman. ๐-Z maxdimension|<width>w|<height>h|<width>:|:<height>โ scale the figure so that the maximum dimension (width or height) is maxdimension inches or cm, depending on whether the figure was saved with imperial or metric units. Scale the figure to the given width by appending a'w'or a colon, scale to the given height by appending a'h'or prepending a colon. This may not be used with the magnification option (-m). again: pick one ๐- other options โ the other options are specific to the choice of graphics language, as described below. yes there are more. so many more. keep scrolling ๐
๐ OPTIONS COMMON TO ALL BITMAP FORMATS ๐
-bborderwidth โ make a blank border around the figure of width borderwidth (1/72 inch).-Fโ use correct font sizes (points, 1/72 inch) instead of the traditional size that xfig/fig2dev uses, which is 1/80 inch. The corresponding xfig command-line option is-correct_font_size. the way that 1/72 vs 1/80 has been haunting us ๐ญ-gcolor โ use color for the background.-Nโ convert all colors to grayscale. monochrome era ๐-Ssmoothfactor โ this will smooth the output by passing smoothfactor to ghostscript in the-dTextAlphaBitsand-dGraphicsAlphaBitsoptions to improve font rendering and graphic smoothing. A value of2for smoothfactor provides some smoothing and4provides more. glow up, literally โจ
๐ GIF OPTIONS ๐
-tcolor โ use color for the transparent color in the GIF file. This must be specified in the same format thatppmmake(1)allows. It may allow an X11 color name, but at least you may use a six-digit hexadecimal RGB value using the#sign, e.g.#ff0000(Red). transparency, but make it specified ๐ซถ
๐ JPEG OPTIONS ๐
-qimage_quality โ use the integer value image_quality for the JPEG "Quality" factor. Valid values are0-100, with the default being75. no cap, that's the range ๐ธ
๐ CGM OPTIONS ๐
CGM is Computer Graphics Metafile, developed by ISO and ANSI and is a vector-based plus bitmap language. Microsoft WORD, PowerPoint and probably other products can import this format and display it on the screen, something that they won't do with EPS files that have an ASCII preview. iykyk ๐
-aโ generate binary output.-rโ position arrowheads for CGM viewers that display rounded arrowheads. Normally, arrowheads are pointed, sofig2devcompensates for this by moving the endpoint of the line back so the tip of the arrowhead ends where the original endpoint of the line was. If the-roption is used, the position of arrows will NOT be corrected for compensating line width effects, because the rounded arrowhead doesn't extend beyond the endpoint of the line. read that twice bestie, the arrow math is real ๐น
๐ง DXF OPTIONS ๐ง
DXF is the Drawing Interchange File Format. The output to DXF is experimental. > experimental!! we're in the lab, handle with care ๐งช
-Pโ rotate the figure to portrait mode. The default is landscape mode. orientation, slay ๐
โญ EMF OPTIONS โญ
EMF is Enhanced Metafile, developed by Microsoft and is a vector-based plus bitmap language. Microsoft WORD, PowerPoint and probably other products can import this format and display it on the screen, something that they won't do with EPS files that have an ASCII preview. yes it's the same speech as CGM, the Microsoft office pipeline is undefeated ๐
-llang โ set the compatibility level to lang, where lang is one ofwin95,win98orwinnt. The default iswinnt.-rโ position arrowheads for EMF viewers that display rounded arrowheads. See the discussion of the-roption for the CGM output driver above. โฌ๏ธ go look, it's the same drama
๐ EPIC OPTIONS ๐
EPIC is literally an enhancement to the LaTeX picture drawing environment. main character energy fr.
EEPIC is an extension to EPIC and the LaTeX picture drawing environment that uses tpic specials as its graphics mechanism. It was written by Conrad Kwok of the Division of Computer Science at University of California, Davis. Conrad Kwok also wrote the EEPIC driver of fig2dev, so yeah, the icon did both. ๐
EEPIC-EMU is an EEPIC emulation package which does not use tpic specials.
When including EPIC/EEPIC output in a LaTeX file, use \usepackage{epic,eepic} in the preamble. no cap, that's the whole vibe check.
-dfactor โ Scale arrowheads by factor. The width and height of arrowheads is divided by this factor. This is because EPIC arrowheads are normally about double the size of TeX arrowheads. it's giving "please shrink me". ๐ญ-Fโ Don't set the font face, series, and style; only set its size and thebaselineskip. By default,fig2devsets all 5 font parameters when it puts some text. The disadvantage is that you can't set the font from your LaTeX document. With this option on, you can set the font from your LaTeX document. ๐
If any of the pictures included in your LaTeX document has been generated with -F, then all pictures must be generated with this option. no mixing bestie, it's all or nothing.
-ffont โ Set the default font used for text objects to font, where font is one ofrm,bf,it,sfortt. The default isrm.-llwidth โ Use\thicklineswhen the width of the line is equal or wider than lwidth. The default is2.-Pโ Generate a complete LaTeX file. In other words, the output file can be formatted without requiring any changes. slay, ready to go. โจ-Rdummyarg โ Allow rotated text. Rotated text will be set using the\rotateboxcommand. So, you will need to include\usepackage{graphics}in the preamble of your LaTeX document. A dummy argument is required after the-R. ๐ธ
If this option is not set, then rotated text will be set horizontally.
-Sscale โ Set the scale to which the figure is rendered. This option automatically sets the magnification andfsizetoscale/12and scale respectively. Scale must be between8and12, inclusively. ๐-tstretch โ Set the stretch factor of dashed lines to stretch. The default is30.-vโ Include comments in the output file. ๐-Wโ Enable variable line width. By default, only two line widths are available: the normal line width (\thinlines), and thick lines (\thicklines). See also the-loption above.-wโ Disable variable line width. Only\thicklinesand/or\thinlinescommands will be generated in the output file.
When the variable line width option is enabled, the \thinlines command is still used when the line width is less than LineThick. One potential problem is that the width of \thinlines is 0.4pt but the resolution of Fig is 1/80 inch (approx. 1pt). If LineThick is set to 2, normal lines will be drawn in 0.4pt wide lines but the next line width is already 2pt. One possible solution is to set LineThick to 1 and set the width of those lines you want to be drawn in \thinlines to 0. ๐ญ
Due to this problem, variable line width is disabled by default (-w).
๐ฆ IBM-GL (HP/GL) OPTIONS ๐ฆ
IBM-GL (IBM Graphics Language) is compatible with HP-GL (Hewlett-Packard Graphics Language). two besties, same energy fr fr.
-aโ Select ANSI A paper size instead of the default ISO A4.-cโ Generate instructions for an IBM 6180 Color Plotter without an IBM Graphics Enhancement Cartridge (IBM-GEC).-dxll,yll,xur,yur โ Restrict plotting to a rectangular area of the plotter paper which has a lower left hand corner at (xll,yll) and a upper right hand corner at (xur,yur). All four numbers are in inches and follow-din a comma-separated list โ xll,yll,xur,yur โ with no spaces between them. don't add spaces, she will not forgive you. ๐-ffontfile โ Load text character specifications from the table in the file fontfile. The table must have36entries โ one for each font plus a default. Each entry consists of5numbers which specify the- standard character set (
0-4,6-9,30-39), - alternate character set (
0-4,6-9,30-39), - character slant angle (degrees),
- character width scale factor and
- character height scale factor.
- standard character set (
-kโ Precede output with PCL command to use HP/GL.-lpattfile โ Load area fill line patterns from the table in the pattfile file. The table must have21entries โ one for each of the area fill patterns. Each entry consists of5numbers which specify the- pattern number (
-1-6), - pattern length (inches),
- fill type (
1-5), - fill spacing (inches) and
- fill angle (degrees).
- pattern number (
-Pโ Rotate the figure to portrait mode. The default is landscape mode.-ppenfile โ Load plotter pen specifications from the table in the penfile file. The table must have9entries โ one for each color plus a default. Each entry consists of2numbers which specify the- pen number (
1-8) and - pen thickness (millimeters).
- pen number (
-Sspeed โ Set the pen speed to speed (centimeters/second). zoom zoom. ๐๏ธ-vโ Plot the figure upside-down in portrait mode or backwards in landscape mode. This allows you to write on the top surface of overhead transparencies without disturbing the plotter ink on the bottom surface. iconic workaround tbh. ๐-xoffset โ Shift figure left by offset inches.-yoffset โ Shift figure up by offset inches.
fig2dev may be installed with either ANSI A or ISO A4 default paper size. The -a option selects the alternate paper size. fig2dev does not fill closed splines. The IBM-GEC is required to fill other polygons. fig2dev may be installed for plotters with or without the IBM-GEC. The -c option selects the alternate instruction set. ๐
๐ธ LATEX OPTIONS ๐ธ
LaTeX cannot accurately represent all the graphics objects which can be described by Fig. For example, the possible slopes which lines may have are limited. Some objects, such as spline curves, cannot be drawn at all. fig2latex chooses the closest possible line slope, and prints error messages when objects cannot be drawn accurately. she's doing her best okay ๐ญ
-bborderwidth โ Make blank border around figure of width borderwidth (1/72inch).-ddmag โ Set a separate magnification for the length of line dashes to dmag.-Fโ Don't set the font face, series, and style; only set its size and thebaselineskip. By default,fig2devsets all 5 font parameters when it puts some text. The disadvantage is that you can't set the font from your LaTeX document. With this option on, you can set the font from your LaTeX document. ๐
If any of the pictures included in your LaTeX document has been generated with -F, then all pictures must be generated with this option. same rule as before, no chaos allowed.
-ffont โ Set the default font used for text objects to font, where font is one ofrm,bf,it,sfortt. The default isrm.-llwidth โ Sets the threshold between LaTeX thin and thick lines to lwidth pixels. LaTeX supports only two different line widths:\thinlinesand\thicklines. Lines of width greater than lwidth pixels are drawn as\thicklines. Also affects the size of dots in dotted line style. The default is1.-vโ Verbose mode. Include comments in the output file. ๐
๐บ๏ธ MAP (HTML image map) OPTIONS ๐บ๏ธ
Xfig version 3.2.3 and later saves and allows the user to edit comments for each Fig object. The fig2dev map output language will produce an HTML image map using Fig objects that have href="some_html_reference" in their comments. Any Fig object except compound objects may be used for this. Usually, besides generating the map file, you would also generate a PNG file, which is the image to which the map refers. it's giving clickable picture era. โจ
For example, you may have an xfig drawing with an imported image that has the comment href="go_here.html" and a box object with a comment href="go_away.html". This will produce an image map file such the user may click on the image and the browser will load the "go_here.html" page, or click on the box and the browser will load the "go_away.html" page. ๐
After the map file is generated by fig2dev you will need to edit it to fill out any additional information it may need. yes bestie, manual labor, sorry.
-bborderwidth โ Make blank border around figure of width borderwidth (1/72inch).
๐ง METAFONT OPTIONS ๐ง
fig2dev scales the figure by 1/8 before generating METAFONT code. The magnification can be further changed with the -m option or by giving magnification options to mf.
In order to process the generated METAFONT code, the mfpic macros must be installed where mf can find them. The mfpic macro package is available at any CTAN cite under the subdirectory: graphics/mfpic
-Ccode โ Specify the starting METAFONT font code. The default is32.-nname โ Specify the name to use in the output file.-ppen_magnification โ Specify how much the line width should be magnified compared to the original figure. The default is1.-ttop โ Specify the top of the whole coordinate system. The default isypos.-xxmin โ Specify the minimum x coordinate value of the figure (inches). The default is0.-yymin โ Specify the minimum y coordinate value of the figure (inches). The default is0.-Xxmax โ Specify the maximum x coordinate value of the figure (inches). The default is8.-Yymax โ Specify the maximum y coordinate value of the figure (inches). The default is8.
๐ METAPOST OPTIONS ๐
-dfile โ Include file content as additional header.-ifile โ Include file content via\input-command.-Mโ Multipage mode, generate one figure for each depth. one figure per depth, she's thorough. ๐-oโ Old mode (no latex).-pnumber โ Adds the line"prologues:=number"to the output.
๐ธ PIC OPTIONS ๐ธ
-ffont โ sets the default font for text objects to font, bestie. font has to be one ofR(roman),B(bold),I(italic),H(sans serif) orC(typewriter). Default isR. periodt.-pext โ turns on certain PIC extensions that are known to work with thegroffpackage. Compatibility with DWB PIC? unknown, literally nobody knows ๐. Here's what each option unlocks:arcโ allowsARC_BOX, i.e. rounded corners get to existlineโ uses the'line_thickness'valuefillโ allows ellipses to be filledallโ uses all of the abovepsfontโ doesn't convert PostScript fonts to generic type (useful for files that are gonna be Ditroff'ed and printed on a PS printer). DWB-compatible.allpsโ uses all of the above (i.e."all"+"psfont")
โจ PICT2E OPTIONS โจ
PICT2E is a glow-up for the LaTeX picture environment ๐
. You enable it by dropping "\usepackage{pict2e}" into the document preamble. Depending on what's in your figure, you might also need "\usepackage{color}" and "\usepackage{graphics}" โ check the vibes of your content first. Figures made with the PICT2E driver can be processed by any LaTeX engine, like LaTeX + dvips, LaTeX + dvipdfm, pdflatex, xelatex, ConTeX, etc. any engine, no cap.
Pattern fills? Not supported by the PICT2E output language, sorry bestie ๐ญ. What the PICT2E driver does instead is render patterns by filling the respective area with the pen-color at 25% intensity, i.e., a 75% tint of the pen-color.
The PICT2E driver lets you choose any font available to the LaTeX engine, PostScript fonts included. TeX and PostScript fonts may appear together in the same document. iconic.
-bborderwidth โ makes a blank border around the figure with widthborderwidth*(1/72)inches. Breathing room, as she deserves ๐-Cnum โ do not emit a\color-command for the color number num. (0= black,1= blue,2= green โ go peek at the color chooser widget in Xfig if you need a refresher). By default,fig2devdoes not issue a\color-command for objects whose color is set to "Default" in xfig. With this option, the"\color"-command is also omitted for objects having the color num. The color of these objects, plus the ones with color set to "Default", gets picked up from the including LaTeX-document.
The option -C 0 is particularly useful, ngl. By default, xfig starts with the color set to black. Then fig2dev emits "\color{black}" commands, and the color-package must be included in the document preamble. For black text and black-and-white drawings, that's superfluous. lowkey unnecessary.
-eโ do not try to be compatible with epic/eepic. By default, you can include"\usepackage{pict2e, epic, eepic}"(in this order!) in the document preamble and mix LaTeX pictures using the epic/eepic command set with pictures produced by the PICT2E output language, all in one document. With this option on, epic or eepic pictures can not be mixed with PICT2E-pictures.
By default, fig2dev avoids the use of the "\circle" and "\oval"-commands, which are defined by epic, in lieu of the "\circlearc"-command exclusive to pict2e. In addition, line widths are not only set using "\linethickness", but also with the eepic-command "\allinethickness" (if it is defined).
-Fโ do not set the font family, series or shape. By default,fig2devsets the font family, series, shape, font size and baselineskip. With this option on, the text font can be set from the including LaTeX-document, e.g.,"\itshape \input{fig1.pict2e}". See also-o(no font size).-ffont โ set the default font used for text objects to font. The string font may be one ofrm,bf,it,sf,tt,\rmfamily,\bfseries,\itshape,\sffamily,\ttfamily, or one of the 35 standard PostScript font names. Default is\rmfamily.-idir โ prepend the string dir to graphics files included in the pict2e-picture. For instance, having imported"image.jpg"in xfig, with-i '$HOME/Figures/'the code"\incudegraphics{$HOME/Figures/image.jpg}"will be generated.-oโ do not set the font size or baselineskip. Text will be rendered at the size that is in force where the pict2e-code is inserted into the LaTeX-document, e.g.,"\small \input{fig1.pict2e}". See also-F(no font properties).-Oโ do not quote characters special to TeX/LaTeX. Useful to get, e.g., an italic x, not$x$, if it was forgotten to set the text flag"TeX"in xfig. This option effectively sets the"TeX"flag for all text.-Pโ Pagemode: generate a stand-alone LaTeX-file as out-file. The document produced from the LaTeX-file will have the paper size equal to the figure's bounding box (but see the-boption to add a margin). The generated LaTeX-file calls the package"geometry.sty"to set the paper size.-Rnum โ replace arrowheads num by LaTeX-arrows ("\vector"). The number of an arrowhead ("Arrow Type"in xfig) can be found by opening the arrow chooser widget in xfig and counting the arrows, starting from 1. For instance, to replace filled triangle arrowheads with LaTeX\vector-commands, use-R 3.-rโ replace all arrows by LaTeX-arrows. all of them. every last one ๐-Tโ only use TeX fonts, even where PostScript-fonts are specified.-vโ verbose mode. Writes comment lines into the output file, usually naming the type of the object that is drawn.-wโ remove the suffix from included graphics-files. With this option on,fig2devgenerates code that contains, e.g.,"\includegraphics{fig1}", instead of"\includegraphics{fig1.eps}".
๐ฆ PICTEX OPTIONS ๐ฆ
To include PiCTeX pictures into a document, you gotta load the PiCTeX macros. That's the entry fee, bestie.
Heads up: PiCTeX uses TeX integer register arithmetic to generate curves, and so it is very slow. PiCTeX draws curves by \put-ing the psymbol repeatedly, and so it requires a large amount of TeX's internal memory, and generates large DVI files. The size of TeX's memory limits the number of plot symbols in a picture. As a result, it is best to use PiCTeX to generate small pictures. keep it cute and small ๐
-ffont โ set the default font used for text objects to font, where font is one ofrm,bf,it,sfortt. Default isrm.-ldimen โ set line thickness to dimen. Default"1pt".-ppsymbol โ set the psymbol. Default"\makebox(0,0)[l]{\tencirc\symbol{'160}}".-rโ do not allow rotated text. Otherwise, files with PiCTeX macros and rotated text need to be processed with dvips.
๐ GBX OPTIONS (Gerber, RS-247-X) ๐
Typically you will wish to set the y scale to -1. See -g for more information. yes this is a hint, take it ๐ซถ
-d[mm|in]โ output dimensions should be assumed to be millimeters (mm) or inches (in). Default is millimeters.-p[pos|neg]โ select the image polarity. For positive images, lines drawn in the fig file will generate lines of material. For negative images, lines drawn in the fig file will result in removed material. Consider etching a chrome on glass transmission mask: drawing lines in the fig file and choosing'neg'will result in these lines being etched through the chrome, leaving transparent lines. it's giving โจetchingโจ-g<x scale>x<y scale>+<x offset>+<y offset>โ this controls the geometry of the output, scaling the dimensions as shown and applying the given offset. Typically you will wish to set the y scale to-1, mirroring about the x axis. This is because Gerber assumes the origin to be bottom left, while xfig selects top left. classic coordinate-system drama ๐ญ-f<n digits>.<n digits>โ this controls the number of digits of precision before and after the implied decimal point. With-f 5.3the following number12345678corresponds to12345.678. Whereas with-f 3.5it corresponds to123.45678. The default is for 3 places before the decimal point and 5 after. This corresponds to a range of 0 to 1m in 10 micron increments.-vโ output comments describing the type of objects being output. The text appears as comments starting with##on each line in the output file.
โจ POSTSCRIPT, ENCAPSULATED POSTSCRIPT (EPS), and PDF OPTIONS โจ
Okay so PostScript is the whole reason a lot of people even use xfig in the first place, and with it you can make multiple page figures ๐ซถ. Pass -M and boom, multi-page output. And if you're doing a poster? Add -O so the pages overlap just a lil bit, which sneaks you around the cursed unprintable area that basically every printer has โ then you cut and paste the pages together and it's giving craft night. Absolutely iconic for text with very big letters ๐
.
The EPS driver is not a straight copy of PostScript though โ here's everything that's different:
- No
showpageis generated, because the output is meant to be imported into another program or document and not printed, bestie. It's a guest star, not a headliner. - The landscape/portrait options are ignored.
- The centering option is ignored.
- The multiple-page option is ignored.
- The paper size option is ignored.
- The x/y offset options are ignored.
The EPS driver has these two special options:
-B 'Wx [Wy X0 Y0]'โ sets the bounding box of the EPS file to widthWxand heightWy. Important: this does not scale your figure to that size, it merely sets the bounding box, okay? If you give a value less than or equal to0forWxorWy, they get set to the width/height respectively of the figure. Origin is relative to screen(0,0)(upper-left).Wx,Wy,X0andY0are interpreted in centimeters or inches depending on the measure given in the fig-file. And remember to wrap the args in quotes (") or apostrophes (') so they group together properly ๐.-R 'Wx [Wy X0 Y0]'โ same as-B, exceptX0andY0are relative to the lower left corner of the figure. Again: quotes (") or apostrophes (') to group the arguments ๐.
The PDF driver accepts all of the PostScript options โ but only if the -P (pagemode) option is given. In that case, the size of the PDF is the pagesize given in the file, or set from the command line via the -z option. Otherwise, if -P isn't given, the PDF is cropped to the bounding box of the figure (optionally with a blank border margin set by the -b option), and all of the EPS options are supported ๐ฆ.
Text can now include various ISO-character codes above 0x7f, which is super useful for language-specific characters printed directly. Ngl though โ not all ISO-characters are implemented ๐.
Color support: colored objects created by Fig can be printed on a color postscript printer. There are 32 standard colors: black, yellow, white, gold, five shades of blue, four shades of green, four shades of cyan, four shades of red, five shades of magenta, four shades of brown, and four shades of pink. On top of that there may be user-defined colors in the file. See the xfig FORMAT3.2 file for the definition of these colors, bestie. On a monochrome printer, colored objects get mapped into different grayscales by the printer. Filled objects are printed using the given area fill and color. There are 21 "shades" going from black to full saturation of the fill color, and 21 more "tints" from full saturation + 1 to white. Plus 16 patterns like bricks, diagonal lines, crosshatch, etc. The way that's a whole palette ๐ญ๐
-Aโ add an ASCII (EPSI) preview. Not for PDF, bestie ๐ .-bborderwidth โ make a blank border around the figure of width borderwidth (1/72inch) ๐ธ.-Cdummy_arg โ add a color binary TIFF preview for Microsoft products that need a binary preview. See also-T(monochrome preview). A dummy argument must be supplied for historical reasons, sorry babes, it's the rules. Not for PDF output ๐.-cโ center the figure on the page. Lowkey the centering may not be accurate if there are texts in the fig_file that extend too far to the right of other objects ๐.-eโ put the figure against the edge (not centered) of the page. Not available in EPS.-Fโ use correct font sizes (points,1/72inch) instead of the traditional size that xfig/fig2dev uses, which is1/80inch. The corresponding xfig command-line option is-correct_font_size. Slay โจ.-ffont โ set the default font used for text objects to font, where font is one of the 35 standard PostScript font names. The default isTimes-Roman.-gcolor โ use color for the background ๐.-jโ enable composite fonts for text objects containing japanese or korean texts. With this option on, and if your environment variableLC_CTYPEis set to one ofja_JP.eucJP,ja_JP.EUC,ja_JP,ja_JP.ujis,ja,japanese,ko_KR.eucKR,ko_KR.EUC,ko_KR,ko, orkorean, fig2dev will insert a postscript preamble taken from thefig2dev/i18ndirectory into the output file. Japanese characters written with theTimes-Romanfont will then be taken from the fontsRyumin-Light-EUC-HorHeiseiMin-W3-EUC-H, and japanese characters written withTimes-Boldwill be taken fromGothicBBB-Medium-EUC-H. For the korean locales, korean characters appearing in text objects for whichTimes-Romanis selected will be taken fromMunhwa-Regular-KSC-EUC-HorHLaTeX-Myoungjo-Regular-KSC-EUC-H. Korean characters inTimes-Boldtext will be taken fromMunhwaGothic-Bold-KSC-EUC-HorHLaTeX-Gothic-Regular-KSC-EUC-H. Ghostscript must be able to find these fonts, no cap ๐ญ.-ldummy_arg โ generate the figure in landscape mode. The dummy argument is ignored, but it must appear on the command line for reasons of compatibility (blame history ๐). This option will override the orientation specification in the file (for file versions3.0and higher). Not available in EPS.-Mโ generate multiple pages if the figure exceeds paper size. Not available in EPS ๐ซถ.-Nโ convert all colors to grayscale.-nname โ set the Title part of the PostScript output to name. This is useful when the input to fig2dev comes from standard input ๐.-Oโ when used with-M, overlaps the pages slightly to get around the problem of the unprintable area in most printers. Not available in EPS โจ.-pdummy_arg โ generate the figure in portrait mode. The dummy argument is ignored, but it must appear on the command line for reasons of compatibility. This option will override the orientation specification in the file (for file versions3.0and higher). This is the default for Fig files of version2.1or lower. Not available in EPS ๐ .-Tโ add a monochrome binary TIFF preview for Microsoft products that need a binary preview. See also-C(color preview). Not available for PDF output ๐.-xoffset โ shift the figure in the X direction by offset PostScript points (1/72inch). A negative value shifts the figure to the left and a positive value to the right. Not available in EPS.-yoffset โ shift the figure in the Y direction by offset points (1/72inch). A negative value shifts the figure up and a positive value down. Not available in EPS.-zpapersize โ set the papersize. Not available in EPS. The available paper sizes are, and I'm listing every single one because I love you:Letter(8.5" x 11"alsoA),Legal(11" x 14")Ledger(11" x 17"),Tabloid(17" x 11", reallyLedgerin Landscape mode),A(8.5" x 11"alsoLetter),B(11" x 17"alsoLedger),C(17" x 22"),D(22" x 34"),E(34" x 44"),A9(37 mm x 52 mm),A8(52 mm x 74 mm),A7(74 mm x 105 mm),A6(105 mm x 148 mm),A5(148 mm x 210 mm),A4(210 mm x 297 mm),A3(297 mm x 420 mm),A2(420 mm x 594 mm),A1(594 mm x 841 mm),A0(841 mm x 1189 mm),B10(32 mm x 45 mm),B9(45 mm x 64 mm),B8(64 mm x 91 mm),B7(91 mm x 128 mm),B6(128 mm x 182 mm),B5(182 mm x 257 mm),B4(257 mm x 364 mm),B3(364 mm x 515 mm),B2(515 mm x 728 mm),B1(728 mm x 1030 mm),B0(1030mm x 1456 mm).
๐ธ PSTEX and PDFTEX OPTIONS ๐ธ
So the pstex and pdftex languages are a variant of ps which suppress text that has the text flag "TeX Text" set. Meanwhile pstex_t and pdftex_t have the complementary behavior: they generate only the text that has the "Tex Text" flag set, plus the commands necessary to position this text. They also generate the commands necessary to overlay the PostScript or PDF file generated using pstex/pdftex. These two drivers let you generate a figure that combines the flexibility of PostScript graphics with LaTeX text formatting of text flagged as "TeX Text" โ literally the best of both worlds, periodt ๐
โจ.
The pstex and pdftex drivers accept the same options that the EPS driver accepts.
-nname โ set the Title part of the PostScript output to name. This is useful when the input to fig2dev comes from standard input ๐ซถ.
๐ฆ PSTEX_T and PDFTEX_T OPTIONS ๐ฆ
The pstex_t and pdftex_t languages produce only the text flagged with the "TeX Text" flag, the commands necessary to position this text, and the commands necessary to overlay the PostScript or PDF file generated using pstex or pdftex (see above ๐).
-Fโ don't set the font face, series, and style; only set its size and the baselineskip. By default, fig2dev sets all 5 font parameters when it puts some text. The disadvantage is that you can't set the font from your LaTeX document. With this option on, you can set the font from your LaTeX document (like"\sfshape \input picture.eepic") ๐.-pfile โ specifies the name of the PostScript file to be overlaid. If not set, or its value is null, then no PS file will be inserted ๐.
Okay bestie, buckle up, this is the PSTricks era of the manual and it's giving big brain energy. ๐
โจ PSTRICKS OPTIONS โจ
So like, the PSTricks driver is the โจmain characterโจ of LaTeX text and math formatting for your XFig drawings โ it does the whole thing in one go, no overlaying separate outputs like those PSTEX methods do. ๐ โโ๏ธ The output quality matches the PostScript driver exactly, except for text, where it uses the LaTeX font selection mechanism just like the other fig2dev LaTeX drivers. Also, text gets rendered black, even though you can totally embed font color-changing LaTeX code inside the drawing if you want. ๐ค
The generated PSTricks code is meant to be readable, fr fr. Every command stands on its own โ it does not rely on global option state variables. So the vibe is: you rough out a PSTricks drawing in XFig, then finish it up by hand-editing. Very DIY, very cute. ๐
To actually use this driver's output, drop \usepackage{pstricks} in your document preamble. You might also need graphicx and pstricks-add โ the first one handles bitmap graphics, and the second handles complex line styles and/or hollow PSTricks arrows (that's with the -R 1 option, iykyk). The driver will literally tell you which packages you need, so no stress. ๐ Then in the document body, include the figure with \input{pstfile}, where pstfile.tex is the output file. Use the XFig TeX text flag to have text passed as-is straight to LaTeX. For non-TeX text, it uses the same mechanism as the LaTeX and epic drivers to match font specs โ but ngl, that's imprecise. ๐
๐ธ Known bugs and limitations ๐ธ
- PSTricks support for join styles is version dependent. Raw postscript gets inserted with
\pstVerbfor old versions when you need anything other than angle joins. The-toption controls this behavior. - PSTricks does not support rotated ellipses directly, so it emits an
rputcommand that rotates and locates a horizontal ellipse. ๐ญ This causes a problem with hatch patterns, which get moved and rotated along with the ellipse. Hatch rotation is fixed by a counter-rotation, but the origin is not adjusted, so registration with adjacent hatch patterns will be incorrect. - Flipped bitmap graphics use an undocumented feature of the
graphicxpackage: a negative height flips the image vertically. This appears to work reliably. However โ you may want to flip graphics with another program before including them in Xfig drawings, just to be sure. ๐ซถ - With the
-poption, the driver attempts to convert non-EPS pictures to EPS with the TeX distribution'sbmepsprogram โ butbmepsdoesn't know about very many file formats, including gif. ๐
-ffont โ Sets the default font used for text objects to font, where font is one ofrm,bf,it,sfortt. The default isrm.-Gdummy_arg โ Draws a standard PSTricks grid in light gray, ignoring the size parameters, numbered in PSTricks units.-lweight โ Sets a line weight factor that is multiplied by the actual Fig line width. The default value0.5roughly matches the output of the PS driver.-n0|1|2|3โ Sets environment type. Default0creates a\pictureenvironment with a bounding box exactly enclosing the picture (but see-xand-y). A1emits bare PSTricks commands with no environment at all, which you can use with\input{commands}inside an existing\pspicture. A2emits a complete LaTeX document. A3also emits a complete LaTeX document, but attempts to set the PSTricks unit to fit a 7.5 by 10 inch (portrait aspect) box. ๐-Pโ Shorthand for-n 3. โจ-pdir โ Attempts to run thebmepsprogram to translate picture files to EPS, which PSTricks requires. The translated files go in dir, which must already exist (the driver will not create it). Moreover, (BIG CAVEAT HERE ๐จ) the driver overwrites files with impunity in this directory! Don't put your stuff here. Theincludegraphicscommands in the output file refer to this directory. Even if the-poption is not used,includegraphicscommands follow this convention with the default directory./eps. In that case, you the user must do the conversions independently. Thebmepsprogram is part of the standard TeX distribution. It converts the following formats to EPS:pngjpgpnmtif. You can see thebmepscommand with the-voption.-R0|1|2โ Sets arrow style. With the default style0, Fig arrows are converted to lines and polygons. With style1, the Fig arrowhead dimensions are converted to PSTricks arrowhead dimensions and PSTricks arrowhead options are emitted. Hollow arrows will require the additional packagepstricks-add. With style2, PSTricks arrowhead options are emitted with no dimensions at all, and arrowhead size may be controlled globally withpsset.-Sscale โ Scales the image according to the same convention as the EPIC driver, i.e., to size scale/12.-tversion โ Provides the driver with a PSTricks version number so output can match expected LaTeX input.-vโ Print verbose warnings and extra comments in the output file. Info provided includes font substitution details, thebmepscommands used for picture conversion (if any), and one comment per Fig object in the output. ๐๏ธ-xmarginsize โ Adds marginsize on the left and right of the PStricks bounding box. By default, the box exactly encloses the image.-ymarginsize โ Adds marginsize on the top and bottom of the PStricks bounding box. By default, the box exactly encloses the image.-z0|1|2โ Sets font handling option. Default option0attempts to honor Fig font names and sizes, finding the best match with a standard LaTeX font. Option1sets LaTeX font size only. Option2issues no font commands at all.
๐ฆ TEXTYL OPTIONS ๐ฆ
-ffont โ Sets the default font used for text objects to font, where font is one ofrm,bf,it,sfortt. The default isrm.-llwidth โ Sets the line thickness. lwidth must be a value between1and12.
๐ TIKZ OPTIONS ๐
TIKZ is a powerful frontend to the Portable Graphics Format (PGF) for TeX/LaTeX. To use figures created by the TIKZ driver in a LaTeX document, use \usepackage{tikz} and โ depending on what's in your figure โ \usetikzlibrary{arrows.meta, bending} and \usetikzlibrary{patterns} in the document preamble. Then just \input or copy the output file into the TeX-document. Simple. โจ
TIKZ files produced by fig2dev may be included into a plain TeX document. However, the stand-alone file produced with the -P option must be processed with a LaTeX-engine. Also, font-commands may require a LaTeX engine. So like, know your limits bestie. ๐
-bborderwidth โ Makes a blank border around the figure of width borderwidth*(1/72)inches.-Cnum โ Do not emit a\color-command for the color number num. (0= black,1= blue,2= green โ see the color chooser widget in Xfig). By default, fig2dev does not issue a\color-command for objects which have the color set to "Default" in xfig. With this option, the\color-command is also omitted for objects having the color num. The color of these objects, as well as of those having the color set to "Default", is picked up from the including document. ๐-Fโ Do not set the font family, series or shape. By default, fig2dev sets the font family, series, shape, font size and baselineskip. As a side effect, this requires the New Font Selection Scheme (NFSS) of LaTeX. With this option on, the text font can be set from the including document, which may be TeX or LaTeX. See also-o(no font size).-ffont โ Set the default font used for text objects to font. The string font may be one ofrm,bf,it,sf,tt,\rmfamily,\bfseries,\itshape,\sffamily,\ttfamily, or one of the 35 standard PostScript font names. The default is\rmfamily.-idir โ Prepend the string dir to graphics files included in the tikz-picture. For instance, having importedimage.jpgin xfig, with-i '$HOME/Figures/'the code\pgfimage[width=..., height=...]{$HOME/Figures/image.jpg}will be generated.-Oโ Do not quote characters special to TeX/LaTeX. Useful to get, e.g., an italic x, not$x$, if it was forgotten to set the text-flag "TeX" in xfig. This option effectively sets the "TeX" flag for all text.-oโ Do not set the font size or baselineskip. Text will be rendered at the size that is in force where the tikz-code is inserted into the document, e.g.,\small\input fig1.tikz. See also-F(no font properties).-Pโ Pagemode, generate a stand-alone LaTeX-file as out-file. Run out-file through LaTeX to generate a pdf or eps of the figure. The document produced from out-file will have the paper size equal to the figure's bounding box (but see the-boption to add a margin). The packagegeometry.styis used in out-file to set the paper size. ๐-Tโ Only use TeX fonts, even where PostScript-fonts are specified.-vโ Verbose mode. Write comment lines into the output file, usually naming the type of the object that is drawn. ๐๏ธ-Wโ Do not emit code at the beginning of the file that allows one to set the figure width or height from the including TeX document. Otherwise, e.g.,\newdimen\XFigwidth\XFigwidth=\linewidthwould scale the following figures to the line width.-wโ Remove the suffix from included graphics-files. With this option on, fig2dev generates code that contains, e.g.,\pgfimage{fig1}instead of\pgfimage{fig1.pdf}. ๐
๐ซถ TK and PTK OPTIONS (tcl/tk and Perl/tk) ๐ซถ
okay so bestie, listen. the tk output language is lowkey picky and here's the tea:
- Arc-boxes are not supported for the tk output language. nope. not a thing. ๐
- Only X bitmap pictures are supported, because of the canvas limitation in tk. it's giving limited, fr fr.
- Picture objects are not scaled with the magnification factor for tk output.
- And because tk scales canvas items according to the X display resolution, polygons, lines, etc. may be scaled differently than imported pictures (bitmaps) โ which aren't scaled at all. so like... vibe mismatch, no cap. ๐ญ
-gcolor โ use color for the background. ๐จ-ldummy_arg โ generate the figure in landscape mode. The dummy_arg is literally ignored, but it must appear on the command line for reasons of compatibility (iykyk). This option will override the orientation specification in the file (for file versions 3.0 and higher). ๐ฅ-pdummy_arg โ generate the figure in portrait mode. The dummy_arg is ignored too, but must appear on the command line for reasons of compatibility. This option will override the orientation specification in the file (for file versions 3.0 and higher). This is the default for Fig files of version 2.1 or lower. ๐ธ-Pโ generate a canvas of full page size instead of using the bounding box of the figure's objects. The default is to use only the bounding box. โจ-wโ wrap the figure with code so you get a complete perl file. That is, you can do:
fig2dev -L ptk -w f.fig f.pl; perl f.pl
and a widget pops up that shows the graphics contained in f.pl. Only available for ptk output, bestie. ๐
-zpapersize โ set the paper size. See the POSTSCRIPT OPTIONS for available paper sizes. This is only used when the-Poption (use full page) is used. ๐
๐ TPIC OPTIONS ๐
-ffont โ set the default font used for text objects to font. The default isrm. The string font can be one of:
rm, bf, it, sf, tt, avant, avantcsc, avantd, avantdi, avanti, bookd, bookdi, bookl, booklcsc, bookli, chanc, cour, courb, courbi, couri, helv, helvb, helvbi, helvc, helvcb, helvcbi, helvci, helvcsc, helvi, pal, palb, palbi, palbu, palc, palcsc, pali, palsl, palu, palx, times, timesb, timesbi, timesc, timescsc, timesi, timessl or timesx.
that's a whole menu of fonts, pick your fighter ๐
๐ SEE ALSO ๐
xfig(1), pic(1), pic2fig(1), transfig(1)
๐ญ BUGS and RESTRICTIONS ๐ญ
Please send bug reports, fixes, new features etc. to:
thomas.loimer@tuwien.ac.at
(they want your emails bestie, that's the whole point ๐ซถ)
โญ COPYRIGHT โญ
- Copyright (c) 1991 Micah Beck
- Parts Copyright (c) 1985-1988 Supoj Sutantavibul
- Parts Copyright (c) 1989-2015 Brian V. Smith
- Parts Copyright (c) 2015-2018 by Thomas Loimer
Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The authors make no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty.
โ ๏ธ and now the all-caps part, because legal text is always screaming:
THE AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
like, they're not liable, okay?? ๐ซ
๐ AUTHORS ๐
- Micah Beck
- Cornell University
- Sept 28 1990
and Frank Schmuck (then of Cornell University)
and Conrad Kwok (then of U.C. Davis).
Drivers contributed by
- Jose Alberto Fernandez R. (U. of Maryland)
- and Gary Beihl (MCC)
Color support, ISO-character encoding and poster support by
- Herbert Bauer (
heb@regent.e-technik.tu-muenchen.de)
Modified from f2p (fig to PIC), by the author of Fig
- Supoj Sutanthavibul (
supoj@sally.utexas.edu) - University of Texas at Austin.
MetaFont driver by
- Anthony Starks (
ajs@merck.com)
X-splines code by
- Carole Blanc (
blanc@labri.u-bordeaux.fr) - Christophe Schlick (
schlick@labri.u-bordeaux.fr)
The initial implementation was done by C. Feuille, S. Grobois, L. Maziere and L. Minihot as a student practice (Universite Bordeaux, France).
Japanese text support for LaTeX output written by T. Sato (VEF00200@niftyserve.or.jp)
The tk driver was written by
- Mike Markowski (
mm@udel.edu) with a little touch-up by Brian Smith
The CGM driver (Computer Graphics Metafile) was written by
- Philippe Bekaert (
Philippe.Bekaert@cs.kuleuven.ac.be)
The EMF driver (Enhanced Metafile) was written by
- Michael Schrick (
m_schrick@hotmail.com)
The GBX (Gerber) driver was written by
- Edward Grace (
ej.grace@imperial.ac.uk).
and that's the whole page bestie!! ๐ธ this one is Version 3.2.9a, dated Dec 2024, and it's fig2dev(1) โ go forth and convert those figs, you absolute icon ๐โจ๐ฆ
๐ฆ where this page comes from
- alpine 3.24: fig2dev-doc 3.2.9a-r3 ยท Xfig
- epel 10: transfig 1:3.2.9a^20250619.ee3f4d8-3.el10_2 ยท Xfig
- fedora 43: transfig 1:3.2.9a^20250619.ee3f4d8-3.fc43 ยท Xfig
- fedora 44: transfig 1:3.2.9a^20250619.ee3f4d8-8.fc44 ยท Xfig
- nixos 26.05: fig2dev 3.2.9a
- nixpkgs unstable: fig2dev 3.2.9a
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms