XDVIK(1) User Commands XDVIK(1) NAME xdvi - DVI Previewer for the X Window System SYNOPSIS xdvi [+[_p_a_g_e]] [-s _s_h_r_i_n_k] [-S _d_e_n_s_i_t_y] [-nogrey] [-gamma _g] [-p _p_i_x_e_l_s] [-margins _d_i_m_e_n] [-sidemargin _d_i_m_e_n] [-topmargin _d_i_m_e_n] [-offsets _d_i_m_e_n] [-xoffset _d_i_m_e_n] [-yoffset _d_i_m_e_n] [- paper _p_a_p_e_r_t_y_p_e] [-altfont _f_o_n_t] [-nomakepk] [-mfmode _m_o_d_e- _d_e_f] [-l] [-rv] [-expert] [ - mgs[_n] _s_i_z_e] [ - hush] [ - hushspecials] [ - hushchars] [-hushchecksums] [-safer] [-fg _c_o_l_o_r] [-bg _c_o_l_o_r] [-hl _c_o_l_o_r] [-bd _c_o_l_o_r] [-cr _c_o_l_o_r] [- bw _w_i_d_t_h] [ - grid1 _c_o_l_o_r] [-grid2 _c_o_l_o_r] [-grid3 _c_o_l_o_r] [-bw _w_i_d_t_h] [-display _h_o_s_t:_d_i_s_p_l_a_y] [ - geometry _g_e_o_m_e_t_r_y] [ - icongeometry _g_e_o_m_e_t_r_y] [ - iconic] [-font _f_o_n_t] [-keep] [- copy] [-thorough] [-nopostscript] [-noscan] [-allowshell] [- noghostscript] [-interpreter _p_a_t_h] [-nogssafer] [-gspalette _p_a_l_e_t_t_e] [-underlink] [-browser _W_W_W_b_r_o_w_s_e_r] [-base _b_a_s_e _U_R_L] [-debug _b_i_t_m_a_s_k] [-version] [_d_v_i__f_i_l_e] DESCRIPTION xdvi is a program which runs under the X window system. It is used to preview _d_v_i files, such as are produced by tex(1). This program has the capability of showing the file shrunken by various (integer) factors, and also has a ``magnifying glass'' which allows one to see a small part of the unshrunk image momentarily. Before displaying any page or part thereof, it checks to see if the _d_v_i file has changed since the last time it was displayed. If this is the case, then xdvi will reinitialize itself for the new _d_v_i file. For this reason, exposing parts of the xdvi window while TeX is running should be avoided. This feature allows you to preview many versions of the same file while running xdvi only once. In addition to using keystrokes to move within the file, xdvi provides buttons on the right side of the window, which are synonymous with various sequences of keystrokes. xdvi can show PostScript specials by any of three methods. It will try first to use Display PostScript, then NeWS, then it will try to use Ghostscript to render the images. All of these options depend on additional software to work properly; moreover, some of them may not be compiled into this copy of xdvi. For performance reasons, xdvi does not render PostScript specials in the magnifying glass. X Version 11 Last change: 6 February 1997 1 XDVIK(1) User Commands XDVIK(1) If _d_v_i__f_i_l_e is not specified, a file-selection widget is popped up for you to choose the dvi file from. OPTIONS In addition to specifying the _d_v_i file (with or without the .dvi extension), xdvi supports the following command line options. If the option begins with a `+' instead of a `- ', the option is restored to its default value. By default, these options can be set via the resource names given in parentheses in the description of each option. +_p_a_g_e Specifies the first page to show. If + is given without a number, the last page is assumed; the first page is the default. -allowshell (.allowShell) This option enables the shell escape in PostScript specials. (For security reasons, shell es- capes are disabled by default.) This option should be rarely used; in particular it should not be used just to uncompress files: that function is done automatical- ly if the file name ends in .Z or .gz. Shell escapes are always turned off if the -safer option is used. -altfont _f_o_n_t (.altFont) Declares a default font to use when the font in the _d_v_i file cannot be found. This is useful, for example, with PostScript fonts. -background _c_o_l_o_r (.background) Determines the color of the background. Same as -bg. -base _b_a_s_e _U_R_L (.urlBase) Sets the base URL value that external links given in the dvi file are assumed relative to - normal- ly this should be the URL of the document itself (?). -bd _c_o_l_o_r (.borderColor) Determines the color of the window bord- er. -bg _c_o_l_o_r (.background) Determines the color of the background. -bordercolor _c_o_l_o_r Same as -bd. -borderwidth _w_i_d_t_h (.borderWidth) Specifies the width of the border of the window. Same as -bw. X Version 11 Last change: 6 February 1997 2 XDVIK(1) User Commands XDVIK(1) -browser _W_W_W_b_r_o_w_s_e_r (.wwwBrowser) Defines the World Wide Web browser to be used to handle external URL's, for example mosaic. If neither the command-line option nor the X resource are set, uses the environment variable WWWBROWSER. -bw _w_i_d_t_h (.borderWidth) Specifies the width of the border of the window. -copy (.copy) Always use the _c_o_p_y operation when writing characters to the display. This option may be neces- sary for correct operation on a color display, but overstrike characters will be incorrect. If greyscale anti-aliasing is in use, the -copy operation will dis- able the use of colorplanes and make overstrikes come out incorrectly. See also -thorough. -cr _c_o_l_o_r (.cursorColor) Determines the color of the cursor. The default is the color of the page border. -debug _b_i_t_m_a_s_k (.debugLevel) If nonzero, prints additional information on standard output. The number is taken as a set of independent bits. The meaning of each bit follows. 1=bitmaps; 2=dvi translation; 4=pk reading; 8=batch operation; 16=events; 32=file opening; 64=PostScript communication; 128=Kpathsea stat(2) calls; 256=Kpathsea hash table lookups; 512=Kpathsea path definitions; 1024=Kpathsea path expansion; 2048=Kpathsea searches. To trace everything having to do with file searching and opening, use 4000. Some of these debugging options are actually provided by Kpathsea. See the Debugging section in the Kpathsea manual. -density _d_e_n_s_i_t_y (.densityPercent) Determines the density used when shrinking bitmaps for fonts. A higher value produces a lighter font. The default value is 40. For monochrome displays; for color displays, use -gamma. See also the S keystroke. Same as -S. -display _h_o_s_t:_d_i_s_p_l_a_y Specifies the host and screen to be used for displaying the _d_v_i file. By default this is obtained from the en- vironment variable DISPLAY. -expert (.expert) Prevent the buttons from appearing. See also the `x' keystroke. X Version 11 Last change: 6 February 1997 3 XDVIK(1) User Commands XDVIK(1) -fg _c_o_l_o_r (.foreground) Determines the color of the text (fore- ground). -foreground _c_o_l_o_r Same as -fg. -font _f_o_n_t (*font) Sets the font for use in the buttons. -gamma _g_a_m_m_a (.gamma) Controls the interpolation of colors in the greyscale anti-aliasing color palette. Default value is 1.0. For 0 < _g_a_m_m_a < 1, the fonts will be lighter (more like the background), and for _g_a_m_m_a > 1, the fonts will be darker (more like the foreground). Nega- tive values behave the same way, but use a slightly different algorithm. For color and grayscale displays; for monochrome, see -density. See also the S keys- troke. -grid1 _c_o_l_o_r (.grid1Color) Determines the color of level 1 grid (de- fault as foreground) -grid2 _c_o_l_o_r (.grid2Color) Determines the color of level 2 grid (de- fault as foreground) -grid3 _c_o_l_o_r (.grid3Color) Determines the color of level 3 grid (de- fault as foreground) -geometry _g_e_o_m_e_t_r_y (*geometry) Specifies the initial geometry of the win- dow. -gspalette _p_a_l_e_t_t_e (.palette) Specifies the palette to be used when using Ghostscript for rendering PostScript specials. Possi- ble values are Color, Greyscale, and Monochrome. The default is Color. -hl _c_o_l_o_r (.highlight) Determines the color of the page border. The default is the foreground color. -hush (.Hush) Causes xdvi to suppress all suppressible warn- ings. -hushchars X Version 11 Last change: 6 February 1997 4 XDVIK(1) User Commands XDVIK(1) (.hushLostChars) Causes xdvi to suppress warnings about references to characters which are not defined in the font. -hushchecksums (.hushChecksums) Causes xdvi to suppress warnings about checksum mismatches between the _d_v_i file and the font file. -hushspecials (.hushSpecials) Causes xdvi to suppress warnings about \special strings that it cannot process. -icongeometry _g_e_o_m_e_t_r_y (.iconGeometry) Specifies the initial position for the icon. -iconic (.iconic) Causes the xdvi window to start in the iconic state. The default is to start with the window open. -interpreter _f_i_l_e_n_a_m_e (.interpreter) Use _f_i_l_e_n_a_m_e as the Ghostscript inter- preter. By default it uses gs. -keep (.keepPosition) Sets a flag to indicate that xdvi should not move to the home position when moving to a new page. See also the `k' keystroke. -l (.listFonts) Causes the names of the fonts used to be listed. -margins _d_i_m_e_n (.Margin) Specifies the size of both the top margin and side margin. This should be a decimal number optional- ly followed by ``cm'', _e._g., 1.5 or 3cm, giving a meas- urement in inches or centimeters. It determines the ``home'' position of the page within the window as fol- lows. If the entire page fits in the window, then the margin settings are ignored. If, even after removing the margins from the left, right, top, and bottom, the page still cannot fit in the window, then the page is put in the window such that the top and left margins are hidden, and presumably the upper left-hand corner of the text on the page will be in the upper left-hand corner of the window. Otherwise, the text is centered in the window. See also -sidemargin, -topmargin, and the keystroke `M.' -mfmode _m_o_d_e-_d_e_f (.mfMode) Specifies a _m_o_d_e-_d_e_f string, which can be X Version 11 Last change: 6 February 1997 5 XDVIK(1) User Commands XDVIK(1) used in searching for fonts (see ENVIRONMENT, below). It is also passed to metafont during automatic creation of fonts. -mgs _s_i_z_e Same as -mgs1. -mgs[_n] _s_i_z_e (.magnifierSize[_n]) Specifies the size of the window to be used for the ``magnifying glass'' for Button _n. The size may be given as an integer (indicating that the magnifying glass is to be square), or it may be given in the form _w_i_d_t_hx_h_e_i_g_h_t. See the MOUSE ACTIONS sec- tion. Defaults are 200x150, 400x250, 700x500, 1000x800, and 1200x1200. -noghostscript (.ghostscript) Inhibits the use of Ghostscript for displaying PostScript specials. (For this option, the logic of the corresponding resource is reversed: - noghostscript corresponds to ghostscript:off; +noghostscript to ghostscript:on.) -nogrey (.grey) Turns off the use of greyscale anti-aliasing when printing shrunken bitmaps. (For this option, the logic of the corresponding resource is reversed: - no- grey corresponds to grey:off; +nogrey to grey:on.) See also the `G' keystroke. -nogssafer (.gsSafer) Normally, if Ghostscript is used to render PostScript specials, the Ghostscript interpreter is run with the option -dSAFER. The - nogssafer option runs Ghostscript without - dSAFER. The -dSAFER option in Ghostscript disables PostScript operators such as deletefile, to prevent possibly malicious PostScript programs from having any effect. If the -safer option is specified, then this option has no effect; in that case Ghostscript is always run with -dSAFER. (For the - nogssafer option, the logic of the corresponding resource is reversed: - nogssafer corresponds to gsSafer:off; +nogssafer to gsSafer:on.) -nomakepk (.makePk) Turns off automatic generation of font files that cannot be found by other means. (For this option, the logic of the corresponding resource is reversed: - nomakepk corresponds to makePk:off; +nomakepk to makePK:on.) -nopostscript X Version 11 Last change: 6 February 1997 6 XDVIK(1) User Commands XDVIK(1) (.postscript) Turns off rendering of PostScript specials. Bounding boxes, if known, will be displayed instead. This option can also be toggled with the `v' keystroke. (For this option, the logic of the corresponding resource is reversed: - nopostscript corresponds to postscript:off; +postscript to postscript:on.) -noscan (.prescan) Normally, when PostScript is turned on, xdvi will do a preliminary scan of the _d_v_i file, in order to send any necessary header files before sending the PostScript code that requires them. This option turns off such prescanning. (It will be automatically be turned back on if xdvi detects any specials that re- quire headers.) (For the -noscan option, the logic of the corresponding resource is reversed: - noscan corresponds to prescan:off; +noscan to prescan:on.) -offsets _d_i_m_e_n (.Offset) Specifies the size of both the horizontal and vertical offsets of the output on the page. This should be a decimal number optionally followed by ``cm'', _e._g., 1.5 or 3cm, giving a measurement in inches or centimeters. By decree of the Stanford TeX Project, the default TeX page origin is always 1 inch over and down from the top-left page corner, even when non-American paper sizes are used. Therefore, the de- fault offsets are 1.0 inch. See also - xoffset and - yoffset. -p _p_i_x_e_l_s (.pixelsPerInch) Defines the size of the fonts to use, in pixels per inch. The default value is 300. -paper _p_a_p_e_r_t_y_p_e (.paper) Specifies the size of the printed page. This may be of the form _w_i_d_t_hx_h_e_i_g_h_t (or _w_i_d_t_hx_h_e_i_g_h_tcm), where _w_i_d_t_h is the width in inches (or cm) and _h_e_i_g_h_t is the height in inches (or cm), respectively. There are also synonyms which may be used: us (8.5x11), usr (11x8.5), legal (8.5x14), foolscap (13.5x17), as well as the ISO sizes a1-a7, b1-b7, c1-c7, a1r-a7r (a1-a7 rotated), etc. The default size is 8.5 x 11 inches. -rv (.reverseVideo) Causes the page to be displayed with white characters on a black background, instead of vice versa. -s _s_h_r_i_n_k (.shrinkFactor) Defines the initial shrink factor. The default value is 3. X Version 11 Last change: 6 February 1997 7 XDVIK(1) User Commands XDVIK(1) -S _d_e_n_s_i_t_y (.densityPercent) Same as -density, q.v. -safer (.safer) This option turns on all available security options; it is designed for use when xdvi is called by a browser that obtains a _d_v_i or TeX file from another site. In the present case, this option selects +nogssafer and +allowshell. -sidemargin _d_i_m_e_n (.sideMargin) Specifies the side margin (see -margins). -thorough (.thorough) xdvi will usually try to ensure that over- strike characters (_e._g., \notin) are printed correctly. On monochrome displays, this is always possible with one logical operation, either _a_n_d or _o_r. On color displays, however, this may take two operations, one to set the appropriate bits and one to clear other bits. If this is the case, then by default xdvi will instead use the _c_o_p_y operation, which does not handle over- striking correctly. The -thorough option chooses the slower but more correct choice. See also -copy. -topmargin _d_i_m_e_n (.topMargin) Specifies the top and bottom margins (see -margins). -underlink (.underLink) Underline links. Default is true. -version Print information on the version of xdvi. -xoffset _d_i_m_e_n (.xOffset) Specifies the size of the horizontal offset of the output on the page. See -offsets. -yoffset _d_i_m_e_n (.yOffset) Specifies the size of the vertical offset of the output on the page. See -offsets. KEYSTROKES xdvi recognizes the following keystrokes when typed in its window. Each may optionally be preceded by a (positive or negative) number, whose interpretation will depend on the particular keystroke. Also, the ``Help'', ``Home'', ``Pri- or'', ``Next'', and arrow cursor keys are synonyms for `?', `^', `b', `f', `l', `r', `u', and `d' keys, respectively. q Quits the program. Control-C and control-D will do X Version 11 Last change: 6 February 1997 8 XDVIK(1) User Commands XDVIK(1) this, too. Q Quits the program with exit status 2. n Moves to the next page (or to the _nth next page if a number is given). Synonyms are `f', Space, Return, and Line Feed. p Moves to the previous page (or back _n pages). Synonyms are `b', control-H, and Delete. g Moves to the page with the given number. Initially, the first page is assumed to be page number 1, but this can be changed with the `P' keystroke, below. If no page number is given, then it goes to the last page. P ``This is page number _n.'' This can be used to make the `g' keystroke refer to actual page numbers instead of absolute page numbers. Control-L Redisplays the current page. ^ Move to the ``home'' position of the page. This is normally the upper left-hand corner of the page, depending on the margins as described in the - margins option, above. u Moves up two thirds of a window-full. d Moves down two thirds of a window-full. l Moves left two thirds of a window-full. r Moves right two thirds of a window-full. c Moves the page so that the point currently beneath the cursor is moved to the middle of the window. It also (gasp!) warps the cursor to the same place. M Sets the margins so that the point currently under the cursor is the upper left-hand corner of the text in the page. Note that this command itself does not move the image at all. For details on how the margins are used, see the -margins option. s Changes the shrink factor to the given number. If no number is given, the smallest factor that makes the en- tire page fit in the window will be used. (Margins are ignored in this computation.) S Sets the density factor to be used when shrinking bit- X Version 11 Last change: 6 February 1997 9 XDVIK(1) User Commands XDVIK(1) maps. This should be a number between 0 and 100; higher numbers produce lighter characters. If greyscaling mode is in effect, this changes the value of gamma in- stead. The new value of gamma is the given number di- vided by 100; negative values are allowed. t Toggles to the next unit in a sorted list of TeX dimen- sion units for the popup magnifier ruler. R Forces the _d_v_i file to be reread. This allows you to preview many versions of the same file while running xdvi only once. k Normally when xdvi switches pages, it moves to the home position as well. The `k' keystroke toggles a `keep- position' flag which, when set, will keep the same po- sition when moving between pages. Also `0k' and `1k' clear and set this flag, respectively. See also the - keep option. x Toggles expert mode (in which the buttons do not ap- pear). Also `0x' and `1x' clear and reset this mode, respectively. See also the -expert option. G This key toggles the use of greyscale anti-aliasing for displaying shrunken bitmaps. In addition, the key se- quences `0G' and `1G' clear and set this flag, respec- tively. See also the -nogrey option. D This key toggles the use of grid over the document. If no number is given, the grid mode toggles. By prepend- ing number, 3 grid levels can be set. The grid in each level is drawn in the colour specified. See also the - grid1, -grid2, and -grid3 option. If given a numeric arg that is not 0 or 1, greyscale anti- aliasing is turned on, and the gamma resource is set to the value divided by 100. E.g., `150G' turns on greyscale and sets gamma to 1.5. v This key toggles the rendering of PostScript spe- cials. If rendering is turned off, then bounding boxes are displayed when available. In addition the key se- quences `0v' and `1v' clear and set this flag, respec- tively. See also the -nopostscript option. F Read a new DVI file. A file-selection widget is popped up for you to choose the dvi file from. MOUSE ACTIONS If the shrink factor is set to any number other than one, X Version 11 Last change: 6 February 1997 10 XDVIK(1) User Commands XDVIK(1) then clicking mouse button 3 will pop up a ``magnifying glass'' which shows the unshrunk image in the vicinity of the mouse click. This subwindow disappears when the mouse button is released. Different mouse buttons produce dif- ferent sized windows, as indicated by the -mgs option. Mov- ing the cursor while holding the button down will move the magnifying glass. Also, the scrollbars (if present) behave in the standard way: pushing Button 2 in a scrollbar moves the top or left edge of the scrollbar to that point and optionally drags it; pushing Button 1 moves the image up or right by an amount equal to the distance from the button press to the upper left-hand corner of the window; pushing Button 3 moves the image down or left by the same amount. If hypertext support is included in xdvi (via libwww), But- ton 3 still acts as a magnifying glass, but Button 1 jumps to a hyperlink target in the current window, while Button 2 opens a new window on the target. If the cursor is not on a link (underlined by default), all buttons act as magnifying glasses. More precisely, for internal links, Button 1 jumps in the same window to the link, while Button 2 starts up a new xdvi on the link. For external links to DVI files, Button 1 changes the current xdvi to be reading that file, while But- ton 2 starts a new xdvi on that file. For other known files, mime.types and mailcap are searched for a parsed to determine the viewer; finally, if no suitable mailcap entry was found, if the WWWBROWSER environment variable is set, or -browser was specified on the command line, it is started up on the file. SIGNALS When xdvi receives a SIGUSR1 signal, it rereads the _d_v_i file. ENVIRONMENT The environment variable DISPLAY specifies which bit map display terminal to use. For compatibility with TeX, you may also use TEXFONTS in place of XDVIFONTS, although in that case the variable should not include any ``%'' specifiers. The reason for recognizing TEXFONTS is that certain versions of TeX also support the convention regarding an extra colon in the font path; therefore, users who create their own fonts can put both their ._t_f_m and raster files in the same directory and do ``setenv TEXFONTS :MFdir'' or ``setenv TEXFONTS MFdir:'' in order to get both TeX and xdvi to search their directory in addition to the system standard directories. The XDVI- X Version 11 Last change: 6 February 1997 11 XDVIK(1) User Commands XDVIK(1) FONTS variable overrides the TEXFONTS variable, so that on those sites where TEXFONTS must be set explicitly, and therefore this feature is not useful, the XDVIFONTS variable may be set to an empty string (_i._e., ``setenv XDVIFONTS'') to cause xdvi to ignore TEXFONTS. xdvi also recognizes the PKFONTS and TEXPKS variables, which are checked after XDVIFONTS but before TEXFONTS. Missing fonts are created by invoking MakeTeXPK unless font generation has been prohibited by a command-line option. The XDVISIZES environment variable may consist of a list of resolutions separated by colons, expressed in integer dots per inch. If a font cannot be found or made at its stated size, these sizes are tried as a fallback. See the `Fall- back font' section in the Kpathsea manual for more details. xdvi tries the actual size of the font before trying any of the given sizes. Virtual fonts are also supported, although xdvi does not have any built-in fonts to which they can refer. The search path for .vf files can be specified with the environment variable XDVIVFS in a similar manner to that for the XDVI- FONTS variable. xdvi will also check the VFFONTS variable if the XDVIFONTS variable is not set. Virtual fonts are searched for immediately after looking for the font as a normal font in the exact size specified. xdvi can display PostScript files included in the dvi file. Such files are first searched in the directory where the dvi file is and then using normal Kpathsea rules. There is an exception to this: if the file name begins with a backtick (`), then the following characters give a shell command (often zcat) which is executed; its standard output is then sent to be interpreted as PostScript. Note that there is some potential for security problems here; see the -allow- shell command-line option. It is better to use compressed files directly (see below). If a file name is given (as opposed to a shell command), if that file name ends in .Z or .gz, and if the first two bytes of the file indicate that it was compressed with compress(1) or gzip(1), respectively, then the file is first un- compressed with uncompress -c or gunzip - c, respectively. This is preferred over using a backtick to call the command directly, since you do not have to specify - allowshell and since it allows for path searching. Xdvik uses the same environment variables and algorithms for finding font files as TeX and friends. See the documenta- tion for the Kpathsea library for details. (Repeating it X Version 11 Last change: 6 February 1997 12 XDVIK(1) User Commands XDVIK(1) here is too cumbersome.) KPATHSEA_DEBUG: Trace Kpathsea lookups; set to -1 for com- plete tracing. MIMELIBDIR: Environment variable/config file value for find- ing the mime.types file, if ~/.mime-types does not exist MAILCAPDIR: Just as with MIMELIBDIR, but for .mailcap. WWWBROWSER: The browser used to open URL's, if neither the -browser option nor the .wwwBrowser resource are set. For more information on the hyper-TeX support, see the `Hyper- text' node in the Dvipsk manual. LIMITATIONS xdvi accepts many but not all types of PostScript specials accepted by dvips. It does accept most specials generated by epsf and psfig, for example. It does not, however, sup- port bop-hook, nor does it do the ``NEAT'' or rotated ``A'' example in the dvips manual. These restrictions are due to the design of xdvi; in all likelihood they will always remain. LaTeX2e color and rotation specials are not currently sup- ported. SEE ALSO X(1), dvips(1). AUTHORS Eric Cooper, CMU, did a version for direct output to a QVSS. Modified for X by Bob Scheifler, MIT Laboratory for Computer Science. Modified for X11 by Mark Eichin, MIT SIPB. Addi- tional enhancements by many others. The current maintainer of the original xdvi is Paul Vojta; the maintainer of the xdvik variant is kb@mail.tug.org. X Version 11 Last change: 6 February 1997 13