SysTutorials

Man Pages › Section 1

xdvi(1)

NAME

xdvi – DVI Previewer for the X Window System

SYNOPSIS

xdvi [+[page]] [–help] [-allowshell] [-altfont font] [-anchorposition anchor] [-bg color] [-browser WWWbrowser] [-copy] [-cr color] [-debug bitmask|string[,string …]] [-display host:display] [-dvipspath path] [-editor command] [-expert] [-expertmode flag] [-fg color] [-findstring string] [-font font] [-fullscreen ] [-gamma g] [-geometry geometry] [-gsalpha] [-gspalette palette] [-h] [-help] [-hl color] [-hush] [-hushbell] [-hushchars] [-hushchecksums] [-hushstdout] [-icongeometry geometry] [-iconic] [-install] [-interpreter path] [-keep] [-l] [-license] [-linkcolor color] [-linkstyle 0|1|2|3] [-margins dimen] [-mfmode mode-def[:dpi]] [-mgs[n] size] [-mousemode 0|1|2] [-nocolor] [-nofork] [-noghostscript] [-nogrey] [-nogssafer] [-noinstall] [-nomakepk] [-nomatchinverted] [-noomega] [-noscan] [-notempfile] [-notype1fonts] [-noxi2scrolling] [-offsets dimen] [-p pixels] [-paper papertype] [-pause] [-pausespecial special-string] [-postscript flag] [-rulecolor color] [-rv] [-S density] [-s shrink] [-safer] [-sidemargin dimen] [-sourceposition line[:col][ ]filename] [-statusline] [-text-encoding encoding] [-thorough] [-topmargin dimen] [-unique] [-version] [-visitedlinkcolor color] [-warnspecials] [-watchfile secs] [-wheelunit pixels] [-xoffset dimen] [-yoffset dimen] [dvi_file]

DESCRIPTION

Xdvi is a program for previewing dvi files, as produced e.g. by the tex(1) program, under the X window system.

Xdvi can show the file shrunken by various integer factors, and it has a “magnifying glass” for viewing parts of the page enlarged (see the section MAGNIFIER below). This version of xdvi is also referred to as xdvik since it uses the kpathsea library to locate and generate font files. In addition to that, it supports the following features:

–

hyperlinks in DVI files (section HYPERLINKS),

–

direct rendering of PostScript<tm> Type 1 fonts (section TYPE 1 FONTS),

–

source specials in the DVI file (section SOURCE SPECIALS),

–

string search in DVI files (section STRING SEARCH),

–

saving or printing (parts of) the DVI file (sections PRINT DIALOG and SAVE DIALOG).

Xdvi can be compiled with the Motif toolkit or the Xaw (Athena) toolkit (and variants of it), and the Motif version has a slightly different GUI; these differences are noted below.

Before displaying a page of a DVI file, xdvi will check to see if the file has changed since the last time it was displayed. If this is the case, it will reload the file. This feature allows you to preview many versions of the same file while running xdvi only once. Since it cannot read partial DVI files, xdvik versions starting from 22.74.3 will create a temporary copy of the DVI file being viewed, to ensure that the file can be viewed without interruptions. (The -notempfile can be used to turn off this feature).

Xdvi can show PostScript<tm> specials by any of three methods. It will try first to use Display PostScript<tm>, 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.

If no file name has been specified on the command line, xdvi will try to open the most recently opened file; if the file history (accessible via the File > Open Recent menu) is empty, or if none of the files in the history are valid DVI files, it will pop up a file selector for choosing a file name. (In previous versions, which didn’t have a file history, the file selector was always used; you can set the X resource noFileArgUseHistory to false to get back the old behaviour.)

OPTIONS

In addition to specifying the dvi 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.

+page

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 escapes 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 automatically if the file name ends in .Z, .gz, or .bz2. Shell escapes are always turned off if the -safer option is used.

-altfont font

(.altFont) Declares a default font to use when the font in the dvi file cannot be found. This is useful, for example, with PostScript <tm> fonts.

-anchorposition anchor

Jump to anchor after opening the DVI file. This is only useful when invoking xdvi from other applications.

-background color

(.background) Determines the color of the background. Same as -bg.

-bg color

(.background) Determines the color of the background.

-browser browser

