MathML: Difference between revisions

Content deleted Content added
Tags: Reverted references removed Mobile edit Mobile web edit
Undid revision 1307712709 by 151.236.180.121 (talk): Test edit.
 
(18 intermediate revisions by 14 users not shown)
Line 1:
{{short description|Format for expressing mathematical formulae}}
{{Self referencefor|For a guide on using MathML and math tags on Wikipedia, see [[|Help:Displaying a formula]].|selfref=y}}
{{Use dmy dates|date=February 2021}}
{{Infobox technology standard
Line 50:
}}
| authors = {{Collapsible list|title=Principal authors|
{{blist|Ron Ausbrooks|Stephen Buswell|David Carlisle|Giorgi Chavchanidze|Stéphane Dalmas|Stan Devitt|Angel Diaz|Sam Dooley|Roger Hunter|Patrick Ion|Michael Kohlhase|Azzeddine Lazrek|Paul Libbrecht|Bruce Miller|Robert Miner|Chris Rowley|Murray Sargent|Bruce Smith|Neil Soiffer|Robert Sutor|Stephen Watt}}
* Ron Ausbrooks
* Stephen Buswell
* David Carlisle
* Giorgi Chavchanidze
* Stéphane Dalmas
* Stan Devitt
* Angel Diaz
* Sam Dooley
* Roger Hunter
* Patrick Ion
* Michael Kohlhase
* Azzeddine Lazrek
* Paul Libbrecht
* Bruce Miller
* Robert Miner
* Chris Rowley
* Murray Sargent
* Bruce Smith
* Neil Soiffer
* Robert Sutor
* Stephen Watt
}}<ref name="w3c-standard-2nd-ed"/>
| website = {{ubl
Line 77 ⟶ 57:
}}
| base_standards = [[XML]]
| related_standards = [[OpenMath]], [[OpenDocument]], [[Office Open XML]], {{abbr|[[OMDoc]]|Open Mathematical Documents}}
| abbreviation = MathML
}}
 
'''Mathematical Markup Language''' ('''MathML''') is a pair of [[mathematical markup language]]s, an application of [[XML]] for describing [[mathematics|mathematical]] notations and capturing both its structure and content, and is one of a number of [[mathematical markup languages]]. Its aim is to natively integrate mathematical formulae into [[World Wide Web]] pages and other documents. It is part of [[HTML5]] and standardised by [[International Organization for Standardization|ISO]]/IEC since 2015.<ref name="iso-iec-standard"/>
 
