Math software for Windows

Configuring and Using
version of 30 June 2005

YAP ("Yet Another Previewer") is a part of Miktex, and it is installed as part of the Miktex installation. But you may still want to configure parts of it after it is installed.

Miscellaneous configuring.

About printing. You will have to tell YAP what kind of printer you have. This may present a problem, since the list of printers that YAP recognizes might not include your printer. You can tell YAP that you have some other kind of printer -- try to guess which one on YAP's list works similarly to yours -- but this may yield imperfect results. Try experimenting with it. When I have a better solution, I'll post it here. I have figured out this much: YAP expects to find the same printer resolution (and perhaps even the same printer) in its settings for "View...Options...Display" and for "View...Options...Printer". Try to find something that works at the same resolution as your own printer. For instance, if you have a 600 dpi printer, try using YAP's "HP Laserjet 5 (600 dpi)" setting. If you have a 1200 dpi printer, try using "LaserJet 4000N, ProRes mode (1200 dpi)" setting.

Things may also be affected by what you have told Windows is the default configuration for your printer. Go into Windows "Start ... Settings ... Control Panel ... Printers". Find which printer is your default. Then click on it with your right mouse button, and click "Properties" at the bottom of the resulting menu. Now look through the various tabbed panels to see how the printer is configured. You may find some section that enables you to change the resolution -- e.g., a section that lets you choose between "High print quality" and "Fast draft printing", or something like that. Changing that setting may change the print resolution, and may make it compatible with YAP's settings.

Actually, sometimes you may find it useful to lie to Yap. Tell Yap that you have a printer with very high resolution. For instance, set both the display and printer to a "LaserJet 4000N, ProRes mode (1200dpi)". Then the display on your computer screen will look very sharp, so you can read it easily when you're editing your tex files. Later, when you're ready to actually print something on paper, you can change the display and printer settings back to the lower resolution your printer actually has.

Handling files. YAP can handle several files at once -- it can have several "child" windows (for different dvi files) within the main YAP window. This can be useful. However, when you're done with some particular dvi file, close that child window, or it may cause problems later. If you leave any dvi files running in YAP, then those may show up in the display the next time you run YAP, which may distract you from what you were looking for. And if you have two different files with the same name (in different directories), YAP may get confused about which one is which, if you haven't closed the first one before opening the second.

Forward search. The use of this feature is explained in my introduction to tex programs. There's nothing to configure in Yap itself for forward search; rather, you must configure your tex shell program to work with Yap's forward search. Different shell programs require different configurations. I'm giving examples of configurations in some of my discussions of different shell programs, elsewhere in this collection of web pages.

Here is one tip to keep in mind about forward search: You may find it useful to configure two different forward search buttons in your shell program -- one for "use the instance of Yap that is already running, if there is one -- and use the most recently used one, if there is more than one", and the other for "start a new instance of Yap, even if there is already a Yap running." (Or, more briefly, "last Yap" and "new Yap".) These both have the same effect if no Yap is already running. Most of the time, you'll want to use "last Yap". But "new Yap" is useful if you want to compare two different parts of the same document; just view them in two different instances of Yap.

Inverse search. The use of this feature is explained in my introduction to tex programs. It is configured in Yap, but it must be configured differently for different text editors or shell programs. Here are some of the configuration lines for editors that I've tried. (You may have to change the directory paths if you've installed one of these programs in a directory location different from mine.)

(actually TeXnic Center puts its line in Yap automatically when you install TeXnic Center). Here is the procedure for configuring YAP:

For advanced users only:

Switching inverse search automatically:   I like to use different shell programs on different days, depending on what I'm working on. But each time I switch shell programs, I have to switch Yap's inverse search configuration (as described above). Here is a way to automate that procedure, so it doesn't involve as much work:

  1. Open Yap. Configure Yap in one of the settings that you like -- i.e., with one of the inverse search settings.
  2. Close Yap.
  3. Run the program "Regedit.exe", which can probably be found in the directory "C:\windows" or "C:\winnt". Caution: The regedit program must only be used very carefully, or you can badly mess up your operating system.
  4. Open Regedit to
    My Computer\HKEY_CURRENT_USER\Software\MiK\MiKTeX\CurrentVersion\Yap\Settings
    Click once on the word "Settings" in Regedit's lefthand pane. (You should see Yap's current settings displayed in the righthand pane, including a specification of "Editor" pointing to the shell you currently have configured for inverse search in Yap.)
  5. In the upper left corner the Regedit window, you see the words "Registry Edit View Favorites Help". Click on the word "Registry". Click on "Export Registry File".
  6. A dialogue box will appear. In the "Export range" section at the bottom, make sure "Selected branch" is chosen, rather than "All". The selected branch showing should be "HKEY_CURRENT_USER\...\Settings".
  7. Under "File name", type something that will enable you to remember which setting this is. For instance, if you currently have Yap's inverse search pointing to Winshell, you might type "winsh" into the filename box.
  8. Make sure the directory where the file will be saved is someplace where you can easily find it (e.g., on the desktop). Make sure that "Save as type:" says "Registration Files". Click on the "Save" button.
  9. Close Regedit.
Repeat the above steps once for each different shell program that you want Yap to point to. For instance, if you want to use Winshell, TexnicCenter, and Pfedit, you might use this procedure three times, to create "winsh.reg", "txc.reg", and "pfe.reg". Save those reg files in a place where you can find them easily.

Now, whenever you want to use a particular shell that is different from the shell you've been using, just follow these steps:

  1. Close Yap, if it's open.
  2. Double-click on the reg file that corresponds to the shell program you want to use.