Copyright (C) 1998 Christian Schenk
Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies.
Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one.
Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions, except that this permission notice may be stated in a translation approved by the Free Software Foundation.
| Introduction | What is YAP? |
| Opening Files | How to open a DVI file |
| Printing | Printing DVI documents |
| DVI Search | Forward and Inverse Search |
| Graphics | Graphics Output |
| Tools | YAP Tools |
| Keyboard | Keyboard Interface |
| Customizing YAP | How to customize YAP |
| Command Line | Command Line Switches |
| Index | Index. |
What is YAP?
You use YAP(1) to view a DVI file compiled by TeX before you send it to a printer. YAP tries hard to follow the WYSIWYG-principle: what you see (on screen) is what you get (when you take the paper out of the tray).
This document will explain
As you can conclude from the version number 0.94d, YAP is still under development. You can get the newest development version from the MiKTeX download page:
---------- Footnotes ----------
(1) Yet Another Previewer
How to open a DVI file
You can open a DVI file in many ways:
yap mydoc.dvi
opens a YAP document window showing the contents of mydoc.dvi.
See Command Line, for more information.
File|Open.
File menu.
---------- Footnotes ----------
(1) Most Recently Used (File)
Printing DVI Documents
There are two different methods to send a DVI document to the printer:
File|Print...).
File|Print PostScript...). If your DVI document contains PostScript specials (e.g. EPS inclusions), than you can't use the standard print command.
The Dvips interface also works in conjunction with non-PostScript printers, provided that you have GhostScript installed on your workstation.
| Standard Printing | Standard Print Command |
| Dvips Interface | Printing using Dvips |
Standard Print Command
The command File|Print... opens the standard Print Setup dialog box.
Printing using Dvips
The command File|Print PostScript... opens the Print PostScript
dialog box.
| Dvips Dialog Box | Print PostScript Dialog Box |
Print PostScript Dialog Box
This dialog box allows you select various Dvips options.
Printer
Check this button if you want to pipe the Dvips output through the
GhostScript interpreter (gswin32c.exe). GhostScript will be invoked
with the following options:
-sDEVICE=mswinpr2
Portrait.
-dBATCH
-dNOPAUSE
-dSAFER
PS File
Check this button if you want to send the Dvips output to a
PostScript printer or if you want to save the output in a PostScript
file. Enter a printer port (such as lpt1) or a filename.
Print range
Select the pages that you want to print.
Extra Dvips options
You can enter additional Dvips options here.
Reconfirm command line
Check this button if you want to inspect the Dvips command line.
Show DOS box
Check this button if you want to see Dvips messages.
Forward and Inverse Search
YAP is capable of searching the DVI file for so called source specials. This feature can help you to optimize the edit-compile-view cycle:
| Inserting Source Specials | How to enrich your document with source specials |
| Forward Search | How to search forward |
| Inverse Search | Initiating Inverse Search |
How to enrich your document with source specials
The general syntax for a source special primitive is
\special{src:nnnfilename}
nnn
is the line number and filename is the filename of the TeX source.You can automate the generation of source specials by using the
srcltx package which is a part of the WinEdt(1) distribution.
---------- Footnotes ----------
(1) ftp://ftp.dante.de/tex-archive/systems/win32/winedt
How to search forward
Forward search is initiated by specifying the command line switch
--find-src-special (see Command Line.).
Most often you will use an editor to initiate a forward search. For example, in WinEdt you can do it like this:
Options|Menu Setup....
&Accessories item.
DVI &Search item.
yap.exe -1 -s "%l %n%t" "%P\%N.dvi"
YAP
%P
%P\%N.dvi
Accessories|LaTeX).
Accessories|DVI Search). Initiating Inverse Search
Provided that the currently opened DVI document contains source specials, you can do an inverse search like this:
Edit Source from the
context menu). Graphics Output
YAP can display the following graphics formats:
| EPS | Encapsulated PostScript |
| BMP | Windows Bitmap (BMP) Files |
Encapsulated PostScript
YAP displays EPS figures with the help of GhostScript. You must
have a working GhostScript installation and YAP needs to know the
location of the GhostScript program (gsdll32.dll).
The easiest way to include EPS figures is through the graphics
package:
\usepackage{graphics} \begin{document} \includegraphics{foo.eps} \end{document}
Windows Bitmap (BMP) Files
YAP can display Windows Bitmap Files.
The easiest way to include BMP graphics is through the graphics
package:
\usepackage{graphics} \begin{document} \includegraphics[width=2in,height=1in]{foo.bmp} \end{document}
YAP Tools
YAP provides several tools for browsing the DVI document.
| src Browser | Browsing Source Specials |
| Hand Tool | Hand Tool |
| Magnifying Glasses | Magnifying Glasses |
Browsing Source Specials
The command Tools|Source Specials... opens the the Source Specials
windows.
| Source Specials Window | Source Specials Window |
Source Specials Window
This window lists all source specials found in the current DVI document.
Goto
This button brings into view the portion of the DVI document which contains the selected source special
Edit Source
This button invokes an editor to edit the TeX source corresponding to the selected source special.
Close
This button closes the window.
Hand Tool
The hand tool allows you to scroll the page by moving the cursor
while the left mouse button is pressed. You select the Hand Tool with
the command Tools|Hand Tool or by clicking the corresponding button in
the toolbar.
Magnifying Glasses
The Magnifying Glass allows you to view a small part of the unshrunk
page. You select this tool with the command Tools|Magnifying Glass or
by clicking the corresponding button in the toolbar.
You can choose between three sizes:
The three magnifying glasses are fully customizable (see Magnifying Glass.).
You can specify the power of the magnifying glass by entering a numerical prefix argument. The argument is interpreted as a shrink factor for the text inside the magnifying glass. A shrink factor of 1 (the default) results in a maximum magnification.
Keyboard Map
Numerical Prefix
Zooming
Changing Pages
Goto Page dialog box if no prefix argument was entered.
Otherwise goes to the specified page.
Scrolling
Misc
Customizing YAP
| Options | Options Dialog Box |
| PostScript Fonts | Telling YAP About PostScript Fonts |
Options Dialog Box
| UI | User Interface |
| Magnifying Glass | Magnifying Glass Property Page |
| Display Settings | Changing display settings |
| Printer Settings | Changing printer settings |
| Inverse Search Settings | Inverse Search |
| GhostScript | GhostScript |
User Interface Property Page
The User Interface property page allows you to customize the Look &
Feel of YAP.
Maintain vertical position
Select this checkbox to cause YAP to keep the vertical scroll position at a change of page.
Maintain horizontal position
Select this checkbox to cause YAP to keep the horizontal scroll position at a change of page.
Magnifying Glass Propery Page
This property page allows you to customize the three magnifying glasses.
Width
Enter the width (in screen pixels) of the rectangular magnifying glass window.
Height
Enter the height (in screen pixels) of the rectangular magnifying glass window.
Shrink Factor
Specify the shrink factor to be used in the magnifying glass window. The shrink factor specifies the power of the magnifying glass. A shrink factor of 1 results in a maximum magnification.
Display Property Page
The Display property page allows you to change various display
settings.
Mode
Specify the METAFONT mode for the display.
The Mode list field contains a list of known METAFONT modes. This
information is needed, when new PK fonts are to be generated. In
principle, it doesn't matter what mode name you select here. But it's
recommended, that you use the same mode name as for the printer, since
this reduces the invocations of the font-generator.
Shrink Factor
Specify the default shrink factor.
Paper Size
Specify the paper type.
Orientation
Specify the orientation of the paper.
Printer Property Page
The Printer property page allows yoy to change various printer
settings.
Mode
Specify the METAFONT mode for the printer.
The Mode list field contains a list of known METAFONT modes. This
information is needed, when new PK fonts are to be generated. You must
select a mode, that matches your printer resolution.
x-shift, y-shift
Specify the the print offset.
For some old printer models it may be necessary to adjust the the print offset (i.e. the position, where printing begins). x-shift/y-shift gives the amount of pixels, an output page has to be shifted right/down.
Inverse Search Property Page
Command
Specify the command line which YAP shall execute after a successful inverse search operation (see Initiating Inverse Search.).
The command may contain the following placeholders:
%f
%l
Examples
Enter something like this, if you are using the WinEdt TeX shell:
"c:\Program Files\WinEdt\winedt.exe" "[Open('%f');SelLine(%l,8)]"
Enter something like this, if you use GNU Emacs:
c:\emacs\bin\gnuclientw.exe +%l %f
GhostScript Property Page
GhostScript DLL
Specify the full pathname of the GhostScript interpreter library
gsdll32.dll.
Telling YAP About PostScript Fonts
YAP consults several font mapping files when a missing PK font has to be generated from a PostScript Type 1 font:
dvips\config\config.ps
miktex\config\miktex.map
Command line switches
The general YAP command line syntax is
yap [options] [dvifile]
The following options are recognized:
--find-src-special srcspecial
-s srcspecial
NNFILENAME (i.e. line number followed by
source file name). See the example below.
--single-instance
-1
--unregister
Example
You want YAP to do a forward search to the DVI location corresponding
to line 41 of the source file mydoc.tex. The name of the DVI file is
mydoc.dvi. The forward search is initiated like this:
yap -s 41mydoc.tex mydoc.dvi
If you already have an open YAP application instance, and you don't
want to start another instance, then add the -1 flag:
yap -1 -s 41mydoc.tex mydoc.dvi
Index
--find-src-special <1>--find-src-special--single-instance--unregister-1-dBATCH-dNOPAUSE-dSAFER-s-sDEVICEBitmap files (BMP)Command line <1>Command line <2>Command lineconfig.psDrag & DropDvips <1>Dvips <2>DvipsEncapsulated PostScriptEPS <1>EPSForward search <1>Forward search <2>Forward searchGhostScript <1>GhostScript <2>GhostScript <3>GhostScriptgnuclientwgsdll32.dll <1>gsdll32.dllgswin32cHand toolInverse search <1>Inverse searchInverse Searchlpt1Magnifying glass, activatingMagnifying glass, customizingMagnifying glass, selectingMETAFONT mode <1>METAFONT modemiktex.mapMRU Filesmswinpr2NavigationNumerical prefix <1>Numerical prefixOrientation <1>OrientationPaper size <1>Paper sizePostScript <1>PostScript <2>PostScriptPrint rangePrintingScrolling <1>ScrollingShrink factor <1>Shrink factor <2>Shrink factor <3>Shrink factorSource specials <1>Source specials <2>Source specialssrcltxType 1 fontsWindows RegistryWinEdt <1>WinEdt <2>WinEdt <3>WinEdtx-shifty-shiftZooming