A Bridge from LaTeX to XML

William F. Hammond

University at Albany
Albany, New York (USA)
CTAN: support/gellmu

TUG 2001, August, 2001

1.  Single Source Authoring

Situation Wanted

Write a single source file to produce:

and to benefit from:

2.  Translating LaTeX

3.  Translating HTML

4.  Pie in the Sky

A Dialect of classical LaTeX that is

5.  XML

eXtensible Markup Language

6.  XML


Generalized Extensible LaTeX-Like MarkUp

8.  Modes

  1. Basic

  2. Advanced

    1. Regular

    2. Other (less fully developed)

9.  Basic GELLMU for XHTML

SourceDerived XMLPresentation
\hr;<hr />(horizontal rule)

10.  The Syntatic Translator

source markup -----> XML or SGML

\foo{ ... } --> <foo> . . . </foo>
\foo; --> <foo/>
\foo --> <foo>
\foo: --> </foo>
\foo[a="x" ...] --> <foo a="x" ...>

11.  Syntactic Differences from LaTeX

12.  Syntax in Basic Mode

Miscellaneous Rules

Brackets are only for attribute specifications.

Unescaped loose braces are insignificant.

Escaping in Basic Mode

Special character % \ { } #
Escaped form \% \\ \{ \} \#

13.  Basic GELLMU for XHTML



the WWW \a[href=""
]{Consortium} site

for generating the XML:

the WWW <a href=""
>Consortium</a> site

to produce:

the WWW Consortium site

14.  \newcommand with XHTML


Using GELLMU's \emph{newcommand}
one can reduce the markup required
for an anchor to \w3ref{W3C}'s
\w3ref{Math/}{MathML} site.

Rendering: Using GELLMU's newcommand one can reduce the markup required for an anchor to W3C's MathML site.

15.  A CTAN Catalogue Entry

\caption{LaTeX-like markup for
         writing XML documents}
\author{\name{William F. Hammond}
 . . .

16.  CTAN Catalogue XML

<caption>LaTeX-like markup for
         writing XML documents</caption>
<author><name>William F. Hammond</name>
<license type="gpl"/>
 . . .

17.  Advanced GELLMU

18.  Why is article ``Didactic''?

19.  Advanced GELLMU for article

SourceDerived XMLPresentation
\label[:<label (invisible)
  series="n"]{}  series="n"></label>

20.  Gamma Function: Its Weierstrass Product

 INT[_{0}^{INFTY} t^{x} e^{-t} {d t}/{t}  ]  =  {1}/{x}  PROD[_{k = 1}^{INFTY}{
(1 +  {1}/{k})
(1 + {x}/{k})
}  ] 

21.  Markup for the Gamma Identity

Regular GELLMU source for the identity:

\[ \int_{0}^{\infty}
      t^x e^{-t} \frac{d t}{t}
   = \frac{1}{x}
      \bal{1 + \frac{1}{k}}^x
      \bal{1 + \frac{x}{k}}
   } \prod: \]

22.  Gamma: Derived XML Markup

 t<pow>x</pow> e<pow><minus/>t</pow>
  <numr>d t</numr>
   <bal>1 <plus/>

23.  Gamma: in MathML

(not by automatic translation)

 class="display" mode="display">
   <mo> </mo>
  <mo> </mo>
 <mo> </mo>

24.  Viewing MathML

Viewing support for MathML in web pages is not yet widely available. The above item can be rendered by:

25.  Generating MathML from article

26.  Reliable Generation of MathML

Reliable translation will require:

A substantial non-XML, but XML-aware, parsing of all math zones in a GELLMU source document.

Occasional math parsing hints from authors in their markup.

Desirable, sometimes required:
  1. Source markup labeling of math symbols.

  2. Source markup typing of math symbols.

27.  MathML Generation Issues

28.  How Were These Slides Made?

There were two sets of slides and, correspondingly, two formatters, one for transparencies formatted by the regular program latex and the other for PP4/PDF web slides formatted by the program pdflatex using a number of packages including ppower4 by Klaus Guntermann of Darmstadt University of Technology. Actually I used a small modification of "pp4slide.sty" named gpp4slide.sty to make things work with the standard slides document class. Both of these work with GELLMU article, and there are slightly different definitions of slide with newcommand in the two.