HTML5 MathML
In HTML5 kann das <math>...</math>-Element in einem Dokument verwendet werden, entsprechend dem <math>...</math>-Tag.
MathML ist eine mathematische Auszeichnungssprache, ein Standard basierend auf XML (eine Teilmenge der Standard Generalized Markup Language), der zum Schreiben mathematischer Symbole und Formeln verwendet wird.
Hinweis:Derzeit unterstützen nur Firefox- oder Safari-Browser es, und die meisten Browser unterstützen das MathML-Tag nicht. Wenn Ihr Browser dieses Tag nicht unterstützt, können Sie die neueste Version von Firefox oder Safari verwenden, um es anzuzeigen.
Wir können auch Stilbibliotheken von Drittanbietern verwenden, um mathematische Notation zu unterstützen. Die in diesem Kapitel verwendete Stilbibliothek kann durch Klicken auf die Schaltfläche unten heruntergeladen werden:
mathml.zip herunterladen
MathML-Beispiel
Hier ist eine einfache MathML-Instanz:
instance
<html>
<head>
<meta charset="UTF-8">
<title>Beispiel-Tutorial (example.com)</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>
Probieren Sie es aus »
Verwenden Sie Drittanbieter-Bibliotheken, um Folgendes zu unterstützen:
instance
<html>
<head>
<meta charset="UTF-8">
<title>Beispiel-Tutorial (example.com)</title>
<script type="text/javascript" src="/static.jyshare.com/assets/js/mathml/mspace.js?v=2"></script>
</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>
Probieren Sie es aus »
Ergebnisbild, wie unten gezeigt:

Hier ist ein Beispiel mit einigen hinzugefügten Operatoren:
instance
<html>
<head>
<meta charset="UTF-8">
<title>Beispiel-Tutorial (example.com)</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>
Probieren Sie es aus »
Verwenden Sie Drittanbieter-Bibliotheken, um Folgendes zu unterstützen:
instance
<html>
<head>
<meta charset="UTF-8">
<title>Beispiel-Tutorial (example.com)</title>
<script type="text/javascript" src="/static.jyshare.com/assets/js/mathml/mspace.js?v=2"></script>
</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>
<mi>x</mi>
</mrow>
<mo>+</mo>
<mn>4</mn>
</mrow>
<mo>=</mo>
<mn>0</mn>
</mrow>
</math>
</body>
</html>
Probieren Sie es aus »
Ergebnisbild, wie unten gezeigt:

Hier ist eine 2×2-Matrix-Instanz, die in Firefox 3.5 und höher effektiv angezeigt werden kann:
instance
<html>
<head>
<meta charset="UTF-8">
<title>Beispiel-Tutorial (example.com)</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>
Probieren Sie es aus »
Verwenden Sie Drittanbieter-Bibliotheken, um Folgendes zu unterstützen:
instance
<html>
<head>
<meta charset="UTF-8">
<title>Beispiel-Tutorial (example.com)</title>
<script type="text/javascript" src="/static.jyshare.com/assets/js/mathml/mspace.js?v=2"></script>
</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>
Probieren Sie es aus »
Ergebnisbild, wie unten gezeigt:
