Question

I have tried to display a simple equation but it doesn't work. My code is as follow (html5):

<math xmlns="http://www.w3.org/1998/Math/MathML" display = 'block'>
    <mrow>
        <msub>
            <mi>a</mi>
            <mi>i</mi>
        </msub>
        <mo>=</mo>
        <msub>
            <mi>a</mi>
            <mi>z</mi>
        </msub>
        <sin/>
        <mi mathvariant='normal' fontfamily='Times New Roman'>α</mi>
        <mo>&minus;</mo>
        <msub>
            <mi>a</mi>
            <mi>x</mi>
        </msub>
        <cos/>
        <mi mathvariant='normal' fontfamily='Times New Roman'>α</mi>
    </mrow>
</math>

In Opera or Chrome I cannot see neither the trigonometrical operations nor the subindices. While in Firefox I can see the subindices but not the trigonometrical operations. Can someone say where the error is? Thanks in advance.

Was it helpful?

Solution

The answer is unfortunately simple: MathML is not supported in Chrome, Opera and IE.

Firefox has a very solid implementation (but not yet complete), Safari only a very partial implementation. Neither Firefox nor Safari support Content MathML.

That's why you'll need to use a polyfill like MathJax (cf MathML support) or jqmath.

Neither of those polyfills supports Content MathML, so you'll want to follow MvG's advice to produce Presentation MathML.

On older IE (6-9), users can install the MathPlayer plugin which is the only implementation supporting all of Presentation and Content MathML.

OTHER TIPS

I'd guess that this problem is due to your mix of presentation and content markup. The <cos/> and <sin/> elements are content markup and as such make sense almost exclusively in the body of an <apply>. You might be better off sticking to presentation markup exclusively, using <mo>cos</mo> and <mo>sin</mo> to denote the operators.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top