== History ==
Line 88 ⟶ 68:
| url = https://www.w3.org/MarkUp/HTMLPlus/htmlplus_45.html
| date = 1993-11-08
}}</ref> MathML 1 was released as a W3C recommendation in April 1998 as the first [[XML]] language to be recommended by the [[W3C]]. Version 1.01 of the format was released in July 1999 and version 2.0 appeared in February 2001. Implementations of the specification appeared in [[Amaya (web editor)|Amaya 1.1]], [[Mozilla Firefox|Mozilla 1.0]] and [[Opera 9.5]].<ref>{{cite web
| title = Mozilla 1.0 Released!
| url = http://www.mozillazine.org/articles/article2278.html
Line 147 ⟶ 127:
}}</ref> Also in 2015, the MathML Association was founded to support the adoption of the MathML standard.<ref>{{citation
| url = http://mathml-association.org/about.html
| archive-url = https://web.archive.org/web/20151002150927/http://mathml-association.org/about.html
| title = Mondial Association for Tools Handling MathML
| url-status = usurped
| archive-date = 2 October 2015
| title = Mondial Association for Tools Handling MathML
| access-date = 2016-06-20
| author1 = Deyan Ginev
Line 164 ⟶ 147:
 
=== MathML Core ===
In August 2021, a new specification called ''MathML Core'' was published, described as the “core"core subset of Mathematical Markup Language, or MathML, that is suitable for browser implementation."<ref>{{cite web
| title = MathML Core
| url = https://www.w3.org/TR/2022/WD-mathml-core-20220504/#abstract
| date = 2022-05-04
| access-date = 2023-03-03
}}</ref> MathML Core set itself apart from MathML 3.0 by including detailed rendering rules and integration with [[CSS]], automated browser support testing resources, and focusing on a fundamental subset of MathML. An implementation was added to Chromium at the beginning of 2023.<ref name="igalia-chrome-109">{{cite web
| url = https://www.igalia.com/2023/01/10/Igalia-Brings-MathML-Back-to-Chromium.html
| title = Igalia Brings MathML Back to Chromium
Line 270 ⟶ 253:
}}</ref>
 
Thus, the expression <math forcemathmode=mathml>a x^2+b x+c</math> requires two layout elements: one to create the overall horizontal row and one for the superscripted exponent. However, the individual tokens also have to be identified as identifiers ({{code|lang=XML|<mi>}}), operators ({{code|lang=XML|<mo>}}), or numbers ({{code|lang=XML|<mn>}}). Adding the token markup, the full form ends up as
 
<syntaxhighlight lang="xml">
Line 299 ⟶ 282:
| mime = application/mathml-content+xml
| type code = <code>MMLc</code>
| uniform type = {{ml">mono|public.mathml.content}}
| conforms to = {{mono|public.mathml}}
| extended from = [[#Generic MathML|Generic MathML]]
}}
Content MathML focuses on the semantics, or meaning, of the expression rather than its layout. Central to Content MathML is the {{code|lang=XML|<apply>}} element that represents function application. The function being applied is the first child element under {{code|lang=XML|<apply>}}, and its operands or parameters are the remaining child elements. Content MathML uses only a few attributes.
 
Tokens such as identifiers and numbers are individually marked up, much as for Presentation MathML, but with elements such as {{code|lang=XML|<ci>}} and {{code|lang=XML|<cn>}}. Rather than being merely another type of token, operators are represented by specific elements, whose mathematical semantics are known to MathML: {{code|lang=XML|<times>}}, {{code|lang=XML|<power>}}, etc. There are over a hundred different elements for different functions and operators.<ref>{{cite web
| url = http://www.w3.org/TR/MathML3/chapter4.html#contm.opel
| title = Content Markup
| website = W3.org
}}</ref>
 
For example, {{code|lang=XML|<apply><sin/><ci>x</ci></apply>}} represents <math>\sin(x)</math> and {{code|lang=XML|<apply><plus/><ci>x</ci><cn>5</cn></apply>}} represents <math>x+5</math>. The elements representing operators and functions are empty elements, because their operands are the other elements under the containing {{code|lang=XML|<apply>}}.
 
The expression <math>a x^2+b x+c</math> could be represented as
 
<syntaxhighlight lang="xml">
<math>
<apply>
Line 457 ⟶ 456:
 
== Other standards ==
The [[International Organization for Standardization|ISO]]/[[International Electrotechnical Commission|IEC]] standard [[OpenDocument]] (ODF) natively supports MathML for mathematical content. OpenDocument is the default file format in office suites like [[LibreOffice]] and [[Collabora Online]], the MathML content is stored in the ODF files (e.g., .odt, .ods, .odp). Microsoft Office does not support MathML in its default office suite XML document format. Instead, it defines a different XML math syntax derived from older [[Microsoft Office]] products.
 
Another standard called [[OpenMath]] that has been more specifically designed (largely by the same people who devised Content MathML) for storing formulae semantically can be used to complement MathML. OpenMath data can be embedded in MathML using the {{code|lang=XML|1=<annotation-xml encoding="OpenMath">}} element. OpenMath ''content dictionaries'' can be used to define the meaning of {{code|lang=XML|<csymbol>}} elements. The following would define ''P''<sub>1</sub>(''x'') to be the first [[Legendre polynomial]]:
<syntaxhighlight lang="xml">
Line 468 ⟶ 469:
 
The [[OMDoc]] format has been created for markup of larger mathematical structures than formulae, from statements like definitions, theorems, proofs, and examples, to complete theories and even entire text books. Formulae in OMDoc documents can either be written in Content MathML or in OpenMath; for presentation, they are converted to Presentation MathML.
 
The [[International Organization for Standardization|ISO]]/[[International Electrotechnical Commission|IEC]] standard [[Office Open XML]] (OOXML) defines a different XML math syntax, derived from [[Microsoft Office]] products. However, it is partially compatible<ref>{{cite web
| url = https://dpcarlisle.blogspot.com/2007/04/xhtml-and-mathml-from-office-20007.html
| title = XHTML and MathML from Office 2007
| first = David | last = Carlisle
| publisher = [[Blogspot]]
| publication-date = 2007-04-10
| access-date = 2007-09-20
}}</ref> through [[XSL Transformations]].
 
== See also ==
Line 488 ⟶ 480:
* [[KaTeX]]{{snd}}JavaScript library that converts LaTeX to MathML
* [[MathJax]]{{snd}}JavaScript library that converts LaTeX to MathML
* [[OpenDocument]] The ISO/IEC standard used by applications like [[LibreOffice]] and [[Collabora Online]] natively support MathML for mathematical content
 
== References ==
Line 513 ⟶ 506:
{{W3C Standards}}
{{Web browsers}}
{{ISO standards}}
 
{{Authority control}}