TkDVI - A TeX Previewer based on Tcl/Tk

Anselm Lingnau (

What is TkDVI?

TkDVI is a new DVI previewer for Unix, based on John Ousterhout's script language Tcl/Tk.

TkDVI defines »DVI images« that display a page from a DVI file in a Tk widget such as the canvas widget. The usual features are available, for example, shrinking the image by various amounts. Optionally the image is anti-aliased using grey levels (like in xdvi) to enhance readability. TkDVI uses the popular Kpathsea library to locate fonts, and missing PK fonts are generated on demand by calling out to Metafont. Therefore, TkDVI is readily compatible with popular Unix TeX distributions such as teTeX.

But TkDVI also offers various unusual features:

It must also be said that some important features are currently missing from TkDVI (but will be added as soon as time permits) -- but hey, this is still alpha code! TkDVI is free software which is distributed under the same license as Tcl/Tk.

Here is a paper I presented at EuroTeX'99 which describes the design and implementation of TkDVI in somewhat more detail. This is written for TeXnicians with little or no knowledge of Tcl; there's also a similar paper that I gave at the 1st European Tcl/Tk User Meeting which is geared towards Tcl people with little or no knowledge of TeX.


From TkDVI 0.1 to TkDVI 0.2:

From TkDVI 0.2 to TkDVI 0.3:

From TkDVI 0.3 to TkDVI 0.3.1:

From TkDVI 0.3.1 to TkDVI 0.4:


You can download source code for the current release of TkDVI from the SourceForge download server. Older releases may also be available (not that they would be particularly interesting) from the project file list. CVS access to the source code is being worked on.

TkDVI has been tested on PCs running Debian GNU/Linux 2.1, 2.2 and pre-3.0, as well as SuSE Linux 6.4 (with a reasonable installation of Tcl/Tk rather than the pile of junk that SuSE sees fit to include in their distribution). There is no particular reason why it shouldn't work on other Linux and Unix platforms. If you do get it to run, please drop me a message containing a description of your system so it can be listed here.

A Debian package of TkDVI 0.3.1 is part of the »testing« and »unstable« distributions and will be in the next Debian release (unless we manage to sneak TkDVI 0.4 in first).


You need Tcl/Tk 8.0 or newer (Tcl/Tk 8.2.x, 8.3.x, and the current alpha releases of Tcl 8.4 are fine; I recommend Tcl/Tk 8.3.3) -- older versions emphatically do not work -- and the Kpathsea library, which comes, e.g., with teTeX, but can be obtained as part of the Web2C distribution available from CTAN. (If you're running Debian GNU/Linux, install the »tetex-dev« or »libkpathsea-dev« packages, depending on which one is in your release.) A version of Kpathsea that doesn't force you to fetch and compile all of web2c or even teTeX is available from the SourceForge download server.


These screenshots show TkDVI 0.3.1. Click on the images to view them at their original size.

TkDVI showing a single page
TkDVI showing a single page of a DVI file.
TkDVI showing 16 pages
TkDVI showing a 16-page booklet in »overview« mode.


Feel free to contact me with suggestions, patches, constructive criticism etc. at (Flames can go to /dev/null.)

There are two mailing lists for TkDVI:
This is a low-traffic moderated mailing list for TkDVI-related announcements such as the publication of new versions.
This is a forum for general exchange between TkDVI users (such as there will be, hopefully). All the traffic from tkdvi-announce shows up here as well, so if you're interested in both lists you only need to read this one.

Anselm Lingnau, 9 August 2001
SourceForge Logo