XFIG(1) USER COMMANDS XFIG(1) NAME xfig - Facility for Interactive Generation of figures under X11 SYNOPSIS xfig [ -ri[ght] ] [ -le[ft] ] [ -L[andscape] ] [ -P[ortrait] ] [ -w[idth] _i_n_c_h_e_s ] [ -h[eight] _i_n_c_h_e_s ] [ -no[track] ] [ -tr[ack] ] [ _f_i_l_e ] DESCRIPTION _X_f_i_g is a menu-driven tool that allows the user to draw and manipulate objects interactively in an X window. It runs under X version 11 release 2 and requires a three-button mouse. _F_i_l_e specifies the name of a file to be edited. The description of objects in the file will be read at the start of _x_f_i_g. The output from _x_f_i_g can be printed in several ways troff - f2p (_x_f_i_g to _p_i_c(1) translator, also known by its previous name _f_t_o_p(1L)) is used to translate _x_f_i_g files into _p_i_c(1) language. The resulting file may then be processed in the same maner as any other _p_i_c file. postscript - f2ps (_x_f_i_g to _p_o_s_t_s_c_r_i_p_t translator) is used to produce a _p_o_s_t_s_c_r_i_p_t file from an _x_f_i_g file. The _p_o_s_t_s_c_r_i_p_t file can be sent directly to a postscript printer. LaTeX - fig2latex (_x_f_i_g to _L_a_T_e_X translator) produces a _L_a_T_e_X file from an _x_f_i_g file. This file contains _L_a_T_e_X pic- ture environment commands and can be processed along with other _L_a_T_e_X commands. PiCTeX - fig2tex (_x_f_i_g to _P_i_C_T_e_X translator) produces a _P_i_C_T_e_X file from an _x_f_i_g file. This file contains macros that can be used with the _P_i_C_T_e_X environment under _T_e_X or _L_a_T_e_X. OPTIONS -ri Change the position of the panel window to the right of the canvas window (default: left). -le Change the position of the panel window to the left of the canvas window. -L Make _x_f_i_g come up in landscape mode (10" x 7.5"). -P Make _x_f_i_g come up in portrait mode (7.5" x 10"). This is the default. -w _i_n_c_h_e_s Make _x_f_i_g come up _i_n_c_h_e_s wide. Sun Release 4.1 Last change: 8 August 1988 1 XFIG(1) USER COMMANDS XFIG(1) -h _i_n_c_h_e_s Make _x_f_i_g come up _i_n_c_h_e_s high. -tr Turn on cursor (mouse) tracking arrows. -no Turn off cursor (mouse) tracking arrows. GRAPHICAL OBJECTS The objects in _x_f_i_g are divided into primitive objects and compound object. The primitive objects are: _A_R_C, _C_I_R_C_L_E, _C_L_O_S_E_D _S_P_L_I_N_E, _E_L_L_I_P_S_E, _P_O_L_Y_L_I_N_E, _P_O_L_Y_G_O_N, _S_P_L_I_N_E, and _T_E_X_T. A primitive can be moved, rotated, flipped, copied or erased. A compound object is composed of primitive objects. The primitive objects that constitute a compound can not be individually modified, but they can be manipulated as an entity; a compound can be moved, rotated, flipped, copied or erased. An extra function that can be applied to a compound object is scaling, which is not available for primitive objects. DISPLAY WINDOWS Five windows comprise the display area of _x_f_i_g: the top ruler, the side ruler, the panel window, the message window, and the canvas window. The message window always appears below the others; it is the area in which messages are sent and received. The panel window can be placed to the left or right of the the canvas window (default: left). POP-UP MENU The pop-up menu appears when the right mouse button is pressed with the cursor positioned within the canvas window. Positioning the cursor over the desired menu entry and releasing the button selects a menu entry. There are a number of file accessing functions in the pop-up menu. Most of the time when one of these functions is selected, the user will be asked for a file name. If the specified file can be located and the access permission are granted, _x_f_i_g will carry out the function. However in case things go wrong, _x_f_i_g will abort the function and printed the causes on the message window. _U_n_d_o Undo the last object creation or modification. _R_e_d_i_s_p_l_a_y Redraw the canvas. _R_e_m_o_v_e _a_l_l Remove all objects on the canvas window (can be undone). _E_d_i_t _f_i_l_e ... Sun Release 4.1 Last change: 8 August 1988 2 XFIG(1) USER COMMANDS XFIG(1) The current contents of the canvas are cleared and objects are read from the specified file. The user will be asked for a file name. This file will become the current file. _S_a_v_e Save the current contents of the canvas in the current file. If no file is being edited, the user will be asked for a file name as in the "Save in ..." function. _R_e_a_d _f_i_l_e ... Read objects from the specified file and merge them with objects already shown on the canvas. (The user will be asked for a file name.) _S_a_v_e _a_s ... Save objects on the screen into a file specified by the user. (The user will be asked for a file name.) _S_t_a_t_u_s Show the name of the current file and directory. _C_h_a_n_g_e _D_i_r_e_c_t_o_r_y Change the working directory. Any file name without a full path name will employ the current working direc- tory. _S_a_v_e & _E_x_i_t Save the objects in the current file and exit from _x_f_i_g. If there is no current file, the user will be asked for a file name. No confirmation will be asked. _Q_u_i_t Exit from _x_f_i_g, discarding all objects. The user will be asked to confirm the action, by clicking the left button. _S_a_v_e _a_s _B_I_T_M_A_P ... Create a bitmap picture of the drawings for use with other tools (for example, for use as an icon). The smallest rectangular area of pixels that encompasses the figure is written to the named file (the user will be asked for a file name) from top row to bottom and left to right (in Sun raster format). Only _T_E_X_T objects that are parts of compound objects will be treated as parts of the picture; other texts are saved as objects in _x_f_i_g format following the bitmap data. The coordinates of these text objects can be used to identify locations on the bitmap. PANEL WINDOW MANIPULATION FUNCTIONS Icons in the panel window represent object manipulation functions, modes and other drawing or modification aids. Manipulation functions are selected by positioning the Sun Release 4.1 Last change: 8 August 1988 3 XFIG(1) USER COMMANDS XFIG(1) cursor over it and clicking the left mouse button. The selected icon is highlighted, and a message describing its function appears in the message window. The left and middle buttons are used to creat and modify objects in the canvas window. Most actions start with clicking of the left button and end with clicking of the right button. There is no need to hold down a button while positioning the cursor. PANEL WINDOW COMMAND DESCRIPTIONS Entries in the panel window can be classified into two categories: object creation/modification/removal commands (only one of which may be active at any one time), and draw- ing aids (which act as toggle switches). There are two ways for drawing circles, two for ellipses, two for splines and two for closed splines. There are two basic splines. One is the interpolated spline in which the spline pass thorough the entered points (knots). The other is the normal spline in which on control points are passed by the spline (except for the two end points in the open spline). OBJECT CREATION/MODIFICATION/REMOVAL Multiple commands are grouped thematically in the following descriptions (which is listed alphabetically). _A_D_D/_D_E_L_E_T_E _A_R_R_O_W_S Add or delete arrow heads for _P_O_L_Y_L_I_N_E, _P_O_L_Y_G_O_N, _S_P_L_I_N_E or _C_L_O_S_E_D _S_P_L_I_N_E objects (points of a _B_O_X can not be added or deleted). _A_D_D/_D_E_L_E_T_E _P_O_I_N_T_S Add or delete points for _P_O_L_Y_L_I_N_E, _P_O_L_Y_G_O_N, _S_P_L_I_N_E or _C_L_O_S_E_D _S_P_L_I_N_E objects (points of a _B_O_X can not be added or deleted). _A_R_C Create an arc. Specify three points using the left button. _B_O_X Create rectangular boxes. Start with the left button and terminate with the right button. _B_R_E_A_K _C_O_M_P_O_U_N_D Break a compound object to allow manipulation of its component parts. Click the left button on the bounding box of the compound object. _C_I_R_C_L_E Create circles by specifying their radii or diameters. Click the left button on the canvas window, move the cursor until the desired radius or diameter is reached, then click the middle button to terminate. The circle Sun Release 4.1 Last change: 8 August 1988 4 XFIG(1) USER COMMANDS XFIG(1) will be drawn after the pressing of the middle button. _C_L_O_S_E_D _I_N_T_E_R_P_O_L_A_T_E_D _S_P_L_I_N_E Create closed or periodic splines. The function is similar to _P_O_L_Y_G_O_N except that a closed interpolated spline is drawn. The spline will pass through the points (knots). _C_L_O_S_E_D _S_P_L_I_N_E Create closed or periodic spline objects. The function is similar to _P_O_L_Y_G_O_N except that a closed spline will be drawn instead of polygon. The entered points are just control points; i.e., the spline will not pass any of these points. _C_O_P_Y Copy object. Click the left button over part of the object to be copied (for _C_I_R_C_L_E and _E_L_L_I_P_S_E objects, position on their circumferences). Drag the object to the desired position and click the middle button. This function as well as the following three functions (_M_O_V_E, _M_O_V_E _P_O_I_N_T, _R_E_M_O_V_E) will cause point markers (manipulation aids) to be shown on the canvas window. There are no markers for _C_I_R_C_L_E or _E_L_L_I_P_S_E objects. _E_L_L_I_P_S_E Create ellipses using the same procedure as for the drawing of circles. _G_L_U_E Glue the objects within a bounding box into a compound object (the bounding box itself is not part of the fig- ure; it is a visual aid for manipulating the compound). _I_N_T_E_R_P_O_L_A_T_E_D _S_P_L_I_N_E Create (cubic spline) spline objects. Enter control vectors in the same way as for creation of a _P_O_L_Y_L_I_N_E object. At least three points (two control vectors) must be entered. The spline will pass through the entered points. _M_O_V_E Move objects in the same way as in _C_O_P_Y. _M_O_V_E _P_O_I_N_T Modify the position of points of _P_O_L_Y_L_I_N_E, _B_O_X, _P_O_L_Y_G_O_N, _E_L_L_I_P_S_E, _A_R_C _a_n_d _S_P_L_I_N_E _o_b_j_e_c_t_s. _C_l_i_c_k _t_h_e _l_e_f_t _b_u_t_t_o_n _o_v_e_r _t_h_e _d_e_s_i_r_e_d _p_o_i_n_t, _r_e_p_o_s_i_t_i_o_n _t_h_e _p_o_i_n_t, _a_n_d _c_l_i_c_k _t_h_e _m_i_d_d_l_e _b_u_t_t_o_n. _N_o_t_e _t_h_a_t _B_O_X _a_n_d _P_O_L_Y_G_O_N _o_b_j_e_c_t_s _a_r_e _i_n_t_e_r_n_a_l_l_y _s_t_o_r_e_d _a_s _P_O_L_Y_L_I_N_E _o_b_j_e_c_t_s, _a_n_d _t_h_e_r_e_f_o_r_e _m_o_v_i_n_g _c_e_r_t_a_i_n _p_o_i_n_t_s _m_a_y _o_p_e_n _t_h_e_s_e _o_b_j_e_c_t_s. _P_O_L_Y_G_O_N Same as _P_O_L_Y_L_I_N_E except that a line segment is drawn Sun Release 4.1 Last change: 8 August 1988 5 XFIG(1) USER COMMANDS XFIG(1) connecting the first and last points entered. _P_O_L_Y_L_I_N_E Create polylines (line segments connecting a sequence of points). Enter points by clicking the left button at the desired positions on the canvas window. Click the middle button to terminate. _R_E_M_O_V_E Remove (or delete) objects. _S_C_A_L_E _C_O_M_P_O_U_N_D Only compound objects can be scaled. Click the left button on a corner of the bounding box, stretch the bounding box to the desired size, and click the middle button. Or click the left button on a side of the bounding box, stretch that side to the desired size, and click the middle button. _S_P_L_I_N_E Create (quadratic spline) spline objects. Enter con- trol vectors in the same way as for creation of a _P_O_L_Y_- _L_I_N_E object. At least three points (two control vec- tors) must be entered. The spline will pass only the two end points. _T_E_X_T Create text strings. Click the left button at the desired position on the canvas window, then enter text from the keyboard. A DEL or ^H (backspace) will delete a character, while a ^U will kill the entire line. Terminate by clicking the middle button or typing the return key. To edit text, click on an existing text string with the left button. Insertion of characters will take place at that point. _T_U_R_N Turn _P_O_L_Y_G_O_N into a _C_L_O_S_E_D _I_N_T_E_R_P_O_L_A_T_E_D _S_P_L_I_N_E object, or turn _P_O_L_Y_L_I_N_E into a _I_N_T_E_R_P_O_L_A_T_E_D _S_P_L_I_N_E object. DRAWING AIDS Drawing aids act as toggle switches. More than one can be selected at a time (except for _G_R_I_D and the line drawing modes). _A_U_T_O _F_O_R_W_A_R_D/_B_A_C_K_W_A_R_D _A_R_R_O_W Automatically add forward/backward arrow heads to _P_O_L_Y_- _L_I_N_E, _S_P_L_I_N_E or _A_R_C objects. _F_L_I_P Invert the object (middle button) or produce a mirror- image copy of an object (left button). Point to part of the object ("the handle"), click the appropriate but- ton. Sun Release 4.1 Last change: 8 August 1988 6 XFIG(1) USER COMMANDS XFIG(1) _G_R_I_D Display either the quarter- or half-inch grids (left button). _M_A_G_N_E_T Round points to the nearest 1/16 of an inch. This affects every function, and is provided as an alignment aid. _U_N_R_E_S_T_R_I_C_T_E_D Allow lines to be drawn with any slope. _M_A_N_H_A_T_T_A_N Enforce drawing of lines in the horizontal and vertical direction only. Both _M_A_N_H_A_T_T_A_N and _M_O_U_N_T_A_I_N can be turned on simultaneously. The creations of _P_O_L_Y_G_O_N, _P_O_L_Y_L_I_N_E and _S_P_L_I_N_E objects are affected by these two modes. _M_O_U_N_T_A_I_N Enforce drawing of only diagonal lines. Both _M_A_N_H_A_T_T_A_N and _M_O_U_N_T_A_I_N can be turned on simultaneously. The crea- tions of _P_O_L_Y_G_O_N, _P_O_L_Y_L_I_N_E and _S_P_L_I_N_E objects are affected by these two modes. _M_A_N_H_A_T_T_A_N _M_O_U_N_T_A_I_N Allow lines to be drawn at any slope allowed when in MOUNTIAIN or MANHATTAN modes. _L_A_T_E_X _L_I_N_E Allow lines to be drawn only at slopes which can be handled by LaTeX picture environment lines: slope = x/y, where x,y are integers in the range [-6,6]. _L_A_T_E_X _V_E_C_T_O_R Allow lines to be drawn only at slopes which can be handled by LaTeX picture environment vectors: slope = x/y, where x,y are integers in the range [-4,4]. _R_O_T_A_T_E Rotate the object (middle button) or copy (left button) +90 degrees. _S_O_L_I_D/_D_A_S_H_E_D _L_I_N_E _S_T_Y_L_E Toggle between solid and dashed line styles. The dash length is fixed at 0.05 inch. X DEFAULTS The overall widget name(Class) is xfig.fig(Fig.TopLevelShell). This set of resources correspond to the command line arguments: trackCursor (boolean:on) -track and -notrack arguments Sun Release 4.1 Last change: 8 August 1988 7 XFIG(1) USER COMMANDS XFIG(1) justify (boolean:false) -right and -left arguments landscape (boolean:false) -Landscape and -Portrait argu- ments debug (boolean:off) -debug arguments width (integer:7.5 or 10 inches) -width argument height (integer:10 or 7.5 inches) -height argument reverseVideo(boolean:off) -inverse argument These arguments correspond to the widgets which make up _x_f_i_g. overall window form(Form) side panel form.panel(Form.Box) icons form.panel.button(Form.Box.Command) top ruler form.truler(Form.Label) side ruler form.sruler(Form.Label) canvas form.canvas(Form.Label) message window form.message(Form.Command) menu form.popup_menu.menu(Form.OverrideShell.Box) menu title form.popup_menu.menu.title(Form.OverrideShell.Box.Label) menu items form.popup_menu.menu.pane(Form.OverrideShell.Box.Command) For example, to set the background of the panel to blue the resource would be: xfig*form.panel.background: blue NOTE: The font used in the canvas cannot be changed at this time. BUGS Text strings will appear differently on hard copy, because the display fonts are fixed-width fonts while the fonts used by the typesetter systems are variable-width fonts. A double quote in a text string should be preceded by a back slash if the it is to be printed through _p_i_c(1). Sun Release 4.1 Last change: 8 August 1988 8 XFIG(1) USER COMMANDS XFIG(1) Objects that extend beyond the canvas window may cause image shrinkage in hard copy printed by _p_i_c(1), since it will try to fit every object onto a single 8.5" x 11" page. Ellipses which are too narrow may cause _x_f_i_g to loop for- ever. Objects which are created while one of the _g_r_i_d_s is on may appear ragged. This can be corrected by selecting _R_e_d_i_s_p_l_a_y from the pop-up menu. The X11 cursors are not the original ones but chosen from X11's cursor font. SEE ALSO Brian W. Kernighan _P_I_C - _A _G_r_a_p_h_i_c_s _L_a_n_g_u_a_g_e _f_o_r _T_y_p_e_s_e_t_t_i_n_g _U_s_e_r _M_a_n_u_a_l ditroff(1), f2p(1), f2ps(1), fig2latex(1), fig2tex(1), pic(1), troff(1), tex(1), latex(1) ACKNOWLEDGEMENT Many thanks goes to Professor Donald E. Fussell who inspired the creation of this tool. AUTHORS Original author: Supoj Sutanthavibul University of Texas at Austin (supoj@sally.utexas.edu) Manual page modified by: R. P. C. Rodgers UCSF School of Pharmacy San Francisco, CA 94118 The LaTeX line drawing modes were contributed by: Frank Schmuck Cornell University X11 port by: Ken Yap Rochester (ken@cs.rochester.edu) Variable window sizes, cleanup of X11 port, right hand side panel under X11, X11 manual page provided by: Dana Chee Bellcore (dana@bellcore.com) Cleanup of color port to X11 by: John T. Kohl Sun Release 4.1 Last change: 8 August 1988 9 XFIG(1) USER COMMANDS XFIG(1) MIT (jtkohl@athena.mit.edu) Sun Release 4.1 Last change: 8 August 1988 10