(.wwwBrowser) Defines the web browser used for handling external URLs. The value of this option or resource has the same syntax as the BROWSER environment variable; see the explanation of that variable in the section `ENVIRONMENT’ below for a detailed description. If neither the option nor the X resource wwwBrowser is specified, the environment variables BROWSER and WWWBROWSER (in that order) are used to determine the browser command. If these are not set either, the following default value is used: xdg-open %s:htmlview %s:firefox -remote -remote "openURL(%s,new-window)":mozilla -remote "openURL(%s,new-window)":netscape -raise -remote "openURL(%s,new-window)":xterm -e w3m %s:xterm -e lynx %s:xterm -e wget %s

-copy

(.copy) Always use the copy operation when writing characters to the display. This option may be necessary for correct operation on a color display, but overstrike characters will be incorrect. If greyscale anti-aliasing is in use, the -copy operation will disable the use of colorplanes and make overstrikes come out incorrectly. See also -thorough.

-cr color

(.cursorColor) Determines the color of the mouse cursor. The default is the same as the foreground color.

-debug bitmask|string[,string …]

(.debugLevel) If nonzero, prints additional information on standard output. The argument can be either a bitmask specified as a decimal number, or comma-separated list of strings.
For the bitmask representation, multiple values can be specified by adding the numbers that represent the individual bits; e.g. to debug all file searching and opening commands, use 4032 (= 2048 + 1024 + 512 + 256 + 128 + 64). Use -1 to turn on debugging of everything (this will produce huge output).
For the string representation, use the strings listed in the following table, with a comma to separate the values; e.g. to debug all file searching and opening commands, use search,expand,paths,hash,stat,open. (The option `kpathsea’ is provided as a shorthand for these.) Note that such a list may need to be quoted to prevent the shell from interpreting commas or spaces in the list.
The individual numbers and strings have the following meanings:

 1       bitmap      Bitmap creation
 2       dvi         DVI translation
 4       pk          PK fonts
 8       batch       Batch mode: Exit after
                     reading the DVI file
 16      event       Event handling
 32      ps          PostScript interpreter calls
 64      stat        Kpathsea stat(2) calls
 128     hash        Kpathsea hash table lookups
 256     open        Kpathsea file opening
 512     paths       Kpathsea path definitions
 1024    expand      Kpathsea path expansion
 2048    search      Kpathsea searching
 4032    kpathsea    All Kpathsea options
 4096    htex        Hypertex specials
 8192    src         Source specials
 16384   client      Client/server mode (see -unique
                     and -sourceposition options)
 32768   ft          FreeType library messages (Type 1 fonts)
 65536   ft_verbose  Verbose FreeType library messages (currently unused)
 131072  gui         GUI elements

Some of the Kpathsea debugging options are actually provided by Kpathsea; see the Debugging section in the Kpathsea manual for more information on these.

-density density

(.densityPercent) Determines the density used when shrinking bitmaps for fonts. A higher value produces a lighter font. The default value is 40. If greyscaling is in use, this argument does not apply; use -gamma instead. See also the `S‘ keystroke. Same as -S.

-display host:display

Specifies the host and screen to be used for displaying the dvi file. By default this is obtained from the environment variable DISPLAY.

-dvipspath path

(.dvipsPath) Use path as the dvips program to use when printing. The default for this is dvips. The program or script should read the DVI file from standard input, and write the PostScript file to standard output.

-editor editor

(.editor) Specifies the editor that will be invoked when the source-special() action is triggered to start a reverse search (by default via Ctrl-Mouse 1). The argument to this option is a format string in which occurrences of “%f” are replaced by the file name, occurrences of “%l” are replaced by the line number within the file, and optional occurrences of “%c” are replaced by the column number within the line.

If neither the option nor the X resource .editor is specified, the following environment variables are checked to determine the editor command: XEDITOR, VISUAL, and EDITOR (in this sequence). If the string is found as the value of the VISUAL or EDITOR environment variables, then “xterm -e ” is prepended to the string; if the editor is specified by other means, then it must be in the form of a shell command to pop up an X window with an editor in it. If none of these variables is set, a warning message is displayed and the command “xterm -e vi +%l %f” is used.

If no “%f” or “%l” occurs in the string, the missing format strings are appended automatically. (This is for compatibility with other programs when using one of the environment variables).

A new instance of the editor is started each time this command is used; therefore it is preferable to use an editor that can be invoked in `client’ mode to load new files into the same instance. Example settings are:

emacsclient –no-wait

(older Emacsen)

gnuclient -q

(XEmacs and newer Emacsen)

gvim –servername

(VIM v6.0+; the `–servername xdvi’ option will cause gvim to run a dedicated instance for the files opened by xdvi.)

nc

(nedit)

Note that those strings need to be enclosed into quotes when using them on the command-line to protect them from the shell; when using them as argument for the .editor resource in an X resource file, no quotes should be used.

NOTE ON SECURITY: The argument of this option isn’t executed as a shell command, but via exec() to prevent evil tricks with the contents of source specials.

-expert

This option is only supported for backwards compatibility; it is equivalent to -expertmode 0, which should be preferred.

-expertmode flag

(.expertMode) With an argument of 0, this option switches off the display of the buttons, scrollbars, the toolbar (Motif only), the statusline and the page list. These GUI elements can also be (de)activated separately, by combining the appropriate values in the flag argument. This acts similar to the -debug option: The integer flag is treated as a bitmap where each bit represents one element. If the bit has the value 1, the element is switched on, if it has the value 0, the element is switched off. The meaning of the bits is as follows:

 1       statusline
 2       scrollbars
 4       Motif: pagelist, Xaw: buttons and pagelist
 8       toolbar (Motif only)
 16      menubar (Motif only)

For example, to turn on only the statusline and the scrollbars, use 3 (= 1 + 2). See also the `x‘ keystroke, where the bits are addressed by their positions, from 1 to 3 (Xaw) or 5 (Motif), respectively.

If the statusline is not active, all messages that would normally be printed to the statusline will be printed to stdout, unless the -hushstdout option is used.

-fg color

(.foreground) Determines the color of the text (foreground).

-findstring string

This option triggers a search for string in the DVI file mentioned on the command-line, similar to forward search (see the description of the sourceposition option): If there is already another instance of xdvi running on the displaying that DVI file, it will cause that instance to perform the search instead. The search starts at the top of the current page of the DVI file.

-font font

(*font) Sets the font used in menus, buttons etc., as described in the X(7x) man page. The font for child windows can be set separately, e.g.:

xdvi*statusline*font: \
   -*-helvetica-medium-r-*-*-12-*-*-*-*-*-*-*
-foreground color

Same as -fg.

-fullscreen

When this option is used, xdvi will (try to) run in fullscreen mode, with no window decorations. This option is not guaranteed to work with all windowmanagers/desktops; if you’re experiencing problems with it, please use the -geometry option instead, and a suitable window manager setting to remove the window decorations. When using this option for presentations, you might want to get rid of all the control widgets as well, using the -expertmode option. This option can also be toggled at runtime using the fullscreen action (by default bound to Ctrl-l).

-gamma gamma

(.gamma) Controls the interpolation of colors in the greyscale anti-aliasing color palette. Default value is 1.0. For 0 < gamma < 1, the fonts will be lighter (more like the background), and for gamma > 1, the fonts will be darker (more like the foreground). Negative values behave the same way, but use a slightly different algorithm. For color and grayscale displays; for monochrome, see -density. See also the `S‘ keystroke.

-geometry geometry

(.geometry) Specifies the initial geometry of the main window, as described in the X(7x) man page. The geometry of child windows can be set separately, e.g.:
xdvi*helpwindow.geometry: 600×800

-gsalpha

(.gsAlpha) Causes Ghostscript to be called with the x11alpha driver instead of the x11 driver. The x11alpha driver enables anti-aliasing in PostScript specials, for a nicer appearance. It is available on newer versions of Ghostscript. This option can also be toggled with the `V‘ keystroke.

-gspalette palette

(.palette) Specifies the palette to be used when using Ghostscript for rendering PostScript specials. Possible values are Color, Greyscale, and Monochrome. The default is Color.

-h, -help, –help

Prints a short help text with an overview of the command-line options to standard output.

-hl color

(.highlight) Determines the color of the page border, of the ruler in `ruler mode’, and of the highlighting markers in forward search and string search. The default is the foreground color.

-hush

(.Hush) Causes xdvi to suppress all suppressible warnings.

-hushbell

(.hushBell) Don’t sound the X bell when an error occurs.

-hushchars

(.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 dvi file and the font file.

-hushstdout

(.hushStdout) Suppresses printing of status messages to stdout. Note that errors or warnings will still be printed to stderr even if this option is used.

-icongeometry geometry

(.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.

-install

(.install) If xdvi is running under a PseudoColor visual, then (by default) it will check for TrueColor visuals with more bits per pixel, and switch to such a visual if one exists. If no such visual exists, it will use the current visual and colormap. If -install is selected, however, it will still use a TrueColor visual with a greater depth, if one is available; otherwise, it will install its own colormap on the current visual. If the current visual is not PseudoColor, then xdvi will not switch the visual or colormap, regardless of its options. The default value of the install resource is the special value, maybe. There is no +install option. See also -noinstall, and the GREYSCALING AND COLORMAPS section.

-interpreter filename

(.interpreter) Use filename as the Ghostscript interpreter. 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. This flag is honored by all page switching actions and by up-or-previous() / down-or-next(), although the latter only honor the horizontal position, not the vertical one. This allows for a "continuous" scrolling back an forth through a document with a display window narrower than a page width.

-l

(.listFonts) List the names of all fonts used.

-license

Prints licensing information.

-linkcolor

(.linkColor) Color used for unvisited hyperlinks (`Blue2′ by default). Hyperlinks are unvisited before you click on them, or after the DVI file has been reloaded. The value should be either a valid X color name (such as DarkGoldenrod4) or a hexadecimal color string (such as #8b6508). See also -visitedlinkcolor and -linkstyle.

-linkstyle

(.LinkStyle) Determines the style in which hyperlinks are displayed. Possible values and their meanings are:

 0       No highlighting of links
 1       Underline links with link color
 2       No underlining, color text with link color
 3       Underline and display text colored with
         link color

The values for link color are specified by the options/resources -linkcolor and -visitedlinkcolor (which see).

-margins dimen

(.Margin) Specifies the size of both the top margin and side margin. This determines the “home” position of the page within the window as follows. 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. The dimension should be a decimal number optionally followed by any of the two-letter abbreviations for units accepted by TeX (pt, pc, in, bp, cm, mm, dd, cc, or sp). By default, the unit will be cm (centimeters). See also -sidemargin, -topmargin, and the keystroke `M.’

-mfmode mode-def

(.mfMode) Specifies a mode-def string, which can be used in searching for fonts (see ENVIRONMENT, below). Generally, when changing the mode-def, it is also necessary to change the font size to the appropriate value for that mode. This is done by adding a colon and the value in dots per inch; for example, -mfmode ljfour:600. This method overrides any value given by the pixelsPerInch resource or the -p command-line argument. The metafont mode is also passed to metafont during automatic creation of fonts. By default, it is unspecified.

-mgs size

Same as -mgs1.

-mgs[n] size

(.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 widthxheight. See the MOUSE ACTIONS section. Defaults are 200×150, 400×250, 700×500, 1000×800, and 1200×1200.

-mousemode [0|1|2]

(.mouseMode) Specifies the default mode of xdvi at startup: Magnifier (0), Text Selection Mode (1) or Ruler Mode (2). See the section MODES, below, for more information.

-nocolor

(.color) Turns off the use of color specials. This option can be toggled with the `C‘ keystroke. (Note: -nocolor corresponds to color:off; +nocolor to color:on.)

-nofork

(.fork) With the -sourceposition and -unique options, the default behavior is for xdvi to put itself into the background (like a daemon) if there is no appropriate instance of xdvi already running. This argument makes it run in the foreground instead. This is useful for debugging, or if your client application cannot deal well with a program self-backgrounding itself in this way — e.g. the IPC functions in emacs are known to have problems with this. If no -sourceposition or -unique argument is given, then this option has no effect. (Note: -nofork corresponds to fork:off; +nofork to fork:on.)

-noghostscript

(.ghostscript) Inhibits the use of Ghostscript for displaying PostScript<tm> specials. (Note: -noghostscript corresponds to ghostscript:off; +noghostscript to ghostscript:on.)

-nogrey

(.grey) Turns off the use of greyscale anti-aliasing when printing shrunken bitmaps. (Note: -nogrey 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. (Note: -nogssafer corresponds to gsSafer:off; +nogssafer to gsSafer:on.)

-noinstall

(.install) Inhibit the default behavior of switching to a TrueColor visual if one is available with more bits per pixel than the current visual. (Note: -noinstall corresponds install:off; there is no +noinstall option.) See also -install, and the GREYSCALING AND COLORMAPS section.

-nomakepk

(.makePk) Turns off automatic generation of font files that cannot be found by other means. (Note: -nomakepk corresponds to makePk:off; +nomakepk to makePK:on.)

-nomatchinverted

(.matchInverted) Don’t highlight string search matches in inverted color; instead, draw a rectangle in highlight color (see the -hl option) around the match. This option is activated automatically if the display isn’t running in TrueColor. (Note: -nomatchinverted corresponds to matchInverted:off; +nomatchinverted to matchInverted:on.)

-noomega

(.omega) This will disable the use of Omega extensions when interpreting DVI files. By default, the additional opcodes 129 and 134 are recognized by xdvi as Omega extensions and interpreted as requests to set 2-byte characters. The only drawback is that the virtual font array will require 65536 positions instead of the default 256 positions, i.e. the memory requirements of xdvi will be slightly larger. If you find this unacceptable or encounter another problem with the Omega extensions, you can switch this extension off by using -noomega (but please do send a bug report if you find such problems – see the bug address in the AUTHORS section below).
(Note: -noomega corresponds to omega: off; +noomega to omega: on.)

-noscan

(.prescan) By default, xdvi does a preliminary scan of the dvi file to process any papersize specials; this is especially important at startup since the paper size may be needed to determine the window size. If PostScript<tm> is in use, then prescanning is also necessary in order to properly process header files. In addition, prescanning is needed to correctly determine the background color of a page. This option turns off such prescanning. (Prescanning will be automatically be turned back on if xdvi detects any of the specials mentioned above.) (Note: -noscan corresponds to prescan:off; +noscan to prescan:on.)

-notempfile

(.tempFile) As mentioned in the section DESCRIPTION above, xdvi will create a temporary copy of the DVI file so that it can be accessed without interruptions even while the file is being rewritten by TeX. Since this introduces the overhead of copying the file every time it has changed, the -notempfile allows you to turn off this behaviour. In this case, exposing parts of the window while the DVI file is being written by TeX will erase the current window contents until the DVI file can be completely reread.
(Note: -notempfile corresponds to tempFile:off; +notempfile to tempFile:on.)

-notype1fonts

(.type1) This will disable the use of the FreeType library to display PostScript<tm> Type 1 fonts. Use this option as a workaround when you encounter problems with the display of Type 1 fonts (but please don’t forget to send a bug report in this case, to the URL mentioned in the section AUTHORS below).
(Note: -notype1fonts corresponds to type1:off; +notype1fonts to type1:on.)

-noxi2scrolling

(.xi2Scrolling) This will disable the use of high-resolution scrolling using the XInput 2.1 features of the X Server. When enabled, horizontal and vertical scrolling is done in smaller increments than would correspond to a single click of a mouse wheel. This is only available for hardware that supports the feature, generally touchpads. It is not available for traditional wheel mice. If suitable hardware is not present or if the X server does not support XInput 2.1 or higher, then the high-resolution scrolling feature is turned off and has no effect.
(Note: -noxi2scrolling corresponds to xi2Scrolling:off; +noxi2scrolling, to xi2Scrolling:on.)

-offsets dimen

(.Offset) Specifies the size of both the horizontal and vertical offsets of the output on the page. 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 default offsets are 1.0 inch. The argument dimen should be a decimal number optionally followed by any of the two-letter abbreviations for units accepted by TeX (pt, pc, in, bp, cm, mm, dd, cc, or sp). By default, the unit will be cm (centimeters). See also -xoffset and -yoffset.

-p pixels

(.pixelsPerInch) Defines the size of the fonts to use, in pixels per inch. The default value is 600. This option is provided only for backwards compatibility; the preferred way is to set both the resolution and the Metafont mode via the -mfmode option (which see).

-paper papertype

(.paper) Specifies the size of the printed page. Note that in most cases it’s best to specify the paper size in the TeX input file via the line