Forum How do I...?

Where are the style libraries for MathML?

johnstephens
Hi! We're working on a document that includes a good bit of math, and we're having trouble styling the components of the mathsubsup element so that mn:first-child sits on the line, without adding whitespace to the top or bottom of the line.

I've found it impossible to target the msubsup with CSS, which means none of my tinkering has given very elegant results. Since Prince is obviously applying styles to the math elements, styles that don't appear in other browsers, I figured I might be able to learn something by looking at the default stylesheet.

But the only file I can find with MathML styles isn't very informative-- it's located at /usr/local/lib/prince/style/mathml.css, and includes only a few lines:
/*
    Prince - MathML stylesheet
    http://www.princexml.com
*/

@namespace math url("http://www.w3.org/1998/Math/MathML");

math[mode=inline] { display: inline }
math[mode=display] { display: block }

math[display=inline] { display: inline }
math[display=block] { display: block }

math|math[mode=inline] { display: inline }
math|math[mode=display] { display: block }

math|math[display=inline] { display: inline }
math|math[display=block] { display: block }


Surely there's more to Princes default math styles than that? Any guidance or help on this issue would be very appreciated!
mikeday
At the moment Prince does not actually apply any CSS properties to MathML elements. The way it works is that Prince converts MathML Content markup to MathML Presentation markup, and Presentation Markup gets converted in turn to SVG. These conversions use hard-wired rules, not CSS style sheets, as the interaction between MathML and CSS is still a bit awkward. This situation may be improved by the forthcoming MathML for CSS specification, a "profile of MathML 3.0 that admits formatting with Cascading Style Sheets" that we plan to support in Prince.
johnstephens
Thanks! I'm grateful for your clear and cogent explanation of this.