with contributions from Tanmoy Bhattacharya, David Carlisle, Mark Doyle, Paul Ginsparg, Alan Jeffrey, Hiroshi Kubo, Sebastian Rahtz and Arthur Smith.
Last updated March 10th, 2004 (removed/corrected links)
HyperTeX is a defacto standard for inclusion of hyperlink information in TeX (and LaTeX) documents. Customized previewers for DVI and Postscript files exist which enable the user to browse through hyperlinked TeX files just like one can browse normal HTML files on WWW.
- Introduction
For users of HyperTeX
- Previewers with HyperTeX support
- Postscript (and PDF) converters and previewers
- Macro packages for creation of HyperTeX documents
- Example DVI files
For programmers of HyperTeX software
- How is HyperTeX implemented?
- What is the standard way to label 'x'?
Other information
- Mailinglists related to HyperTeX
TeX plays a very important role in scientific and technical publishing. Thus far it has however been almost exclusively confined to the production of a paper end-product.HyperTeX was inspired by the success of the World Wide Web, and is an extension of TeX structure to embed within a document links to other parts of the document and to other documents. The information about these links is stored in the DVI file (or in the postscript or PDF files that are generated from them), and when viewed with a previewer that understands this extra information, these links become active and allow the reader to move with greater ease within and between documents. External links can be to any document on the internet, in a manner compatible with the naming scheme used in the WWW.
For LaTeX documents, there is often a very well defined internal structure (more sophisticated than the structured markup of HTML which is the basic language of the WWW), and the HyperTeX definitions allow a single-line modification of the source LaTeX file (inclusion of a specific macro package) to turn those internal structures into links and the document into an active hypertext. There are also several varieties of plain TeX for which similar modified macro packages are available.
Note that HyperTeX is not intended as a replacement to HTML (just like PDF, with its capability of storing hyperlink information, is not intended to replace HTML). Both have their own strengths. The advantage of HyperTeX is that there is no need for a conversion step (which means that any TeX paper can be extended to include hyperlink information).
If you're looking for an easy way to get started, the teTeX TeX distribution might be useful. This distribution contains a HyperTeX-capable version of xdvi and some macro packages to help you create your own hyperlinked TeX documents, as well as a version of dvips that supports creation of pdf files with hyperlinks. See below for other previewers and other macro packages.
Below is a list of DVI previewers for various platforms. Instead of viewing the DVI file, it is also possible to first convert it to 'hyperhacked' postscript or PDF and then view it with a modified postscript viewer or a PDF viewer. See the section on postscript previewers for details on that.JAVA based viewers (for any browser with JAVA support):
- IDVI, by Garth A. Dickie (dickie@elastic.avid.com). Since this is a JAVA applet, you can use it in any browser with JAVA support (ie. Netscape and Microsoft Explorer) without installation.
Unix systems (see below for NeXT systems):
- XDVI, maintained by Paul Vojta (http://arxiv.org/hypertex/vojta@math.berkeley.edu) with contributions from many people; HyperTeX capability was added by Arthur Smith (apsmith@aps.org). This is a viewer running under X-Windows. It can optionally start a web browser for external links or fetch them using the libwww library from W3C. Nicolai Langfeldt (janl@math.uio.no) maintains the kpathsea version of xdvi. The latest teTeX distribution contains a version of xdvi with HyperTeX support.
- nDVI, by Kasper Peeters (k.peeters@damtp.cam.ac.uk). This is a Netscape plugin, which enables you to browse through HyperTeX documents just like you browse through WWW pages.
- A compiled version of TeXview.app, the nExtstep dvi previewer augmented for hypertex, was originally provided by Dmitri Linde (dmitri@physics.stanford.edu [also the author of InstantTeX.app]). Mark Doyle has significantly extended Dmitri's original version with the addition of multiple views and multiple documents. The README gives a more complete overview of the current features and known bugs. The latest binary (as of 12 May 1996) is available at HyperTeXview0.1beta1. NeXT TeX users might also be interested in stepTeX 2000. HyperTeXview is also part of the teTeX distribution for NeXTSTEP, thanks to Gregor Hoffleit (who has also added support for kpathsearch).
Windows 95/NT:
- dviout for Windows, written by Toshio Oshima (oshima@akagi.ms.u-tokyo.ac.jp). Besides HyperTeX, this dvi viewer also supports color specials, included graphics and Japanese fonts (and a lot more). Also available through ftp at ftp://akagi.ms.u-tokyo.ac.jp/pub/TeX/dviout/current/ and at CTAN. Although originally intended for Japanese users, dviout now includes English on-line help and works with non-Japanese versions of Windows.
Apple Macintosh:
- For MacOS X please refer to the Unix section above.
- The DVI previewer of OzTeX supports hyperlinks.
- DirectTeXpro by Wilfried Ricken (wilfr@hadron.tp2.ruhr-uni-bochum.de). This is a shareware package.
Adobe has implemented a modification of Postscript called Acrobat (with file extension .pdf = Portable Document Format). It is essentially a version of uuencoded compressed postscript with a full hyperlink overlay. In addition, PDF files are searchable and indexable.Using a DVI to postscript converter with HyperTeX support, a postscript file is generated that includes so called PDF marks. There are postscript viewers which understand these marks. Alternatively, you can convert the postscript file to PDF and use a PDF viewer (which naturally have support for hyperlinks).
DVI to postscript/PDF converters with HyperTeX support:
- The well-known dvips converter by Tom Rokicki supports HyperTeX as of version 5.60a. See below for information about how to convert postscript files to PDF using dvips. The teTeX distribution has a recent version of dvips. You can still get the
- drop in replacement for dvipsk (5.58f). Download teTeX-dvipsk and compile it within the teTeX source tree in place of dvipsk (upgrading the entire teTeX is probably a lot easier).
- dvipdfm by Mark A. Wicks is a DVI to PDF converter with support for hyperTeX specials (in version 0.11 and above).
- There's also still a hyperhacked version of dvips, dvihps written by Mark Doyle and Tanmoy Bhattacharya. It produces postscript with embedded links which can subsequently be browsed in a modified version of ghostview. As this program has not been updated since 1996, the recommended method is to use dvips and a pdf viewer.
Modifed postscript viewers with HyperTeX support:
- HyperHacked Ghostview, by Tanmoy Bhattacharya (tanmoy@lanl.gov). This is a modified version of Ghostview that understands the links produced by dvihps. You also need either GNU Ghostscript or a recent version of Aladdin Ghostscript, for which we supply simple modifications to make them pass on the hyperlink information to Tanmoy's hyperhacked ghostview.
Postscript-with-hyperlinks to PDF converters:
- Ghostscript has a program called 'ps2pdf' which converts a postscript file generated by dvi to a pdf file.
You have to use the '-z' flag of dvips to make it include hyperlink information in the ps file. Not all versions of dvips have this option (it can be set during compile time by defining '-DHPS' and not all installations do this).
- Adobe Distiller (commercial software) by Adobe Inc. It converts the output of dvihps to PDF, which can then be viewed with a PDF viewer.
PDF viewers:
- Adobe Acrobat (available for free) by Adobe Inc. This is a viewer for PDF files. It's also available in the form of a plugin for Netscape and Microsoft Explorer.
- Xpdf. This is freely distributable (see the README for details) PDF viewer for Unix/X windows.
- Ghostscript 3.33 and up. These versions have some support for viewing of PDF files.
Han The Thanh (thanh@fi.muni.cz) has written a modified version of TeX, called pdftex, which outputs PDF directly (instead of DVI). The LaTeX hyperref package supports pdftex. The most recent version of pdftex can be found at ftp.cstug.cz/pub/tex/local/cstug/thanh/pdftex or at your local CTAN mirror in 'systems/pdftex'.
If you want to create TeX files yourself that make use of the hyperlink facilities of the HyperTeX standard, there are various macro packages that can help you. Not all of these are supported any longer. If you're new to hyperTeX, the `hyperref' package is the recommended choice:
- Hyperref, by Sebastian Rahtz (sebastian.rahtz@oucs.ox.ac.uk), is a LaTeX2e package. It provides macros for constructing hyperlinks by hand, and it can also automatically construct hyperlinks for all the '\cite' and '\ref' commands. There is even a script to produce a LaTeX .fmt file which enables this feature also for documents that do not explicitly activate this package. Hyperref is included in the latest teTeX distribution.
Hyperref is also able to generate hyperlinks for output formats other than DVI, in particular for PDF.
Also available at any CTAN mirror in the directory 'macros/latex2e/contrib/hyperref/'.
- Michael Mehlich has written a similar package, hyper.
Also available at any CTAN mirror in the directory 'macros/latex2e/contrib/hyper/'.
- hyperbasics.tex by Tanmoy Bhattacharya. A simple example of how to write a macropackage supporting HyperTeX.
- hyperlatex.tex: (Somewhat outdated and for LaTeX 2.09 only) For latex-based source, automatically upgrades latex macros to hyperlatex (install in tex/inputs directory). This file is input before the \documentstyle when using LaTeX, and will automatically cause the relevant .hty files (if present) to be included after the associated .sty file. Some .hty files to install in tex/inputs (each containing modifications to the corresponding .sty file) are available here (look for files with extension hty).
To define a convenient hlatex format using a format (.fmt) file, use hlatex.tex to generate hlatex.fmt (e.g. on unix systems, use:initex \&latex hlatex.tex) and install in tex/formats directory. This format will automatically \input hyperlatex at the beginning of all documents. Command line use of hlatex.fmt is system dependent: on unix systems, create a link (e.g.ln -s latex hlatex), then the commandhlatex filereplaceslatex fileto produce automatic hyperlatex.- lanlmac.tex, by Paul Ginsparg. This is a modified version of harvmac.tex (last updated 7/26/94). It works seamlessly to convert pre-existing harvmac-based source to hypertex (see examples below).
- Some tools to give the WEB system (tangle/weave) HyperTeX capabilities have been written by Tanmoy Bhattacharya. In particular, hyperwebmac.tex (modified version of webmac.tex that is used to process .tex generated from .web by weave), hypercwebmac.tex (modified version of cwebmac.tex [version 2.1] that is used to process .tex generated from .w by cweave), and hyperncwebmac.tex (same as above for cwebmac.tex version 3.0).
If you use BibTeX, there are various styles that have support for entries referring to electronic preprints. See BibTeX and Eprints for a list.
Probably the most extensive source of documents created with HyperTeX aware macro packages is the electronic preprint archive (for physics and mathematics) at xxx.lanl.gov. Some older examples are available below.
- harvsamp.dvi : A sample file illustrating the modified harvmac macros, with source harvsamp.tex.
- hyperlh88.tar.gz: by popular demand, dvi file plus figures of Paul Ginsparg's 1988 Les Houches lectures "Applied Conformal Field Theory" (266kb .gz file gunzips to 911kb). Good example of pre-existing source that painlessly retexs with new macros (harvmac/lanlmac) into much more functional form with large numbers of internal links to sections, subsections, eqns, refs, figs, etc.
- hypertasi92.tar.gz: dvi file plus figures from hep-th/9304011 [abs], 200 page set of lecture notes using harvmac/lanlmac. (note that 392kb .gz file gunzips to 1.6Mb -- but worthwhile as another impressive example of pre-existing source that automatically recompiles with thousands of internal linkages [couldn't be faked...].)
- emdual.tar.gz dvi plus two figures from hep-th/9407087 [abs], a random paper that also uses harvmac.
- ambjorn.dvi: The dvi file from hep-lat/9405022 [abs], an example file from the e-print archives using latex (article style).
- anomalkap.dvi: The dvi file from hep-lat/9309014 [abs], an example file from the e-print archives using revtex.
The Journal for High Energy Physics also has all papers online in HyperTeX format.
TeX and LaTeX output is in the form of a ".dvi" file, the letters being short for "device-independent". ".dvi" files are not completely self-contained because they depend on external font files, but aside from that they describe the formatting of a document in a fashion independent of the display or printing device. The ".dvi" format is also arbitrarily extendible, due to the "\special" command of TeX, which allows new display commands to be embedded in the ".dvi" file. The "\special" command has previously been used to extend TeX by allowing inclusion of line drawings, PostScript figures, and colored text.HyperTeX adds five new "\special" commands to the menagerie. These are:
These are identified as HyperTeX specials by the first 4 characters, "html". The first three commands establish links between sections of documents in a manner exactly analogous to the HTML of the WWW. The "img" command is intended to place an image of arbitrary graphical format on the page, although this is not very widely supported by current viewers. The "hrefstring" values are arbitrary URLs. If you want to use a fragment indicator in the URL (the `#' hash mark), make sure to change its catcode to `letter' first:\special{html:<a href="hrefstring">} \special{html:<a name="namestring">} \special{html:</a>} \special{html:<img src="hrefstring">} \special{html:<base href="hrefstring">}See chapter 7 of the TeXbook for more information about catcodes.{\catcode`\#=11 \special{html:<a href="http://www.foo.org/bar#foobar"}}Rather than just applying these "\special" commands directly, use of one of the macro packages (at least as a first step to "hyper-izing" a document) is highly recommended.
The various subsections of a document can be referenced as part of a URL description through the "#" extension to the URL name. We have been using the following standard names for ease of linking into HyperTeX documents based on the macro packages currently available:(but see the note about `#' catcodes in the previous section). Similar definitions thus far exist for subsection, figure and table entities. New macro packages or style files should try to conform to this naming scheme (see the currently available packages for details on how this is done).Page 5 is at doc.dvi#page.5 Section 2 is at doc.dvi#section.2 Equation 3 is at doc.dvi#equation.3 Reference 11 is at doc.dvi#reference.11
There is currently one low-traffic mailinglist for announcements of new software and macro packages that support HyperTeX. To subscribe, send e-mail to
majordomo@aps.orgwithin the body of the message.subscribe hypertex-announceThere is also a list for developers of HyperTeX applications and macro packages. To subscribe, send e-mail to
majordomo@aps.orgwithin the body of the message.subscribe hypertex-dev
Kasper Peeters (k.peeters@damtp.cam.ac.uk).