[Haskell-cafe] Haddock Markup

Wolfgang Jeltsch g9ks157k at acme.softbase.org
Fri Feb 6 10:03:29 EST 2009

Am Freitag, 6. Februar 2009 11:31 schrieb George Pollard:
> I think that the TeX *language* is great for writing mathematics,
> but that we should be wary of blindly incorporating TeX *output*
> into Haddock.
> Most of Haddock's documentation is currently HTML-based, and
> if we add TeX mathematics in the usual way (i.e. embedding images)
> it is very ‘inaccessible content’ (no selection, scaling, and a myriad
> of other small niggles) compared to the rest of the HTML file.
> My thoughts would be to use the TeX engine itself for when generating
> high-quality PDF documentation, and have something else translate TeX
> to (e.g.) MathML for the HTML pages. There are various programs to do this
> (or it could be done in Haskell :D!)

TeX is not so great for mathematics and especially not for conversion into 
MathML (which would be needed for HTML output). The TeX math language 
provides rather little semantic information. As input language for the 
concrete software named TeX this is mostly okay since the concrete rendering 
algorithm of TeX doesn’t need certain information (for example, about 
implicit bracketing).

However, even for rendering with TeX, you sometimes have to ressort to ugly 
tricks since TeX sometimes misinterprets what you wrote. Knuth gives some 
examples in chapter 18 of The TeXbook. For conversion into MathML, a TeX 
source generally doesn’t have enough information since even presentation 
MathML code contains much more structure than ordinary TeX source code does.

So using TeX as a general language for math is a very bad idea, in my opinion. 
The problem is that there is no good language which provides enough 
structural information for conversion into MathML and is at the same time 
simple to write and read. Maybe, both requirements contradict.

Best wishes,

More information about the Haskell-Cafe mailing list