It seems that to use MathML, I ("hypothetical I") need to use a Ruby program called iTeX
There seem to be some very confused descriptions of MathML, which doesn't require iTeX or Ruby or any server side configuration at all.
You can't really compare MathJax and MathML as they are different things,
MathJax is a an implementation of a client side parser for both a TeX-like syntax and MathML.
Then (which ever input syntax is used for input) it can use various rendering methods including native MathML in the browser (including IE+MathPlayer, or recent WebKit builds, not just Firefox) or it can use CSS rendering.
Currently, if you don't want to use some JavaScript such as MathJax (or the simpler, less ambitious asciimathml) then you do need to serve the files as well formed XHTML (not necessarily valid XHTML, despite the comment above) however this is changing, MathML parsing is built into HTML5 so Firefox 4 (beta) for example will render MathML in an HTML page not just XHTML. So going forward a year or two one would expect HTML+MathML pages to not require any JavaScript or server side support at all. whereas a TeX like syntax (like a wiki) will always require some additional JavaScript or server processing.
Whether you want to use a linear TeX-like syntax or the XML/HTML syntax of MathML is pretty much a matter of choice, it is exactly analogous to a choice of whether to use a linear wiki style markup for your web pages, or to directly code (or generate) HTML markup.
Sometimes one is more appropriate than the other, many sites use both wiki and traditional HTML markup, depending on the context.
David
(co editor of mathml2 and 3, and before that co-developer of latex2e, and before that a long time association with the Mathematics department at Manchester, and still an LMS member should you want any discussion offline at any stage about MathML, I'm easy enough to find:-)
Update 07/2020:
The code bellow is not needed anymore. TeX4ht has now full support for the MathJax output. The equivalent of the code bellow is this:
make4ht filename.tex "mathml,mathjax"
If you want to keep your LaTeX math as plain text, use just:
make4ht filename.tex "mathjax"
make4ht
is replacement for htlatex
that converts to HTML5 and UTF-8 by default, so no special configurations as in the old answer are necessary.
Original answer:
You can use TeX4ht
. It can output math as mathml
which can be then displayed with mathjax
. You can also configure html
header to load mathjax
script from mathjax's cdn
:
\Preamble{xhtml,mathml}
\Configure{VERSION}{}
\Configure{DOCTYPE}{\HCode{<!DOCTYPE html>\Hnewline}}
\Configure{HTML}{\HCode{<html>\Hnewline}}{\HCode{\Hnewline</html>}}
\Configure{@HEAD}{}
\Configure{@HEAD}{\HCode{<meta charset="UTF-8" />\Hnewline}}
\Configure{@HEAD}{\HCode{<meta name="generator" content="TeX4ht
(http://www.cse.ohio-state.edu/\string~gurari/TeX4ht/)" />\Hnewline}}
\Configure{@HEAD}{\HCode{<link
rel="stylesheet" type="text/css"
href="\expandafter\csname aa:CssFile\endcsname" />\Hnewline}}
\Configure{@HEAD}{\HCode{<script type="text/javascript"\Hnewline
src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"\Hnewline
></script>\Hnewline}}
\Configure{@HEAD}{\HCode{<style type="text/css">\Hnewline
.MathJax_MathML {text-indent: 0;}\Hnewline
</style>\Hnewline}}
\begin{document}
\EndPreamble
With this config file, we request to output math as mathml
, then configure html
header so resulting file is html5
. Save it as for example ht5mjlatex.cfg
and then call from command line:
htlatex filename.tex "ht5mjlatex.cfg, charset=utf-8" " -cunihtf -utf8"
or you can use William F. Hammond's script (at bottom of the page)
Best Answer
Actually, what you ask for doesn't need a revision of the web standards. What you need is better implementation of the existing standards. MathML is the web standard for communicating mathematics. However, it is not universally supported (Firefox is good, IE works with a plugin, other browsers are ... not so good). Indeed, MathJaX is a bridge allowing MathML on browsers that don't support it.
For generating it, take a look at the list of converters on the w3 webpages. Tex4HT is The Big One for converting TeX documents. I recommend itextomml for shorter maths segments (it's what is used on the nlab, for example).