MathML Implemented in CSS


Presentation Examples (MathML Namespace)

Which doesn't look too good, but it turns out that Opera has a bug which means that if an element is in a namespace, CSS can't see its attributes, so here is the same file again with the XHTML and MathML all in the XHTML namespace:

Presentation Examples (XHTML Namespace)

Note that now the different menclose examples are styled differently and mathvariant on mi and mn changes the font and open and close on mfenced has an effect.

The CSS is here: pmathmlcss.css

A discussion of the css selector bug is here:

Note that as Opera doesn't have XSL the rendering is even more basic than the pmathmlcss.xsl stylesheet version as that can insert javascript to do stretchy brackets and can see element content as well as attribute values, so can cange the default font for mi depending on content length and can implement a basic operator dictionary of spacing rules for mo. However the aim here is the same, make the mathml ugly but legible. Apart from the fact it fails if the elements are in the mathml namespace I think it just about succeeds in that. Note an xhtml+presentation mathml document could use two xml-stylesheet pi's one pointing at the XSL stylesheet and one at this CSS, and then the file should render in IE mozilla netscape and opera.

Content MathML

There have to be a few shortcuts and a few non standard notations, but surprisingly enough it makes a more or less legible presentation of the cmathml.xsl test file used for the XSL stylesheets (that contains most of the content examples from the mathml 2 rec, plus a few special test cases)

As before, a version with and without the MathML namespace declaration (although it makes less difference here as there are fewer attributes to be handled)

Presentation Examples (MathML Namespace)

Presentation Examples (XHTML Namespace)

The CSS is here: cmathmlcss.css

This is all just standard CSS2 so in theory it should work in other places besides opera. Can safari css style xml for example??

David Carlisle