A contemporary author writing an article for “dual presentation” has in mind both the classical printed presentation of an article and the modern web form of an article based on HTML.
There are two main approaches for achieving dual presentation that are relevant to the TeX community.1
Write a LaTeX article, and use a program that translates to HTML.
Write an article in a suitable XML document type, such as DocBook or TEI, and use standard software for generating LaTeX and HTML.
Both methods present challenges to authors who have been accustomed to using LaTeX.
Since mid-2002 the second-generation form of HTML that supports mathematical content has been supported by the two most widely deployed web browsers, but not many articles seem to have appeared on the web in this form so far. The most likely reason is difficulty of production.
This talk will address the use of “generalized LaTeX” to produce dual content from a single LaTeX-like source. This method combines the reliability of XML document transformation with many of the conveniences available when writing LaTeX markup.
Here's the source for a relatively simple example.
It compiles to this:
The markup looks like LaTeX. In fact, except for the use of the zone closers \int: and \prod:, it would be LaTeX. I call it generalized LaTeX.
Aside from the zone closers, which are required for GELLMU, there are a few other things to notice. Most of these have to do with the fact that, as part of the overall system design, markup semantics are independent of the command vocabulary. Thus, for example:
Command arguments must be explicitly braced.
Braces for the argument of a superscript or subscript may be omitted only if the argument is a single character.
The semi-colon at the end of a command name (such as \latex; above) indicates that the command does not introduce content. Often this type of semi-colon may be omitted, and, beyond that for most purposes \foo; may be regarded as shorthand for \foo{}.
The command vocabulary differs somewhat from that of LaTeX.
There follows a GELLMU version of an example posted to the UseNet newsgroup sci.math.research on 29 October 2002, message id: <apmpvn$bpb$1.repost@nef.ens.fr>, by David Madore of ENS for the purpose of comparing TeX markup to MathML.
In a letter to Godfrey Harold Hardy, Sṟīṉivāsa Rāmāṉujaṉ Aiyaṅkār asserts that
The markup for this:
Note the use of \bal{ ... } instead of the LaTeX usage \left( ... \right). GELLMU has various balancers of this type and will eventually have more. This is related not only to the fact that the markup is simply a “front” for an SGML document type but also to its notion of sound mathematical semantics. The processor for XHTML+MathML output will not tolerate unbalanced balancing characters in a math zone except as provided through these balancers and also through the list generator
\vect[...]{...}{...} ... {...} . |
The kinds of weak enforcement of mathematical semantics represented by such balancing provisions and by the requirement for explicit ending of sum, int, and prod containers is prelude to future optional incorporation of stronger mathematical semantics in the markup.
Madore is correct in suggesting that one doesn't want to look at the MathML markup for this, but the rendering by Firefox, somewhat enlarged, is captured in this screenshot:
There are several reasons why it is important to have articles and course materials with mathematical content online in modern HTML, i.e., XHTML+MathML.
To a young person XHTML+MathML represents “math on the web”.
It fits the paradigm of web browsing.
It's more flexible and more convenient for online reading than PDF — doubly so by comparison with double-column online PDF.
The journals are disappearing from our libraries.
It's great for proof reading. (Enlarge and shorten the lines.)
Articles presented in XHTML+MathML comply with web accessibility guidelines. (PDF with math does not.)
Large print editions at no cost.
The small gamma bit presented earlier may easily be made to look like this in Firefox (a screenshot):
GELLMU is based on cross-platform free software licensed under the GNU GPL. Its package is available from CTAN ([2]) and from the GELLMU web site ([6]). The package requires a number of other cross-platform free software packages including GNU Emacs, Perl, and some standard items of SGML/XML software, chiefly Open SP.
Linux: The required packages are generally part of a full GNU/Linux distribution. The package should be installed in /usr/local/gellmu and symlinks to driver scripts should be made from a suitable place in one's command path.
MacOS-X and other Unix variants: The only difference from GNU/Linux is that some of the supporting packages may need to be acquired and installed.
MS Windows: The best strategy is to acquire and install a full Cygwin distribution. Then proceed as with Linux.
Let's package the preceding markup segment as an article. Because it is GELLMU, not LaTeX, it begins with \documenttype rather than with \documentclass.
Beyond early-stage syntatic processing the system requires that there be a title in the preamble of every article. An empty title is allowed.
Text normally must be in paragraphs. (There are exceptions.) Therefore, the blank line after \begin{document} is essential.
It is sometimes said about LaTeX that a blank line ends a paragraph. However, in GELLMU a blank line begins a paragraph.
We place this article text in a file named gammabit.glm, with “.glm” the canonical suffix for a GELLMU source file, enter the command
and prepare to read the scroll. At the end when all goes well there are the following outputs:
Additionally one might note that some level of rendering based on cascading style sheets (CSS) is possible for the author-level XML.
In order to understand the scroll one needs to understand the system design.
Regular GELLMU is a system assembled from modular components. Each step along the way produces an intermediate stage output that has its own sense and that, when things go wrong, provides opportunity both for diagnosis and intervention.
Here's the flow chart:
What I call the “side door” is the second row entry showing the possibility of translation from source languages other than the markup of regular GELLMU into the author-level XML documenttype corresponding to the source markup of regular GELLMU.
One will note from the scroll that SGML/XML validation is done at several stages. This validation can be important for catching the author's mistakes. When there are error messages, it is possible and important to consult the scroll's last message regarding the stage of processing. Note in this regard that the translation from elaborated XML to XHTML+MathML takes place in 3 stages that are not shown on the chart but that may be seen in the example scroll.
Much more information may be found in the User Guide ([3]), the GELLMU Manual ([4]), and the GELLMU web site, http://www.albany.edu/~hammond/gellmu/. A link to an online version of this preliminary document should be available at the GELLMU web site by July 6.