-
Notifications
You must be signed in to change notification settings - Fork 22.7k
/
Copy pathindex.md
99 lines (70 loc) · 6.4 KB
/
index.md
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
---
title: MathML
slug: Web/MathML
page-type: landing-page
browser-compat: mathml.elements.math
spec-urls: https://w3c.github.io/mathml/
sidebar: mathmlref
---
**Mathematical Markup Language (MathML)** is an [XML](/en-US/docs/Web/XML)-based language for describing mathematical notation.
[MathML](https://w3c.github.io/mathml/) was originally designed as a general-purpose specification for browsers, office suites, [computer algebra systems](https://en.wikipedia.org/wiki/Computer_algebra_system), [EPUB](https://www.w3.org/publishing/epub33/) readers, [LaTeX](https://en.wikipedia.org/wiki/LaTeX)-based generators. However, this approach was not very adapted to the Web: the [subset focusing on semantics](https://w3c.github.io/mathml/#contm) has never been implemented in browsers while the [subset focusing on math layout](https://w3c.github.io/mathml/#presm) led to incomplete and inconsistent browser implementations.
[MathML Core](https://w3c.github.io/mathml-core/) is a subset with increased implementation details based on rules from [LaTeX](https://en.wikipedia.org/wiki/LaTeX) and the [Open Font Format](https://learn.microsoft.com/en-us/typography/opentype/spec/math). It is tailored for browsers and designed specifically to work well with other web standards including [HTML](/en-US/docs/Web/HTML), [CSS](/en-US/docs/Web/CSS), [DOM](/en-US/docs/Web/API/Document_Object_Model), [JavaScript](/en-US/docs/Web/JavaScript).
Below you will find links to documentation, examples, and tools to work with MathML. MDN uses [MathML Core](https://w3c.github.io/mathml-core/) as a reference specification but, due to an erratic standardization history, legacy MathML features may still show up in existing implementations and web content.
> [!NOTE]
> It is highly recommended that developers and authors switch to MathML Core, perhaps relying on other web technologies to cover missing use cases. The Math WG is maintaining a set of [MathML polyfills](https://github.com/w3c/mathml-polyfills) to facilitate that transition.
## Tutorials
- [MathML for beginners](/en-US/docs/Web/MathML/Tutorials/For_beginners)
- : This tutorial will guide you through creating math formulas using structured markup. It starts with an introduction to adding MathML to an HTML document, followed by a deep dive into key components: fractions and roots, scripted elements, and text containers. The tutorial then covers tabular layouts for matrices and advanced math formatting. Finally, a challenge tests your understanding by having you recreate three famous mathematical formulas using the learned concepts.
## Guides
- [Authoring MathML](/en-US/docs/Web/MathML/Guides/Authoring)
- : Suggestions and tips for writing MathML, including suggested MathML editors and how to integrate their output into Web content.
- [Fonts for MathML](/en-US/docs/Web/MathML/Guides/Fonts)
- : How users can install such math fonts to properly display MathML in browsers.
## Reference
- [MathML element reference](/en-US/docs/Web/MathML/Reference/Element)
- : Details about each MathML element and compatibility information for desktop and mobile browsers.
- [MathML global attribute reference](/en-US/docs/Web/MathML/Reference/Global_attributes)
- : Information about global MathML attributes applicable to all elements.
- [MathML attribute reference](/en-US/docs/Web/MathML/Reference/Attribute)
- : Information about MathML attributes that modify the appearance or behavior of elements.
- [MathML attribute values](/en-US/docs/Web/MathML/Reference/Values)
- : Further information about MathML attribute values.
## Examples
Below you'll find some examples you can look at to help you to understand how to use MathML.
### MathML formulas
The following demos display increasingly complex mathematical concepts in Web content.
- [Proving the Pythagorean theorem](/en-US/docs/Web/MathML/Guides/Proving_the_Pythagorean_theorem)
- : Small example showing a proof of the Pythagorean Theorem.
- [Deriving the quadratic formula](/en-US/docs/Web/MathML/Guides/Deriving_the_quadratic_formula)
- : Outlines the derivation of the Quadratic Formula.
- [Mozilla MathML test](https://fred-wang.github.io/MathFonts/mozilla_mathml_test/)
- : Original test from the Mozilla MathML project. It contains examples from the [TeXbook](https://en.wikipedia.org/wiki/Computers_and_Typesetting) with image references generated by TeX.
- [MathML browser test](http://eyeasme.com/Joe/MathML/MathML_browser_test.html)
- : A similar test with concrete formulas taken from Wikipedia.
### Other Web technologies
The following demos mix MathML with other Web technologies to produce advanced content.
- [`<la-tex>` custom element](https://fred-wang.github.io/TeXZilla/examples/customElement.html)
- : A [custom element](/en-US/docs/Web/API/Web_components/Using_custom_elements) that accepts [LaTeX](https://en.wikipedia.org/wiki/LaTeX) content.
- [Magnetic field demo](https://fred-wang.github.io/TeXZilla/examples/toImageWebGL.html)
- : A 3D representation of a magnetic field, using [SVG](/en-US/docs/Web/SVG) and [WebGL](/en-US/docs/Web/API/WebGL_API).
- [Συνάρτηση ζήτα Ρήμαν (el)](https://fred-wang.github.io/MathFonts/%CE%A3%CF%85%CE%BD%CE%AC%CF%81%CF%84%CE%B7%CF%83%CE%B7_%CE%B6%CE%AE%CF%84%CE%B1_%CE%A1%CE%AE%CE%BC%CE%B1%CE%BD.html)
- : A greek article about the Riemann zeta function, with [Web fonts](/en-US/docs/Learn_web_development/Core/Text_styling/Web_fonts) from the [Greek Font Society](https://greekfontsociety-gfs.gr/).
- [Pell's equation](https://people.igalia.com/fwang/pell-bigint-mathml/)
- : A JavaScript program to solve Pell's equation using [`BigInt`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt).
- [Lovelace's program for Bernoulli numbers](https://people.igalia.com/fwang/lovelace-jsclass-mathml/)
- : An emulator for Ada Lovelace's program to calculate Bernoulli numbers, using [Private properties](/en-US/docs/Web/JavaScript/Reference/Classes/Private_properties).
## Getting help from the community
- [W3C Math Home](https://www.w3.org/Math/)
- [Raise issues on GitHub w3c/mathml repository](https://github.com/w3c/mathml/issues)
- [www-math w3.org mail archive](https://lists.w3.org/Archives/Public/www-math/)
## Tools
- [W3C Validator](https://validator.w3.org/)
- [W3C's wiki page](https://www.w3.org/wiki/Math_Tools)
## Related topics
- [CSS](/en-US/docs/Web/CSS)
- [HTML](/en-US/docs/Web/HTML)
- [SVG](/en-US/docs/Web/SVG)
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}