使用 MathML 编写数学

数学标记语言(或 MathML)是用于在网页中使用分数、脚本、根式、矩阵、积分、级数等编写数学公式的标记语言。虽然它最初被设计为独立的 XML 语言,但 MathML 通常嵌入在网页中 HTML 文档可以看作是 HTML 的扩展。

¥Mathematical Markup Language — or MathML — is the markup language used to write mathematical formulas in web pages using fractions, scripts, radicals, matrices, integrals, series, etc. Although it was originally designed as an independent XML language, MathML is generally embedded inside HTML documents and can be seen as an extension of HTML.

警告:实际上,MathML 内容是从 轻量级标记语言(例如 LaTeX)或使用 图形用户界面 生成的:如果你只需要在网页中集成数学公式,编写 MathML 页面的提示就足够了。

¥Warning: In practice, MathML content is generated from lightweight markup languages (e.g. LaTeX) or using graphical user interface: if you just need to integrate mathematical formulas in your web pages, the tips from the Authoring MathML page should be enough.

先决条件

¥Prerequisites

在尝试学习 MathML 之前,假设你对 HTMLCSS 有一些基础知识。因此,强烈建议你首先至少熟悉这两种技术。首先完成以下模块:

¥Before attempting to learn MathML, it is assumed that you have some basic knowledge of HTML and CSS. Consequently, you are strongly advised to get familiar with at least these two technologies first. Start by working through the following modules:

尽管将根据需要解释所需的概念,但对数学符号和 TeX 渲染规则的一些熟悉也可能会派上用场。

¥Some familiarity with mathematical notations and TeX rendering rules might also come in handy, even though required concepts will be explained as needed.

模块

¥Modules

MathML 第一步

MathML 是用于在网页中编写数学公式的标记语言。本模块为你掌握 MathML 的道路提供了一个温和的开始,包括它的工作原理、语法是什么样子以及如何开始在 HTML 中使用它的基础知识。

也可以看看

¥See also

MDN 上的 MathML

MDN 上 MathML 文档的主要入口点,你可以在其中找到 MathML 语言所有功能的详细参考文档。想知道属性的所有价值吗?这是一个值得一去的好地方。