HTML5's HTML syntax allows us to apply MathML elements within the document using the tag.
Here is a valid HTML5 document using MathML:
XML/HTML CodeCopy content to clipboard
- html
-
>
-
<html>
-
<head>
-
<meta charset="UTF-8">
-
<title>Pythagorean theoremtitle>
-
head>
-
<body>
-
<math xmlns="http://www.w3.org/1998/Math/MathML">
-
<mrow>
-
<msup><mi>ami><mn>2mn>msup>
-
<mo> mo>
-
<msup><mi>bmi><mn>2mn>msup>
-
<mo>=mo>
-
<msup><mi>cmi><mn>2mn>msup>
-
mrow>
-
math>
-
body>
-
html>
This will produce the following result:
a2 b2 = c2
Easy to learn This concept - please use FireFox 3.7 or higher to practice online.
Using MathML characters
Imagine that here is a markup that uses the character ⁢:
XML/HTML CodeCopy content to clipboard
- html
-
>
-
<html>
-
<head>
-
<meta charset="UTF-8">
-
<title>MathML Examplestitle>
-
head>
-
<body>
-
<math xmlns="http://www.w3.org/1998/Math/MathML">
-
<mrow>
-
<mrow>
-
<msup>
-
<mi>xmi>
-
<mn>2mn>
-
msup>
-
<mo> mo>
-
<mrow>
-
<mn>4mn>
-
<mo>mo>
-
<mi>xmi>
-
mrow>
-
<mo> mo>
-
<mn>4mn>
-
mrow>
-
<mo>=mo>
-
<mn>0mn>
-
mrow>
-
math>
-
body>
-
html>
这会生成如下结果
x 2 4 x 4 = 0
便于学习这一概念 - 请使用 FireFox 3.7 或更高版本进行在线练习。
矩阵表达示例
想象一下下面的例子,它会被用来表示一个简单的 2x2 矩阵:
XML/HTML Code复制内容到剪贴板
- html
-
>
-
<html>
-
<head>
-
<meta charset="UTF-8">
-
<title>MathML Examplestitle>
-
head>
-
<body>
-
<math xmlns="http://www.w3.org/1998/Math/MathML">
-
<mrow>
-
<mi>Ami>
-
<mo>=mo>
-
<mfenced open="[" close="]">
-
<mtable>
-
<mtr>
-
<mtd><mi>xmi>mtd>
-
<mtd><mi>ymi>mtd>
-
mtr>
-
<mtr>
-
<mtd><mi>zmi>mtd>
-
<mtd><mi>wmi>mtd>
-
mtr>
-
mtable>
-
mfenced>
-
mrow>
-
math>
-
body>
-
html>
这会生成如下结果