YAP User's Guide

August 1998

Christian Schenk <cschenk@snafu.de>

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:

http://www.snafu.de/~cschenk/miktex/downloads.html


---------- Footnotes ----------

(1) Yet Another Previewer

How to open a DVI file

You can open a DVI file in many ways:

• By double-clicking its icon in a Windows Explorer window.
• By invoking YAP from the command line:
yap mydoc.dvi


opens a YAP document window showing the contents of mydoc.dvi. See Command Line, for more information.

• Per Drag&Drop.
• With the command File|Open.
• By selecting an MRU(1) entry from the File menu.

---------- Footnotes ----------

(1) Most Recently Used (File)

Printing DVI Documents

There are two different methods to send a DVI document to the printer:

1. By means of the standard print command (File|Print...).
2. By means of Dvips (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
Causes GhostScript to open the standard Print Setup dialog box. You must set the orientation to Portrait.
-dBATCH
Causes GhostScript to quit when the document has been printed.
-dNOPAUSE
Disables the prompt and the pause at the end of each page.
-dSAFER
Disables unsafe operators.

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:

• While editing a TeX source, issue an appropriate command that invokes YAP to display the TeXed document. YAP will indicate it's idea of the current edit position by drawing a small circle. This is called forward search.
• While viewing the TeXed document with YAP, move the mouse cursor over a paragraph that you want to edit next. Press <e> to jump back to the editor. YAP will try to move the text cursor to the correct source line. This is called inverse search.

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

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:

1. Open the Menu Setup window with the command Options|Menu Setup....
2. Go to the Main Menu page.
3. Double-click the &Accessories item.
4. Select the DVI &Search item.
5. Enter the following information:
Utility
yap.exe -1 -s "%l %n%t" "%P\%N.dvi"
Caption
YAP
Start in
%P
Requires file:
%P\%N.dvi
6. Open a LaTeX document which has been prepared for source specials.
7. Compile the document (Accessories|LaTeX).
8. Initiate DVI Search (Accessories|DVI Search).

Initiating Inverse Search

Provided that the currently opened DVI document contains source specials, you can do an inverse search like this:

1. Define the editor command line (see Inverse Search Settings.).
2. Move the cursor over a paragraph that you want to edit.
3. Press <e> (alternatively, you can select Edit Source from the context menu).

Graphics Output

YAP can display the following graphics formats:

EPS
Encapsulated PostScript
BMP
Device-independant Bitmap

 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:

1. Pressing the left mouse button activates the small magnifying glass.
2. Pressing the left mouse button in combination with the <Shift> key activates the medium sized magnifying glass.
3. Pressing the left mouse button in combination with the <Control> key activates the large magnifying glass.

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

<0>
<1>
<2>
<3>
<4>
<5>
<6>
<7>
<8>
<9>
Adds a digit to the numerical prefix.
<BACK>
Removes the last digit from the numerical prefix.
<->
Negates the numerical prefix.

Zooming

prefix+<+>
Zooms in (unshrinks the page).
prefix+<->
Zooms out (shrinks the page).

Changing Pages

prefix+<g>
Opens the Goto Page dialog box if no prefix argument was entered. Otherwise goes to the specified page.
prefix+<PgUp>
prefix+<b>
prefix+<p>
prefix+<h>
prefix+<Del>
Goes to previous page.
prefix+<PgDn>
prefix+<f>
prefix+<n>
Goes to the next page.
<Ctrl>+<Home>
Goes to the first page.
<Ctrl>+<End>
Goes to the last page.

Scrolling

<End>
Scrolls the window to the bottom of the page.
<Home>
<^>
Scrolls the window to the top of the page.
<Left>
Scrolls the windows left a little bit.
<Shift>+<Left>
<l>
Scrolls the window left.
<Right>
Scrolls the window right a little bit.
<Shift>+<Right>
<r>
Scrolls the window right.
<Space>
Scrolls the window down. Goes to the next page, if at the bottom of the current page.
<Up>
Scrolls the windows up a little bit.
<Shift>+<Up>
<u>
Scrolls the window up.
<Down>
Scrolls the windows down a little bit.
<Shift>+<Down>
<d>
Scrolls the window down.

Misc

<?>
Show the keyboard map.
<e>
Start a text editor to edit the TeX source under the mouse cursure (i. e. perform an inverse search).
<F>
<Ctrl>+<O>
Open a new DVI Document.
<Ctrl>+<P>
Send the DVI document to the printer.
<q>
<Ctrl>+<c>
<Ctrl>+<d>
Quit the application.

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
Expands to the name of the source file.
%l
Expands to the line number in the source file.

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.

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
YAP first consults the Dvips configuration file.
miktex\config\miktex.map
YAP then consults the MiKTeX font mapping file.

Command line switches

The general YAP command line syntax is

yap [options] [dvifile]


The following options are recognized:

--find-src-special srcspecial
-s srcspecial
Initiate a forward search (see Forward and Inverse Search.). The syntax for srcspecial is NNFILENAME (i.e. line number followed by source file name). See the example below.
--single-instance
-1
Use an already opened YAP application window (if one exists). This flag prevents multiple YAP applications instances.
--unregister
Remove YAP related settings from the Windows Registry

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
-sDEVICE
Bitmap files (BMP)
Command line <1>
Command line <2>
Command line
config.ps
Drag & Drop
Dvips <1>
Dvips <2>
Dvips
Encapsulated PostScript
EPS <1>
EPS
Forward search <1>
Forward search <2>
Forward search
GhostScript <1>
GhostScript <2>
GhostScript <3>
GhostScript
gnuclientw
gsdll32.dll <1>
gsdll32.dll
gswin32c
Hand tool
Inverse search <1>
Inverse search
Inverse Search
lpt1
Magnifying glass, activating
Magnifying glass, customizing
Magnifying glass, selecting
METAFONT mode <1>
METAFONT mode
miktex.map
MRU Files
mswinpr2
Navigation
Numerical prefix <1>
Numerical prefix
Orientation <1>
Orientation
Paper size <1>
Paper size
PostScript <1>
PostScript <2>
PostScript
Print range
Printing
Scrolling <1>
Scrolling
Shrink factor <1>
Shrink factor <2>
Shrink factor <3>
Shrink factor
Source specials <1>
Source specials <2>
Source specials
srcltx
Type 1 fonts
Windows Registry
WinEdt <1>
WinEdt <2>
WinEdt <3>
WinEdt
x-shift
y-shift
Zooming

This document was generated using GNU Makeinfo version 1.68