XDVI(1)

NAME
xdvi - DVI Previewer for the X Window System

SYNOPSIS
xdvi [+[page]] [-s shrink] [-S density] [-p pixels] [-l] [-paper papertype] [-mgs[n] size] [-hushspecials] [-hushchars] [-hush] [-altfont font] [-margins dimen] [-sidemargin dimen] [-topmargin dimen] [-offsets dimen] [-xoffset dimen] [-yoffset dimen] [-keep] [-rv] [-fg color] [-bg color] [-hl color] [-bd color] [-cr color] [-bw width] [-geometry geometry] [-icongeometry geometry] [-iconic] [-display display] [-copy] [-thorough] [-nogrey] [-gamma gamma] [-expert] [-ps] [-printer printer] [-printall print_command] [-printcurrent print_command] [-printmarked print_command] [-printregion print_command] [-printlist print_command] [-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.

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

OPTIONS
In addition to specifying the .dvi file (with or without the .dvi), 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.

-s shrink
    (.shrinkFactor) Defines the initial shrink factor. The default value is 5.

-S density
    (.densityPercent) Determines the density used when shrinking bitmaps for fonts. A higher value produces a lighter font. The default value is 40.

-density density
    Same as -S.

-p pixels
    (.pixelsPerInch) Defines the size of the fonts to use, in pixels per inch. The default value is 600.

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

-l  (.listFonts) Causes the names of the fonts used to be listed.

-hushspecials
    (.hushSpecials) Causes xdvi to suppress warnings about \special strings which it cannot process.

-hushchars
    (.hushLostChars) Causes xdvi to suppress warnings about references to characters which are not defined in the font.

-hush
    (.Hush) Causes xdvi to suppress all suppressable warnings.

-rv (.reverseVideo) Causes the page to be displayed with white characters on a black background, instead of vice versa.

-bw width
    (.borderWidth) Specifies the width of the border of the window.

-borderwidth width
    Same as -bw.

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

-foreground color
    Same as -fg.

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

-background color
    Same as -bg.

-hl color
    (.highlight) Determines the color of the page border. The default is the foreground color.

-bd color
    (.borderColor) Determines the color of the window border.

-bordercolor color
    Same as -bd.

-cr color
    (.cursorColor) Determines the color of the cursor. The default is the color of the page border.

-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, below.

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

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

-expert
    (.expert) Prevent the buttons from appearing. See also the `x' keystroke.

-ps (.psSpesial) Display PS file. See also the control-G keystroke.

-version
    Print information on the version of xdvi.

-margins dimen
    (.Margin) Specifies the size of both the top margin and side margin. This should be a decimal number optionally followed by "cm", e.g., 1.5 or 3cm, giving a measurement in inches or centimeters. It 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. See also `M' under the KEYSTROKES section.

-sidemargin dimen
    (.sideMargin) Specifies the side margin (see above).

-topmargin dimen
    (.topMargin) Specifies the top and bottom margins (see above).

-offsets dimen
    (.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 default offsets are 1.0 inch.

-xoffset dimen
    (.xOffset) Specifies the size of the horizontal offset of the output on the page (see above).

-yoffset dimen
    (.yOffset) Specifies the size of the vertical offset of the output on the page (see above).

-paper papertype
    (.paper) Specifies the size of the printed page. This may be of the form wxh (or wxhcm), where w is the width in inches (or cm) and h 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 21 x 29.7 cm (A4 size).

-nogrey
    (.grey) Turns off the use of greyscale anti-aliasing when printing shrunken bitmaps. (In this case, the logic of the corresponding resource is the reverse: -nogrey corresponds to grey:off; +nogrey to grey:on.) See also the `G' keystroke.

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

-mgs[n] size
    (.magnifierSize[n]) Specifies the size of the window to be used for the ``magnifying glass'' for Button n. See the MOUSE ACTIONS section. Defaults are 200, 350, 600, 900, and 1200.

-mgs size
    Same as -mgs1.

-geometry geometry
    (*geometry) Specifies the initial geometry of the window.

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

-display host:display
    Specifies the host and screen to be used for displaying the dvi file. This is normally obtained from the environment variable ``DISPLAY.''

-printer printer
    (.printer) Specifies the printer name to which xdvi will print-out the dvi file. This is normally obtained from the environment variable ``PRINTER.'' When it is not defined, ``"lp"'' is used as the default.

-printall print_command
    (.printAll) Specifies the print-out command to convert the dvi file into printer dependent file for all pages and send it printer. See the section ``PRINT-OUT.''

-printcurrent print_command
    (.printCurrent) Specifies the print-out command to convert the dvi file into printer dependent file for current page and send it printer. See the section ``PRINT-OUT.''

-printmarked print_command
    (.printMarked) Specifies the print-out command to convert the dvi file into printer dependent file for last marked page and send it printer. See the section ``PRINT-OUT.''

-printregion print_command
    (.printRegion) Specifies the print-out command to convert the dvi file into printer dependent file for pages in region and send it printer. See the section ``PRINT-OUT.''

-printlist print_command
    (.printList) Specifies the print-out command to convert the dvi file into printer dependent file for marked pages and send it printer. See the section ``PRINT-OUT.''

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 "Home", "Prior", "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 this, too.

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 entire page fit in the window will be used. (Margins are ignored in this computation.)

S   Sets the density factor to be used when shrinking bitmaps. This should be a number between 0 and 100; higher numbers produce lighter characters.

R   Forces the dvi 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 position 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 appear). 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 sequences `0G' and `1G' clear and set this flag, respectively. See also the -nogrey option.

Control-G
    This key toggles the permission of displaying PS file. See also the -ps option.

F   Open the window for file selection.

m   Marks the page with the given number. If no page number is given, then it marks the current page. Page marking behavior is like the Mark Ring of GNU Emacs (as Control-SPC), but the detail is different from it; when the marks of a page are duplicated, they are simplified to one mark, like the LRU-stack. Also pushing Button 2 in TOC makes the page marked.

U   Deletes mark of the page with the given number. If no page number is given, then it deletes mark of the current page. Also pushing Button 3 in TOC makes the page not marked.

a   Marks all pages.

A   Deletes marks of all pages.

<   Marks the current page, and moves to the first page (like Meta-< of GNU Emacs). It is same as 'm' and '1g'.

>   Marks the current page, and moves to the last page (like Meta-> of GNU Emacs). It is same as 'm' and 'g'.

'   Moves to the last marked page.

"   Exchanges the current page and the last marked page, that is, the current page is marked and moves to the last marked page, then the last mark is deleted (like Control-x Control-x of GNU Emacs). Exceptionally, if the current page was already marked, the last mark would not be deleted. It marks the current page (this causes the current page is last marked), and moves to the ex-last marked page.

`   Traces the page mark ring in the marked order, that is, it moves to the last marked page, then the last marked page is changed to the previous mark of it (like Control-u Control-SPC of GNU Emacs). When it reaches the oldest marked page, it loops back. Because the page mark ring is cyclic.

o   Popup the print-out menu. The menu consists of ``All pages"", ``Current page"" , ``Last marked page"", ``Region"", ``All marked pages"" ; ``All pages"" means that all pages in the DVI file are printed. ``Current page"" means that the current page is only printed. ``Last marked page"" means that the last marked page is only printed. ``Region"" means that pages in the region between the current page and the last marked page are printed. ``All marked pages"" means that the all marked page are printed.

t   Popup the set paper-type menu.

MOUSE ACTIONS
If the shrink factor is set to any number other than one, then clicking any mouse button 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.

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.

TABLE OF CONTENTS
The page number list is shown as TOC (table of contents). The current page is marked with a "<" in the right margin of TOC. The marked pages are marked with a "*" in the left margin of TOC. In particular, the last marked page is marked with ">" in the left margin of TOC. Pushing Button 1 on a page number moves the current page to the page and is marked with "<". Pushing Button 2 on a page number makes the page marked. Pushing Button 3 on a page number makes the page not marked. Button 2 and 3 can be drugged, then makes all drugged pages marked/not marked.

PRINT-OUT
Xdvi has no functions to select necessary pages for print-out and to print-out these pages inside itself. Therefore, xdvi requires external commands at the print-out work, for example, dviselect, dvi2ps, dvips, and so on. So these commands should be installed before xdvi is installed.

In order to print-out with these external commands, xdvi has command strings. Xdvi interprets the corresponding command string to the selected print-out work from popup menu. The interpretation is that the internal variables in the command string are instantiated and the instantiated command string is executed.

The meanings of internal variables are shown in the following.

%f  Filename of DVI file (full pathname)

%F  Filename of DVI file (basename of pathname)

%d  Directory where DVI file is placed (directory of pathname)

%D  Directory to put the temporal files (if the environment variable TMPDIR is defined, use it)

%p  Printer name (if the environment variable PRINTER is defined, use it)

%P  Print command string (if the environment variable PRINTCMD is defined, use it)

%z  Paper size specified with -paper option (lower case; ex. "a4")

%Z  Paper size translated from -paper option (ex. "a4landscape" for dvi2ps-j translated from "a4r")

%r  Proces id of xdvi

%R  DVI filter command string (if the environment variable DVIFILTER is defined, use it)

The following variables denote absolute page number.

%c  Current page number

%m  Last marked page number

%s  Start page number of region; minimum of %c and %m

%e  End page number of region; maximum of %c and %m

%l  Marked page list; marked order; separated by ","

%L  Marked page list; marked order; separated by " "

%t  Marked page list; sorted; separated by ","

%T  Marked page list; sorted; separated by " "

%o  Marked page list; sorted; page-to-page form (p1-p2); separated by ","

%O  Marked page list; sorted; page-to-page form (p1-p2); separated by " "

%k  Like %l; "=" is put on each page number (assumed dviselect)

%K  Like %L; "=" is put on each page number (assumed dviselect)

%a  Like %t; "=" is put on each page number (assumed dviselect)

%A  Like %T; "=" is put on each page number (assumed dviselect)

%g  Like %o; page-to-page form (=p1:p2) (assumed dviselect)

%G  Like %O; page-to-page form (=p1:p2) (assumed dviselect)

The print-out popup menu has the command strings as following.

``All pages""
    "cd %d; %R %F > %D/%F:All@%r.ps; %P -J"%F" %D/%F:All@%r.ps"

``Current page""
    "cd %d; dviselect -i %F -o %D/%F:%c@%r.dvi =%c; %R %D/%F:%c@%r.dvi > %D/%F:%c@%r.ps; /bin/rm %D/%F:%c@%r.dvi; %P -J"%F (Page %c)" %D/%F:%c@%r.ps"

``Last marked page""
    "cd %d; dviselect -i %F -o %D/%F:%m@%r.dvi =%m; %R %D/%F:%m@%r.dvi > %D/%F:%m@%r.ps; /bin/rm %D/%F:%m@%r.dvi; %P -J"%F (Page %m)" %D/%F:%m@%r.ps"

``Region""
    "cd %d; dviselect -i %F -o %D/%F:%s-%e@%r.dvi =%s:%e; %R %D/%F:%s-%e@%r.dvi > %D/%F:%s-%e@%r.ps; /bin/rm %D/%F:%s-%e@%r.dvi; %P -J"%F (Page %s-%e)" %D/%F:%s-%e@%r.ps"

``All marked pages""
    "cd %d; dviselect -i %F -o %D/%F:%o@%r.dvi %G; %R %D/%F:%o@%r.dvi > %D/%F:%o@%r.ps; /bin/rm %D/%F:%o@%r.dvi; %P -J"%F (Page %o)" %D/%F:%o@%r.ps"

For example, it is assumed that the command string to print-out ``Current page"" is defined as "cd %d; dviselect -i %F -o %D/%F:%c@%r.dvi =%c; %R %D/%F:%c@%r.dvi > %D/%F:%c@%r.ps; /bin/rm %D/%F:%c@%r.dvi; %P -J"%F (Page %c)" %D/%F:%c@%r.ps", and xdvi displays the file /home/foo/bar.dvi. This command string is instantiated into ``(cd /home/foo; dviselect -i bar.dvi -o /tmp/bar.dvi:13@3255.dvi =13; dvi2ps /tmp/bar.dvi:13@3255.dvi) | lpr -Plp -J"bar.dvi (Page 13)"; /bin/rm /tmp/bar.dvi:13@3255.dvi"", where the process ID of xdvi is 3255 and current page is 13 and printer name is ``lp"".

ENVIRONMENT
Uses the environment variable ``DISPLAY"" to specify which bit map display terminal to use.

The environment variable ``XDVIFONTS"" determines the path(s) searched for fonts in the following manner. The string consists of one or more strings separated by colons. In each such string, the substring ``%f"" is changed to the font name; ``%d"" is changed to the magnification; and ``%p"" is changed to the font file format (``gf"", ``pk"", or ``pxl""). If no ``%f"" appears in the string, then the string ``/%f.%d%p"" is added on the end. For example, if the string is ``/usr/local/tex/fonts"" and the font is cmr10 at 300dpi, then it searches for /usr/local/tex/fonts/cmr10.300gf, /usr/local/tex/fonts/cmr10.300pk, and /usr/local/tex/fonts/cmr10.1500pxl, in that order. An extra colon anywhere in the ``XDVIFONTS"" variable causes the system default paths to be tried at that point. If the font is not found in the desired size, then xdvi will invoke Metafont to create the font in the correct size. Failing that, it will try to find the nearest size. If the font cannot be found at all, then xdvi will try to vary the point size of the font (within a certain range), and if this fails, then it will use the font specified as the alternate font (cf. -altfont).

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 .tfm 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 XDVIFONTS 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 may be set to an empty string (i.e., ``setenv XDVIFONTS"") to cause xdvi to ignore TEXFONTS.

xdvi also recognizes the PKFONTS variable, which is checked after XDVIFONTS but before TEXFONTS.

The script used to create fonts may be controlled by the environment variable ``XDVIMAKEPK."" Usually this variable would be set to the name of the script. In that case the script is called with the following options: (1) the font name, (2) the requested resolution in dots per inch, (3) the base resolution in dots per inch, and (4) a (possibly more accurate) indication of the magnification using magsteps (if possible). Optionally, the variable may include specifiers ``%n,"" ``%d,"" ``%b,"" and ``%m"" to indicate each of the above arguments, respectively. This is compatible with the font creation mechanism used in dvips. By default, XDVIMAKEPK equals "/usr/local/bin/MakeTeXPK".

You can also enable recursive searching in the font path by using the ``*"" and ``**"" specifiers. At this point in the path, xdvi will recursively search subdirectories of the given directory in order to find font files. A single asterisk limits the search to one level; a double asterisk will search through an arbitrary number of levels. Also, the variable TEXFONTS_SUBDIR can be used to give a colon-separated list of directories to recursively search. This is equivalent to including the specifiers with a ``*"" after each; the usual conventions regarding extra colons applies here, too, relative to a default subdirectory path. Asterisks may not be preceded by a ``%"" specifier in any path component.

The ``XDVISIZES"" variable may be set to indicate which sizes of fonts are available. It should consist of a list of numbers separated by colons. If the list begins with a colon, the system default sizes are used, as well. Sizes are expressed in dots per inch; decimals may be used for ``pxl"" files: for example, a 300 dots per inch file magnified by half a step comes out to 1643 dots per five inches, which should be encoded as 328.6. The current default set of sizes is FontSizes600. xdvi will also try 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 ``XDVIVFS"" environment variable in a similar manner to that for the ``XDVIFONTS"" 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.

The environment variable ``TMPDIR"" is used to put the temporal files for print-out.

The environment variable ``DVIFILTER"" is used to convert the dvi file into printer dependent file as the dvi filter (device driver) when print-out facility is called. It replaces the internal variable %R when the internal variable is extracted.

The environment variable ``PRINTCMD"" is used to send the printer dependent file translated by the dvi filter (device driver) into the printer. It replaces the internal variable %P when the internal variable is extracted.

The environment variable ``XDVIFILTOPTTBL"" indicates the translation table filename from the paper type (specified by -paper option) in xdvi into the dvi filter option string (e.g. -o option of dvi2ps-j). It is used when the internal variable %Z is extracted. For example, the paper type in xdvi ``a4r"" will be translated into ``a4landscape"" in dvi2ps-j. Or it will be translated into ``a4 -l"" in jdvi2kps.

FILES
.
/usr/local/lib/fonts/pk600
/usr/local/share/tex/jfonts/jfms
/usr/local/lib/texmf/fonts/public/ptex/tfm
/usr/local/share/texmf/fonts/tfm/ptex
    Font pixel files.
.
/usr/local/lib/tex/fonts/vf
    Virtual font files.
/usr/local/share/tex/xdvipaper.dvi2ps-j
    Translation table file from paper type in xdvi into the dvi filter (device driver) option string.

SEE ALSO
X(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. Additional enhancements by many others.