Manpages

Manpage of XDVI

XDVI

Section: User Commands (1)
Updated: 15 October 2001
Index
Return to Main Contents
 

NAME

xdvi - DVI Previewer for the X Window System  

SYNOPSIS

xdvi [+[page]] [-s shrink] [-S density] [-nogrey] [-gamma g] [-install] [-noinstall] [-p pixels] [-margins dimen] [-sidemargin dimen] [-topmargin dimen] [-offsets dimen] [-xoffset dimen] [-yoffset dimen] [-paper papertype] [-altfont font] [-nomakepk] -mfmode mode-def[:dpi] [-editor command] [-sourceposition line[:col][ ]filename] [-l] [-rv] [-expert] [-[no]statusline] [-shrinkbuttonn shrink] [-mgs[n] size] [-warnspecials] [-hush] [-hushchars] [-hushchecksums] [-hushspecials] [-hushstdout] [-safer] [-fg color] [-bg color] [-hl color] [-bd color] [-cr color] [-bw width] [-grid1 color] [-grid2 color] [-grid3 color] [-bw width] [-display host:display] [-geometry geometry] [-icongeometry geometry] [-iconic] [-font font] [-keep] [-copy] [-thorough] [-wheelunit pixels] [-nopostscript] [-noscan] [-allowshell] [-noghostscript] [-nogssafer] [-gsalpha] [-interpreter path] [-gspalette palette] [-not1lib] [-underlink] [-browser WWWbrowser] [-base base URL] [-debug bitmask] [-version] [dvi_file]  

DESCRIPTION

xdvi is a program which runs under the X window system. It is used to preview dvi 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. Other new features are: it can display Postscript<tm> Type1 fonts directly without converting them to pixel fonts, and has support for source specials in the .dvi file (see section SOURCE SPECIALS below).

