Reputation: 2164
I'm trying to displaying math formula on a web page. But when I write html code like following
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>Binomial Theorem</title>
</head>
<body>
<p>Binomial Theorem:</p>
<math xmlns="http://www.w3.org/1998/Math/MathML">
<mrow>
<msup>
<mfenced>
<mrow>
<mi>a</mi>
<mo>+</mo>
<mi>b</mi>
</mrow>
</mfenced>
<mn>2</mn>
</msup>
<mo>=</mo>
<msup>
<mrow>
<mi>a</mi>
</mrow>
<mn>2</mn>
</msup>
<mo>+</mo>
<msup>
<mrow>
<mi>b</mi>
</mrow>
<mn>2</mn>
</msup>
<mo>+</mo>
<mrow>
<mn>2</mn>
<mi>a</mi>
<mi>b</mi>
</mrow>
</mrow>
</math>
</body>
</html>
And the result is just
Binomial Theorem:
a + b 2 = a 2 + b 2 + 2 a b
It is not like a formula
help me to use MathML in HTML Thanks,
Upvotes: 5
Views: 5464
Reputation: 3233
MathML isn't supported by all popular user agents. Firefox 3.5 or later releases, for example, do support it:
Upvotes: 4
Reputation: 461
I would make 3 changes to your page:
<!DOCTYPE html>
identifies this page to the browser as an HTML5 page.html
element. It doesn't hurt anything to have it there, but it's not necessary. You're probably going to include it on each math
element anyway.</head>
, the math will be visible in all browsers, not just Firefox:<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
Upvotes: 4
Reputation: 492
MathML is currently supported only on Firefox browsers. Try on Firefox browser.
Upvotes: 1