http://www.cis.ohio-state.edu/~gurari/
docs/mml-00/mml-00.html

XML: XHTML, TEI, DocBOOK, ...
A LaTeX source:
Gaussian of the form :
\begin{eqnarray*}
f( \epsilon , \delta s)
\approx
\frac
{1}
{\xi
\sqrt{
\frac{2 \pi}{\kappa}
\left( 1 - \beta^2/2 \right)
}}
\exp \left [
\frac
{( \epsilon - \bar{\epsilon} )^2}
{2}
\frac
{\kappa}
{\xi^2 (1- \beta^2/2)}\right ]
\end{eqnarray*}
thus implying
|
The TEI/MathML output of TeX4ht:
<!--l. 5--><div type="p"><p>Gaussian of the form :
<!--l. 6--><formula notation="mathml"
rend="block"><math xmlns="http://www.w3.org/1998/Math/MathML"
display="block"> <mtable class="eqnarray-star"><mtr><mtd
class="eqnarray-1"> <mi>f</mi><mrow
><mo>(</mo><mi>ε</mi><mo>,</mo>
<mi>δ</mi><mi>s</mi><mo>)</mo></mrow> <mo>≈</mo>
<mfrac><mrow ><mn>1</mn></mrow> <mrow
><mi>ξ</mi><msqrt><!--<mi>∘</mi>
--><mfrac><mrow ><mn>2</mn><mi>π</mi></mrow>
<mrow ><mi>κ</mi></mrow></mfrac> <mfenced
open='(' close=')' ><mn>1</mn> <mo>−</mo> <msup
><mi>β</mi><mrow ><mn>2</mn></mrow></msup
><mo>/</mo><mn>2</mn></mfenced></msqrt></mrow></mfrac><mo
form="prefix" class="csname">exp</mo> <mfenced
open='[' close=']' ><mfrac><mrow ><msup ><mrow
><mo>(</mo><mi>ε</mi> <mo>−</mo> <munderover
accent='true'><mrow ><mi>ε</mi></mrow><mrow ></mrow><mrow
><mo>̄</mo></mrow></munderover><mo>)</mo></mrow><mrow
><mn>2</mn></mrow></msup ></mrow> <mrow
><mn>2</mn></mrow></mfrac> <mfrac><mrow
><mi>κ</mi></mrow> <mrow ><msup
><mi>ξ</mi><mrow ><mn>2</mn></mrow></msup ><mrow
><mo>(</mo><mn>1</mn> <mo>−</mo> <msup
><mi>β</mi><mrow ><mn>2</mn></mrow></msup
><mo>/</mo><mn>2</mn><mo>)</mo></mrow></mrow></mfrac></mfenced></mtd><mtd
class="eqnarray-2"> </mtd><mtd class="eqnarray-3"> </mtd><mtd
class="eqnarray-4"> <mtext class="eqnarray"></mtext></mtd> </mtr></mtable>
</math></formula>
thus implying </p></div>
|
The PassiveTeX Output:
|
TeX4ht as a layer built on top of LaTeX:


Input: Standard LaTeX source file foo.tex
Output: Configurable, with a few built-in configurations provided.
| command line | output file | output format |
| xhmlatex foo | foo.html | XHTML + MathML |
| teimlatex foo | foo.xml | TEI + MathML |
| dbmlatex foo | foo.xml | DocBook + MathML |
| xhlatex foo | foo.html | XHTML |
| pdflatex foo | foo.pdf | |
| latex foo | foo.dvi | DVI |
A command line invokes LaTeX with appropriate configuration files.
| xhmlatex | mathml.4ht + html4.4ht + html4-mml.4ht |
| teimlatex | mathml.4ht + tei.4ht + tei-mml.4ht |
| dbmlatex | mathml.4ht + docbook.4ht + docbook-mml.4ht |
| xhlatex | html4.4ht + html4-math.4ht |

Native definition
Modified definition
Declared hooks
| \frac{A}{B} | |
| \Configure{frac} {} { / } {} {} | A / B |
| \Configure{frac} {\HCode{<mfrac><mrow>}} {\HCode{</mrow>}} {\HCode{<mrow>}} {\HCode{</mrow></mfrac>}} | <mfrac> <mrow> A </mrow> <mrow> B </mrow> </mfrac> |
| \Configure{frac} {\HPage{numerator}} {\EndHPage{}/} {\HPage{denumerator}} {\EndHPage{}} | numerator / denumerator |
| \Configure{frac} {\Picture+{}\bgroup} {} {} {\egroup\EndPicture} | bitmap |
| $a+1$ in TeX4ht | $a+1$ in LaTeX |
| <mi>a</mi> <mo>+</mo> <mn>1</mn> | <ord>a</ord> <bin>+</bin> <ord>1</ord> |
| $(a+b)^c$ in TeX4ht | $(a+b)^c$ in LaTeX |
| <msup> <mrow>(...)</mrow> <mrow>...</mrow> </msup> | (...<msup> <mrow>)</mrow> <mrow >...</mrow> </msup> |
| \begin{array}{cc} a & b \cr d & e \end{array} | <mtable equalrows='false' equalcolumns='false' class='array'> <mtr><mtd><mi>a</mi></mtd> <mtd><mi>b</mi></mtd> </mtr> <mtr><mtd><mi>d</mi></mtd> <mtd><mi>e</mi></mtd> </mtr> <!--cc--></mtable> |
| xhmlatex | ![]() | latexexa.html | ![]() | XSLT (xt) | ![]() | latexexa.notex |
| | |
||||
| latexexa.tex | latexexa.pdf | xhm2latex.xsl | utf2any | |||
| ![]() | |
||||
| pdflatex | latexexa-1.pdf | ![]() | pdflatex | ![]() | latexexa-1.tex |
• Logical structures may pass through without markup, or with improper markup, if their definitions are not configured for TeX4ht.
• Content MathML requires new user-friendly TeX notation, or a postprocessor.
• The native TeX math model allows abuses, and might be in conflict with MathML.
| $$\vbox{...}$$ | unclear intention: math? center? |
| $R=\{x|x$ is real $\}$ | ‘broken’ math |
Fixes (typically) are:
• TeX4ht benefits enormously from its access to
but could have been marginally improved from the addition of a few features to the TeX compiler:
Don Knuth noticed the issue of subscripts and superscripts already in 1986 [4].
LaTeX |
*ML |
A macro library in TeX for typesetting XSL Formatting Objects.

The MathML <math> elements pass through unchanged

The presentation Typesetting MathML with XMLTeX of David Carlisle discusses XMLTeX
[1] David Carlisle, XmlTeX: A non validating (and not 100% conforming) namespace aware XML parser implemented in TeX, ftp://ftp.tex.ac.uk/tex-archive/macros/xmltex/base/manual.html.
[2] Michel Goossens and Sebastian Rahtz with Eitan M. Gurari, Ross Moore, and Robert S. Sutor, The LaTeX Web Companion: Integrating TeX, HTML, and XML, Addison Wesley, 1999, ISBN 0-201-43311-7.
[3] Eitan M. Gurari, TeX4ht: LaTeX and TeX for hypertext, http://www.cis.ohio-state.edu/~gurari/TeX4ht/mn.html.
[4] Donald Knuth, Personal communication with Sebastian Rahtz regarding the Elsevier LaTeX to SGML conversion, 1986.
[5] Sebastian Rahtz, PassiveTeX, http://users.ox.ac.uk/~rahtz/passivetex/.