Before displaying any page or part thereof, it checks to see if the dvi file has changed since the last time it was displayed. If this is the case, then xdvi will reinitialize itself for the new dvi 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<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 dvi_file is not specified, a file-selection widget is popped up for you to choose the dvi file.  

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.
-background color
(.background) Determines the color of the background. Same as -bg.
-base base URL
(.urlBase) Sets the base URL value that external links given in the dvi file are assumed relative to - normally this should be the URL of the document itself (?).
-bd color
(.borderColor) Determines the color of the window border.
-bg color
(.background) Determines the color of the background.
-bordercolor color
Same as -bd.
-borderwidth width
(.borderWidth) Specifies the width of the border of the window. Same as -bw.
-browser WWWbrowser
(.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 width
(.borderWidth) Specifies the width of the border of the window.
-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 cursor. The default is the color of the page border.
-debug bitmask
(.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 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.
-editor editor
(.editor) Specifies the editor that will be invoked when the source-special() action is triggered (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 no ``%f'' or ``%l'' occurs in the string, a warning is given and the missing designators are appended.

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, the command ``xterm -e vi %s +%d'' is used and a warning message is given.

A new instance of the editor is started each time this command is used; therefore it is preferrable 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 +%l %f (older Emacsen),

gnuclient -q +%l %f (XEmacs and newer Emacsen)

nc +%l %f (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. Execution of the -editor command is disabled when the -safer option is used.

-expert
(.expert) Prevent the buttons from appearing. See also the `x' keystroke.
-fg color
(.foreground) Determines the color of the text (foreground).
-foreground color
Same as -fg.
-font font
(*font) Sets the font for use in the buttons.
-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
-grid1 color
(.grid1Color) Determines the color of level 1 grid (default as foreground)
-grid2 color
(.grid2Color) Determines the color of level 2 grid (default as foreground)
-grid3 color
(.grid3Color) Determines the color of level 3 grid (default as foreground)
-geometry geometry
(*geometry) Specifies the initial geometry of the window.
-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.
-gsalpha
(.gsAlpha) Causes Ghostscript to be called with the x11alpha driver instead of the x11 driver. The x11alpha driver enables anti-aliasing in PostScript figures, for a nicer appearance. It is available on newer versions of Ghostscript. This option can also be toggled with the `V' keystroke.
-sourceposition line[:col][ ]filename
This option makes xdvi start in `client mode' to perform a `forward search'. The main dvi file dvi_file is specified on the command line as usual. `Forward search' means that xdvi will try to open the page in dvi_file corresponding to the line (optionally also the column) and filename of the .tex source, and highlight the place found by drawing a rectangle in highlight colour (see the -hl option) around the corresponding text. (This only works when the dvi_file has been prepared with source special information; see the section SOURCE SPECIALS for more information on this.)

`Client mode' means that if there is already another instance of xdvi running on this X display and displaying the same dvi_file, a new instance started with the -sourceposition option will only notify that running instance to perform the forward search, and exit after that. This way, other programs such such as text editors may invoke xdvi in `client mode' to jump to a specific place in the .dvi file corresponding to the current cursor position in the .tex file.

The argument for filename should be a string with the same extension as the file name used for the source specials in the dvi file. The space before filename is only needed if the filename starts with a digit. When the space is used, the argument needs to be encosed in quotes to prevent the shell from misinterpreting the space as argument separator.

-hl color
(.highlight) Determines the color of the page border. The default is the foreground color.
-hush
(.Hush) Causes xdvi to suppress all suppressible warnings.
-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.
-hushspecials
(.hushSpecials) Causes xdvi to suppress warnings about \special strings that it cannot process.
-hushstdout
(.hushStdout) Causes xdvi to suppress all status informations it would normally print to stdout if the statusline is disabled.
-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.
-l
(.listFonts) Causes the names of the fonts used to be listed.
-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 200x150, 400x250, 700x500, 1000x800, and 1200x1200.
-noghostscript
(.ghostscript) Inhibits the use of Ghostscript for displaying PostScript<tm> 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: -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. (For the -nogssafer option, the logic of the corresponding resource is reversed: -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. This option corresponds to a resource of 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. (For this option, the logic of the corresponding resource is reversed: -nomakepk corresponds to makePk:off; +nomakepk to makePK:on.)
-nopostscript
(.postscript) Turns off rendering of PostScript<tm> 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<tm> is turned on, xdvi will do a preliminary scan of the dvi 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 require headers.) (For the -noscan option, the logic of the corresponding resource is reversed: -noscan corresponds to prescan:off; +noscan to prescan: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 of setting the font size is by setting the Metafont mode at the same time; see the -mfmode option.
-paper papertype
(.paper) Specifies the size of the printed page. This may be of the form widthxheight optionally followed by a unit, where width and height are decimal numbers giving the width and height of the paper, respectively, and the unit is 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). There are also synonyms which may be used: us (8.5x11in), usr (11x8.5in), legal (8.5x14in), foolscap (13.5x17in), as well as the ISO sizes a1-a7, b1-b7, c1-c7, a1r-a7r (a1-a7 rotated), etc. The default size is 21 x 29.7 cm (A4 size).
-rv
(.reverseVideo) Causes the page to be displayed with white characters on a black background, instead of vice versa.
-s shrink
(.shrinkFactor) Defines the initial shrink factor. The default value is 8. If shrink is given as 0, then the initial shrink factor is computed so that the page fits within the window (as if the `s' keystroke were given without a number).
-S density
(.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 dvi or TeX file from another site. This option turns off evalutation of source specials (see SOURCE SPECIALS for details). Furthermore, it selects +nogssafer and +allowshell.
-shrinkbuttonn shrink
(.shrinkButtonn) Specifies that the nth button changing shrink factors shall change to shrink factor factor. This is useful, e.g., when using 600 dpi fonts, since in that case shrinking by a factor of 4 is still not enough. Here n may be a number from 1 to 3 (in the default button layout, the ``Full Size'' button is unaffected by these options). If the buttons are customized, higher values of n (up to 9) may be used.
-sidemargin dimen
(.sideMargin) Specifies the side margin (see -margins).
-statusline, -nostatusline
(.statusline) Display/do not display the statusline at the bottom of the window. This can also be toggled with the `1x' keystroke. If displaying the statusline is disabled, the messages that would normally be printed to the statusline will be printed to stdout. To suppress printing these messages as well, use the -hushstdout option.
-thorough
(.thorough) xdvi will usually try to ensure that overstrike characters (e.g., \notin) are printed correctly. On monochrome displays, this is always possible with one logical operation, either and or or. 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 copy operation, which does not handle overstriking correctly. The -thorough option chooses the slower but more correct choice. See also -copy.
-topmargin dimen
(.topMargin) Specifies the top and bottom margins (see -margins).
-not1lib
(.not1lib) This will disable the use of T1Lib to display PostScript<tm> fonts. Use this option when you encounter problems with the display of T1Lib.
-underlink
(.underLink) Underline links. Default is true.
-version
Print information on the version of xdvi.
-warnspecials
(.warnSpecials) Causes xdvi to issue warnings about \special strings that it cannot process.
-wheelunit pixels
(.wheelUnit) Sets the number of pixels that a motion of a wheel mouse will move the image up or down. If set to zero, the wheel mouse functionality is disabled. The default value is 80.
-xoffset dimen
(.xOffset) Specifies the size of the horizontal offset of the output on the page. See -offsets.
-yoffset dimen
(.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'', ``Prior'' and ``Next'' keys are synonyms for `?', `^', `b', and `f' keys, respectively.

The key assignments given here are those that xdvi assigns by default. They can be changed--see CUSTOMIZATION, below. The names appearing in brackets at the beginning of each of the following keystroke definitions is the name assigned to the action associated with that key, for use when customizing. Users who do not customize their keystrokes may ignore these labels.

q
[quit()] Quits the program. Control-C and control-D will do this, too.
n [forward-page()] Moves to the next page (or to the nth next page if a number is given). Synonyms are `f', Return, and Line Feed.
Space
[down-or-next()] Moves down two-thirds of a window-full, or to the next page if already at the bottom of the page.
p
[back-page()] Moves to the previous page (or back n pages). Synonyms are `b' and control-H.
Delete
[up-or-previous()] Moves up two-thirds of a window-full, or to the bottom of the previous page if already at the top of the page. The BackSpace key will also do this.
g
[goto-page()] 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
[declare-page-number()] ``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
[forward-page(0)] Redisplays the current page.
^
[home()] 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.
Up arrow
[up(0.015)] Scrolls page up.
Down arrow
[down(0.015)] Scrolls page down.
u
[up()] Moves page up two thirds of a window-full. With a float argument to ``up'', moves up the corresponding fraction of a window-full.
d
[down()] Moves page down two thirds of a window-full. With a float argument to ``down, moves down the corresponding fraction of a window-full.
Left arrow
[left(0.015)] Scrolls page left.
Right arrow
[right(0.015)] Scrolls page right.
l
[left()] Moves page left two thirds of a window-full.
r
[right()] Moves page right two thirds of a window-full.
c
[center()] 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
[set-margins()] 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
[set-shrink-factor()] Changes the shrink factor to the given number. If no number is given, the smallest factor that makes the entire page fit in the window will be used. (Margins are ignored in this computation.)
S
[set-density()] Sets the density factor to be used when shrinking bitmaps. 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 instead. The new value of gamma is the given number divided by 100; negative values are allowed.
R
[reread-dvi-file()] Forces the dvi file to be reread. This allows you to preview many versions of the same file while running xdvi only once.
k
[set-keep-flag()] 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 position when moving between pages. Also `0k' and `1k' clear and set this flag, respectively. See also the -keep option.
x
[set-expert-mode()] Toggles expert mode (in which the buttons do not appear). Typing `1x' toggles the display of the statusline at the bottom of the window. See also the options -expert and -[no]statusline.
Control-v
[show-source-specials()] Show bounding boxes for every source special on the current page, and print the strings contained in these specials to stderr. With prefix 1, show every bounding box on the page. This is for debugging purposes mainly.
Control-x
[source-what-special()] Display information about the source special next to the cursor in the statusline. This is the same special that would be found by source-special() , but without invoking the editor. For debugging purposes.
G
[set-greyscaling()] This key toggles the use of greyscale anti-aliasing for displaying shrunken bitmaps. In addition, the key sequences `0G' and `1G' clear and set this flag, respectively. See also the -nogrey option.

If given a numeric argument 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.

D
[toggle-grid-mode()] This key toggles the use of grid over the document. If no number is given, the grid mode toggles. By prepending 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 options.
v
[set-ps()] This key toggles the rendering of PostScript<tm> specials. If rendering is turned off, then bounding boxes are displayed when available. In addition the key sequences `0v' and `1v' clear and set this flag, respectively. See also the -nopostscript option.
Control-F
[select-dvi-file()] Read a new dvi file. A file-selection widget is popped up for you to choose the dvi file from.
V
[set-gs-alpha()] This key toggles the anti-aliasing of PostScript<tm> specials when Ghostscript is used as renderer. In addition the key sequences `0V' and `1V' clear and set this flag, respectively. See also the -gsalpha option.
?
[help()] Pops up a help window with a short explanation of the most important key bindings and concepts. The help texts and menu entries are fully configurable via the following X resources (the defaults strings are given in parentheses, or as <Text> if they contain a longer text):

helpTopicsButtonLabel (Topic)

helpQuitButtonLabel (Close)

helpIntro <text>

helpGeneralMenulabel (General)

helpGeneral <text>

helpHypertexMenulabel (HyperTeX commands)

helpHypertex <text>

helpOthercommandsMenulabel (Other Commands)

helpOthercommands <text>

helpPagemotionMenulabel (Page Motion)

helpPagemotion <text>

helpSourcespecialsMenulabel (Source Specials)

helpSourcespecials <text>.

 

MOUSE ACTIONS

If the shrink factor is set to any number other than one, 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 different sized windows, as indicated by the -mgs option. Moving the cursor while holding the button down will move the magnifying glass. To access this feature via customization, use the magnifier action. Its argument is either a string of the form widthxheight, as in the -mgsn command-line option, or one of the strings *1 through *5, referring to the value specified by the corresponding -mgsn option.

Holding down the CTRL key and clicking on mouse button 1 starts a ``reverse search'' (action source-special(); see the section on SOURCE SPECIALS for details).

If the cursor is on a hypertext link (underlined by default), then that link overrides the magnifying glass for Buttons 1 and 2. If Button 1 is clicked over a link, then xdvi jumps to the target in the current window. If Button 2 is clicked over a link, then xdvi opens a new window on the target.

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 Button 2 starts a new xdvi on that file. For other file types, mime.types and mailcap are 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.

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.

The image can also be dragged around, by holding down the shift key and a mouse button. Shift-button 1 will allow vertical dragging only; Shift-button 3, horizontal dragging; and Shift-button 2 allows dragging in either direction. To access these actions via customization, use the drag action. This action should have one parameter, the character ``|'', ``-'', or ``+'', indicating vertical dragging, horizontal dragging, or dragging in both directions.

Wheel mice are supported: motion of the wheel on such a mouse moves the image up or down by the number of pixels indicated by the -wheelunit option. To access this option via customization, use the wheel action. This action takes one parameter, giving the distance to scroll the image. If the parameter contains a decimal point, the distance is given in wheel units; otherwise, pixels.  

UNBOUND ACTIONS

The following actions have not been assigned any keystroke, but are available if customization is used.
shrink-to-dpi()
This action takes one (required) argument. It sets the shrink factor to an integer so as to approximate the use of fonts with the corresponding number of dots per inch. If xdvi is using fonts scaled for p dots per inch, and the argument to shrink-to-dpi is n, then the corresponding shrink factor is the ratio p/n, rounded to the nearest integer.
 

CUSTOMIZATION

Key and mouse button assignments can be changed by setting the mainTranslations resource to a string of translations as defined in the documentation for the X toolkit. The actions should take the form of action names as given in the KEYSTROKES and MOUSE ACTIONS sections.

Key actions will usually be without arguments, or they may give an argument to replace an optional number typed immediately prior to the action. The keys 0-9 and hyphen cannot be reassigned, since they are used for inputting numbers.

Some key actions may take special arguments, as follows. The argument of goto-page may be the letter `e', indicating the action of going to the end of the document. The argument of set-shrink-factor may be the letter `a', indicating that the shrink factor should be set to the smallest value such that the page will fit in the window. Finally, actions that would perform a toggle, such as set-keep-flag, may be the letter `t', indicating that the action should toggle regardless of what number may have been typed recently.

Mouse actions should refer only to ButtonPress events (e.g., <Btn1Down>:magnifier(*1)). The corresponding motion and release events will then be handled internally. A key action may be bound to a mouse event, but not vice versa.

Usually the string of translations should begin with ``#override'', indicating that the default key and mouse button assignments should not be discarded.

When keys or mouse buttons involving modifiers (such as Ctrl or Shift) are customized together with their non-modified equivalents, the modified keys should come first, for example:


Ctrl<Btn1Down>: magnifier(*3)\n\
Shift<Btn1Down>: magnifier(*2)\n\
<Btn1Down>: magnifier(*1)\n\

Because xdvi needs to capture pointer motion events, and because the X Toolkit translations mechanism cannot accommodate both motion events and double-click events at the same time, it is not possible to specify double-click actions in xdvi customizations. For information on this and other aspects of translations, see the X Toolkit Intrinsics documentation.

There is no command-line option to set the mainTranslations resource, since changing this resource on the command line would be cumbersome. To set the resource for testing purposes, use the -xrm command-line option provided by the X toolkit. For example, xdvi -xrm 'XDvi.mainTranslations: #override "z":quit()' ... or xdvi -xrm 'XDvi.mainTranslations: #override <Key>z:quit()' ... will cause the key `z' to quit xdvi.

Support of wheel mice is controlled by the wheelTranslations resource. Generally the only action routine called by this resource should be wheel. The default value is ``<Btn4Down>:wheel(-1.)\n<Btn5Down>:wheel(1.)''. Because this resource is implemented differently from the others, it should not begin with ``#override''; when specifying a value for this resource, all wheel actions should be included.

The button labels and actions may also be customized, in a similar manner. In this case the resource buttonTranslations should consist of a string describing the button labels and the associated actions. The string consists of substrings, separated by the newline character (`\n'), each describing one button. Each substring consists of a string (to be used as the button's label), a colon, and a sequence of actions to be performed when the button is pushed. Unlike the situation with key actions, an action associated to a button should provide an argument (if applicable).

The label string may contain a colon if it is escaped by a backslash (`\'). It also may contain some special sequences tied to the -shrinkbuttonn command-line options. If the characters `$#' occur, then they are replaced by the argument of the corresponding -shrinkbutton command-line option (if present). If no corresponding -shrinkbutton option was given, then the value is taken from the list of actions, which is expected to contain at least one set-shrink-factor or shrink-to-dpi action. Likewise, the character sequence `$%' will be replaced by the percentage corresponding to the shrink factor, determined as above. In order for the -shrinkbutton option to affect a given button, the label string must contain one of the character sequences `$#', `$%', or '$_'. This last string flags a button to be affected by a -shrinkbutton option, without making any numbers appear in the label text (the `$_' will not appear in the label text).

Some resources are provided to allow customization of the geometry of the command buttons. Again, they are not changeable via command-line options, other than via the -xrm option. All of these resources take integer values.

buttonSideSpacing
The number of pixels to be placed on either side of the buttons. The default value is 6.
buttonTopSpacing
The number of pixels between the top button and the top of the window. The default value is 50.
buttonBetweenSpacing
The number of pixels between most buttons. The default value is 20.
buttonBetweenExtra
The number of pixels of additional space to be inserted if the buttonTranslations resource string contains an extra newline character. The default value is 50.
buttonBorderWidth
The border width of the button windows. The default value is 1.
 

SIGNALS

When xdvi receives a SIGUSR1 signal, it rereads the dvi file.  

GREYSCALING AND COLORMAPS

The greyscale anti-aliasing feature in xdvi will not work at its best if the display does not have enough colors available. This can happen if other applications are using most of the colormap (even if they are iconified). If this occurs, then xdvi will print an error message and turn on the -copy option. This will result in overstrike characters appearing wrong; it may also result in poor display quality if the number of available colors is very small.

Typically this problem occurs on displays that allocate eight bits of video memory per pixel. To see how many bits per pixel your display uses, type xwininfo in an xterm window, and then click the mouse on the root window when asked. The ``Depth:'' entry will tell you how many bits are allocated per pixel.

Displays using at least 15 bits per pixel are typically TrueColor visuals, which do not have this problem, since their colormap is permanently allocated and available to all applications. (The visual class is also displayed by xwininfo.) For more information on visual classes see the documentation for the X Window System.

To alleviate this problem, therefore, one may (a) run with more bits per pixel (this may require adding more video memory or replacing the video card), (b) shut down other applications that may be using much of the colormap and then restart xdvi, or (c) run xdvi with the -install option.

One application which is often the cause of this problem is Netscape. In this case there are two more alternatives to remedying the situation. One can run ``netscape -install'' to cause Netscape to install a private colormap. This can cause colors to change in bizarre ways when the mouse is moved to a different window. Or, one can run ``netscape -ncols 220'' to limit Netscape to a smaller number of colors. A smaller number will ensure that other applications have more colors available, but will degrade the color quality in the Netscape window.  

ENVIRONMENT

Please see the kpathsea documentation.

 

HANDLING OF POSTSCRIPT FIGURES

xdvi can display PostScript files included in the dvi file. Such files are first searched for in the directory where the dvi file is, and then using normal Kpathsea rules. There is an exception to this, however: if the file name begins with a backtick (`), then the remaining characters in the file name 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 -allowshell 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 uncompressed 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.  

SOURCE SPECIALS

Some TeX implementations or macro packages provide the facility to automatically include so-called `source specials' into a .dvi file. These contain the line number, eventually a column number, and the filename of the .tex source. This makes it possible to jump from a .dvi file to the corresponding place in the .tex source and back (also called `reverse search' and `forward search'). To be usable with xdvi, source specials in the dvi file must have one of the following formats:

    src:line[ ]filename
    src:line:col[ ]filename
    src:line
    src:line:col
    src::col

If filename or line are omitted, the most recent values are used. The first source special on each page must be in one of the first two forms, since defaults are not inherited across pages.

You will need a TeX implementation or a macro package (such as srcltx.sty or srctex.sty , available from CTAN) to insert such source specials into the dvi file.

For reverse search, you can use the combination CTRL-Mouse 1 to make xdvi open an editor (the value of the -editor command line option) with the file and the line number of the .tex source. (See the description of the -editor option for more information and examples.) For forward search, xdvi has a -sourceposition option that makes xdvi jump jump to the page in the .dvi file corresponding to the line number and the file name and highlight the line found. See the description of the -sourceposition for more details.

The evaluation of source specials is disabled when the -safer option is used.  

ENVIRONMENT

xdvik uses the same environment variables and algorithms for finding font files as TeX and friends. See the documentation for the Kpathsea library for details (repeating it here is too cumbersome). In addition, xdvik accepts the following variables:
DISPLAY
Specifies which graphics display terminal to use.
KPATHSEA_DEBUG
Trace Kpathsea lookups; set it to -1 for complete tracing.
MIMELIBDIR
Directory containing the mime.types file, if ~/.mime-types does not exist.
MAILCAPDIR
Directory containing the .mailcap file, if ~/.mailcap does not exist.
WWWBROWSER
The browser used to open URL's, if neither the -browser option nor the .wwwBrowser resource are set. For more information on hyper-TeX support, see the `Hypertext' node in the dvipsk manual.
TMPDIR
The directory to use for storing temporary files created when uncompressing PostScript files.
XEDITOR
Determines the editor command used for source special `reverse search', if neither the -editor command-line option nor the .editor resource are specified. See the description of the -editor command line option for details on the format.
VISUAL
Determines an editor to be opened in an xterm window if neither of -editor, .editor, or XEDITOR is specified.
EDITOR
Determines an editor to be opened in an xterm window if neither of -editor, .editor, XEDITOR or VISUAL is specified.
 

LIMITATIONS

xdvi accepts many but not all types of PostScript specials accepted by dvips. For example, it accepts most specials generated by epsf and psfig. It does not, however, support bop-hook or eop-hook, nor does it allow PostScript commands to affect the rendering of things that are not PostScript (for example, the ``NEAT'' and rotated ``A'' examples 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 supported.

MetaPost files containing included text are not supported.  

FILES

xdvi.cfg needs to be supplied in the directory named by the XDVIINPUTS kpathsea variable. Please see the file README.t1fonts in the source distribution if xdvi.cfg is missing. xdvik also relies on the whole kpathsea infrastructure. Please see the kpathsea documentation for further information.  

SEE ALSO

X(1), dvips(1), Kpathsea documentation  

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. +Additional enhancements by many others. The current maintainer of the original xdvi is Paul Vojta, U.C. Berkeley; the maintainer of the xdvik variant is the xdvik project at sourceforge, please see http://sourceforge.net/projects/xdvi/


 

Index

NAME
SYNOPSIS
DESCRIPTION
OPTIONS
KEYSTROKES
MOUSE ACTIONS
UNBOUND ACTIONS
CUSTOMIZATION
SIGNALS
GREYSCALING AND COLORMAPS
ENVIRONMENT
HANDLING OF POSTSCRIPT FIGURES
SOURCE SPECIALS
ENVIRONMENT
LIMITATIONS
FILES
SEE ALSO
AUTHORS

This document was created by man2html, using the manual pages.
Time: 04:45:30 GMT, December 09, 2024