HTML5 - MathML
La sintassi HTML di HTML5 consente di utilizzare elementi MathML all'interno di un documento utilizzando i tag <math> ... </math>.
La maggior parte dei browser web può visualizzare tag MathML. Se il tuo browser non supporta il MathML, ti suggerirei di utilizzare l'ultima versione di Firefox.
Esempi MathML
Di seguito è riportato un documento HTML5 valido con MathML -
<!doctype html>
<html>
<head>
<meta charset = "UTF-8">
<title>Pythagorean theorem</title>
</head>
<body>
<math xmlns = "http://www.w3.org/1998/Math/MathML">
<mrow>
<msup><mi>a</mi><mn>2</mn></msup>
<mo>+</mo>
<msup><mi>b</mi><mn>2</mn></msup>
<mo> = </mo>
<msup><mi>c</mi><mn>2</mn></msup>
</mrow>
</math>
</body>
</html>
Questo produrrà il seguente risultato:
Usare i caratteri del MathML
Considera, il seguente è il markup che fa uso dei caratteri & InvisibleTimes; -
<!doctype html>
<html>
<head>
<meta charset = "UTF-8">
<title>MathML Examples</title>
</head>
<body>
<math xmlns = "http://www.w3.org/1998/Math/MathML">
<mrow>
<mrow>
<msup>
<mi>x</mi>
<mn>2</mn>
</msup>
<mo>+</mo>
<mrow>
<mn>4</mn>
<mo></mo>
<mi>x</mi>
</mrow>
<mo>+</mo>
<mn>4</mn>
</mrow>
<mo>=</mo>
<mn>0</mn>
</mrow>
</math>
</body>
</html>
Ciò produrrebbe il seguente risultato. Se non riesci a vedere risultati corretti come x 2 + 4x + 4 = 0, usa Firefox 3.5 o versione successiva.
Questo produrrà il seguente risultato:
Esempi di presentazione a matrice
Considera il seguente esempio che verrebbe utilizzato per rappresentare una semplice matrice 2x2:
<!doctype html>
<html>
<head>
<meta charset = "UTF-8">
<title>MathML Examples</title>
</head>
<body>
<math xmlns = "http://www.w3.org/1998/Math/MathML">
<mrow>
<mi>A</mi>
<mo>=</mo>
<mfenced open = "[" close="]">
<mtable>
<mtr>
<mtd><mi>x</mi></mtd>
<mtd><mi>y</mi></mtd>
</mtr>
<mtr>
<mtd><mi>z</mi></mtd>
<mtd><mi>w</mi></mtd>
</mtr>
</mtable>
</mfenced>
</mrow>
</math>
</body>
</html>
Questo produrrà il seguente risultato:
Ciò produrrebbe il seguente risultato. Se non riesci a vedere il risultato corretto, utilizza Firefox 3.5 o versione successiva.