## 5 Using the Active-DVI presenter

### 5.1 Launching Active-DVI

Active-DVI is invoked with the following command syntax

    advi [options] dvifile [dvifile]

Once Active-DVI is launched, just press `?` to get help on the keys you can use to control the presenter (type `^f` (Control-F) to get full screen, `<` or `>` to change the magnification of the text).

When two file names are provided Active-DVI displays them both: see section 5.12 for details on the use of a secondary DVI file.

### 5.2 Command line options

The advi commands recognized the following options:

#### Help and info options

`-v` | Prints the advi current version and exits
`--version` | Prints the full advi current version and exits
`-help` | Short command line options help

#### Window and display specifications

`-geometry geom` | Geometry of Active-DVI’s window specification

Geometry `geom` is specified in pixels, using the standard format for X-Window geometry specifications (i.e: `WIDTHxHEIGHT[+XOFFSET+YOFFSET]`).

`-fullwidth` | Adjust the size of the window to the width of the screen

`-nomargins` | Cancel horizontal and vertical margins
`-hmargin dimen` | Horizontal margin specification (default: 1cm)
`-vmargin dimen` | Vertical margin specification (default: 1cm)

Dimensions are specified as numbers optionally followed by two letters representing units. When no units are given, dimensions are treated as numbers of pixels. Currently supported units are the standard TeX units as specified in the TeX book (D. Knuth, Addison-Wesley, (C) 1986): ‘pt’ (point), ‘pc’ (pica), ‘in’ (inch), ‘bp’ (big point), ‘cm’ (centimeter), ‘mm’ (millimeter), ‘dd’ (didot point), ‘cc’ (cicero) and ‘sp’ (scaled point). Note that dimensions are specified w.r.t the original TeX document, and do not correspond to what is actually shown on the screen, which can be displayed at a different resolution than specified in the original TeX source.

`-crop` | Crop the window to the best size (default)
`-nocrop` | Disable cropping

#### Color specifications

`-fgcolor <color>` | Specify the color of the foreground color
`-bgcolor <color>` | Specify the color of the background color
`-rv` | Specify that reverse video should be simulated by exchanging
| the background and foreground colors
`-gamma <float>` | Specify gamma correction (>0.0) of glyphs

#### Helpers specification

`-pager` | Specify the name of the pager to launch on a `txt` link
`-browser` | Specify the name of the browser to a `html` link

#### Debugging options

`--debug` | General debug option
`--debug_pages` | Debug page motion
`--show_ps` | Print a copy of Postscript sent to gs to stdout
`--verbose_image_access` | Change the cursor while loading images

#### Rendering options

`-A` | Toggle Postscript anti-aliasing
`-passive` | Inhibit effects that are visible when redrawing the page
| (Transitions, delays, embedded applications)

#### Safety options

`-exec` | Set safety policy to “always execute embedded applications”
`-ask` | Set safety policy to “ask user before execution of embedded applications”
`-safer` | Set safety policy to “never execute embedded applications”

#### Option files option

`-option-file <filename>` | Load filename as a file containing a list of options
| as given on the command line to advi.

#### Miscelleanous options

-autoswitch | Set the autoswitch flag, which allows implicit switch to master
| on usr1 signal (default is off).

### 5.3 Cut and paste

Text can be copied from the Active-DVI previewer to another application. However, this uses the XBuffer and not the XSelection mechanism.

- Shift middle-click copies the current word.
- Shift right-click and drag copies the specified region.

Moreover, Shift left-click dump an ASCII representation of the region under the mouse pointer in the source file. This expects the DVI to have been instrumented with line numbers of the form

> line: ⟨ line⟩ ⟨ file⟩

where ⟨ line⟩ and ⟨ file⟩ are the current source line and current source file.

The position is exported in ASCII, in the form

> `#line` ⟨ before⟩, ⟨ after⟩ <<⟨ prefix⟩>><<⟨ suffix⟩>> ⟨ file⟩

where ⟨ before⟩ and ⟨ after⟩ are the enclosing line numbers, ⟨ prefix⟩⟨ suffix⟩ the word constituent surrounding the mouse position, and file is the name of the current file.

Line numbers default to 0 when not found. Note that line numbers may be inconsistent if there \special-line commands have not been inserted close enough to the position.

### 5.4 Hyper-text references

Active-DVI supports the LATEX hyperref package with both internal and cross-file references. For cross-file references, it launches a new advi process to view the target.

Active-DVI improves the treatment of hyper-refs over conventional previewers, by emphasizing the hyper-target text of an hyper-link. Thus, an hyper-target definition:

\hypertarget{⟨ tag⟩}{⟨ text⟩}

