Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
MathML
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== Presentation MathML === {{Infobox file format | name = Presentation MathML | mime = application/mathml-presentation+xml<ref name="mathml-media-types"/> | type code = <code>MMLp</code> | uniform type = {{mono|public.mathml.presentation}} | conforms to = {{mono|public.mathml}} | extended from = [[#Generic MathML|Generic MathML]] }} Presentation MathML focuses on the display of an equation, and has about 30 elements. The elements' names all begin with {{code|m}}. A Presentation MathML expression is built up out of ''tokens'' that are combined using higher-level elements, which control their layout. Finer details of presentation are affected by close to 50 attributes. Token elements generally only contain characters (not other elements). They include: * {{code|lang=XML|<mi>x</mi>}} β identifiers; * {{code|lang=XML|<mo>+</mo>}} β operators; * {{code|lang=XML|<mn>2</mn>}} β numbers; * {{code|lang=XML|<mtext>suchΒ that</mtext>}} β text. Note, however, that these token elements may be used as extension points, allowing markup in host languages. MathML in [[HTML5]] allows most inline HTML markup in mtext, and {{code|lang=XML|<mtext><b>non</b> zero</mtext>}} is conforming, with the HTML markup being used within the MathML to mark up the embedded text (making the first word bold in this example). These are combined using layout elements, that generally contain only elements. They include: * {{code|lang=XML|<mrow>}} β a horizontal row of items; * {{code|lang=XML|<msup>}}, {{code|lang=XML|<munderover>}}, and others β superscripts, limits over and under operators like sums, etc.; * {{code|lang=XML|<mfrac>}} β fractions; * {{code|lang=XML|<msqrt>}} and {{code|lang=XML|<mroot>}} β roots; * {{code|lang=XML|<mfenced>}} β surrounding content with fences, such as parentheses. As usual in HTML and XML, many [[character entity reference|entities]] are available for specifying special symbols by name, such as {{code|lang=HTML|π}} and {{code|lang=HTML|→}}. An interesting feature of MathML is that entities also exist to express normally-invisible operators, such as {{code|lang=HTML|⁢}} (or the shorthand {{code|lang=HTML|⁢}}) for implicit multiplication. They are: * {{unichar|2061|FUNCTION APPLICATION}} (to distinguish <math>\sin(x)</math> from <math>\sin\cdot x</math> in <math>\sin{x}</math>); * {{unichar|2062|INVISIBLE TIMES}} (to distinguish <math>a_{m\times n}</math> from <math>a_{m,n}</math> in <math>a_{mn}</math>); * {{unichar|2063|INVISIBLE SEPARATOR}} (vice versa); * {{unichar|2064|INVISIBLE PLUS}} (to distinguish <math>2 + \frac{1}{3}</math> from <math>2 \cdot \frac{1}{3}</math> in <math>2\tfrac{1}{3}</math>). The full specification of MathML entities<ref>{{cite web | url = http://www.w3.org/TR/MathML3/chapter7.html | title = Characters, Entities and Fonts | website = W3.org }}</ref> is closely coordinated with the corresponding specifications for use with HTML and XML in general.<ref>{{cite web | url = http://www.w3.org/TR/xml-entity-names/Overview.html | title = XML Entity Definitions for Characters (2nd Edition) | website = W3.org }}</ref> Thus, the expression <math>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"> <mrow> <mi>a</mi> <mo>⁢</mo> <msup><mi>x</mi><mn>2</mn></msup> <mo>+</mo><mi>b</mi><mo>⁢</mo><mi>x</mi> <mo>+</mo><mi>c</mi> </mrow> </syntaxhighlight> A complete document that consists of just the MathML example above, is shown here: <syntaxhighlight lang="xml"> <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE math PUBLIC "-//W3C//DTD MathML 2.0//EN" "http://www.w3.org/Math/DTD/mathml2/mathml2.dtd"> <math xmlns="http://www.w3.org/1998/Math/MathML"> <mrow> <mi>a</mi> <mo>⁢</mo> <msup><mi>x</mi><mn>2</mn></msup> <mo>+</mo><mi>b</mi><mo>⁢</mo><mi>x</mi> <mo>+</mo><mi>c</mi> </mrow> </math> </syntaxhighlight>
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)