%
% DVItoVDU User Guide -- released 10 March 1988
% ~~~~~~~~~~~~~~~~~~~
%			 updated for DVItoVDU V2.1 27 July 1988
%			 updated for DVItoVDU V3.1 29 November 1988
%			 updated for DVItoVDU V3.2  6 December 1988
%
% This file is used to produce a Local Guide for users wishing to use
% DVItoVDU to preview .DVI files generated by TeX, LaTeX & SliTeX.
%
%
% The installer of LaTeX at a site is responsible for customizing this
% document and providing copies for users.  He will have to read the
% text of this file CAREFULLY to see what must be added, removed, and
% changed.
%
%
% The \contact command is defined to generate the name of the person to
% whom queries should be sent.  This should be someone at the site.
% Most users' questions can be answered  by anyone slightly familiar
% with LaTeX or TeX. Don't bother anyone at another site with questions
% that can be answered locally.
%
%
% Acknowledgement
% ~~~~~~~~~~~~~~~
%
% This guide is based on the original guide which came from:
%
%		Andrew Trevorrow
%		University of Adelaide
%		Adelaide
%		Australia
%
% with his original DVItoVDU program,  written in Modula-2.
%
%
\documentstyle[11pt,twoside]{article}
\pagestyle{headings}
\textheight=21cm
\addtolength{\textwidth}{1cm}

%
%	USEFUL MACROS
%
\newcommand{\chapend}{\clearpage\ifodd\count0\else
  \markboth{}{}
  \vspace*{\fill}\centerline{\small This page is left intentionally blank}
  \vspace*{\fill}\cleardoublepage\fi}

\newcommand{\contact}{Niel Kempson}

\newcommand{\BibTeX}{{\rm B\kern-.05em{\sc i\kern-.025em b}\kern-.08em
    T\kern-.1667em\lower.7ex\hbox{E}\kern-.125emX}}

\newcommand{\SliTeX}{{\rm S\kern-.06em{\sc l\kern-.035emi}\kern-.06em T\kern
   -.1667em\lower.7ex\hbox{E}\kern-.125emX}}

\newcommand\DVItoVDU{DVIto\kern-.15em VDU}

\newcommand\bs{\char '134 }  % A backslash character for \tt font
\newcommand\us{\char '137 }	 % An underscore character for \tt font
\newcommand\verbsp{\char '40  }  % The \verb* space character in \tt font
%
% make tabular columns further apart
%
\addtolength{\tabcolsep}{3mm}
  

%
%   DOCUMENT STARTS HERE
%
\title{\bf \DVItoVDU{} User Guide\\for the {\sl VAXen\/} at RMCS}
\author{Niel Kempson\\School of Electrical Engineering \& Science\\
Military College of Science\\Shrivenham}
\date{6th December 1988\\
For \DVItoVDU{} Version 3.2}


\begin{document}

\maketitle
\begin{abstract}
    This document describes the operation of the \DVItoVDU{} program, which
    allows \TeX\ output files in  device-independent {\tt .DVI} form to be
    previewed on a variety of Visual Display Units (VDUs). 

    It is assumed that the reader is familiar with \LaTeX\  and has read
    the local \LaTeX\ User Guide\cite{RMCS:latexguide}. Familiarity
    with the {\sl VAX/VMS\/} operating system is also assumed. 

    If you have a question that you can't answer by reading this document,
    ask \contact.  He should also be informed of any possible \DVItoVDU\
    bugs or undocumented anomalies. 

    \begin{center}
	{\bf Acknowledgement}
    \end{center}

The original \DVItoVDU{} program was written by Andrew Trevorrow,
University of Adelaide, Australia. This user guide is based on his
original guide, written in plain \TeX.

\end{abstract}
\setcounter{page}{0}

%
%   A horrible cludge to stop LaTeX putting a page number on the title page
%
{\let\thepage\relax\newpage}

\pagenumbering{roman}
\tableofcontents
\clearpage
\listoffigures
\vspace{1.5in}
\listoftables

\clearpage
\pagenumbering{arabic}

\section{Introduction}

\subsection{What \LaTeX\ does with your Source File}

When any program\footnote{This document refers mostly to \LaTeX, since that
is the program most commonly used at this site; however, it may be assumed
that this includes \TeX\ and \SliTeX\ as well.} of the \TeX\ family is run
(\TeX, \LaTeX\ or \SliTeX), it produces two output files.  One of these is
the {\sl log file}, which records all the output that \LaTeX\ sent to the
terminal (and a lot more besides!).  On a {\sl VAX\/} implementation of
\LaTeX, this file has the file type {\tt .LIS}. However, it is the other
file (of type {\tt .DVI}) which is of most interest because this contains
all the instructions
to typeset your document; this file is in a {\sl Device-Independent
Format\/} which is common to {\it every\/} \LaTeX\ site in the world. Details
of the internal format of {\tt .DVI} files are explained within the program
DVItype, which describes the definitive method for processing {\tt .DVI}
files, but need only concern those who are writing {\tt .DVI} processing
programs. 


\subsection{Previewing \LaTeX\ Output}

Before you can see what wonders \LaTeX\ has wrought for you, it is
necessary to process this {\tt .DVI} file.  As a first stage, you should
use \DVItoVDU{} to produce a representation of your document on a graphics
terminal, rather than waste paper unnecessarily. When you have finished 
previewing, you can use the {\tt DVILN03\/} and {\tt TEXPRINT} commands to 
produce a printed document; the {\tt DVILN03} User
Guide\cite{RMCS:dvilguide} and the local \LaTeX\ User
Guide\cite{RMCS:latexguide} describe these commands. 

Let's assume that you have  a \LaTeX\  source file 
called {\tt myfile.tex}.  You run this file through \LaTeX\ by typing the 
command:
\begin{quote}
\tt LATEX MYFILE
\end{quote}
and if all is well, \LaTeX\ creates the two files
{\tt MYFILE.DVI} and {\tt MYFILE.LIS}.  Even if no \LaTeX\ errors are
detected, you cannot be sure that the document is formatted correctly.
There might be bad line breaks, bad page breaks, alignment problems, poor
selection of fonts, not to mention spelling mistakes. Before {\DVItoVDU}
came along, the only way to check your document was to continue through the
\LaTeX\ cycle and look for any errors in the printed output. This was time 
consuming and wasted  a great deal of paper. Now you can use {\DVItoVDU} to look
at {\tt MYFILE.DVI} on a variety of commonly available VDUs. 

{\DVItoVDU} reads a given {\tt .DVI} file and translates the coded
description of a page into some sort of visible representation on the
screen. {\DVItoVDU} is an interactive program; you can enter commands to
select a particular page for display, look at the overall format of the
entire page and then request a smaller region for closer examination. The
manner in which the page is displayed can be varied from a full, accurate
representation to a terse, fast display for when fine details are
unimportant. All the commands are described in detail in 
section~\ref{subsec:commands}. 



\section{Invoking \DVItoVDU}
To preview  {\tt MYFILE.DVI}, just type the command:
\begin{quote}
    \tt DVITOVDU MYFILE
\end{quote}


\subsection{The command qualifiers.}
The {\DVItoVDU} command verb can be followed by a number of qualifiers,
either before or after the {\tt .DVI} file name. If the same
qualifier appears more than once then the last value will be used. If a
particular qualifier does not appear then {\DVItoVDU} will use a default
value. The default values are listed in table~\ref{table:defaultquals}. 

\begin{table}[htbp]
\centering
\begin{tabular}{|l|l|}
\hline
{\bf Qualifier} &   {\bf Default Value} \\
\hline
{\tt /VDU} & {\tt ReGIS} \\
{\tt /RESOLUTION} & 300 \\
{\tt /XSIZE}    & 210mm\\
{\tt /YSIZE}     & 297mm \\
{\tt /XORIGIN}   & 25.4mm \\
{\tt /YORIGIN}   & 25.4mm \\
{\tt /HOFFSET}   & 0mm \\
{\tt /VOFFSET}   & 0mm \\
{\tt /MAGNIFICATION}  & {\tt .DVI} magnification \\
{\tt /TFM\us{}DIRECTORY} & {\tt TEX\$FONTS:} \\
{\tt /PK\us{}FONT\us{}DIRECTORY} & {\tt TEX\$PK:} \\
{\tt /PXL\us{}FONT\us{}DIRECTORY} & {\tt TEX\$PXL\us{}ROOT:} \\
{\tt /DUMMY\us{}FONT}   & {\tt CMR10} \\
{\tt /HELP\us{}FILE}     & {\tt TEX\$HELP:DVITOVDU\us{}V3-2\us{}ONLINE.HLP} \\
{\tt /PSPREFIX} & {\tt ps-} \\
\hline
\end{tabular}
\caption{The default values of the {\tt DVITOVDU} command 
qualifiers}\label{table:defaultquals}
\end{table}



\subsubsection{{\tt /VDU}}

This qualifier is used to tell {\DVItoVDU} what type of VDU you are using.
In our case, {\tt /VDU=ReGIS} is the default.  If your terminal is not
ReGIS compatible ({\em e.g.\/} VT240, VT241, VT330, VT340) you need to
override the default value.  For example, if you're using a Visual 550
terminal, type:
\begin{quote}
    \tt DVITOVDU/VDU=VIS550 MYFILE
\end{quote} 

The values of the {\tt /VDU} qualifier accepted by the current version of 
{\DVItoVDU} are listed in table~\ref{table:vduvalues}. Some VDUs may require 
special settings for {\DVItoVDU} to work properly, see 
Appendix~\ref{app:vdusetups} for details.



\begin{table}[htbp]
\centering
\begin{tabular}{|l|l|}
\hline
{\bf Value} & {\bf Meaning} \\
\hline
AED483&    AED 512 with 512 by 483 screen\\
AED512&    AED 512 with 512 by 512 screen\\
ANSI&      any ANSI compatible VDU; includes VT100, VT200\\
BBC&	   BBC model B micro running {\sl Termulator}\\
GIGI&	   GIGI terminal using ReGIS \\
REGIS&	   any ReGIS compatible VDU \\
SG480&     VT100 with Selanar Graphics\\
Tektronix& Tektronix 40xx \\
VIS240&    VISUAL 240\\
VIS241&    VISUAL 241\\
VIS500&    VISUAL 500\\
VIS550&    VISUAL 550\\
VK100&     GiGi terminal, using ReGIS\\
VT100&	   VT100 in 80 column mode\\
VT100132&  VT100/200/300 series in 132 column mode\\
VT125&	   VT125 using ReGIS\\
VT200&	   VT200 series using downloaded chunky graphics\\
VT220&	   VT220 using downloaded chunky graphics\\
VT240&     VT240 using ReGIS\\
VT241&     VT241 using ReGIS\\
VT300&	   VT300 series using downloaded chunky graphics\\
VT320&	   VT320 using downloaded chunky graphics\\
VT330&     VT330 using ReGIS\\
VT340&     VT340 using ReGIS\\
VT640&     VT100 with Retro-Graphics\\
VTTEK&	   VT200/300 series using Tektronix graphics\\
\hline
\end{tabular}
\caption{Acceptable values of the {\tt /VDU} 
qualifier}\label{table:vduvalues}
\end{table}


\subsubsection{{\tt /RESOLUTION}}
{\DVItoVDU} treats the imaginary sheet of paper on which a {\tt .DVI} page
will appear as a two-dimensional array of tiny dots known as pixels (short
for ``picture elements''). The value defines the number of paper pixels per
inch, horizontally {\it and} vertically, and should be a positive integer.
Its value should match the resolution of the device that will be used to
print your document. RMCS has a number of DEC LN03 laser printers with
a resolution of 300 dots per inch.



\subsubsection{{\tt /XSIZE} and {\tt /YSIZE}}
These two qualifiers define the dimensions of the paper upon which your
document will be printed. Note that their default values specify A4 paper
(210mm wide by 297mm high). Every time you select a page for
display, {\DVItoVDU} will use these paper dimensions to check that the page
edges fall within the paper edges. 


\subsubsection{{\tt /XORIGIN} and {\tt /YORIGIN}}
These two qualifiers are used to define the paper coordinates of the
\TeX{} origin.  You should only need to use them if you need to change the
origin from the \TeX{} standard of (1in, 1in). Negative dimensions are
not allowed as the \TeX{} origin must correspond to a point on the physical
page.


\subsubsection{{\tt /HOFFSET} and {\tt /VOFFSET}}
These two qualifiers are used to shift the location of each page within the
paper. You should only need to use them if you plan to print the document with
similar offsets. Negative dimensions are allowed ({\em e.g.\/} {\tt
/HOFFSET=-0.5IN} shifts each page half an inch to the left.


\subsubsection{{\tt /MAGNIFICATION}}
The {\tt /MAGNIFICATION} qualifier allows you to override the 
{\tt \bs magnification} value of the {\tt .DVI} file.

Unless you know exactly what you are doing, you should avoid using the 
{\tt /MAGNIFICATION} qualifier. The complete story on magnification can be 
found in chapters 4 and 10 of {\sl The \TeX book\/}\cite{knuth:texbook}. 

\subsubsection{{\tt /TFM\us{}DIRECTORY}}
DVItoVDU needs to read TFM files if your document uses resident
PostScript fonts (for which bitmapped information does not exist).

Unless you know exactly what you're doing, you should avoid using this
qualifier.

 
\subsubsection{{\tt /PK\us{}FONT\us{}DIRECTORY}}
DVItoVDU gets its font bitmap information from PK and/or PXL files, searching
first for the PK version of the font, and then the PXL version if the PK
version could not be opened.  The directory given by this qualifier is
searched for the PK files. 

Unless you know exactly what you're doing, you should avoid using this
qualifier.  


\subsubsection{{\tt /PXL\us{}FONT\us{}DIRECTORY}}
DVItoVDU gets its font bitmap information from PK and/or PXL files, searching
first for the PK version of the font, and then the PXL version if the PK
version could not be opened.  The directory given by this qualifier is
searched for the PXL files. 

Unless you know exactly what you're doing, you should avoid using this
qualifier.  

 
\subsubsection{{\tt /DUMMY\us{}FONT}}
If a requested font does not exist, {\DVItoVDU} will first warn you, then
load the given \TeX{} font specified by {\tt /DUMMY\us{}FONT} and continue as
best it can so you can look for more errors. Paragraphs using this dummy
information are likely to have ragged right margins. Even if you don't use
{\tt /MAGNIFICATION}, there may still be problems with the fonts requested
in your \LaTeX\ source file, since fonts do not exist at all possible
sizes. Refer to the \LaTeX\ User Guide~\cite{RMCS:latexguide} for a list of
the fonts available in our system. 

Unless you know exactly what you're doing, you should avoid using this
qualifier.


\subsubsection{{\tt /HELP\us{}FILE}}
This qualifier specifies the text file to be used by \DVItoVDU{} for online
help information.

Unless you know exactly what you're doing, you should avoid using this
qualifier.


\subsubsection{{\tt /PSPREFIX}}
If your document uses PostScript fonts (for which no bitmap exists),
\DVItoVDU{} uses the {\tt .TFM} files to display a representation of the 
document. All fonts beginning with this prefix are assumed to be PostScript
fonts. If you specify {\tt /PSPREFIX=""}, {\em all} fonts will be treated
as PostScript fonts.



\section{Using \DVItoVDU}
If you have invoked \DVItoVDU{} correctly ({\em i.e.\/} with the
appropriate {\tt /VDU} qualifier value for your terminal), {\DVItoVDU} will
clear the screen and start up with the  display shown in
figure~\ref{fig:startupscreen}. 


\begin{figure}[htbp]
\centering\tt
\fbox{\shortstack[l]{
Total pages=$n$~~~~~DVI page=0~~~TeX page=[0]~~~Next=>~~~Terse \\
Window at ($h$,$v$) {\em Wwd} by {\em Wht}~~~Page at ({\em minh},{\em minv}) 
{\em Pwd} by {\em Pht}~~~IN \\
This is DVItoVDU, version 3.2\\
Command: \\
\vspace*{2.5in}}}
\caption{\DVItoVDU{} Startup Screen}\label{fig:startupscreen}
\end{figure}

The top four lines represent the ``dialogue region''; the rest of 
the screen is called the ``window region'' and should be blank at this stage. 


\subsection{The Dialogue Region.}

The top two lines show status information.  The first status line shows:

%
%
% redefine the description environment
%
%
\def\descriptionlabel#1{#1\ \hfil}
\makeatletter
\settowidth{\labelwidth}{\tt Page at ({\em minh},{\em minv})}
\addtolength{\labelwidth}{\labelsep}
\def\description{\list{}{\leftmargin\labelwidth
\advance\leftmargin\labelsep
  \itemindent\z@ \itemsep=0pt plus 1pt \let\makelabel\descriptionlabel}}
  \makeatother
%
%
\begin{description}
\item[\tt Total pages=$n$]
		The total number of pages in the {\tt .DVI} file.
\item[\tt DVI page=0] 
		The current {\tt .DVI} page.
\item[{\tt TeX page=[0]}] 
		The  \LaTeX\ page counters corresponding  to the 
		current {\tt .DVI} page. Specific pages can be selected 
		by their position 
		in the DVI file (1 to $n$) or by the value of their \LaTeX\ 
		counters. 
\item[{\tt Next=>}] The direction in which the {\tt N} command will select 
		consecutive pages; initially {\tt >}.  The {\tt >} and 
		{\tt <} commands allow you to move forwards or backwards 
		through the {\tt .DVI} file. 
\item[\tt Terse] 	The current display mode; initially {\tt Terse}. The 
		{\tt T}, {\tt B} and {\tt F} commands allow you to switch 
		between {\tt Terse}, {\tt Box} and {\tt Full} display modes. 
\end{description}

\noindent The second status line shows:

\begin{description}
\item[\tt Window at ($h$,$v$)]
      The current location and size of the window. $h$ and $v$ are
      horizontal and vertical coordinates that define the current paper
      position of the top left corner of the window region. The following
      section has details on the coordinate scheme used by
      {\DVItoVDU}\null.  The {\tt W} command allows you to move the window
      to an absolute position; the {\tt U}, {\tt D}, {\tt L} and {\tt R}
      commands allow relative positioning.
       
\item[\tt {\em Wwd} by {\em Wht}]
      {\em Wwd} and {\em Wht} represent the current width and height of 
      the window
      region; their values are changed by the {\tt H} and {\tt V}
      commands. The initial window size depends on the {\tt /RESOLUTION}
      value and the size and resolution of your VDU screen. 
\item[\tt Page at ({\em minh},{\em minv})]
      The location and size of the ``page rectangle''. The values {\em minh},
      {\em minv}, {\em maxh\/} and {\em maxv\/} define the smallest rectangle
      containing
      all the rules and characters in the current page. ({\em minh,minv\/}) is
      the top left corner of this rectangle.
\item[\tt {\em Pwd\/} by {\em Pht}]
      The rectangle is {\em Pwd\/} units wide and {\em Pht\/} units high. 
\item[\tt IN]
      The current units; initially inches. All numbers shown in this line
      are dimensions in terms of these units. The two letters shown at the
      end of the line correspond to the commands that allow you to switch
      between inches ({\tt IN}), centimetres ({\tt CM}), millimetres ({\tt
      MM}), points ({\tt PT}), picas ({\tt PC})  and pixels ({\tt PX}).
      Pixel values are shown as integral numbers and represent exact
      dimensions; all other values are shown as real numbers but only to
      one decimal place. 
\end{description}

\noindent Until a page is selected, most of the status values are
meaningless and set to zero. 

The third line is initially blank;  {\DVItoVDU} displays messages of
various kinds in this line.  Some of these messages appear only briefly but
may convey helpful information. Others are more important and indicate some
sort of problem, such as an invalid command or a page that won't fit on the
paper; in these cases {\DVItoVDU} will prompt you to hit the {\tt RETURN}
key before continuing. 

The last line in the dialogue region is for entering commands.  The first
thing you normally want to do is choose a particular page for display. For
example, typing {\tt 1} will select the first page in the {\tt .DVI} file.
Many commands can be entered in the one command line.  Hit {\tt RETURN} to
execute the command(s). 

\subsection{The Window Region.}

The number of {\em paper\/} pixels per inch is given by the {\tt /RESOLUTION}
qualifier. A pixel can be either black (corresponding to a tiny blob of ink)
or white (no ink). A typical DVI page contains characters from one or more
fonts, and perhaps a few rules. A rule is simply a rectangular region of black
pixels, usually in the shape of a thin horizontal or vertical line. A
character is usually a more complicated pattern of black and white pixels.
Every character and rule has a paper position---or ``reference point''---that
is defined by a pair of pixel values $(h{,}v)$ where $h$ is the horizontal
coordinate and $v$ is the vertical coordinate. {\DVItoVDU} uses a coordinate
scheme in which the position $(0{,}0)$ is a pixel one inch in from the top and
left edges of the paper.  Vertical coordinates increase down the paper,
horizontal coordinates increase to the right. Confused?
Figure~\ref{fig:layout} may help to clear things up. 

\begin{figure}[htbp]
\setlength{\unitlength}{0.62in}

\begin{picture}(8.5,12.5)(0,-0.5)
\tiny
\put(0,0){\framebox(8.3,11.7){\mbox{}}}
\multiput(1.0,10.7)(0.0,0.05){20}{\circle*{0.01}}
\multiput(1.0,10.7)(-0.05,0.0){20}{\circle*{0.01}}
\put(1.0,10.7){\circle*{0.07}}
\put(0.0,11.7){\circle*{0.07}}
\put(1.1,11.2){1"}
\put(0.4,10.55){1"}
\put(0.58,10.8){(0,0)}
\put(0,11.9){(-1,-1) in inches}
\put(1.4,11.2){The number of pixels per inch is set by the {\tt /RESOLUTION} 
qualifier.}
\put(0.0,11.8){\makebox(8.3,0.0)[c]{Paper edges will be displayed if visible.}}
\put(3.0,-0.2){Paper width is set by {\tt /XSIZE} qualifier.}
\put(0.1,5.8){\shortstack[l]{Paper height is set by\\ the {\tt /YSIZE} 
		qualifier.}}
\put(1.1,10.67){$\rightarrow$}
\put(1.4,10.66){increasing $h$ coordinates}
\put(0.5,10.1){\shortstack[c]{$\downarrow$\\increasing\\$v$ coordinates}}
\put(2.4,1.0){\dashbox{0.09}(3.6,5.6)[t]{\Large\bf Chapter 56}}
\put(2.4,4.8){\makebox(3.6,0.0)[c]{\huge\bf How to LOGIN}}
\put(2.4,1.1){\makebox(3.6,0.0)[c]{\normalsize\bf HAL 9000 Beginner's Guide}}
\put(2.4,6.6){\circle*{0.07}}
\put(6.0,1.0){\circle*{0.07}}
\put(0.75,6.55){Page at ({\em minh},{\em minv\/})}
\put(6.1,0.95){($maxh$,$maxv$)}

\put(3.6,4.8){\dashbox{0.09}(3.0,3.1)[t]{\shortstack{\mbox{}\\Use {\tt U}, 
{\tt D}, {\tt L} and {\tt R} commands\\to move the window.}}}
\put(3.6,7.9){\circle*{0.07}}
\put(1.9,8.0){Window at ($h$,$v$)}
\put(3.6,8.05){\makebox(3.0,0.0)[c]{Window width is set by the {\tt H} command.}}
\put(6.65,6.3){\shortstack[c]{Window height is set\\by the {\tt V} command.}}

\put(3.9,5.7){\shortstack{Only this portion of the\\page is currently visible.}}
\put(2.4,0.8){\makebox(3.6,0.0)[c]{Page width.}}
\put(1.9,1.0){\makebox(0.0,5.6)[c]{Page height.}}

\end{picture}
\caption{The relationship between the screen window and the
paper}\label{fig:layout}
\end{figure}




The window region is used to view the current DVI page.
{\DVItoVDU} treats this region of the VDU screen as a two-dimensional array
of dots, but we refer to these dots as ``screen pixels'' to distinguish them
from the paper pixels described above.
A screen pixel is usually the smallest possible area on a VDU screen that
can be drawn or erased; the greater the number of screen pixels in a given area,
the higher the resolution of the VDU.

The initial size of the window region depends on {\tt /RESOLUTION} and the
size and resolution of the VDU screen you are using.
Assuming a {\tt /RESOLUTION} value of 300, the initial window sizes 
(widths by heights) for the VDUs currently implemented are listed in 
table~\ref{table:windowsizes}.

\begin{table}[htbp]
\centering
\begin{tabular}{|l|l|l|l|}
\hline
{\bf VDU} & {\bf inches} & {\bf cm} &{\bf pixels}\\
\hline
& & & \\[-0.5ex]
AED483&    1.7 by 1.5&   4.3 by 3.7&  512 by 442\\
AED512&    1.7 by 1.8&   4.3 by 4.0&  512 by 471\\
ANSI&      0.3 by 0.1&   0.7 by 0.2&  80 by 20\\
BBC&       3.4 by 2.2&   8.7 by 5.5&  1024 by 650\\
GIGI&	   2.6 by 1.3&   6.5 by 3.4&  768 by 400\\
REGIS&	   2.6 by 1.3&   6.5 by 3.4&  768 by 400\\
SG480&     3.4 by 2.2&   8.7 by 5.5&  1024 by 650\\
Tektronix& 3.4 by 2.2&   8.7 by 5.6&  1024 by 657\\
VIS240&    2.7 by 1.7&   6.8 by 4.2&  800 by 500\\
VIS241&    2.7 by 1.7&   6.8 by 4.2&  800 by 500\\
VIS500&    3.4 by 2.3&   8.7 by 5.8&  1024 by 688\\
VIS550&    3.4 by 2.3&   8.7 by 5.8&  1024 by 688\\
VK100&     2.6 by 1.3&   6.5 by 3.4&  768 by 400\\
VT100&     0.3 by 0.1&   0.7 by 0.2&  80 by 20\\
VT100132&  0.4 by 0.1&   1.1 by 0.2&  132 by 20\\
VT125&     2.6 by 1.3&   6.5 by 3.4&  768 by 400\\
VT200&     0.4 by 0.3&   1.1 by 0.8&  132 by 100\\
VT220&     0.4 by 0.3&   1.1 by 0.8&  132 by 100\\
VT240&     2.7 by 1.3&   6.5 by 3.4&  768 by 400\\
VT241&     2.7 by 1.3&   6.5 by 3.4&  768 by 400\\
VT300&     0.4 by 0.3&   1.1 by 0.8&  132 by 100\\
VT320&     0.4 by 0.3&   1.1 by 0.8&  132 by 100\\
VT330&     2.7 by 1.3&   6.5 by 3.4&  768 by 400\\
VT340&     2.7 by 1.3&   6.5 by 3.4&  768 by 400\\
VT640&     3.4 by 2.2&   8.7 by 5.5&  1024 by 650\\[0.5ex]
VTTEK&     3.4 by 2.2&   8.7 by 5.5&  1024 by 650\\
\hline
\end{tabular}
\caption{The initial window sizes of the VDUs supported by 
\DVItoVDU}\label{table:windowsizes}
\end{table}


The most accurate representation of a page will occur at these unscaled values,
since paper pixels are mapped directly to screen pixels.
You can increase or decrease the area currently visible by using
the {\tt H} and {\tt V} commands to change the size of the window region.  The higher
the resolution of the VDU, the greater the accuracy of such scaled displays.

Note the very low resolution of the ANSI and VT100132 VDUs.
These are not ``graphic'' terminals;
{\DVItoVDU} has to define a screen pixel to be an entire character position,
since the individual dots making up characters cannot be turned on and off.
An ANSI screen typically consists of 24 lines of 80 columns,
therefore the initial window region is 80 pixels wide and 20 pixels high
(the top 4 lines are used for the dialogue region).
At more useful window sizes the resulting displays will be extremely crude.
Nevertheless, a variety of formatting errors can still be detected on such
terminals; just don't try proofreading your document!

The size and location of the window region are automatically set
every time a page is selected.
{\DVItoVDU} tries to show as much of the
paper (and presumably the page) as possible, and without too much distortion.
After comparing the shape of the paper with the shape of your
VDU's {\it initial} window region, and depending on the location of the
page, {\DVItoVDU} may show the entire paper,
or the top or bottom half, or the left or right half.
If any part of the page is off the paper then the entire paper {\it and} the
entire page will be shown.
Since most paper sizes have portrait dimensions (width $<$ height), and most
VDU screens have landscape dimensions (width $>$ height), {\DVItoVDU} will
normally show the top half of a sheet of paper containing the selected page.


\subsection{The Commands}\label{subsec:commands}

In response to the {\tt Command:} prompt, you can enter one or more of the
following commands in upper or lowercase.  Multiple commands are
processed in the order given but the window region is only updated,
if necessary, at the end.
E.g., if you type {\tt NFD} then {\DVItoVDU} will get the Next page, switch to
Full display mode, move the window Down, and only then display the page.
If an invalid command is detected, any further commands are ignored.
Most commands consist of only one or two characters; some can be followed by
parameters.  Spaces before and after commands and parameters are optional.

\subsubsection{Miscellaneous}
%
%
% redefine the description environment
%
%
\def\descriptionlabel#1{#1\ \hfil}
\makeatletter
\settowidth{\labelwidth}{\tt {[$i_0$.$i_1$. $\scriptstyle\cdots$ .$i_9$]}}
\addtolength{\labelwidth}{\labelsep}
\def\description{\list{}{\leftmargin\labelwidth
\advance\leftmargin\labelsep
  \itemindent\z@ \itemsep=0pt plus 1pt \let\makelabel\descriptionlabel}}
  \makeatother
%
%
\begin{description}
\item[\tt ?] Display help on the available commands.  Information is shown a
	screenfull at a time; you can request the next screenfull or return 
	to the current page display.
\item[\tt S] Show the various qualifier values and statistics about the 
	number of fonts, characters and rules used in the current page.
\item[\tt Q] Quit from {\DVItoVDU}.
\end{description}

\subsubsection{Selecting a Page}
\begin{description}
\item[\em i\/] Display the $i$th DVI page.  $i$ must be a positive integer 
	from 1 to $n$ where $n$ is the total number of pages in the DVI file.
\item [\tt {[$i_0$.$i_1$. $\scriptstyle\cdots$ .$i_9$]}]
	Display the DVI page whose \LaTeX\ page counters match the given
	specification. $i_0$ to $i_9$ are integers separated by periods.  
	Any number of these integers may be absent and trailing periods may 
	be omitted.
	An absent integer will match any value in the corresponding counter.
	If more than one DVI page matches, the lowest will be chosen.
	E.g., {\tt []} is equivalent to {\tt [.........]} and will select the 
	first DVI page, even though the request matches every possible page.

	\LaTeX\ stores the values of {\tt \bs count0},{\tt \bs count1}, ..., 
	{\tt \bs count} in each 
	DVI page. \LaTeX\ normally uses only {\tt \bs count0} to control page 
	numbering; 
	the remaining counters are set to zero. Some other macro packages 
	may use 
	the other counters for section or chapter numbering; e.g., {\tt [2.5]} 
	might mean ``select page 2 from chapter 5''.

	When showing the current \LaTeX\ page in the top status line, 
	{\DVItoVDU} always shows the value of {\tt \bs count0}, but trailing 
	counters with zero values are not shown.

	If your \LaTeX\ source file doesn't
	change the value of {\tt \bs count0} then the $i$th DVI page will 
	be \LaTeX\ page [$i$].

\item[\tt N] Display the Next DVI page, depending on the current DVI page and
	the current direction ({\tt >} or {\tt <}).  Before any page has been 
	requested, {\tt N} will select the first DVI page if the current 
	direction is {\tt >}, or the last DVI page if the current direction
	is {\tt <}.
\item[\tt >] Select DVI pages in ascending order.  If $i$ is the current DVI 
	page, an {\tt N} command will select page $i+1$ unless $i$ is the 
	last DVI page.

\item[\tt <] Select DVI pages in descending order.  If $i$ is the current DVI 
	page, an {\tt N} command will select page $i-1$ unless $i$ is 1.
\end{description}

\subsubsection{Changing the Way a Page is Displayed}
The window region is updated in the following manner:
\begin{enumerate}
\item Visible paper edges are drawn first.
\item Visible rules are then shown in full, no matter what the display mode.
\item Visible characters are finally shown font by font (in order of
	increasing number of characters on the page).
\end{enumerate}
At any stage, you can hit the {\tt RETURN} key to abort the display,
or change the display mode by hitting the {\tt T}, {\tt B} or {\tt F} keys.

\begin{description}
\item[\tt T] 	Display a {\tt Terse} representation of characters.
	On most VDUs the \LaTeX\ text fonts should be readable; the 
	characters will be in approximately the right position and may even 
	be about the right size.
	Note that the text fonts will all look alike; you won't be able to 
	distinguish between roman and bold characters for example.
	Characters from non-text fonts, such as math symbols, will be 
	incorrectly represented.

\item[\tt B] Display {\tt Box} outlines of the smallest rectangles containing 
	all the	black pixels in characters.  The reference points of 
	characters from most
	\LaTeX\ fonts are usually located at or near the bottom left corners
	of these boxes.
\item[\tt F] Display a {\tt Full} representation of all pixels in characters.
	This display is the most accurate but may take some time;
	hit {\tt RETURN} or switch to {\tt Terse} or {\tt Box} mode if you 
	get bored.
	On the higher resolution VDUs, a good compromise between speed and 
	accuracy is to start off in {\tt Full} mode so that math symbols and 
	any other special characters are displayed correctly, and to switch to 
	{\tt Terse} mode when the bulk of the text begins.
\end{description}
\subsubsection{Changing the Units of Dimensions}
All the numbers in the second line of the dialogue region are dimensions in
the units shown at the end of the line. The parameters following some
commands are also dimensions in terms of these units. Unlike the dimensions
in \LaTeX, you don't explicitly type the units when you need to specify a
dimension to {\DVItoVDU}; simply enter an integer value or real value
(which will be truncated to four decimal places if necessary). A given
value is rounded up internally to the nearest pixel based on the current
units and the conversion factors shown below. 

\begin{description}
\item[\tt IN] Dimensions will be shown and entered in inches
              ({\tt /RESOLUTION} defines the number of pixels per inch).
\item[\tt CM] Dimensions will be shown and entered in centimetres.
\item[\tt MM] Dimensions will be shown and entered in millimetres.
\item[\tt PC] Dimensions will be shown and entered in picas (1pc = 12pt).
\item[\tt PT] Dimensions will be shown and entered in points (72.27pt = 1in).
\item[\tt PX] Dimensions will be shown and entered in pixels.
\end{description}


\subsubsection{Changing the Size of the Window}
The width and height of the window region can be changed at any time to
increase or decrease the area of page currently in view. The location of
the window will not change unless the page becomes invisible. The
parameters $wd$ and $ht$ are dimensions ranging from 1 pixel to 480 inches.
Note that the width and height of the window are automatically set every
time a page is selected; their values will normally depend on the paper
dimensions. 

\begin{description}
\item[{\tt H} $wd$]
	Set the Horizontal size of the window to the given width. If $wd$
        is absent then set window width to its initial, unscaled value. 
\item[{\tt V} $ht$]
	Set the Vertical size of the window to the given height. If $ht$ is
        absent then set window height to its initial, unscaled value. 
\item[{\tt ZI}]
	Zoom in by halving the current height and width of the window.
\item[{\tt ZO}]
	Zoom out by doubling the current height and width of the window.

\end{description}


\subsubsection{Moving the Window Over a Page}
The window region can be moved to any position over the current page. The
parameters $h$ and $v$ are dimensions ranging from $-480$ inches to $+480$
inches (for those of you \LaTeX ing billboards). You will be told if the
window moves entirely outside the page rectangle defined by {\em minh},
 {\em minv}, {\em maxh\/} and {\em maxv}.  If this does happen, the 
movement is restricted to {\em just outside\/} the edges to make it easier 
to get back over the page using
only the {\tt U}, {\tt D}, {\tt L} and {\tt R} commands. Note that the
location of the window is automatically set every time a page is selected;
this position will normally be $(-1,-1)$ in inches; i.e., the top left
corner of the paper. 

\begin{description}
\item[{\tt W} $h,v$]
	Move the Window region's top left corner to the given paper
        position. $h$ is the horizontal coordinate, $v$ is the vertical
        coordinate. If $h$ and $v$ are absent then the window is moved to
        $(minh{,}minv)$, the top left corner of the page rectangle. 
\item[{\tt U} $v$]
	Move the window Up $v$ units. If $v$ is absent then move up an
        amount equal to the window's current height. 
\item[{\tt D} $v$]
	Move the window Down $v$ units. If $v$ is absent then move down an
        amount equal to the window's current height. 
\item[{\tt L} $h$]
	Move the window Left $h$ units. If $h$ is absent then move left an
        amount equal to the window's current width. 
\item[{\tt R} $h$]
	Move the window Right $h$ units. If $h$ is absent then move right
        an amount equal to the window's current width. 
\end{description}



 
\section{Examples of \DVItoVDU{} Commands}
The spaces between commands in the following examples are for clarity; they
are not mandatory. 
 
\begin{quote}
\tt
  < N N N
\end{quote}

If these commands are given before a page has been requested, they will
select the 3rd last page for display (assuming there are at least 3 pages).
{\tt <}~tells {\DVItoVDU} to select pages in reverse order; the following
{\tt N} selects the last page; the remaining {\tt N}s go back another 2
pages. Note that only the 3rd last page will be displayed, even though the
intervening pages are also decoded. 
 
\begin{quote}
\tt
1 F W H V
\end{quote}
 
This command sequence is very useful for looking carefully at the results
of a small \LaTeX\ experiment.  You might, for instance, want to look
closely at the appearance of two characters separated by a small {\tt \bs
kern}. {\tt 1}~selects the first DVI page (usually the only page in such
experiments); {\tt F}~sets the display mode to full; {\tt W}~moves the
window to the top left corner of the page; {\tt H}~sets the horizontal size
of the window to its unscaled value and {\tt V}~sets the vertical size of
the window to its unscaled value. Remember that this unscaled window size
produces the most accurate display, since each screen pixel corresponds to
exactly one paper pixel. 
 
\begin{quote}
\tt
R9999 L D9999 U
\end{quote}
 
Sometimes you want to move quickly to the right edge of the page to have a
look at line breaks, or you might want to go to the bottom and look at
where the page was broken. This particular command sequence will move the
window's {\it bottom right} corner to the bottom right corner of the
current page; i.e., $(maxh{,}maxv)$. {\tt R9999}~moves the entire window to
the right of the page, but only just; {\tt L}~then moves the window left by
its current width so that the {\it right} edges of the window and the page
coincide; {\tt D9999}~moves the entire window below the page, but only
just; {\tt U}~then moves the window up by its current height so that the
{\it bottom} edges of the window and page also coincide. 
 
\begin{quote}
\tt
IN W-1,-1 V12 H16 T
\end{quote}
 
It is often useful to get an overview of the positioning of the page within
the paper.  These commands will do just that on all the VDUs currently
implemented, assuming the default A4 paper size. (The {\tt S} command shows
the paper dimensions if you can't remember them.) {\tt IN}~sets the current
units to inches just in case they were something else; {\tt W-1,-1}~moves
the window to the top left corner of the paper (recall that $(0{,}0)$ is
one inch in from the top and left paper edges); {\tt V12}~sets the window
height to slightly more than the default paper height; {\tt H16}~sets the
window width to a value that will ensure the paper shape maintains the
right proportions (most VDUs have screens with widths greater than their
heights); {\tt T}~sets the display mode to terse since you're probably not
concerned with finer details when looking at the entire paper. 
 
\begin{quote}
\tt
[.56] W IN H2.5 V2.6 R1 U1 F
\end{quote}
 
This is the likely command sequence that led to the window display shown in
figure~\ref{fig:layout}.  The author has been clever enough to define a {\tt
\bs chapter} macro that sets {\tt \bs count1} to the given chapter number.
{\tt [.56]}~will thus select the appropriate DVI page ({\tt \bs count0} is
ignored); {\tt W}~moves the window to the top left corner of the page; {\tt
IN}~sets the current units to inches; {\tt H2.5}~and {\tt V2.6}~set the window
dimensions; {\tt R1}~moves the window right 1 inch; {\tt U1}~moves the window
up 1 inch; {\tt F}~sets the display mode to full. 

\chapend
\appendix
\section{Setting up Your VDU for \DVItoVDU}\label{app:vdusetups}
Some VDUs require special settings for \DVItoVDU{} to work properly.
The VDUs are listed by the appropriate {\tt /VDU} qualifier value.

\subsection{\tt /VDU=AED483}
The AED483 terse display is a bit nastier than most: characters
may get overwritten if they are too close together.  Don't worry too
much if you suddenly see many more spelling mistakes than
usual!

\subsection{\tt /VDU=AED512}
The AED512 terse display is a bit nastier than most: characters
may get overwritten if they are too close together.  Don't worry too
much if you suddenly see many more spelling mistakes than
usual!

\subsection{\tt /VDU=VIS500}
The VIS500  terminal has function keys which control how information on 
the screen is to be displayed. {\DVItoVDU} assumes  graphic images and 
alphanumeric text can be seen at the same time. To ensure that this is 
possible, you may need to 

\begin{itemize}
  \item hit the SET-UP key
  \item hit the F6 function key until F6=BOTH appears
  \item hit the SET-UP key to return to normal operating mode.
\end{itemize}

You can do this while {\DVItoVDU} is running.
The Scale Factor should be set at 3:4.

\subsection{\tt /VDU=VIS550}
The VIS550  terminal has function keys which control how information on 
the screen is to be displayed. {\DVItoVDU} assumes  graphic images and 
alphanumeric text can be seen at the same time. To ensure that this is 
possible, you may need to 

\begin{itemize}
  \item hit the SET-UP key
  \item hit the F6 function key until F6=BOTH appears
  \item hit the SET-UP key to return to normal operating mode.
\end{itemize}

You can do this while {\DVItoVDU} is running. The Scale Factor should be set
 at 3:4.

The VIS550 VDU is assumed to be emulating a VT100 when handling
alphanumeric text.  Check the SET-UP menus if your screen becomes
full of junk. 


\subsection{\tt /VDU=VT100132}
If you select VT100132, {\DVItoVDU} assumes you have already switched
to 132 column mode; {\em i.e.}, you must type the command: 
\begin{quote}
 \tt SET TERM/WIDTH=132
\end{quote}
 {\it before\/} running {\DVItoVDU}.

\chapend
\begin{thebibliography}{1}

\bibitem{RMCS:latexguide}
C.~Niel Kempson and Brian {Hamilton Kelly}.
\newblock {\LaTeX} {U}ser {G}uide for the {{\sl VAXen\/}} at {RMCS}.
\newblock Technical report, School of Electrical Engineering \& Science, Royal
  Military College of Science, Shrivenham, Swindon, SN6~8LA, July 1988.
\newblock (Second Edition).

\bibitem{RMCS:dvilguide}
Brian Hamilton~Kelly.
\newblock {DVILN03} {U}ser {G}uide.
\newblock Technical report, School of Electrical Engineering \& Science, Royal
  Military College of Science, Shrivenham, Swindon, SN6~8LA, July 1988.
\newblock (For DVILN03 Version 2.0).

\bibitem{knuth:texbook}
Donald~Erwin Knuth.
\newblock {\em The {\TeX}book}.
\newblock Addison-Wesley, October 1984.
\newblock ISBN 0-201-13448-9.

\end{thebibliography}
\addcontentsline{toc}{section}{References}


\end{document}