should make the activation of the link ⟨ text⟩ not only move to the page where ⟨ tag⟩ occurs, but also emphasize the destination target ⟨ tag⟩. However, since \hypertarget does include its second argument within the target, we use the following command instead:

    \edef\hyper@quote{\string"}
    \edef\hyper@sharp{\string#}

    \newcommand{\softtarget}[2]%
      {\special{html:<a name=\hyper@quote#1\hyper@quote>}#2%
       \special{html:</a>}}

(If you are viewing this document with Active-DVI, you may move over this area or click on this one to see the effect.)

Similarly, to define a link target we use:

    \newcommand{\softlink}[2]%
      {\special{html:<a href=\hyper@quote\hyper@sharp#1\hyper@quote>}#2%
       \special{html:</a>}}

### 5.5 Floating table of contents and thumbnails

There are two ways to include a floating table of contents while previewing.

- Active-DVI recognizes the reserved hyper-targets advitoc.first and advitoc.last as markers for the first and last pages of the table of contents. These pages then become floating, i.e. accessible from anywhere in the document with the default key binding `t`. The first stroke on `t` shows the first page of the table of contents. Successive stokes will show the following pages. (As usual, prefix integer argument may be used to directly access a specific page of the table of contents.)

  The package advi described below redefines the macro \tableofcontents so that it automatically inserts the reserved hyper-targets markers around the table of contents. It also provides two new macros, \advitoc and \endadvitoc, that serve to insert these markers when the table of contents is hand-made.

- If no table of contents markers are found, then Active-DVI will compute thumbnails, i.e. will show the whole set of pages of the presentation, each page drawn at a smaller scale and packed with the others on a single page. Active-DVI computes the scale so that all the thumbnails fit on one page only, provided that the scale is less or equal to a maximal value; otherwise, the maximal value scale is selected and the thumbnail pages spread on several pages. The default maximal scale value is 5, so that 25 thumbnails can fit on the same page. This value can be changed using the option -thumbnail_scale.

  Normally, thumbnails are drawn for all the pages. However, thumbnail pages can also be defined manually, with an hyper-target whose anchor is of the form /page.⟨ suffix⟩. In this case, all the desired thumbnails must be explicitly marked.

By default, the binding T processes thumbnails and the binding t displays thumbnails if already processed, or shows the table of contents if available. Otherwise pressing t has no action. Thumbnails computation is explicit, so that incidentally hitting the t key does not lead to an unexpected computation, hence an unexpected delay.

### 5.6 Moving around

See the key bindings in the appendix.

### 5.7 Scratching on slides

During the show you can annotate your slides, entering the scratching mode. There are two modes, one for writing characters (the writing mode, entered by pressing s during the show) and the other to draw lines or figures on the slides (the drawing mode, entered by pressing S). In each of this modes, you can enter the scratch setting mode to set various properties of the scratching process. See the relevant key bindings for writing mode and drawing mode in the appendix.

### 5.8 Using the laser pointer

If you press `^X-l` (Control-X then l) the laser pointer appears on the slide; the pointer sticks to the mouse pointer and allows easy pointing to parts of the presentation. The laser pointer size and color can be set on the command line (options -laser-pointer-color and laser-pointer-size).

### 5.9 Saving slides

You can save a snapshot of the current slide at any time by pressing `^X-^S` (Control-X then Control-S). An image file is written (by default a png file). The name of the file produced can be set via the command line (see advi -help for details) or directly from within the LATEX source file with commands `\advisavepageimage` and `\advisavepageimagefile{filename}`).

### 5.10 Creating events from the LATEX source file

Active-DVI provides the command `\advipushkeys` that provides key presses to the presenter as if you had pressed it when viewing the presentation. For instance:

    \advipushkeys{"q"}

ends the talk immediately.

Note that control keys must be encoded inside key strings passed to Active-DVI: we use the Emacs textual convention. For instance, the character “Control-A” (ASCII 1) is denoted by the two charcters `^X` (i.e. a carret character immediately followed by an X). Hence, the command

    \advipushkeys{"^X^F"}

switches to full screen mode.

### 5.11 Using and making special effects

Presentation examples can be found in the `examples` directory. Don’t miss to play them! Then, feel free to read their source code and copy the effects they provide.

Active-DVI can be used as is, but will shine when driven by a user with a bias towards programming: special effects can easily be realized by using the LATEX packages provided with the distribution.

Creative advanced users may program the presenter at various levels, either using or defining simple LATEX macros, writing new LATEX package files, or by implementing extensions to the previewer itself.

### 5.12 Viewing multiple files simultaneously

Active-DVI can be invoked with several DVI files (currently only two). The first file is always used as the master file and others are client files. The user can switch between files explicitly (see key bindings) or implicitly. There is an implicit switch from the master to the client file c when an hyperlink that is not found in the master file can be found in the client file c; there is also a switch from the client c to the master when using the history stack and the previous event on the stack was an implicit switch from the master to the client c.

If autoswitch flag is set, there is also an implicit switch to the master, whenever Active-DVI receives signal usr1 (to mean immediate refresh).