Math and Hypertext
Hypertext is appealing because it offers a way of organizing information
so that the interconnections between ideas can be laid bare. A mathematics
text is often internally cross-referenced to a great extent. Is paper still
the best medium for presenting ideas?
HTML 3.0
was a proposed hypertext specification of the
World-Wide-Web Consortium (W3C)
which included mathematical
capabilities. It resembled TeX in syntax, with modifications to make
it compatible with HTML syntax. You can
try it out
if you are using an older version of the
Arena browser. Unfortunately
the HTML 3.0 specification was abandoned, and its successor,
HTML 3.2
has dropped the math part of the specification. Current versions of the
Arena browser don't even display the math part of the HTML 3.0 demonstration
document correctly.
A currently developing attempt at a standard is
MathML, another project of
W3C. Much has changed since the failure of the HTML 3.0
specification, and MathML may well succeed.
The Arena browser, which was the testbed of math support in HTML 3.0
is no longer supported by W3C (it is currently in the hands of
Yggdrasil). The newer
Amaya browser is the W3C organization's
current testbed for MathML. We will be able to say that MathML has arrived
when it is supported by Microsoft and Netscape. These companies are not
represented on the
MathML task force. However, both companies are involved in the
XML specification, and
XML support is promised or already implemented for both
Netscape Navigator
and
Microsoft Explorer.
Since, according to W3C ``MathML is cast as an application of
XML. As such, with adequate style sheet support, it will ultimately be
possible for browsers to natively render mathematical expressions,''
this means that Netscape and MS Explorer should eventually support
MathML.
Unfortunately MathML appears
unnecessarily
complex and, unlike TeX can't be easily written by hand. Is there
no better way? A fairly obvious idea is that html could have a ``tex''
tag. You'd write:
<tex> \int_{-\infty}^\infty e^{-\pi x^2}\,dx=1 </tex>
Or if you wanted a displayed formula, you'd type
<tex align="center">.
Between the tags, < and > would be escaped:
<tex> x^2+y^2 \< 1 </tex> . This scheme can be
criticised on grounds of purity---we are mixing two markup languages, HTML and
TeX. This is only an aesthetic consideration---it would be easy for a
preprocessor to take the document and run a Pidgin TeX to MathML preprocessor
on any text between and tags.
Meanwhile, alternatives exist:
- In the
preprint server,
documents are stored as dvi, postscript or PDF to be retrieved using a
browser. This is an informal method of publications. Electronic Journals such
as those published by the American
Mathematical Society resemble the preprint server in technology but serve
the more traditional goals of formally refereed publication.
- An entire page of text can be represented by a gif. A .dvi file
is much smaller but a gif will be accessible from any graphical browser, so
if bandwidth is subordinate to convenience, this may be a valid solution.
If you want to create a gif containing the content of a page or more
from a postscript file, here is the process. Assuming that you have
ghostscript
and the netpbm utilities installed, run gs with the
option -sDEVICE=ppmraw -r100x100. Then pipe the output to
ppmtogif. If you prefer, you may run pnmcrop before
ppmtogif to crop the gif. Suggested shell scripts to carry out this
task may be found at Luc Levroye's Postscript
Page, or here is one I wrote myself.
- First, there is HyperTeX,
which adds hyptertext capabilities to a TeX document. To preview Hypertex you
need a HyperTeX previewer, such as xhdvi (a modification of
xdvi). To write your
own HyperTeX, you need the
hyperbasics.tex macros. There are no modifications needed to the TeX
program---everything is done with macros and \special commands. The principal
problem that I see with HyperTeX as it currently exists is that the previewers
are still in the beta
stage. In September 1996, Kasper Peters posted to comp.text.tex that he's
rewriting xhdvi as a netscape plugin.
-
IBM's TechExplorer version 1.2 here is a netscape plugin. Their literature
states ``IBM's techexplorer Hypermedia Browser Version 1.0 formats and
displays expressions and documents containing mathematical and scientific
markup. It is a Netscape Navigator plug-in for readers and publishers of
scientific documents coded with the popular TeX and LaTeX markup languages.''
This sounds like the right sort of thing ... if you're running Windows 95, NT,
Solaris 2.5, AIX or IRIX.
-
Project MINSE is another scheme
for putting mathematics on the web.
- Java offers another possibility.
Here
and
here and here
are applets which suggests some approaches, and here is
IDVI, a dvi previewer written in Java!
-
LaTeX2HTML, works very well, though I personally found the process of
preparing documents this way confusing. For a good example of what can
be done with this program, see the Proceedings of the
Organic Mathematics Workshop. LaTeX2HTML is a large and complex perl
script, authored by Nikos Drakos. In its conception and execution, it is a
brilliant piece of work. It produces html documents from latex source, and
rendering mathematics is only a small part of this objective. To render
mathematics, first latex then dvips is run, then various filters (from
standard image-processing packages such as pbmplus or netpbm) which produce
gifs out of the postscript. In the end, the formulas are turned into bitmapped
graphics. This is a somewhat slow way of putting mathematics on the web,
because of the large bandwidth requirements for all those gifs. But it works,
and it may be ideal for some purposes, such as putting math on a local
network, or for documents where the formula density is low.
-
Hyperlatex is another latex to html scheme. The method of treating
formulas in Hyperlatex is discussed
here.
- Webify is another
scheme for converting postscript documents to HTML, which like
LaTeX2HTML relies on the netpbm filters to create graphics files.
Links
Here is
Paul Pollock's useful page
on this topic.
Back to Daniel Bump
Back to Stanford Math Department