diff --git a/files/en-us/web/mathml/attribute/index.md b/files/en-us/web/mathml/attribute/index.md index c6b74b305c60c6f..4f4847c8f9ec3ac 100644 --- a/files/en-us/web/mathml/attribute/index.md +++ b/files/en-us/web/mathml/attribute/index.md @@ -5,423 +5,634 @@ tags: - MathML - MathML Reference --- -
{{MathMLRef}}
+{{MathMLRef}} -

This is an alphabetical list of MathML attributes. More details for each attribute are available on particular element pages.

+This is an alphabetical list of MathML attributes. More details for each attribute are available on particular [element pages](/en-US/docs/Web/MathML/Element). -

Notes:

+Notes: - +- The MathML {{ MathMLElement("mstyle") }} and {{ MathMLElement("math") }} elements accept all attributes of all MathML presentation elements. +- See [values](/en-US/docs/Web/MathML/Attribute/Values) for notes on values and units in MathML. +- The attributes `background`, `color`, `fontfamily`, `fontsize`, `fontstyle`, `fontweight` and `xlink:href` are deprecated. +- The [XLink](/en-US/docs/Glossary/XLink) attributes on MathML elements: `xlink:actuate`, `xlink:href`, `xlink:show` and `xlink:type` are deprecated as well. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameElements accepting attributeDescription
accent{{ MathMLElement("mo") }}, {{ MathMLElement("mover") }}, {{ MathMLElement("munderover") }}A Boolean value specifying whether the operator should be treated as an accent.
accentunder{{ MathMLElement("munder") }}, {{ MathMLElement("munderover") }}A Boolean value specifying whether the operator should be treated as an accent.
actiontype{{ MathMLElement("maction") }}A string value specifying the action happening for this element.
align {{deprecated_inline}}{{ MathMLElement("mtable") }}
- {{ MathMLElement("munder") }}, {{ MathMLElement("mover") }}, {{ MathMLElement("munderover") }}
- {{ MathMLElement("mstack") }}
Specifies different alignments of several elements (see element pages for details).
{{ unimplemented_inline() }}
- altimg
- altimg-width
- altimg-height
- altimg-valign
- alttext
{{ MathMLElement("math") }}Visual and textual fall-back options.
bevelled {{deprecated_inline}}{{ MathMLElement("mfrac") }}Specifies the style how the fraction should be displayed. Deprecated. Use U+2044 (fraction slash) instead.
{{ unimplemented_inline() }} charalign{{ MathMLElement("mstack") }}Specifies the horizontal alignment of digits.
close{{ MathMLElement("mfenced") }}A string for the closing delimiter.
columnalign{{ MathMLElement("mtable") }}, {{ MathMLElement("mtd") }}, {{ MathMLElement("mtr") }}Specifies the horizontal alignment of table cells.
columnlines{{ MathMLElement("mtable") }}Specifies table column borders.
columnspacing{{ MathMLElement("mtable") }}Specifies the space between table columns.
columnspan{{ MathMLElement("mtd") }}A non-negative integer value that indicates over how many table columns the cell extends.
{{ unimplemented_inline() }} crossout{{ MathMLElement("mscarry") }}Specifies what kind of line is drawn to cross out carries.
denomalign {{deprecated_inline}}{{ MathMLElement("mfrac") }}The alignment of the denominator under the fraction.
depth{{ MathMLElement("mpadded") }}Sets or increments the depth. See length.
dir{{ MathMLElement("math") }}, {{ MathMLElement("mi") }}, {{ MathMLElement("mo") }}, {{ MathMLElement("mrow") }}, {{ MathMLElement("ms") }}, {{ MathMLElement("mtext") }}The text direction. Possible values are either ltr (left to right) or rtl (right to left).
display{{ MathMLElement("math") }}Specifies the rendering mode. The values block and inline are allowed.
displaystyleAll -

A Boolean value specifying whether more vertical space is used for displayed equations or, if set to false, a more compact layout is used to display formulas.

- -

In MathML 3 this attribute was only valid on {{ MathMLElement("mstyle") }}, {{ MathMLElement("mtable") }}, and  {{ MathMLElement("math") }}.

-
{{ unimplemented_inline() }} edge{{ MathMLElement("malignmark") }}
fence{{ MathMLElement("mo") }}A Boolean value specifying whether the operator is a fence (such as parentheses). There is no visual effect for this attribute.
frame{{ MathMLElement("mtable") }}Specifies borders of an entire {{ MathMLElement("mtable") }}. Possible values are: none (default), solid and dashed.
framespacing{{ MathMLElement("mtable") }}Specifies additional space added between the table and frame.
{{ unimplemented_inline() }} groupalign{{ MathMLElement("maligngroup") }}
height{{ MathMLElement("mpadded") }}, {{ MathMLElement("mspace") }}Specifies the desired height. See lengths for possible values.
hrefAllUsed to set a hyperlink to a specified URI.
idAllSets up a unique identifier associated with the element.
{{ unimplemented_inline() }} indentalign{{ MathMLElement("mo") }}, {{ MathMLElement("mspace") }}
{{ unimplemented_inline() }} indentalignfirst{{ MathMLElement("mo") }}, {{ MathMLElement("mspace") }}
{{ unimplemented_inline() }} indentalignlast{{ MathMLElement("mo") }}, {{ MathMLElement("mspace") }}
{{ unimplemented_inline() }} indentshift{{ MathMLElement("mo") }}, {{ MathMLElement("mspace") }}
{{ unimplemented_inline() }} indentshiftfirst{{ MathMLElement("mo") }}, {{ MathMLElement("mspace") }}
{{ unimplemented_inline() }} indentshiftlast{{ MathMLElement("mo") }}, {{ MathMLElement("mspace") }}
{{ unimplemented_inline() }} indenttarget{{ MathMLElement("mo") }}, {{ MathMLElement("mspace") }}
{{ unimplemented_inline() }} infixlinebreakstyle{{ MathMLElement("mstyle") }}Specifies the default linebreakstyle to use for infix operators.
length{{ MathMLElement("msline") }}
{{ unimplemented_inline() }} linebreak{{ MathMLElement("mo") }}
{{ unimplemented_inline() }} linebreakmultchar{{ MathMLElement("mo") }}, {{ MathMLElement("mspace") }}
{{ unimplemented_inline() }} linebreakstyle{{ MathMLElement("mo") }}, {{ MathMLElement("mspace") }}
{{ unimplemented_inline() }} lineleading{{ MathMLElement("mo") }}, {{ MathMLElement("mspace") }}
linethickness{{ MathMLElement("mfrac") }}The thickness of the horizontal fraction line.
{{ unimplemented_inline() }} location{{ MathMLElement("mscarries") }}
{{ unimplemented_inline() }} longdivstyle{{ MathMLElement("mlongdiv") }}Controls the style of the long division layout.
lspace{{ MathMLElement("mo") }}, {{ MathMLElement("mpadded") }}The amount of space before the operator (see length for values and units).
lquote{{ MathMLElement("ms") }}The opening quote character (depends on dir) to enclose the content. The default value is """.
mathbackgroundAllThe background color. You can use #rgb, #rrggbb and HTML color names.
mathcolorAllThe text color. You can use #rgb, #rrggbb and HTML color names.
mathsize{{ MathMLElement("mi") }}, {{ MathMLElement("mn") }}, {{ MathMLElement("mo") }}, {{ MathMLElement("ms") }}, {{ MathMLElement("mtext") }}The size of the content.
mathvariant{{ MathMLElement("mi") }}, {{ MathMLElement("mn") }}, {{ MathMLElement("mo") }}, {{ MathMLElement("ms") }}, {{ MathMLElement("mtext") }}The logical class of the identifier, which varies in typography.
maxsize{{ MathMLElement("mo") }}The maximum size of the operator.
minsize{{ MathMLElement("mo") }}The minimum size of the operator.
movablelimits{{ MathMLElement("mo") }}Specifies whether attached under- and overscripts move to sub- and superscript positions.
notation{{ MathMLElement("menclose") }}A list of notations, separated by white space, to apply to the child elements.
numalign {{deprecated_inline}}{{ MathMLElement("mfrac") }}The alignment of the numerator over the fraction.
open{{ MathMLElement("mfenced") }}A string for the opening delimiter.
{{ unimplemented_inline() }} position{{ MathMLElement("msgroup") }}, {{ MathMLElement("msrow") }}, {{ MathMLElement("mscarries") }}, {{ MathMLElement("msline") }}
rowalign{{ MathMLElement("mtable") }}, {{ MathMLElement("mtd") }}, {{ MathMLElement("mtr") }}Specifies the vertical alignment of table cells.
rowlines{{ MathMLElement("mtable") }}Specifies table row borders.
rowspacing{{ MathMLElement("mtable") }}Specifies the space between table rows.
rowspan{{ MathMLElement("mtd") }}A non-negative integer value that indicates on how many rows does the cell extend.
rspace{{ MathMLElement("mo") }}The amount of space after the operator.
rquote{{ MathMLElement("ms") }}The closing quote mark (depends on dir) to enclose the content. The default value is """.
scriptlevel{{ MathMLElement("mstyle") }}Controls mostly the font-size. The higher the scriptlevel, the smaller the font size.
scriptminsize{{ MathMLElement("mstyle") }}Specifies a minimum font size allowed due to changes in scriptlevel.
scriptsizemultiplier{{ MathMLElement("mstyle") }}Specifies the multiplier to be used to adjust font size due to changes in scriptlevel.
selection{{ MathMLElement("maction") }}The child element which is addressed by the action.
separator{{ MathMLElement("mo") }}There is no visual effect for this attribute, but it specifies whether the operator is a separator (such as commas).
separators{{ MathMLElement("mfenced") }}A sequence of zero or more characters to be used for different separators.
{{ unimplemented_inline() }} shift{{ MathMLElement("msgroup") }}
{{ unimplemented_inline() }} stackalign{{ MathMLElement("mstack") }}
stretchy{{ MathMLElement("mo") }}Specifies whether the operator stretches to the size of the adjacent element.
subscriptshift {{deprecated_inline}}{{ MathMLElement("mmultiscripts") }}, {{ MathMLElement("msub") }}, {{ MathMLElement("msubsup") }}The minimum space by which to shift the subscript below the baseline of the expression.
supscriptshift {{deprecated_inline}}{{ MathMLElement("mmultiscripts") }}, {{ MathMLElement("msup") }}, {{ MathMLElement("msubsup") }}The minimum space by which to shift the superscript above the baseline of the expression.
symmetric{{ MathMLElement("mo") }}If stretchy is true, this attribute specifies whether the operator should be vertically symmetric around the imaginary math axis (centered fraction line).
voffset{{ MathMLElement("mpadded") }}Sets the vertical position of the child content.
width{{ MathMLElement("mpadded") }}, {{ MathMLElement("mspace") }}, {{ MathMLElement("mtable") }}Specifies the desired width. See lengths for possible values.
xlink:href {{deprecated_inline}}AllCan be used to set a hyperlink to a specfied URI. However, authors are encouraged to use the href attribute instead.
xmlns{{ MathMLElement("math") }}Specifies the URI for the MathML namespace (http://www.w3.org/1998/Math/MathML)
NameElements accepting attributeDescription
accent + {{ MathMLElement("mo") }}, {{ MathMLElement("mover") }}, + {{ MathMLElement("munderover") }} + + A Boolean value specifying whether the operator should be treated as an + accent. +
accentunder + {{ MathMLElement("munder") }}, + {{ MathMLElement("munderover") }} + + A Boolean value specifying whether the operator should be treated as an + accent. +
actiontype{{ MathMLElement("maction") }}A string value specifying the action happening for this element.
align {{deprecated_inline}} + {{ MathMLElement("mtable") }}
{{ MathMLElement("munder") }}, + {{ MathMLElement("mover") }}, + {{ MathMLElement("munderover") }}
{{ MathMLElement("mstack") }} +
+ Specifies different alignments of several elements (see element pages + for details). +
+ {{ unimplemented_inline() }}
altimg
altimg-width
altimg-height
altimg-valign
alttext +
{{ MathMLElement("math") }}Visual and textual fall-back options.
bevelled {{deprecated_inline}}{{ MathMLElement("mfrac") }} + Specifies the style how the fraction should be displayed. Deprecated. + Use U+2044 (fraction slash) instead. +
{{ unimplemented_inline() }} charalign{{ MathMLElement("mstack") }}Specifies the horizontal alignment of digits.
close{{ MathMLElement("mfenced") }}A string for the closing delimiter.
columnalign + {{ MathMLElement("mtable") }}, + {{ MathMLElement("mtd") }}, + {{ MathMLElement("mtr") }} + Specifies the horizontal alignment of table cells.
columnlines{{ MathMLElement("mtable") }}Specifies table column borders.
columnspacing{{ MathMLElement("mtable") }}Specifies the space between table columns.
columnspan{{ MathMLElement("mtd") }} + A non-negative integer value that indicates over how many table columns + the cell extends. +
{{ unimplemented_inline() }} crossout{{ MathMLElement("mscarry") }}Specifies what kind of line is drawn to cross out carries.
denomalign {{deprecated_inline}}{{ MathMLElement("mfrac") }}The alignment of the denominator under the fraction.
depth{{ MathMLElement("mpadded") }} + Sets or increments the depth. See + length. +
dir + {{ MathMLElement("math") }}, {{ MathMLElement("mi") }}, + {{ MathMLElement("mo") }}, {{ MathMLElement("mrow") }}, + {{ MathMLElement("ms") }}, {{ MathMLElement("mtext") }} + + The text direction. Possible values are either ltr (left to right) or + rtl (right to left). +
display{{ MathMLElement("math") }} + Specifies the rendering mode. The values block and + inline are allowed. +
displaystyleAll +

+ A Boolean value specifying whether more vertical space is used for + displayed equations or, if set to false, a more compact + layout is used to display formulas. +

+

+ In MathML 3 this attribute was only valid + on {{ MathMLElement("mstyle") }}, + {{ MathMLElement("mtable") }}, and  + {{ MathMLElement("math") }}. +

+
{{ unimplemented_inline() }} edge{{ MathMLElement("malignmark") }}
fence{{ MathMLElement("mo") }} + A Boolean value specifying whether the operator is a fence (such as + parentheses). There is no visual effect for this attribute. +
frame{{ MathMLElement("mtable") }} + Specifies borders of an entire {{ MathMLElement("mtable") }}. + Possible values are: none (default), solid and + dashed. +
framespacing{{ MathMLElement("mtable") }} + Specifies additional space added between the table and + frame. +
{{ unimplemented_inline() }} groupalign{{ MathMLElement("maligngroup") }}
height + {{ MathMLElement("mpadded") }}, + {{ MathMLElement("mspace") }} + + Specifies the desired height. See + lengths + for possible values. +
hrefAllUsed to set a hyperlink to a specified URI.
idAllSets up a unique identifier associated with the element.
{{ unimplemented_inline() }} indentalign + {{ MathMLElement("mo") }}, + {{ MathMLElement("mspace") }} +
+ {{ unimplemented_inline() }} indentalignfirst + + {{ MathMLElement("mo") }}, + {{ MathMLElement("mspace") }} +
{{ unimplemented_inline() }} indentalignlast + {{ MathMLElement("mo") }}, + {{ MathMLElement("mspace") }} +
{{ unimplemented_inline() }} indentshift + {{ MathMLElement("mo") }}, + {{ MathMLElement("mspace") }} +
+ {{ unimplemented_inline() }} indentshiftfirst + + {{ MathMLElement("mo") }}, + {{ MathMLElement("mspace") }} +
{{ unimplemented_inline() }} indentshiftlast + {{ MathMLElement("mo") }}, + {{ MathMLElement("mspace") }} +
{{ unimplemented_inline() }} indenttarget + {{ MathMLElement("mo") }}, + {{ MathMLElement("mspace") }} +
+ {{ unimplemented_inline() }} infixlinebreakstyle + {{ MathMLElement("mstyle") }} + Specifies the default linebreakstyle to use for infix + operators. +
length{{ MathMLElement("msline") }}
{{ unimplemented_inline() }} linebreak{{ MathMLElement("mo") }}
+ {{ unimplemented_inline() }} linebreakmultchar + + {{ MathMLElement("mo") }}, + {{ MathMLElement("mspace") }} +
{{ unimplemented_inline() }} linebreakstyle + {{ MathMLElement("mo") }}, + {{ MathMLElement("mspace") }} +
{{ unimplemented_inline() }} lineleading + {{ MathMLElement("mo") }}, + {{ MathMLElement("mspace") }} +
linethickness{{ MathMLElement("mfrac") }}The thickness of the horizontal fraction line.
{{ unimplemented_inline() }} location{{ MathMLElement("mscarries") }}
{{ unimplemented_inline() }} longdivstyle{{ MathMLElement("mlongdiv") }}Controls the style of the long division layout.
lspace + {{ MathMLElement("mo") }}, + {{ MathMLElement("mpadded") }} + + The amount of space before the operator (see + length for + values and units). +
lquote{{ MathMLElement("ms") }} + The opening quote character (depends on dir) to enclose the + content. The default value is """. +
mathbackgroundAll + The background color. You can use #rgb, + #rrggbb and + HTML color names. +
mathcolorAll + The text color. You can use #rgb, #rrggbb and + HTML color names. +
mathsize + {{ MathMLElement("mi") }}, {{ MathMLElement("mn") }}, + {{ MathMLElement("mo") }}, {{ MathMLElement("ms") }}, + {{ MathMLElement("mtext") }} + The size of the content.
mathvariant + {{ MathMLElement("mi") }}, {{ MathMLElement("mn") }}, + {{ MathMLElement("mo") }}, {{ MathMLElement("ms") }}, + {{ MathMLElement("mtext") }} + The logical class of the identifier, which varies in typography.
maxsize{{ MathMLElement("mo") }}The maximum size of the operator.
minsize{{ MathMLElement("mo") }}The minimum size of the operator.
movablelimits{{ MathMLElement("mo") }} + Specifies whether attached under- and overscripts move to sub- and + superscript positions. +
notation{{ MathMLElement("menclose") }} + A list of notations, separated by white space, to apply to the child + elements. +
numalign {{deprecated_inline}}{{ MathMLElement("mfrac") }}The alignment of the numerator over the fraction.
open{{ MathMLElement("mfenced") }}A string for the opening delimiter.
{{ unimplemented_inline() }} position + {{ MathMLElement("msgroup") }}, + {{ MathMLElement("msrow") }}, + {{ MathMLElement("mscarries") }}, + {{ MathMLElement("msline") }} +
rowalign + {{ MathMLElement("mtable") }}, + {{ MathMLElement("mtd") }}, + {{ MathMLElement("mtr") }} + Specifies the vertical alignment of table cells.
rowlines{{ MathMLElement("mtable") }}Specifies table row borders.
rowspacing{{ MathMLElement("mtable") }}Specifies the space between table rows.
rowspan{{ MathMLElement("mtd") }} + A non-negative integer value that indicates on how many rows does the + cell extend. +
rspace{{ MathMLElement("mo") }}The amount of space after the operator.
rquote{{ MathMLElement("ms") }} + The closing quote mark (depends on dir) to enclose the + content. The default value is """. +
scriptlevel{{ MathMLElement("mstyle") }} + Controls mostly the font-size. The higher the scriptlevel, + the smaller the font size. +
scriptminsize{{ MathMLElement("mstyle") }} + Specifies a minimum font size allowed due to changes in + scriptlevel. +
scriptsizemultiplier{{ MathMLElement("mstyle") }} + Specifies the multiplier to be used to adjust font size due to changes + in scriptlevel. +
selection{{ MathMLElement("maction") }}The child element which is addressed by the action.
separator{{ MathMLElement("mo") }} + There is no visual effect for this attribute, but it specifies whether + the operator is a separator (such as commas). +
separators{{ MathMLElement("mfenced") }} + A sequence of zero or more characters to be used for different + separators. +
{{ unimplemented_inline() }} shift{{ MathMLElement("msgroup") }}
{{ unimplemented_inline() }} stackalign{{ MathMLElement("mstack") }}
stretchy{{ MathMLElement("mo") }} + Specifies whether the operator stretches to the size of the adjacent + element. +
subscriptshift {{deprecated_inline}} + {{ MathMLElement("mmultiscripts") }}, + {{ MathMLElement("msub") }}, + {{ MathMLElement("msubsup") }} + + The minimum space by which to shift the subscript below the baseline of + the expression. +
supscriptshift {{deprecated_inline}} + {{ MathMLElement("mmultiscripts") }}, + {{ MathMLElement("msup") }}, + {{ MathMLElement("msubsup") }} + + The minimum space by which to shift the superscript above the baseline + of the expression. +
symmetric{{ MathMLElement("mo") }} + If stretchy is true, this attribute specifies + whether the operator should be vertically symmetric around the imaginary + math axis (centered fraction line). +
voffset{{ MathMLElement("mpadded") }}Sets the vertical position of the child content.
width + {{ MathMLElement("mpadded") }}, + {{ MathMLElement("mspace") }}, + {{ MathMLElement("mtable") }} + + Specifies the desired width. See + lengths + for possible values. +
xlink:href {{deprecated_inline}}All + Can be used to set a hyperlink to a specfied URI. However, authors are + encouraged to use the href attribute instead. +
xmlns{{ MathMLElement("math") }} + Specifies the URI for the MathML namespace (http://www.w3.org/1998/Math/MathML) +
diff --git a/files/en-us/web/mathml/attribute/values/index.md b/files/en-us/web/mathml/attribute/values/index.md index 7ec3405f2b71437..e6af8fefe78f61b 100644 --- a/files/en-us/web/mathml/attribute/values/index.md +++ b/files/en-us/web/mathml/attribute/values/index.md @@ -6,140 +6,55 @@ tags: - MathML - MathML Reference --- -
{{MathMLRef}}
- -

Lengths

- -

Several MathML presentation elements have attributes that accept length values used for size or spacing. MathML accepts different units and constants for specifying lengths.

- -

Units

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
UnitDescription
em{{ Cssxref("font-size", "Font-relative") }} unit
ex{{ Cssxref("font-size", "Font-relative") }} unit. (The "x"-height of the element, 1ex ≈ 0.5em in many fonts)
pxPixels
inInches (1 inch = 2.54 centimeters)
cmCentimeters
mmMillimeters
ptPoints (1 point = 1/72 inch)
pcPicas (1 pica = 12 points)
%Percentage of the default value.
- -

Constants

- -

{{deprecated_header}}

- -

A replacement for the deprecated constants below is:

- -
veryverythinmathspace  => 0.05555555555555555em
-verythinmathspace      => 0.1111111111111111em
-thinmathspace          => 0.16666666666666666em
-mediummathspace        => 0.2222222222222222em
-thickmathspace         => 0.2777777777777778em
-verythickmathspace     => 0.3333333333333333em
-veryverythickmathspace => 0.3888888888888889em
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ConstantValue
veryverythinmathspace1/18em
verythinmathspace2/18em
thinmathspace3/18em
mediummathspace4/18em
thickmathspace5/18em
verythickmathspace6/18em
veryverythickmathspace7/18em
negativeveryverythinmathspace-1/18em
negativeverythinmathspace-2/18em
negativethinmathspace-3/18em
negativemediummathspace-4/18em
negativethickmathspace-5/18em
negativeverythickmathspace-6/18em
negativeveryverythickmathspace-7/18em
- -

Note: Namedspace binding is deprecated in MathML3 and has been removed in Gecko 15.0 {{ geckoRelease("15.0") }} (bug 673759).

+{{MathMLRef}} + +## Lengths + +Several MathML presentation elements have attributes that accept length values used for size or spacing. MathML accepts different units and constants for specifying lengths. + +### Units + +| Unit | Description | +| ---- | --------------------------------------------------------------------------------------------------------------------------- | +| `em` | {{ Cssxref("font-size", "Font-relative") }} unit | +| `ex` | {{ Cssxref("font-size", "Font-relative") }} unit. (The "x"-height of the element, `1ex ≈ 0.5em` in many fonts) | +| `px` | Pixels | +| `in` | Inches (1 inch = 2.54 centimeters) | +| `cm` | Centimeters | +| `mm` | Millimeters | +| `pt` | Points (1 point = 1/72 inch) | +| `pc` | Picas (1 pica = 12 points) | +| `%` | Percentage of the default value. | + +### Constants + +{{deprecated_header}} + +A replacement for the deprecated constants below is: + + veryverythinmathspace => 0.05555555555555555em + verythinmathspace => 0.1111111111111111em + thinmathspace => 0.16666666666666666em + mediummathspace => 0.2222222222222222em + thickmathspace => 0.2777777777777778em + verythickmathspace => 0.3333333333333333em + veryverythickmathspace => 0.3888888888888889em + +| Constant | Value | +| -------------------------------- | --------- | +| `veryverythinmathspace` | 1/18`em` | +| `verythinmathspace` | 2/18`em` | +| `thinmathspace` | 3/18`em` | +| `mediummathspace` | 4/18`em` | +| `thickmathspace` | 5/18`em` | +| `verythickmathspace` | 6/18`em` | +| `veryverythickmathspace` | 7/18`em` | +| `negativeveryverythinmathspace` | -1/18`em` | +| `negativeverythinmathspace` | -2/18`em` | +| `negativethinmathspace` | -3/18`em` | +| `negativemediummathspace` | -4/18`em` | +| `negativethickmathspace` | -5/18`em` | +| `negativeverythickmathspace` | -6/18`em` | +| `negativeveryverythickmathspace` | -7/18`em` | + +Note: [Namedspace binding is deprecated](https://www.w3.org/TR/MathML3/chapter3.html#id.3.3.4.2.1) in MathML3 and has been removed in Gecko 15.0 {{ geckoRelease("15.0") }} ([bug 673759](https://bugzilla.mozilla.org/show_bug.cgi?id=673759)). diff --git a/files/en-us/web/mathml/authoring/index.md b/files/en-us/web/mathml/authoring/index.md index 74fc5234fa48345..01af1af9797493a 100644 --- a/files/en-us/web/mathml/authoring/index.md +++ b/files/en-us/web/mathml/authoring/index.md @@ -6,80 +6,92 @@ tags: - MathML - MathML Project --- -

This page explains how to write mathematics using the MathML language. Just like HTML, MathML is described with tags and attributes. HTML becomes verbose when your document contains advanced structures like lists or tables but fortunately there are many generators from simple notations, WYSIWYG editors and other Content Management Systems to help writing Web pages.

+This page explains how to write mathematics using the MathML language. Just like HTML, MathML is described with tags and attributes. HTML becomes verbose when your document contains advanced structures like lists or tables but fortunately there are many generators from simple notations, WYSIWYG editors and other Content Management Systems to help writing Web pages. -

Mathematical notations are even more complex with structures like fractions, square roots or matrices that are likely to require their own tags. As a consequence, good MathML authoring tools are more important and we describe some tools below. In particular, the Mozilla MathML team has been developing TeXZilla, a Javascript Unicode LaTeX-to-MathML converter that is intended to be used in many scenarios described here. Of course, the list is by no means exhaustive and you are invited to check out the W3C MathML software list where you can find various other tools.

+Mathematical notations are even more complex with structures like fractions, square roots or matrices that are likely to require their own tags. As a consequence, good MathML authoring tools are more important and we describe some tools below. In particular, the Mozilla MathML team has been developing [TeXZilla](https://github.com/fred-wang/TeXZilla/), a Javascript Unicode LaTeX-to-MathML converter that is intended to be used in many scenarios described here. Of course, the list is by no means exhaustive and you are invited to check out the [W3C MathML software list](https://www.w3.org/Math/Software/) where you can find various other tools. -

Note that by design, MathML is well-integrated in HTML5 and in particular you can use usual Web features like CSS, DOM, Javascript or SVG. This is out of the scope of this document but anyone with basic knowledge of Web languages will easily be able to mix these features with MathML. Check out our demos and MathML references for more details.

+Note that by design, MathML is well-integrated in HTML5 and in particular you can use usual Web features like CSS, DOM, Javascript or SVG. This is out of the scope of this document but anyone with basic knowledge of Web languages will easily be able to mix these features with MathML. Check out [our demos](/en-US/docs/Mozilla/MathML_Project#Sample_MathML_Documents) and [MathML references](/en-US/docs/Web/MathML) for more details. -

Using MathML

+## Using MathML -

MathML in HTML pages

+#### MathML in HTML pages -

You can use Presentation MathML inside HTML5 documents:

+You can use Presentation MathML inside HTML5 documents: -
<!DOCTYPE html>
-<html>
-<head>
- <title>MathML in HTML5</title>
-</head>
-<body>
+```html
+
+
+
+ MathML in HTML5
+
+
 
-  <h1>MathML in HTML5</h1>
+  

MathML in HTML5

- <p> +

Square root of two: - <math> - <msqrt> - <mn>2</mn> - </msqrt> - </math> - </p> + + + 2 + + +

-</body> -</html>
+ + +``` -

Content MathML is not supported by browsers. It's recommended to convert your Content MathML markup into Presentation MathML before publishing it, for example with the help of the ctop.xsl stylesheet. Tools mentioned on this page generates Presentation MathML.

+Content MathML is not supported by browsers. It's recommended to convert your Content MathML markup into Presentation MathML before publishing it, for example with the help of the [ctop.xsl](https://code.google.com/p/web-xslt/source/browse/trunk/#trunk/ctop) stylesheet. Tools mentioned on this page generates Presentation MathML. -

Fallback for Browsers without MathML support

+#### Fallback for Browsers without MathML support -

Unfortunately, some browsers are not able to render MathML equations or only have a limited support. Hence you will need to use a MathML polyfill to provide some fallback rendering. If you need only basic mathematical constructions such as those used on this MDN wiki then a small mathml.css stylesheet might be enough. To use it, just insert one line in your document header:

+Unfortunately, some browsers are not able to render MathML equations or only have a limited support. Hence you will need to use a MathML polyfill to provide some fallback rendering. If you need only basic mathematical constructions such as those used on this MDN wiki then a small [mathml.css](https://github.com/fred-wang/mathml.css) stylesheet might be enough. To use it, just insert one line in your document header: -
<script src="https://fred-wang.github.io/mathml.css/mspace.js"></script>
+```html + +``` -

If you need more complex constructions, you might instead consider using the heavier MathJax library as a MathML polyfill:

+If you need more complex constructions, you might instead consider using the heavier [MathJax](https://www.mathjax.org) library as a MathML polyfill: -
<script src="https://fred-wang.github.io/mathjax.js/mpadded-min.js"></script>
+```html + +``` -

Note that these two scripts perform feature detection of the mspace or mpadded elements (see the browser compatibility table on these pages). There is also a similar script to display a warning at the top of the page for browsers without good MathML support and let the users choose between one of the fallback above:

+Note that these two scripts perform feature detection of the [mspace](/en-US/docs/Web/MathML/Element/mspace) or [mpadded](/en-US/docs/Web/MathML/Element/mpadded) elements (see the browser compatibility table on these pages). There is also a similar script to display a warning at the top of the page for browsers without good MathML support and let the users choose between one of the fallback above: -
<script src="https://fred-wang.github.io/mathml-warning.js/mpadded-min.js"></script>
+```html + +``` -

If you don't want to use this link to GitHub but instead to integrate these polyfills or others in your own project, you might need the detection scripts to verify the level of MathML support. For example the following function verifies the MathML support by testing the mspace element (you may replace mspace with mpadded):

+If you don't want to use this link to GitHub but instead to integrate these polyfills or others in your own project, you might need the detection scripts to verify the level of MathML support. For example the following function verifies the MathML support by testing the mspace element (you may replace `mspace` with `mpadded`): -
 function hasMathMLSupport() {
+```js
+ function hasMathMLSupport() {
   var div = document.createElement("div"), box;
-  div.innerHTML = "<math><mspace height='23px' width='77px'/></math>";
+  div.innerHTML = "";
   document.body.appendChild(div);
   box = div.firstChild.firstChild.getBoundingClientRect();
   document.body.removeChild(div);
-  return Math.abs(box.height - 23) <= 1 && Math.abs(box.width - 77) <= 1;
-}
+ return Math.abs(box.height - 23) <= 1 && Math.abs(box.width - 77) <= 1; +} +``` -

Alternatively, the following UA string sniffing will allow to detect the rendering engines with native MathML support (Gecko and WebKit). Note that UA string sniffing is not the most reliable method and might break from version to version:

+Alternatively, the following UA string sniffing will allow to detect the rendering engines with native MathML support (Gecko and WebKit). Note that UA string sniffing is not the most reliable method and might break from version to version: -
var ua = navigator.userAgent;
-var isGecko = ua.indexOf("Gecko") > -1 && ua.indexOf("KHTML") === -1 && ua.indexOf('Trident') === -1;
-var isWebKit = ua.indexOf('AppleWebKit') > -1 && ua.indexOf('Chrome') === -1;
-
+```js +var ua = navigator.userAgent; +var isGecko = ua.indexOf("Gecko") > -1 && ua.indexOf("KHTML") === -1 && ua.indexOf('Trident') === -1; +var isWebKit = ua.indexOf('AppleWebKit') > -1 && ua.indexOf('Chrome') === -1; +``` -

Mathematical fonts

+#### Mathematical fonts -

In order to get a good layout or to allow different style, it's important to have mathematical fonts available. It's always good to provide a link to MDN's Font Instructions, so that your visitors can verify whether they have appropriate fonts installed on their system. It's also good to provide a fallback with Web fonts.

+In order to get a good layout or to allow different style, it's important to have mathematical fonts available. It's always good to provide a link to [MDN's Font Instructions](/en-US/docs/Mozilla/MathML_Project/Fonts), so that your visitors can verify whether they have appropriate fonts installed on their system. It's also good to provide a fallback with Web fonts. -

Prior to Gecko 31.0 {{GeckoRelease("31.0")}}, it was a bit tedious to setup math fonts, see the font instructions for Mozilla 2.0. For Gecko 31.0 {{GeckoRelease("31.0")}}, this is much simpler and is compatible with any Web rendering engine with MathML support. For example, here is a minimal stylesheet to use Latin Modern for the text and Latin Modern Math for the mathematics:

+Prior to Gecko 31.0 {{GeckoRelease("31.0")}}, it was a bit tedious to setup math fonts, see the [font instructions for Mozilla 2.0](/en-US/docs/Mozilla/MathML_Project/FontsMozilla2.0#MathML_Font_Selection_with_CSS). For Gecko 31.0 {{GeckoRelease("31.0")}}, this is much simpler and is compatible with any Web rendering engine with MathML support. For example, here is a minimal stylesheet to use Latin Modern for the text and Latin Modern Math for the mathematics: -
@namespace url('http://www.w3.org/1999/xhtml');
+```css
+@namespace url('http://www.w3.org/1999/xhtml');
 @namespace m url('http://www.w3.org/1998/Math/MathML');
 
 body, m|mtext {
@@ -87,118 +99,113 @@ body, m|mtext {
 }
 m|math {
     font-family: Latin Modern Math;
-}
+} +``` -

You can then use the @font-face rule as usual to provide WOFF fallback for Latin Modern and Latin Modern Math. See this GitHub repository to get WOFF fonts and sample CSS stylesheets to use on your Web site and check its test page.

+You can then use the [@font-face](/en-US/docs/Web/CSS/@font-face) rule as usual to provide WOFF fallback for Latin Modern and Latin Modern Math. See this [GitHub repository to get WOFF fonts and sample CSS stylesheets](https://github.com/fred-wang/MathFonts) to use on your Web site and check [its test page](https://fred-wang.github.io/MathFonts/). -

MathML in XML documents (XHTML, EPUB, etc)

+#### MathML in XML documents (XHTML, EPUB, etc) -

If for some reason you need to use MathML in XML documents, be sure to satisfy the usual requirements: well-formed document, use of correct MIME type, MathML namespace "http://www.w3.org/1998/Math/MathML" on <math> roots. For example, the XHTML version of the previous example looks like this:

+If for some reason you need to use MathML in XML documents, be sure to satisfy the usual requirements: well-formed document, use of correct MIME type, MathML namespace `"http://www.w3.org/1998/Math/MathML"` on `` roots. For example, the XHTML version of the previous example looks like this: -
<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN"
-  "http://www.w3.org/Math/DTD/mathml2/xhtml-math11-f.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
- <title>XHTML+MathML Example</title>
-</head>
-<body>
+```xml
+
+
+
+
+ XHTML+MathML Example
+
+
 
-<h1>XHTML+MathML Example</h1>
+

XHTML+MathML Example

- <p> +

Square root of two: - <math xmlns="http://www.w3.org/1998/Math/MathML"> - <msqrt> - <mn>2</mn> - </msqrt> - </math> - </p> - -</body> -</html>

- -

MathML in email and instant messaging clients

- -

Modern mail clients may send and receive emails in the HTML5 format and thus can use MathML expressions. Be sure to have the "send as HTML" and "view as HTML" options enabled. In Thunderbird, you can use the "Insert HTML" command to paste your HTML+MathML code. MathBird is a convenient add-on for Thunderbird to insert such MathML expressions using the AsciiMath input syntax. Moreover, a LaTeX-to-MathML input box has also been integrated into SeaMonkey since version 2.28 and into Thunderbird since version 31. Again, the way MathML is handled and the quality of the MathML rendering depends on the mail client. Even if your browser supports MathML, your Webmail may prevent you to send or receive mails with MathML inside.

- -

Gecko-based instant messaging clients can integrate a Javascript-based text-to-MathML converter (mentioned below) and then render the MathML expressions generated from the (plaintext) instant messages. For example, there is an Instantbird add-on that handles LaTeX expressions.

- -

Conversion from a Simple Syntax

- -

There are many simple notations (e.g. wiki or markdown syntaxes) to generate HTML pages. The same is true for MathML: for example ASCII syntaxes as used in calculators or the more powerful LaTeX language, very popular among the scientific community. In this section, we present some of these tools to convert from a simple syntax to MathML.

- - - -

Client-side Conversion

- -

In a Web environment, the most obvious method to convert a simple syntax into a DOM tree is to use Javascript and of course many libraries have been developed to perform that task.

- - - -

TeXZilla has an <x-tex> custom element, that can be used to write things like

- -
<x-tex>\frac{x^2}{a^2} + \frac{y^2}{b^2} = 1</x-tex>
- -

and get it automatically converted into MathML. This is still a work-in-progress, but could be improved in the future thanks to Web Components and shadow DOM. Alternatively, you can use the more traditional Javascript parsing of expressions at load time as all the other tools in this section do.

- -

One simple client-side conversion tools is ASCIIMathML. Just download the ASCIIMathML.js script and copy it to your Web site. Then on your Web pages, add a <script> tag to load ASCIIMathML and the mathematical expressions delimited by ` (grave accent) will be automatically parsed and converted to MathML:

- -
<html>
-<head>
+    
+      
+        2
+      
+    
+  

+ + + +``` + +#### MathML in email and instant messaging clients + +Modern mail clients may send and receive emails in the HTML5 format and thus can use MathML expressions. Be sure to have the "send as HTML" and "view as HTML" options enabled. In Thunderbird, you can use the "Insert HTML" command to paste your HTML+MathML code. [MathBird](http://disruptive-innovations.com/zoo/MathBird/) is a convenient add-on for Thunderbird to insert such MathML expressions using the AsciiMath input syntax. Moreover, a LaTeX-to-MathML input box has also been integrated into [SeaMonkey](https://www.seamonkey-project.org/) since version 2.28 and into [Thunderbird](https://www.mozilla.org/thunderbird/) since version 31. Again, the way MathML is handled and the quality of the MathML rendering [depends on the mail client](https://web.archive.org/web/20160304021257/http://www.maths-informatique-jeux.com/blog/frederic/?post/2012/11/14/Writing-mathematics-in-emails#c121). Even if your browser supports MathML, your Webmail may prevent you to send or receive mails with MathML inside. + +Gecko-based instant messaging clients can integrate a Javascript-based text-to-MathML converter (mentioned below) and then render the MathML expressions generated from the (plaintext) instant messages. For example, there is an [Instantbird add-on](https://addons.instantbird.org/en-US/instantbird/addon/340) that handles LaTeX expressions. + +## Conversion from a Simple Syntax + +There are many simple notations (e.g. wiki or markdown syntaxes) to generate HTML pages. The same is true for MathML: for example ASCII syntaxes as used in calculators or the more powerful LaTeX language, very popular among the scientific community. In this section, we present some of these tools to convert from a simple syntax to MathML. + +- pros: + + - Writing mathematical expressions may only require a standard text editor. + - Many tools are available, some of them are compatible with the classical LaTeX-to-pdf workflow. + - This gives access to advanced features of LaTeX like macros. + +- cons: + + - This may be harder to use: people must learn a syntax, typos in the code may easily lead to parsing or rendering errors etc + - The interface is not user-friendly: only code editor without immediate display of the mathematical expression. + - None of the syntax has been standardized, making cross-compatibility between converters difficult. Even the popular LaTeX language keeps having new packages added. + +### Client-side Conversion + +In a Web environment, the most obvious method to convert a simple syntax into a DOM tree is to use Javascript and of course many libraries have been developed to perform that task. + +- pros: + + - This is very easy setup: only a few Javascript and CSS files to upload and/or a link to add to your document header. + - This is a pure Web-based solution: everything is done by the browsers and no other programs must be installed or compiled. + +- cons: + + - This won't work if the visitor has Javascript disabled. + - The MathML code is not exposed to Web crawlers (e.g. those of math search engines or feed aggregators). In particular, your content won't show up properly on Planet. + - The conversion must be done at each page load, may be slow and may conflict with the HTML parsing (e.g. "<" for tags or "$" for money amounts) + - You may need to synchronize the Javascript converter with other Javascript programs on your page. + +[TeXZilla](https://github.com/fred-wang/TeXZilla) has an [\](https://github.com/fred-wang/x-tex) custom element, that can be used to write things like + + \frac{x^2}{a^2} + \frac{y^2}{b^2} = 1 + +and get it automatically converted into MathML. This is still a work-in-progress, but could be improved in the future thanks to Web Components and shadow DOM. Alternatively, you can use the more traditional [Javascript parsing of expressions at load time](https://github.com/fred-wang/TeXZilla/wiki/Advanced-Usages#parsing-tex-expressions-in-your-web-page) as all the other tools in this section do. + +One simple client-side conversion tools is [ASCIIMathML](http://www1.chapman.edu/~jipsen/mathml/asciimath.html). Just download the [ASCIIMathML.js](https://mathcs.chapman.edu/~jipsen/mathml/ASCIIMathML.js) script and copy it to your Web site. Then on your Web pages, add a ` ... -</head> -<body> + + ... -<p>blah blah `x^2 + y^2 = r^2` blah ... +

blah blah `x^2 + y^2 = r^2` blah ... ... -

+``` -

LaTeXMathML is a similar script that allows to parse more LaTeX commands. The installation is similar: copy LaTeXMathML.js and LaTeXMathML.standardarticle.css, add links in the header of your document and the LaTeX content of your Web page marked by the "LaTeX" class will be automatically parsed and converted to HTML+MathML:

+[LaTeXMathML](https://math.etsu.edu/LaTeXMathML/) is a similar script that allows to parse more LaTeX commands. The installation is similar: copy [LaTeXMathML.js](https://math.etsu.edu/LaTeXMathML/LaTeXMathML.js) and [LaTeXMathML.standardarticle.css](https://math.etsu.edu/LaTeXMathML/LaTeXMathML.standardarticle.css), add links in the header of your document and the LaTeX content of your Web page marked by the "LaTeX" class will be automatically parsed and converted to HTML+MathML: -
<head>
+```html
+
 ...
-<script type="text/javascript" src="LaTeXMathML.js"></script>
-<link rel="stylesheet" type="text/css" href="LaTeXMathML.standardarticle.css" />
+
+
 ...
-</head>
+
 
-<body>
+
 ...
 
-<div class="LaTeX">
+
\documentclass[12pt]{article} \begin{document} @@ -215,133 +222,121 @@ This is a sample LaTeXML document. $$ \sum_{n=1}^{+\infty} \frac{1}{n^2} = \frac{\pi^2}{6} $$ \end{document} -</div> -...
+ +... +``` + +[jqMath](https://mathscribe.com/author/jqmath.html) is another script to parse a simple LaTeX-like syntax but which also accepts non-ASCII characters like `√{∑↙{n=1}↖{+∞} 6/n^2} = π²` to write n = 1 + 6 n 2 = π² . The installation is similar: download and copy the relevant [Javascript and CSS files](https://mathscribe.com/downloads/mathscribe-unix-0.4.0.zip) on your Web site and reference them in your page header (see the `COPY-ME.html` file from the zip archive for an example). One of the advantage of jqMath over the previous scripts is that it will automatically add some simple CSS rules to do the mathematical layout and make the formulas readable on browsers with limited MathML support. + +### Command-line Programs + +An alternative way is to parse the simple syntax before publishing your web pages. That is, you use command-line programs to generate them and publish these static pages on your server. -

jqMath is another script to parse a simple LaTeX-like syntax but which also accepts non-ASCII characters like √{∑↙{n=1}↖{+∞} 6/n^2} = π² to write n = 1 + 6 n 2 = π² . The installation is similar: download and copy the relevant Javascript and CSS files on your Web site and reference them in your page header (see the COPY-ME.html file from the zip archive for an example). One of the advantage of jqMath over the previous scripts is that it will automatically add some simple CSS rules to do the mathematical layout and make the formulas readable on browsers with limited MathML support.

+- pros: -

Command-line Programs

+ - You get static Web pages: the LaTeX source don't need to be parsed at each page load, the MathML code is exposed to Web crawlers and you can put them easily on any Web server. + - Binary programs may run faster than Javascript programs and can be more sophisticated e.g. have a much complete LaTeX support or generate other formats like EPUB. + - You can keep compatibility with other tools to generate pdf e.g. you can use the same .tex source for both latex and latexml. -

An alternative way is to parse the simple syntax before publishing your web pages. That is, you use command-line programs to generate them and publish these static pages on your server.

+- cons: - + - This requires to install programs on your computer, which may be a bit more difficult or they may not be available on all platforms. + - You must run the programs on your computer and have some kind of workflow to get the Web pages at the end ; that may be a bit tedious. + - Binary programs are not appropriate to integrate them in a Mozilla extension or XUL application. -

TeXZilla can be used from the command line and will essentially have the same support as itex2MML described below. However, the stream filter behavior is not implemented yet.

+[TeXZilla](https://github.com/fred-wang/TeXZilla) can be used [from the command line](https://github.com/fred-wang/TeXZilla/wiki/Using-TeXZilla#usage-from-the-command-line) and will essentially have the same support as itex2MML described below. However, the stream filter behavior is not implemented yet. -

If you only want to parse simple LaTeX mathematical expressions, you might want to try tools like itex2MML or Blahtex. The latter is often available on Linux distributions. Let's consider the former, which was originally written by Paul Gartside at the beginning of the Mozilla MathML project and has been maintained by Jacques Distler since then. It's a small stream filter written in C/C++ and generated with flex and bison ; in particular it is very fast. Install flex/bison as well as the classical compiler and make tools. On Unix, you can then download itex2MML, build and install it:

+If you only want to parse simple LaTeX mathematical expressions, you might want to try tools like [itex2MML](https://golem.ph.utexas.edu/~distler/blog/itex2MML.html) or [Blahtex](http://gva.noekeon.org/blahtexml/). The latter is often available on Linux distributions. Let's consider the former, which was originally written by Paul Gartside at the beginning of the Mozilla MathML project and has been maintained by Jacques Distler since then. It's a small stream filter written in C/C++ and generated with flex and bison ; in particular it is very fast. Install flex/bison as well as the classical compiler and make tools. On Unix, you can then download itex2MML, build and install it: -
wget http://golem.ph.utexas.edu/~distler/blog/files/itexToMML.tar.gz; \
+```bash
+wget http://golem.ph.utexas.edu/~distler/blog/files/itexToMML.tar.gz; \
 tar -xzf itexToMML.tar.gz; \
 cd itex2MML/itex-src;
 make
 sudo make install
-
+``` -

Now suppose that you have a HTML page with TeX fragments delimited by dollars:

+Now suppose that you have a HTML page with TeX fragments delimited by dollars: -
input.html
+```html
+input.html
 
 ...
-</head>
-<body>
-  <p>$\sqrt{a^2-3c}$</p>
-  <p>$$ {\sum_{i=1}^N i} = \frac{N(N+1)}{2} $$</p>
-</body>
-</html>
-
+ + +

$\sqrt{a^2-3c}$

+

$$ {\sum_{i=1}^N i} = \frac{N(N+1)}{2} $$

+ + +``` + +Then to generate the HTML page input.html with TeX expressions replaced by MathML expressions, just do + + cat input.html | itex2MML > output.html + +There are even more sophisticated tools to convert arbitrary LaTeX documents into HTML+MathML. For example [TeX4ht](https://www.tug.org/tex4ht/) is often included in TeX distributions and has an option to use MathML instead of PNG images. This command will generate an XHTML+MathML document foo.xml from a foo.tex LaTeX source: -

Then to generate the HTML page input.html with TeX expressions replaced by MathML expressions, just do

+ mk4ht mzlatex foo.tex # Linux/Mac platforms + mzlatex foo.tex # Windows platform -
cat input.html | itex2MML > output.html
+Note that [tex4ebook](https://github.com/michal-h21/tex4ebook) relies on TeX4ht to generate EPUB documents. -

There are even more sophisticated tools to convert arbitrary LaTeX documents into HTML+MathML. For example TeX4ht is often included in TeX distributions and has an option to use MathML instead of PNG images. This command will generate an XHTML+MathML document foo.xml from a foo.tex LaTeX source:

+[LaTeXML](https://dlmf.nist.gov/LaTeXML/) is another tool that can generate HTML5 and EPUB documents. Windows users can watch this [video tutorial](https://www.youtube.com/watch?v=Dg881w2e-lI). Given a foo.tex LaTeX file, you can use these simple commands: -
   mk4ht mzlatex foo.tex # Linux/Mac platforms
-   mzlatex foo.tex       # Windows platform
-
+ latexmlc --dest foo.html foo.tex # Generate a HTML5 document foo.html + latexmlc --dest foo.epub foo.tex # Generate an EPUB document foo.epub -

Note that tex4ebook relies on TeX4ht to generate EPUB documents.

+To handle the case of browsers without MathML support, you can use the `--javascript` parameter to tell LaTeXML to include one of the [fallback scripts](#fallback_for_browsers_without_mathml_support): -

LaTeXML is another tool that can generate HTML5 and EPUB documents. Windows users can watch this video tutorial. Given a foo.tex LaTeX file, you can use these simple commands:

+ latexmlc --dest foo.html --javascript=https://fred-wang.github.io/mathml.css/mspace.js foo.tex # Add the CSS fallback + latexmlc --dest foo.html --javascript=https://fred-wang.github.io/mathjax.js/mpadded-min.js foo.tex # Add the MathJax fallback -
  latexmlc --dest foo.html foo.tex # Generate a HTML5 document foo.html
-  latexmlc --dest foo.epub foo.tex # Generate an EPUB document foo.epub
+If your LaTeX document is big, you might want to split it into several small pages rather than putting everything in a single large page. For example, this will split the pages at the `\section` level: -

To handle the case of browsers without MathML support, you can use the --javascript parameter to tell LaTeXML to include one of the fallback scripts:

+ latexmlc --dest foo.html --splitat=section foo.tex -
  latexmlc --dest foo.html --javascript=https://fred-wang.github.io/mathml.css/mspace.js foo.tex  # Add the CSS fallback
-  latexmlc --dest foo.html --javascript=https://fred-wang.github.io/mathjax.js/mpadded-min.js foo.tex # Add the MathJax fallback
-
+### Server-side Conversion -

If your LaTeX document is big, you might want to split it into several small pages rather than putting everything in a single large page. For example, this will split the pages at the \section level:

+- pros: -
  latexmlc --dest foo.html --splitat=section foo.tex
-
+ - Conversion is done server-side and the MathML output can be cached, which is more efficient and cleaner than client-side conversion. -

Server-side Conversion

+- cons: - + - This might be a bit more difficult to set up, since you need some admin right on your server. -

TeXZilla, LaTeXML and Mathoid and can be used to perform server-side LaTeX-to-MathML conversion. Instiki and MediaWiki are two wiki engines that support LaTeX-to-MathML conversion.

+[TeXZilla](https://github.com/fred-wang/TeXZilla), [LaTeXML](https://dlmf.nist.gov/LaTeXML/) and [Mathoid](https://github.com/gwicke/mathoid) and can be used to perform server-side LaTeX-to-MathML conversion.[ Instiki](http://instiki.org/show/HomePage) and [MediaWiki](https://www.mediawiki.org/wiki/MediaWiki) are two wiki engines that support LaTeX-to-MathML conversion. -

Graphical Interface

+## Graphical Interface -

Input Box

+### Input Box -

TeXZilla has several interfaces, including a CKEditor plugin used on MDN, an online demo, a Firefox add-on or a FirefoxOS Webapp. It has also been integrated into SeaMonkey since version 2.28 and into Thunderbird since version 31. Abiword contains a small equation editor, based on itex2MML. Finally, Bluegriffon has an add-on to insert MathML formulas in your document, using ASCII/LaTeX-like syntax.

+[TeXZilla](https://github.com/fred-wang/TeXZilla) has several interfaces, including a [CKEditor plugin](https://ckeditor.com/addon/texzilla) used on MDN, an [online demo](https://fred-wang.github.io/TeXZilla/), a [Firefox add-on](https://addons.mozilla.org/en-US/firefox/addon/texzilla/) or a [FirefoxOS Webapp](https://marketplace.firefox.com/app/texzilla-1/). It has also been integrated into [SeaMonkey](https://www.seamonkey-project.org/) since version 2.28 and into [Thunderbird](https://www.mozilla.org/thunderbird/) since version 31.[ Abiword](http://abisource.org/) contains a small equation editor, based on itex2MML. Finally, [Bluegriffon](http://www.bluegriffon.com/) has an add-on to insert MathML formulas in your document, using ASCII/LaTeX-like syntax. -

BlueGriffon

+![BlueGriffon](mathml-shot1.png) -

WYSIYWG Editors

+### WYSIYWG Editors -

Firemath is an extension for Firefox that provides a WYSIWYG MathML editor. A preview of the formula is displayed using the rendering engine of Mozilla. The generated MathML code is available at the bottom. Use the text field for token elements and buttons to build advanced constructions. Once you are done, you can save your document as a XHTML page.

+[Firemath](https://www.firemath.info/) is an extension for Firefox that provides a WYSIWYG MathML editor. A preview of the formula is displayed using the rendering engine of Mozilla. The generated MathML code is available at the bottom. Use the text field for token elements and buttons to build advanced constructions. Once you are done, you can save your document as a XHTML page. -

LyX is a graphical LaTeX editor, which has built-in support for XHTML+MathML export and can be configured to use similar LaTeX-to-(X)HTML converters. You can for example, you can configure it to use LaTeXML HTML5/EPUB export.

+[LyX](https://www.lyx.org/) is a graphical LaTeX editor, which has built-in support for XHTML+MathML export and can be configured to use similar LaTeX-to-(X)HTML converters. You can for example, you can configure it to [use LaTeXML HTML5/EPUB export](https://github.com/brucemiller/LaTeXML/wiki/Integrating-LaTeXML-into-TeX-editors#lyx). -

TeXmacs is a free structured editor with special facilities for mathematics, graphics and interactive sessions. TeXmacs documents can be exported in XHTML+MathML.

+[TeXmacs](https://www.texmacs.org/) is a free structured editor with special facilities for mathematics, graphics and interactive sessions. TeXmacs documents can be exported in XHTML+MathML. -

TeXmacs MathML example

+![TeXmacs MathML example](tm-mathml-collage.png) -

OpenOffice and LibreOffice have an equation editor (File → New → Formula). It is semi-WYSIWYG: you enter the source of the formula using the equation panel/keyboard and a preview of the formula is regularly refreshed. The editor uses its own syntax "StarMath" for the source but MathML is also generated when the document is saved. To get the MathML code, save the document as mml and open it with any text editor. Alternatively, you can extract the odf file (which is actually a zip archive) and open an xml file called content.xml.

+[OpenOffice](https://www.openoffice.org/) and [LibreOffice](https://libreoffice.org/) have an equation editor (File → New → Formula). It is semi-WYSIWYG: you enter the source of the formula using the equation panel/keyboard and a preview of the formula is regularly refreshed. The editor uses its own syntax "StarMath" for the source but MathML is also generated when the document is saved. To get the MathML code, save the document as mml and open it with any text editor. Alternatively, you can extract the odf file (which is actually a zip archive) and open an xml file called `content.xml`. -

Open Office Math

+![Open Office Math](openoffice.png) -

Amaya is the W3C's web editor, which is able to handle MathML inside XHTML documents. Use the Elements and the Special Chars panels to create various advanced mathematical constructs. Simple text such as a+2 is automatically parsed and the appropriate MathML markup is generated. Once you are done, you can directly save your XHTML page and open it in Mozilla.

+[Amaya](https://www.w3.org/Amaya/) is the W3C's web editor, which is able to handle MathML inside XHTML documents. Use the Elements and the Special Chars panels to create various advanced mathematical constructs. Simple text such as `a+2` is automatically parsed and the appropriate MathML markup is generated. Once you are done, you can directly save your XHTML page and open it in Mozilla. -

Optical Character & Handwriting Recognition

+## Optical Character & Handwriting Recognition -

Inftyreader is able to perform some Optical Character Recognition, including translation of mathematical equations into MathML. Other tools can do handwriting recognition such as the Windows Math Input Panel or the online converter Web Equation.

+[Inftyreader](https://www.inftyreader.org/) is able to perform some Optical Character Recognition, including translation of mathematical equations into MathML. Other tools can do handwriting recognition such as the [Windows Math Input Panel]() or the online converter [Web Equation](https://webdemo.myscript.com/views/math.html). -

Original Document Information

+### Original Document Information - +- Author(s): Frédéric Wang +- Other Contributors: Florian Scholz +- Copyright Information: Portions of this content are © 2010 by individual mozilla.org contributors; content available under a Creative Commons license | [Details](https://www.mozilla.org/foundation/licensing/website-content.html). diff --git a/files/en-us/web/mathml/element/index.md b/files/en-us/web/mathml/element/index.md index 24e824ac559799a..204eb8982552e75 100644 --- a/files/en-us/web/mathml/element/index.md +++ b/files/en-us/web/mathml/element/index.md @@ -5,218 +5,170 @@ tags: - MathML - MathML Reference --- -

{{MathMLRef}}

+{{MathMLRef}} -

This is an alphabetical list of MathML presentation elements.

+This is an alphabetical list of MathML **presentation** elements. -

The term presentation markup is used to describe the layout structure of mathematical notation whereas content markup provides the underlying mathematical meaning and is not supposed to be rendered by the MathML parser (see {{ bug(276028) }}). If you want to learn more about content markup you should consider Chapter 4 in the MathML 3 specification.

+The term **presentation markup** is used to describe the layout structure of mathematical notation whereas **content markup** provides the underlying mathematical meaning and is not supposed to be rendered by the MathML parser (see {{ bug(276028) }}). If you want to learn more about content markup you should consider [Chapter 4](https://www.w3.org/TR/MathML3/chapter4.html) in the [MathML 3 specification](https://www.w3.org/TR/MathML3/). -

MathML elements implement the {{domxref("MathMLElement")}} class.

+MathML elements implement the {{domxref("MathMLElement")}} class. -

MathML presentation elements A  to Z

+## MathML presentation elements A  to Z -

math

+### math - +- {{MathMLElement("math")}} (Top-level element) -

A

+### A - +- {{MathMLElement("maction")}} (Bound actions to sub-expressions) +- {{MathMLElement("maligngroup")}} (Alignment group) +- {{MathMLElement("malignmark")}} (Alignment points) -

E

+### E - +- {{MathMLElement("menclose")}} (Enclosed contents) +- {{MathMLElement("merror")}} (Enclosed syntax error messages) -

F

+### F - +- {{MathMLElement("mfenced")}} (Parentheses) {{deprecated_inline}} +- {{MathMLElement("mfrac")}} (Fraction) -

I

+### I - +- {{MathMLElement("mi")}} (Identifier) -

L

+### L - +- {{MathMLElement("mlongdiv")}} (Long division notation) -

M

+### M - +- {{MathMLElement("mmultiscripts")}} (Prescripts and tensor indices) -

N

+### N - +- {{MathMLElement("mn")}} (Number) -

O

+### O - +- {{MathMLElement("mo")}} (Operator) +- {{MathMLElement("mover")}} (Overscript) -

P

+### P - +- {{MathMLElement("mpadded")}} (Space around content) +- {{MathMLElement("mphantom")}} (Invisible content with reserved space) -

R

+### R - +- {{MathMLElement("mroot")}} (Radical with specified index) +- {{MathMLElement("mrow")}} (Grouped sub-expressions) -

S

+### S - +- {{MathMLElement("ms")}} (String literal) +- {{MathMLElement("mscarries")}} (Annotations such as carries) +- {{MathMLElement("mscarry")}} (Single carry, child element of {{MathMLElement("mscarries")}}) +- {{MathMLElement("msgroup")}} (Grouped rows of {{MathMLElement("mstack")}} and {{MathMLElement("mlongdiv")}} elements) +- {{MathMLElement("msline")}} (Horizontal lines inside {{MathMLElement("mstack")}} elements) +- {{MathMLElement("mspace")}} (Space) +- {{MathMLElement("msqrt")}} (Square root without an index) +- {{MathMLElement("msrow")}} (Rows in {{MathMLElement("mstack")}} elements) +- {{MathMLElement("mstack")}} (Stacked alignment) +- {{MathMLElement("mstyle")}} (Style change) +- {{MathMLElement("msub")}} (Subscript) +- {{MathMLElement("msup")}} (Superscript) +- {{MathMLElement("msubsup")}} (Subscript-superscript pair) -

T

+### T - - -

U

- - - -

Other elements

- - - -

MathML presentation elements by category

- -

Top-level elements

- - - -

Token elements

- - - -

General layout

- - - -

Script and limit elements

- - - -

Tabular math

- - - -

Elementary math

- - - -

Uncategorized elements

- - - -

Semantic annotations

- - - -

See also

- - +- {{MathMLElement("mtable")}} (Table or matrix) +- {{MathMLElement("mtd")}} (Cell in a table or a matrix) +- {{MathMLElement("mtext")}} (Text) +- {{MathMLElement("mtr")}} (Row in a table or a matrix) + +### U + +- {{MathMLElement("munder")}} (Underscript) +- {{MathMLElement("munderover")}} (Underscript-overscript pair) + +### Other elements + +- {{MathMLElement("semantics")}} (Container for semantic annotations) +- [``](/en-US/docs/Web/MathML/Element/semantics#annotation) (Data annotations) +- [``](/en-US/docs/Web/MathML/Element/semantics#annotation-xml) (XML annotations) + +## MathML presentation elements by category + +### Top-level elements + +- {{MathMLElement("math")}} + +### Token elements + +- {{MathMLElement("mi")}} +- {{MathMLElement("mn")}} +- {{MathMLElement("mo")}} +- {{MathMLElement("ms")}} +- {{MathMLElement("mspace")}} +- {{MathMLElement("mtext")}} + +### General layout + +- {{MathMLElement("menclose")}} +- {{MathMLElement("merror")}} +- {{MathMLElement("mfenced")}} {{deprecated_inline}} +- {{MathMLElement("mfrac")}} +- {{MathMLElement("mpadded")}} +- {{MathMLElement("mphantom")}} +- {{MathMLElement("mroot")}} +- {{MathMLElement("mrow")}} +- {{MathMLElement("msqrt")}} +- {{MathMLElement("mstyle")}} + +### Script and limit elements + +- {{MathMLElement("mmultiscripts")}} +- {{MathMLElement("mover")}} +- {{MathMLElement("mprescripts")}} +- {{MathMLElement("msub")}} +- {{MathMLElement("msubsup")}} +- {{MathMLElement("msup")}} +- {{MathMLElement("munder")}} +- {{MathMLElement("munderover")}} +- {{MathMLElement("none")}} + +### Tabular math + +- {{MathMLElement("maligngroup")}} +- {{MathMLElement("malignmark")}} +- {{MathMLElement("mtable")}} +- {{MathMLElement("mtd")}} +- {{MathMLElement("mtr")}} + +### Elementary math + +- {{MathMLElement("mlongdiv")}} +- {{MathMLElement("mscarries")}} +- {{MathMLElement("mscarry")}} +- {{MathMLElement("msgroup")}} +- {{MathMLElement("msline")}} +- {{MathMLElement("msrow")}} +- {{MathMLElement("mstack")}} + +### Uncategorized elements + +- {{MathMLElement("maction")}} + +## Semantic annotations + +- [``](/en-US/docs/Web/MathML/Element/semantics#annotation) +- [``](/en-US/docs/Web/MathML/Element/semantics#annotation-xml) +- {{MathMLElement("semantics")}} + +## See also + +- [MathML](/en-US/docs/Web/MathML) +- [MathML attribute reference](/en-US/docs/Web/MathML/Attribute) diff --git a/files/en-us/web/mathml/element/maction/index.md b/files/en-us/web/mathml/element/maction/index.md index ed96a73e5cda224..873a3725030aa65 100644 --- a/files/en-us/web/mathml/element/maction/index.md +++ b/files/en-us/web/mathml/element/maction/index.md @@ -8,93 +8,90 @@ tags: - MathML:Enlivening Expressions browser-compat: mathml.elements.maction --- -
{{MathMLRef}}
- -
-

The MathML <maction> element provides a possibility to bind actions to (sub-) expressions. The action itself is specified by the actiontype attribute, which accepts several values. To specify which child elements are addressed by the action, you can make use of the selection attribute.

-
- -

Attributes

- -
-
actiontype
-
The action which specifies what happens for this element. Possible values are: -
    -
  • statusline: If there is a click on the expression or the reader moves the pointer over it, the message is sent to the browser's status line. The syntax is: <maction actiontype="statusline"> expression message </maction>.
  • -
  • toggle: When there is a click on the subexpression, the rendering alternates the display of selected subexpressions. Therefore each click increments the selection value.
    - The syntax is: <maction actiontype="toggle" selection="positive-integer" > expression1 expression2 expressionN </maction>.
  • -
  • tooltip: When the pointer moves over the expression, a tooltip box with a message is displayed near the expression.
    - The syntax is: <maction actiontype="tooltip"> expression message </maction>.
  • -
-
-
class, id, style
-
Provided for use with stylesheets.
-
displaystyle
-
A Boolean value specifying whether more vertical space is used for displayed equations or, if set to false, a more compact layout is used to display formulas. The main effect is that larger versions of operators are displayed, when displaystyle is set to true. See also movablelimits on {{ MathMLElement("mo") }}.
-
href
-
Used to set a hyperlink to a specified URI.
-
mathbackground
-
The background color. You can use #rgb, #rrggbb and HTML color names.
-
mathcolor
-
The text color and also the fraction line color. You can use #rgb, #rrggbb and HTML color names.
-
selection
-
The child element which is addressed by the action. The default value is 1, which is the first child element.
-
- -

Examples

- -

The following example uses the "toggle" actiontype:

- -
<math>
-
-<maction actiontype="toggle">
-
-  <mfrac>
-    <mn>6</mn>
-    <mn>8</mn>
-  </mfrac>
-
-  <mfrac>
-    <mrow>
-      <mn>3</mn>
-      <mo>&sdot;</mo>
-      <mn>2</mn>
-    </mrow>
-    <mrow>
-      <mn>4</mn>
-      <mo>&sdot;</mo>
-      <mn>2</mn>
-    </mrow>
-  </mfrac>
-
-  <mfrac>
-    <mn>3</mn>
-    <mn>4</mn>
-  </mfrac>
-
-</maction>
-
-</math>
-
- -

Specifications

- -

{{Specifications}}

- -

Browser compatibility

- -

{{Compat}}

- -

Gecko-specific notes

- -
    -
  • Prior to Gecko 9.0 {{ geckoRelease("9.0") }} the non-standard restyle value on the actiontype attribute was supported. This value has been removed.
  • -
  • Prior to Gecko 14.0 {{ geckoRelease("14.0") }} the statusline action type was using a non-standard syntax (see below). This has been fixed to follow the MathML specification. -
    <maction actiontype="statusline#(message)">
    -(expression)
    -</maction>
    -
    -
  • -
  • With Gecko 15.0 {{geckoRelease("15.0")}} the selection attribute is only taken into account with the actiontype "toggle".
  • -
  • Starting with Gecko 16.0 {{geckoRelease("16.0")}} the selection attribute is also taken into account when an unknown actiontype is specified. If an actiontype is not specified (is empty) or when the selection attribute is invalid, the markup will throw an MathML error (invalid-markup).
  • -
+{{MathMLRef}} + +The MathML **``** element provides a possibility to bind actions to (sub-) expressions. The action itself is specified by the `actiontype` attribute, which accepts several values. To specify which child elements are addressed by the action, you can make use of the `selection` attribute. + +## Attributes + +- actiontype + + - : The action which specifies what happens for this element. Possible values are: + + - `statusline`: If there is a click on the _expression_ or the reader moves the pointer over it, the _message_ is sent to the browser's status line. The syntax is: ` expression message .` + - `toggle`: When there is a click on the subexpression, the rendering alternates the display of selected subexpressions. Therefore each click increments the `selection` value. + The syntax is: ` expression1 expression2 expressionN `. + - `tooltip`: When the pointer moves over the _expression_, a tooltip box with a _message_ is displayed near the expression. + The syntax is:` expression message .` + +- class, id, style + - : Provided for use with [stylesheets](/en-US/docs/Web/CSS). +- `displaystyle` + - : A Boolean value specifying whether more vertical space is used for displayed equations or, if set to `false`, a more compact layout is used to display formulas. The main effect is that larger versions of operators are displayed, when `displaystyle` is set to `true`. See also `movablelimits` on {{ MathMLElement("mo") }}. +- href + - : Used to set a hyperlink to a specified URI. +- mathbackground + - : The background color. You can use `#rgb`, `#rrggbb` and [HTML color names](/en-US/docs/Web/CSS/color_value#color_keywords). +- mathcolor + - : The text color and also the fraction line color. You can use `#rgb`, `#rrggbb` and [HTML color names](/en-US/docs/Web/CSS/color_value#color_keywords). +- selection + - : The child element which is addressed by the action. The default value is `1`, which is the first child element. + +## Examples + +The following example uses the "toggle" `actiontype`: + +```html + + + + + + 6 + 8 + + + + + 3 + + 2 + + + 4 + + 2 + + + + + 3 + 4 + + + + + +``` + +## Specifications + +{{Specifications}} + +## Browser compatibility + +{{Compat}} + +## Gecko-specific notes + +- Prior to Gecko 9.0 {{ geckoRelease("9.0") }} the non-standard `restyle` value on the `actiontype` attribute was supported. This value has been removed. +- Prior to Gecko 14.0 {{ geckoRelease("14.0") }} the `statusline` action type was using a non-standard syntax (see below). This has been fixed to follow the MathML specification. + + ```html + + (expression) + + ``` + +- With Gecko 15.0 {{geckoRelease("15.0")}} the `selection` attribute is only taken into account with the actiontype `"toggle"`. +- Starting with Gecko 16.0 {{geckoRelease("16.0")}} the `selection` attribute is also taken into account when an unknown `actiontype` is specified. If an `actiontype` is not specified (is empty) or when the `selection` attribute is invalid, the markup will throw an MathML error (invalid-markup). diff --git a/files/en-us/web/mathml/element/math/index.md b/files/en-us/web/mathml/element/math/index.md index 6d4bfdf04b23b29..363946a01849dc2 100644 --- a/files/en-us/web/mathml/element/math/index.md +++ b/files/en-us/web/mathml/element/math/index.md @@ -7,133 +7,130 @@ tags: - MathML:Element browser-compat: mathml.elements.math --- -
{{MathMLRef}}
- -

The top-level element in MathML is <math>. Every valid MathML instance must be wrapped in <math> tags. In addition you must not nest a second <math> element in another, but you can have an arbitrary number of other child elements in it.

- -

Attributes

- -

In addition to the following attributes, the <math> element accepts any attributes of the {{ MathMLElement("mstyle") }} element.

- -
-
class, id, style
-
Provided for use with stylesheets.
-
dir
-
Overall directionality of formulas. Possible values are either ltr (left to right) or rtl (right to left).
-
href
-
Used to set a hyperlink to a specified URI.
-
mathbackground
-
The background color. You can use #rgb, #rrggbb and HTML color names.
-
mathcolor
-
The text color. You can use #rgb, #rrggbb and HTML color names.
-
display
-
This enumerated attribute specifies how the enclosed MathML markup should be rendered. It can have one of the following values: -
    -
  • block, which means that this element will be displayed outside the current span of text, as a block that can be positioned anywhere without changing the meaning of the text;
  • -
  • inline, which means that this element will be displayed inside the current span of text, and cannot be moved out of it without changing the meaning of that text.
  • -
- -

If not present, its default value is inline.

-
-
mode {{deprecated_inline}}
-
Deprecated in favor of the display attribute.
- Possible values are: display (which has the same effect as display="block") and inline.
-
- -

Examples

- -

Theorem of Pythagoras

- -

HTML5 notation

- -
<!DOCTYPE html>
-<html>
-  <head>
-    <title>MathML in HTML5</title>
-  </head>
-  <body>
-
-  <math>
-    <mrow>
-      <mrow>
-        <msup>
-          <mi>a</mi>
-          <mn>2</mn>
-        </msup>
-        <mo>+</mo>
-        <msup>
-          <mi>b</mi>
-          <mn>2</mn>
-        </msup>
-      </mrow>
-      <mo>=</mo>
-      <msup>
-        <mi>c</mi>
-        <mn>2</mn>
-      </msup>
-    </mrow>
-  </math>
-
-  </body>
-</html>
-
- -

XHTML notation

- -
<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN" "http://www.w3.org/Math/DTD/mathml2/xhtml-math11-f.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
- <title>MathML in XHTML</title>
-</head>
-<body>
-
-  <math xmlns="http://www.w3.org/1998/Math/MathML">
-    <mrow>
-      <mrow>
-        <msup>
-          <mi>a</mi>
-          <mn>2</mn>
-        </msup>
-        <mo>+</mo>
-        <msup>
-          <mi>b</mi>
-          <mn>2</mn>
-        </msup>
-      </mrow>
-      <mo>=</mo>
-      <msup>
-        <mi>c</mi>
-        <mn>2</mn>
-      </msup>
-    </mrow>
-  </math>
-
-</body>
-</html>
- -

Notes: XHTML documents with MathML must be served as application/xhtml+xml. You can achieve that easily by adding the .xhtml extension to your local files. For Apache servers you can configure your .htaccess file to map extensions to the correct Mime type. Since you notate your MathML in an XML document, also be sure you write a well-formed XML document.

- -

Specifications

- -

{{Specifications}}

- -

Browser compatibility

- - -

{{Compat}}

- - -

Firefox-specific notes

- -

Firefox 7 introduced support for accepting all MathML attributes on the top-level math element (i.e. the same behavior as a {{ MathMLElement("mstyle") }} element). However, the displaystyle attribute was not taken into account and has been added in Firefox 8.

- -

A textual fall-back (alttext) or referring to an alternative image using the attributes altimg, altimg-width, altimg-height or altimg-valign is currently not implemented in Firefox.

- -

See also

- -
    -
  • HTML top-level element: {{ HTMLElement("html") }}
  • -
  • SVG top-level element: {{ SVGElement("svg") }}
  • -
  • MathML browser test
  • -
+{{MathMLRef}} + +The top-level element in MathML is ``. Every valid MathML instance must be wrapped in `` tags. In addition you must not nest a second `` element in another, but you can have an arbitrary number of other child elements in it. + +## Attributes + +In addition to the following attributes, the `` element accepts any attributes of the {{ MathMLElement("mstyle") }} element. + +- class, id, style + - : Provided for use with [stylesheets](/en-US/docs/Web/CSS). +- dir + - : Overall directionality of formulas. Possible values are either `ltr` (left to right) or `rtl` (right to left). +- href + - : Used to set a hyperlink to a specified URI. +- mathbackground + - : The background color. You can use `#rgb`, `#rrggbb` and [HTML color names](/en-US/docs/Web/CSS/color_value#color_keywords). +- mathcolor + - : The text color. You can use `#rgb`, `#rrggbb` and [HTML color names](/en-US/docs/Web/CSS/color_value#color_keywords). +- display + + - : This enumerated attribute specifies how the enclosed MathML markup should be rendered. It can have one of the following values: + + - `block`, which means that this element will be displayed outside the current span of text, as a block that can be positioned anywhere without changing the meaning of the text; + - `inline`, which means that this element will be displayed inside the current span of text, and cannot be moved out of it without changing the meaning of that text. + + If not present, its default value is `inline`. + +- mode {{deprecated_inline}} + - : Deprecated in favor of the [display attribute](#attr-display). + Possible values are: `display` (which has the same effect as `display="block"`) and `inline`. + +## Examples + +![Theorem of Pythagoras](math.jpg) + +### HTML5 notation + +```html + + +   +    MathML in HTML5 +   +   + + + + + + a + 2 + + + + + b + 2 + + + = + + c + 2 + + + + +  + +``` + +### XHTML notation + +```xml + + + + + MathML in XHTML + + + + + + + + a + 2 + + + + + b + 2 + + + = + + c + 2 + + + + + + +``` + +**Notes**: XHTML documents with MathML must be served as `application/xhtml+xml`. You can achieve that easily by adding the `.xhtml` extension to your local files. For Apache servers you can [configure your `.htaccess` file](https://httpd.apache.org/docs/2.4/mod/mod_mime.html#addtype) to map extensions to the correct Mime type. Since you notate your MathML in an XML document, also be sure you write a well-formed XML document. + +## Specifications + +{{Specifications}} + +## Browser compatibility + +{{Compat}} + +## Firefox-specific notes + +Firefox 7 introduced support for accepting all MathML attributes on the top-level math element (i.e. the same behavior as a {{ MathMLElement("mstyle") }} element). However, the `displaystyle` attribute was not taken into account and [has been added](https://bugzilla.mozilla.org/show_bug.cgi?id=669719) in Firefox 8. + +A textual fall-back (`alttext`) or referring to an alternative image using the attributes `altimg`, `altimg-width`, `altimg-height` or `altimg-valign` is currently not implemented in Firefox. + +## See also + +- HTML top-level element: {{ HTMLElement("html") }} +- SVG top-level element: {{ SVGElement("svg") }} +- [MathML browser test](http://eyeasme.com/Joe/MathML/MathML_browser_test.html) diff --git a/files/en-us/web/mathml/element/menclose/index.md b/files/en-us/web/mathml/element/menclose/index.md index 96264185b2301f3..554f2934db0b046 100644 --- a/files/en-us/web/mathml/element/menclose/index.md +++ b/files/en-us/web/mathml/element/menclose/index.md @@ -8,170 +8,72 @@ tags: - MathML:General Layout Schemata browser-compat: mathml.elements.menclose --- -
{{MathMLRef}}
- -

The MathML <menclose> element renders its content inside an enclosing notation specified by the notation attribute.

- -

Attributes

- -
-
class, id, style
-
Provided for use with stylesheets.
-
displaystyle
-
A Boolean value specifying whether more vertical space is used for displayed equations or, if set to false, a more compact layout is used to display formulas. The main effect is that larger versions of operators are displayed, when displaystyle is set to true. See also movablelimits on {{ MathMLElement("mo") }}.
-
href
-
Used to set a hyperlink to a specified URI.
-
mathbackground
-
The background color. You can use #rgb, #rrggbb and HTML color names.
-
mathcolor
-
The text color. You can use #rgb, #rrggbb and HTML color names.
-
notation
-
A list of notations, separated by white space, to apply to the child elements. The symbols are each drawn as if the others are not present, and therefore may overlap. Possible values are: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ValueSample RenderingRendering in
- your browser
Description
longdiv (default)longdiv a2 + b2 long division symbol
actuarialactuarial a2 + b2 actuarial symbol
radical {{deprecated_inline}}radical a2 + b2 square root symbol. Deprecated. Use {{MathMLElement("msqrt")}} instead.
boxbox a2 + b2 box
roundedboxroundedbox a2 + b2 rounded box
circlecircle a2 + b2 circle
leftleft a2 + b2 line to the left of the contents
rightright a2 + b2 line to the right of the contents
toptop a2 + b2 line above of the contents
bottombottom a2 + b2 line below of the contents
updiagonalstrikeupdiagonalstrike a2 + b2 strikeout line through contents from lower left to upper right
downdiagonalstrikedowndiagonalstrike a2 + b2 strikeout line through contents from upper left to lower right
verticalstrikeverticalstrike a2 + b2 vertical strikeout line through contents
horizontalstrikehorizontalstrike a2 + b2 horizontal strikeout line through contents
madruwbmadruwb a2 + b2 Arabic factorial symbol
updiagonalarrow a2 + b2 diagonal arrow
phasorangleScreenshot of the phasorangle notation a2 + b2 phasor angle
-
-
- -

Examples

- -
<math>
-
-  <menclose notation="circle box">
-    <mi> x </mi>
-    <mo> + </mo>
-    <mi> y </mi>
-  </menclose>
-
-</math>
- -

Specifications

- -

{{Specifications}}

- -

Browser compatibility

- -

{{Compat}}

- -

Gecko-specific notes

- -
    -
  • Addtional values for the notation attribute have been added in the following releases: - -
      -
    • madruwb in Gecko 2.0 {{GeckoRelease("2.0")}}.
    • -
    • updiagonalarrow in Gecko 24.0 {{GeckoRelease("24.0")}}
    • -
    • phasorangle in Gecko 32.0 {{GeckoRelease("32.0")}}
    • -
    -
  • -
+{{MathMLRef}} + +The MathML `` element renders its content inside an enclosing notation specified by the `notation` attribute. + +## Attributes + +- class, id, style + - : Provided for use with [stylesheets](/en-US/docs/Web/CSS). +- `displaystyle` + - : A Boolean value specifying whether more vertical space is used for displayed equations or, if set to `false`, a more compact layout is used to display formulas. The main effect is that larger versions of operators are displayed, when `displaystyle` is set to `true`. See also `movablelimits` on {{ MathMLElement("mo") }}. +- href + - : Used to set a hyperlink to a specified URI. +- mathbackground + - : The background color. You can use `#rgb`, `#rrggbb` and [HTML color names](/en-US/docs/Web/CSS/color_value#color_keywords). +- mathcolor + - : The text color. You can use `#rgb`, `#rrggbb` and [HTML color names](/en-US/docs/Web/CSS/color_value#color_keywords). +- notation + + - : A list of notations, separated by white space, to apply to the child elements. The symbols are each drawn as if the others are not present, and therefore may overlap. Possible values are: + + | Value | Sample Rendering | Rendering in your browser | Description | + | -------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | + | `longdiv` (default) | ![longdiv](default.png) | a2 + b2 | long division symbol | + | `actuarial` | ![actuarial](actuarial.png) | a2 + b2 | [actuarial symbol](https://en.wikipedia.org/wiki/Actuarial_notation) | + | `radical` {{deprecated_inline}} | ![radical](radical.png) | a2 + b2 | square root symbol. Deprecated. Use {{MathMLElement("msqrt")}} instead. | + | `box` | ![box](box.png) | a2 + b2 | box | + | `roundedbox` | ![roundedbox](roundedbox.png) | a2 + b2 | rounded box | + | `circle` | ![circle](circle.png) | a2 + b2 | circle | + | `left` | ![left](left.png) | a2 + b2 | line to the left of the contents | + | `right` | ![right](right.png) | a2 + b2 | line to the right of the contents | + | `top` | ![top](top.png) | a2 + b2 | line above of the contents | + | `bottom` | ![bottom](bottom.png) | a2 + b2 | line below of the contents | + | `updiagonalstrike` | ![updiagonalstrike](updiagonalstrike.png) | a2 + b2 | strikeout line through contents from lower left to upper right | + | `downdiagonalstrike` | ![downdiagonalstrike](downdiagonalstrike.png) | a2 + b2 | strikeout line through contents from upper left to lower right | + | `verticalstrike` | ![verticalstrike](verticalstrike.png) | a2 + b2 | vertical strikeout line through contents | + | `horizontalstrike` | ![horizontalstrike](horizontalstrike.png) | a2 + b2 | horizontal strikeout line through contents | + | `madruwb` | ![madruwb](madruwb.png) | a2 + b2 | [Arabic factorial symbol](https://en.wikipedia.org/wiki/Modern_Arabic_mathematical_notation#Arithmetic_and_algebra) | + | `updiagonalarrow` | ![](updiagonalarrow.png) | a2 + b2 | diagonal arrow | + | `phasorangle` | ![Screenshot of the phasorangle notation](phasorangle.png) | a2 + b2 | phasor angle | + +## Examples + +```html + + +  +    x +    + +    y + + +``` + +## Specifications + +{{Specifications}} + +## Browser compatibility + +{{Compat}} + +## Gecko-specific notes + +- Addtional values for the `notation` attribute have been added in the following releases: + + - `madruwb` in Gecko 2.0 {{GeckoRelease("2.0")}}. + - `updiagonalarrow` in Gecko 24.0 {{GeckoRelease("24.0")}} + - `phasorangle` in Gecko 32.0 {{GeckoRelease("32.0")}} diff --git a/files/en-us/web/mathml/element/merror/index.md b/files/en-us/web/mathml/element/merror/index.md index 7f044c73c2adfa1..d2307dc93d812e8 100644 --- a/files/en-us/web/mathml/element/merror/index.md +++ b/files/en-us/web/mathml/element/merror/index.md @@ -8,46 +8,45 @@ tags: - MathML:General Layout Schemata browser-compat: mathml.elements.merror --- -
{{MathMLRef}}
+{{MathMLRef}} -

The MathML <merror> element is used to display contents as error messages. In Firefox this error message is rendered similar to the typical XML error message. Note that this error is not thrown when your MathML markup is wrong or not well-formed XML. You will still get an XML parsing error (in case of the XHTML notation of MathML), which has nothing to do with <merror>.

+The MathML `` element is used to display contents as error messages. In Firefox this error message is rendered similar to the typical XML error message. Note that this error is **not** thrown when your MathML markup is wrong or not well-formed XML. You will still get an XML parsing error (in case of the XHTML notation of MathML), which has nothing to do with ``. -

Attributes

+## Attributes -
-
class, id, style
-
Provided for use with stylesheets.
-
displaystyle
-
A Boolean value specifying whether more vertical space is used for displayed equations or, if set to false, a more compact layout is used to display formulas. The main effect is that larger versions of operators are displayed, when displaystyle is set to true. See also movablelimits on {{ MathMLElement("mo") }}.
-
href
-
Used to set a hyperlink to a specified URI.
-
mathbackground
-
The background color. You can use #rgb, #rrggbb and HTML color names.
-
mathcolor
-
The text color and also the fraction line color. You can use #rgb, #rrggbb and HTML color names.
-
+- class, id, style + - : Provided for use with [stylesheets](/en-US/docs/Web/CSS). +- `displaystyle` + - : A Boolean value specifying whether more vertical space is used for displayed equations or, if set to `false`, a more compact layout is used to display formulas. The main effect is that larger versions of operators are displayed, when `displaystyle` is set to `true`. See also `movablelimits` on {{ MathMLElement("mo") }}. +- href + - : Used to set a hyperlink to a specified URI. +- mathbackground + - : The background color. You can use `#rgb`, `#rrggbb` and [HTML color names](/en-US/docs/Web/CSS/color_value#color_keywords). +- mathcolor + - : The text color and also the fraction line color. You can use `#rgb`, `#rrggbb` and [HTML color names](/en-US/docs/Web/CSS/color_value#color_keywords). -

Examples

+## Examples -
<math>
+```html
+
 
-<merror>
-  <mrow>
-    <mtext> Division by zero: </mtext>
-    <mfrac>
-      <mn> 1 </mn>
-      <mn> 0 </mn>
-    </mfrac>
-  </mrow>
-</merror>
+
+  
+     Division by zero: 
+    
+       1 
+       0 
+    
+  
+
 
-</math>
-
+ +``` -

Specifications

+## Specifications -

{{Specifications}}

+{{Specifications}} -

Browser compatibility

+## Browser compatibility -

{{Compat}}

+{{Compat}} diff --git a/files/en-us/web/mathml/element/mfenced/index.md b/files/en-us/web/mathml/element/mfenced/index.md index fb0d7fbff5b3589..7ba3025288c2a21 100644 --- a/files/en-us/web/mathml/element/mfenced/index.md +++ b/files/en-us/web/mathml/element/mfenced/index.md @@ -9,69 +9,69 @@ tags: - MathML:General Layout Schemata browser-compat: mathml.elements.mfenced --- -
{{MathMLRef}}
+{{MathMLRef}} -

The deprecated MathML <mfenced> element used to provide the possibility to add custom opening and closing parentheses (such as brackets) and separators (such as commas or semicolons) to an expression. It has been removed from the latest MathML standard and modern browsers no longer support it. Use the {{MathMLElement("mrow")}} and {{MathMLElement("mo")}} elements instead.

+The deprecated MathML `` element used to provide the possibility to add custom opening and closing parentheses (such as brackets) and separators (such as commas or semicolons) to an expression. It has been removed from the latest MathML standard and modern browsers no longer support it. Use the {{MathMLElement("mrow")}} and {{MathMLElement("mo")}} elements instead. -

Attributes

+## Attributes -
-
class, id, style
-
Provided for use with stylesheets.
-
close
-
A string for the closing delimiter. The default value is ")" and any white space is trimmed.
-
href
-
Used to set a hyperlink to a specified URI.
-
mathbackground
-
The background color. You can use #rgb, #rrggbb and HTML color names.
-
mathcolor
-
The text color and also the fraction line color. You can use #rgb, #rrggbb and HTML color names.
-
open
-
A string for the opening delimiter. The default value is "(" and any white space is trimmed.
-
separators
-
A sequence of zero or more characters to be used for different separators, optionally divided by white space, which is ignored. The default value is ",". By specifying more than one character, it is possible to set different separators for each argument in the expression. If there are too many separators, all excess is ignored. If there are too few separators in the expression, the last specified separator is repeated.
-
+- `class`, `id`, `style` + - : Provided for use with [stylesheets](/en-US/docs/Web/CSS). +- `close` + - : A string for the closing delimiter. The default value is `")`" and any white space is trimmed. +- `href` + - : Used to set a hyperlink to a specified URI. +- `mathbackground` + - : The background color. You can use `#rgb`, `#rrggbb` and [HTML color names](/en-US/docs/Web/CSS/color_value#color_keywords). +- `mathcolor` + - : The text color and also the fraction line color. You can use `#rgb`, `#rrggbb` and [HTML color names](/en-US/docs/Web/CSS/color_value#color_keywords). +- `open` + - : A string for the opening delimiter. The default value is `"("` and any white space is trimmed. +- `separators` + - : A sequence of zero or more characters to be used for different separators, optionally divided by white space, which is ignored. The default value is ",". By specifying more than one character, it is possible to set different separators for each argument in the expression. If there are too many separators, all excess is ignored. If there are too few separators in the expression, the last specified separator is repeated. -

Examples

+## Examples -

The last separator is repeated (,)

+### The last separator is repeated (`,`) -

Sample rendering: {a;b;c,d,e}

+Sample rendering: ![{a;b;c,d,e}](mfenced01.png) -

Rendering in your browser: a b c d e

+Rendering in your browser: a b c d e -
<math>
-  <mfenced open="{" close="}" separators=";;,">
-    <mi>a</mi>
-    <mi>b</mi>
-    <mi>c</mi>
-    <mi>d</mi>
-    <mi>e</mi>
-  </mfenced>
-</math>
-
+```html + + + a + b + c + d + e + + +``` -

All excess is ignored (,)

+### All excess is ignored (`,`) -

Sample rendering: [a|b|c|d|e]

+Sample rendering: ![[a|b|c|d|e]](mfenced02.png) -

Rendering in your browser: a b c d e

+Rendering in your browser: a b c d e -
<math>
-  <mfenced open="[" close="]" separators="||||,">
-    <mi>a</mi>
-    <mi>b</mi>
-    <mi>c</mi>
-    <mi>d</mi>
-    <mi>e</mi>
-  </mfenced>
-</math>
-
+```html + + + a + b + c + d + e + + +``` -

Specifications

+## Specifications -

The <mfenced> element is no longer part of the latest MathML standard. Use the {{MathMLElement("mrow")}} and {{MathMLElement("mo")}} elements instead, or, for backwards compatibility, see mathml-polyfills/mfenced.

+The \ element is no longer part of the [latest MathML standard](https://github.com/mathml-refresh/mathml/issues/2). Use the {{MathMLElement("mrow")}} and {{MathMLElement("mo")}} elements instead, or, for backwards compatibility, see [mathml-polyfills/mfenced.](https://github.com/mathml-refresh/mathml-polyfills/tree/master/mfenced) -

Browser compatibility

+## Browser compatibility -

{{Compat}}

+{{Compat}} diff --git a/files/en-us/web/mathml/element/mfrac/index.md b/files/en-us/web/mathml/element/mfrac/index.md index d0046c937821c93..63fbf44e7c76006 100644 --- a/files/en-us/web/mathml/element/mfrac/index.md +++ b/files/en-us/web/mathml/element/mfrac/index.md @@ -8,65 +8,66 @@ tags: - MathML:General Layout Schemata browser-compat: mathml.elements.mfrac --- -
{{MathMLRef}}
+{{MathMLRef}} -

The MathML <mfrac> element is used to display fractions.

+The MathML `` element is used to display fractions. -

Syntax

+## Syntax -
<mfrac>numerator denominator</mfrac>
+```html +numerator denominator +``` -

Attributes

+## Attributes -
-
bevelled {{deprecated_inline}}
-
Specifies the way the fraction is displayed. If true, the fraction line is bevelled, which means that numerator and denominator are displayed side by side and separated by a slash (/). Otherwise, if set to false (which is the default value), numerator and denominator are on top of each other.
- This attribute is deprecated and will be removed in the future. Use U+2044 (fraction slash) instead.
-
class, id, style
-
Provided for use with stylesheets.
-
denomalign {{deprecated_inline}}
-
The alignment of the denominator under the fraction. Possible values are: left, center (default), and right.
- This attribute is deprecated and will be removed in the future. Use CSS text-align instead.
-
displaystyle
-
A Boolean value specifying whether more vertical space is used for displayed equations or, if set to false, a more compact layout is used to display formulas. The main effect is that larger versions of operators are displayed, when displaystyle is set to true. See also movablelimits on {{ MathMLElement("mo") }}.
-
href
-
Used to set a hyperlink to a specified URI.
-
linethickness
-
The thickness of the horizontal fraction line. This attributes accepts any length values.
- The values medium, thin, and thick are deprecated and will be removed in the future.
-
mathbackground
-
The background color. You can use #rgb, #rrggbb and HTML color names.
-
mathcolor
-
The text color and also the fraction line color. You can use #rgb, #rrggbb and HTML color names.
-
numalign {{deprecated_inline}}
-
The alignment of the numerator over the fraction. Possible values are: left, center (default), and right.
- This attribute is deprecated and will be removed in the future. Use CSS text-align instead.
-
+- `bevelled` {{deprecated_inline}} + - : Specifies the way the fraction is displayed. If `true`, the fraction line is bevelled, which means that numerator and denominator are displayed side by side and separated by a slash (/). Otherwise, if set to `false` (which is the default value), numerator and denominator are on top of each other. + This attribute is deprecated and will be removed in the future. Use U+2044 (fraction slash) instead. +- `class`, `id`, `style` + - : Provided for use with [stylesheets](/en-US/docs/Web/CSS). +- `denomalign` {{deprecated_inline}} + - : The alignment of the denominator under the fraction. Possible values are: `left`, `center` (default), and `right`. + This attribute is deprecated and will be removed in the future. Use CSS [`text-align`](/en-US/docs/Web/CSS/text-align) instead. +- `displaystyle` + - : A Boolean value specifying whether more vertical space is used for displayed equations or, if set to `false`, a more compact layout is used to display formulas. The main effect is that larger versions of operators are displayed, when `displaystyle` is set to `true`. See also `movablelimits` on {{ MathMLElement("mo") }}. +- `href` + - : Used to set a hyperlink to a specified URI. +- `linethickness` + - : The thickness of the horizontal fraction line. This attributes accepts any [length values](/en-US/docs/Web/CSS/length). + The values `medium`, `thin`, and `thick` are deprecated and will be removed in the future. +- `mathbackground` + - : The background color. You can use `#rgb`, `#rrggbb` and [HTML color names](/en-US/docs/Web/CSS/color_value#color_keywords). +- `mathcolor` + - : The text color and also the fraction line color. You can use `#rgb`, `#rrggbb` and [HTML color names](/en-US/docs/Web/CSS/color_value#color_keywords). +- `numalign` {{deprecated_inline}} + - : The alignment of the numerator over the fraction. Possible values are: `left`, `center` (default), and `right`. + This attribute is deprecated and will be removed in the future. Use CSS [`text-align`](/en-US/docs/Web/CSS/text-align) instead. -

Examples

+## Examples -

Sample rendering: (a/b)/(c/d)

+Sample rendering: ![(a/b)/(c/d)](mfrac.png) -

Your browser rendering: a b c d

+Your browser rendering: a b c d -
<math>
-  <mfrac bevelled="true">
-     <mfrac>
-        <mi> a </mi>
-        <mi> b </mi>
-     </mfrac>
-     <mfrac>
-        <mi> c </mi>
-        <mi> d </mi>
-     </mfrac>
-  </mfrac>
-</math>
-
+```html + + + + a + b + + + c + d + + + +``` -

Specifications

+## Specifications -

{{Specifications}}

+{{Specifications}} -

Browser compatibility

+## Browser compatibility -

{{Compat}}

+{{Compat}} diff --git a/files/en-us/web/mathml/element/mi/index.md b/files/en-us/web/mathml/element/mi/index.md index f6749f7ea07ca8c..90db8d51e8ef051 100644 --- a/files/en-us/web/mathml/element/mi/index.md +++ b/files/en-us/web/mathml/element/mi/index.md @@ -8,87 +8,133 @@ tags: - MathML:Token Elements browser-compat: mathml.elements.mi --- -
{{MathMLRef}}
- -

The MathML <mi> element indicates that the content should be rendered as an identifier such as function names, variables or symbolic constants. You can also have arbitrary text in it to mark up terms.

- -

Attributes

- -
-
class, id, style
-
Provided for use with stylesheets.
-
dir
-
The text direction. Possible values are either ltr (left to right) or rtl (right to left).
-
displaystyle
-
A Boolean value specifying whether more vertical space is used for displayed equations or, if set to false, a more compact layout is used to display formulas. The main effect is that larger versions of operators are displayed, when displaystyle is set to true. See also movablelimits on {{ MathMLElement("mo") }}.
-
href
-
Used to set a hyperlink to a specified URI.
-
mathbackground
-
The background color. You can use #rgb, #rrggbb and HTML color names.
-
mathcolor
-
The text color. You can use #rgb, #rrggbb and HTML color names.
-
mathsize
-
The size of the content. See length for possible values.
- Deprecated values are: small, normal and big. These will be removed in the future.
-
mathvariant
-
This logical class of the identifier, which varies in typography. That is, although the names suggest the typographic style for the class, semantically, items with the same class are treated "the same" within an expression, which might or might not involve displaying them with the named typography. The following values are allowed: -
    -
  • normal (Default value for more than one character) ; Example
  • -
  • bold ; Example
  • -
  • italic (Default value for a single character) ; Example
  • -
  • bold-italic ; Example
  • -
- -
    -
  • double-struck ; Example
  • -
  • bold-fraktur ; Example
  • -
  • script ; Example
  • -
  • bold-script ; Example
  • -
  • fraktur ; Example
  • -
- -
    -
  • sans-serif ; Example
  • -
  • bold-sans-serif ; Example
  • -
  • sans-serif-italic ; Example
  • -
  • sans-serif-bold-italic ; Example
  • -
  • monospace ; Example
  • -
- -
    -
  • initial ; مثال
  • -
  • tailed ; مثال
  • -
  • looped ; مثال
  • -
  • stretched ; مثال
  • -
-
-
- -

Examples

- -
<math>
-
-  <mi> y </mi>
-
-  <mi> sin </mi>
-
-  <mi mathvariant="monospace"> x </mi>
-
-  <mi mathvariant="bold"> &pi; </mi>
-
-</math>
-
- -

Specifications

- -

{{Specifications}}

- -

Browser compatibility

- -

{{Compat}}

- -

Gecko-specific notes

- -
    -
  • Some mathvariant values are only implemented starting with Gecko 28.0 {{ geckoRelease("28.0") }} and require appropriate math fonts.
  • -
+{{MathMLRef}} + +The MathML `` element indicates that the content should be rendered as an **identifier** such as function names, variables or symbolic constants. You can also have arbitrary text in it to mark up terms. + +## Attributes + +- class, id, style + - : Provided for use with [stylesheets](/en-US/docs/Web/CSS). +- dir + - : The text direction. Possible values are either `ltr` (left to right) or `rtl` (right to left). +- `displaystyle` + - : A Boolean value specifying whether more vertical space is used for displayed equations or, if set to `false`, a more compact layout is used to display formulas. The main effect is that larger versions of operators are displayed, when `displaystyle` is set to `true`. See also `movablelimits` on {{ MathMLElement("mo") }}. +- href + - : Used to set a hyperlink to a specified URI. +- mathbackground + - : The background color. You can use `#rgb`, `#rrggbb` and [HTML color names](/en-US/docs/Web/CSS/color_value#color_keywords). +- mathcolor + - : The text color. You can use `#rgb`, `#rrggbb` and [HTML color names](/en-US/docs/Web/CSS/color_value#color_keywords). +- mathsize + - : The size of the content. See [length](/en-US/docs/Web/CSS/length) for possible values. + Deprecated values are: `small`, `normal` and `big`. These will be removed in the future. +- mathvariant + + - : This logical class of the identifier, which varies in typography. That is, although the names suggest the typographic style for the class, semantically, items with the same class are treated "the same" within an expression, which might or might not involve displaying them with the named typography. The following values are allowed: + + - `normal` (Default value for _more than one character_) ; + + Example + + - `bold` ; + + Example + + - `italic` (Default value for _a single character_) ; + + Example + + - `bold-italic` ; + + Example + + + + - `double-struck` ; + + Example + + - `bold-fraktur` ; + + Example + + - `script` ; + + Example + + - `bold-script` ; + + Example + + - `fraktur` ; + + Example + + + + - `sans-serif` ; + + Example + + - `bold-sans-serif` ; + + Example + + - `sans-serif-italic` ; + + Example + + - `sans-serif-bold-italic` ; + + Example + + - `monospace` ; + + Example + + + + - `initial` ; + + مثال + + - `tailed` ; + + مثال + + - `looped` ; + + مثال + + - `stretched` ; + + مثال + +## Examples + +```html + + + y + + sin + + x + + π + + +``` + +## Specifications + +{{Specifications}} + +## Browser compatibility + +{{Compat}} + +## Gecko-specific notes + +- Some `mathvariant` values are only implemented starting with Gecko 28.0 {{ geckoRelease("28.0") }} and require appropriate [math fonts](/en-US/docs/Mozilla/MathML_Project/Fonts). diff --git a/files/en-us/web/mathml/element/mmultiscripts/index.md b/files/en-us/web/mathml/element/mmultiscripts/index.md index 1c60aa528dd701c..d1babff6f5e1d49 100644 --- a/files/en-us/web/mathml/element/mmultiscripts/index.md +++ b/files/en-us/web/mathml/element/mmultiscripts/index.md @@ -8,115 +8,105 @@ tags: - MathML:Script and Limit Schemata browser-compat: mathml.elements.mmultiscripts --- -
{{MathMLRef}}
+{{MathMLRef}} -

The MathML <mmultiscripts> element allows you to create tensor-like objects. In a descriptive way tensors are multidimensional matrices (mathematical imprecise but exemplified). The degree of a tensor depends on the dimensionality of a representative array. For example, a number is a 0-dimensional array, or a 0th-order tensor. A 1-dimensional array (e.g. vectors) is a 1st-order tensor and so 2nd-order tensors are needed to represent square matrices. To learn more about the mathematical background of tensors refer to the entry on Wikipedia.

+The MathML `` element allows you to create tensor-like objects. In a descriptive way [tensors](https://en.wikipedia.org/wiki/Tensor) are multidimensional matrices (mathematical imprecise but exemplified). The degree of a tensor depends on the dimensionality of a representative array. For example, a number is a 0-dimensional array, or a 0th-order tensor. A 1-dimensional array (e.g. vectors) is a 1st-order tensor and so 2nd-order tensors are needed to represent square matrices. To learn more about the mathematical background of tensors refer to the [entry on Wikipedia](https://en.wikipedia.org/wiki/Tensor). -

MathML uses a special syntax to describe subscripts and superscripts for both, postscripts and prescripts, attached to a base expression:

+MathML uses a special syntax to describe subscripts and superscripts for both, postscripts and prescripts, attached to a base expression: -
<mmultiscripts>
-    base
-     (subscript superscript)*
-     [ <mprescripts/> (presubscript presuperscript)* ]
-</mmultiscripts>
-
+```html + + base + (subscript superscript)* + [ (presubscript presuperscript)* ] + +``` -

After the base expression you can specify a postsubscript and a postsuperscript. Prescripts are optional and are separated by the empty tag <mprescripts/> (only one <mprescripts /> element is allowed, otherwise you will get an DuplicateMprescripts error in the Error Console and "invalid-markup" in your rendering). In addition you are able to use <none/> as a placeholder for empty scripts (not for the base). See the examples section for a correct usage.

+After the base expression you can specify a postsubscript and a postsuperscript. Prescripts are optional and are separated by the empty tag `` (only one \ element is allowed, otherwise you will get an `DuplicateMprescripts` error in the [Error Console](/en-US/docs/Error_Console) and "invalid-markup" in your rendering). In addition you are able to use `` as a placeholder for empty scripts (not for the base). See the examples section for a correct usage. -

Attributes

+## Attributes -
-
class, id, style
-
Provided for use with stylesheets.
-
displaystyle
-
A Boolean value specifying whether more vertical space is used for displayed equations or, if set to false, a more compact layout is used to display formulas. The main effect is that larger versions of operators are displayed, when displaystyle is set to true. See also movablelimits on {{ MathMLElement("mo") }}.
-
href
-
Used to set a hyperlink to a specified URI.
-
mathbackground
-
The background color. You can use #rgb, #rrggbb and HTML color names.
-
mathcolor
-
The text color. You can use #rgb, #rrggbb and HTML color names.
-
subscriptshift {{deprecated_inline}}
-
The minimum space by which to shift the subscript below the baseline of the expression, as a CSS length.
- This property is deprecated and will be removed in the future.
-
superscriptshift {{deprecated_inline}}
-
The minimum space by which to shift the superscript above the baseline of the expression, as a CSS length.
- This property is deprecated and will be removed in the future.
-
+- `class`, `id`, `style` + - : Provided for use with [stylesheets](/en-US/docs/Web/CSS). +- `displaystyle` + - : A Boolean value specifying whether more vertical space is used for displayed equations or, if set to `false`, a more compact layout is used to display formulas. The main effect is that larger versions of operators are displayed, when `displaystyle` is set to `true`. See also `movablelimits` on {{ MathMLElement("mo") }}. +- `href` + - : Used to set a hyperlink to a specified URI. +- `mathbackground` + - : The background color. You can use `#rgb`, `#rrggbb` and [HTML color names](/en-US/docs/Web/CSS/color_value#color_keywords). +- `mathcolor` + - : The text color. You can use `#rgb`, `#rrggbb` and [HTML color names](/en-US/docs/Web/CSS/color_value#color_keywords). +- `subscriptshift` {{deprecated_inline}} + - : The minimum space by which to shift the subscript below the baseline of the expression, as a [CSS length](/en-US/docs/Web/CSS/length). + This property is deprecated and will be removed in the future. +- `superscriptshift` {{deprecated_inline}} + - : The minimum space by which to shift the superscript above the baseline of the expression, as a [CSS length](/en-US/docs/Web/CSS/length). + This property is deprecated and will be removed in the future. -

Examples

+## Examples -

Using <mprescripts/>

+### Using `` -

Sample rendering:

+Sample rendering: ![](mmultiscripts_prescripts.png) -

Rendering in your browser: X d c b a

+Rendering in your browser: X d c b a -
<math>
+```html
+
 
-    <mmultiscripts>
+    
 
-        <mi>X</mi>      <!-- base expression -->
+        X      
 
-        <mi>d</mi>      <!-- postsubscript -->
-        <mi>c</mi>      <!-- postsuperscript -->
+        d      
+        c      
 
-        <mprescripts />
-        <mi>b</mi>      <!-- presubscript -->
-        <mi>a</mi>      <!-- presuperscript -->
+        
+        b      
+        a      
 
-    </mmultiscripts>
+    
 
-</math>
-
+ +``` -

Using <none/>

+### Using `` -

Sample rendering:

+Sample rendering: ![](mmultiscripts_none.png) -

Rendering in your browser: - - - X - - c - - b - - - -

+Rendering in your browser: X +c +b -
<math>
+```html
+
 
-    <mmultiscripts>
+    
 
-        <mi>X</mi>      <!-- base expression -->
+        X      
 
-        <none />        <!-- postsubscript -->
-        <mi>c</mi>      <!-- postsuperscript -->
+                
+        c      
 
-        <mprescripts />
-        <mi>b</mi>      <!-- presubscript -->
-        <none />        <!-- presuperscript -->
+        
+        b      
+                
 
-    </mmultiscripts>
+    
 
-</math>
-
+ +``` -

Specifications

+## Specifications -

{{Specifications}}

+{{Specifications}} -

Browser compatibility

+## Browser compatibility -

{{Compat}}

+{{Compat}} -

See also

+## See also -
    -
  • {{ MathMLElement("msub") }} (Subscript)
  • -
  • {{ MathMLElement("msup") }} (Superscript)
  • -
  • {{ MathMLElement("msubsup") }} (Subscript-superscript pair)
  • -
+- {{ MathMLElement("msub") }} (Subscript) +- {{ MathMLElement("msup") }} (Superscript) +- {{ MathMLElement("msubsup") }} (Subscript-superscript pair) diff --git a/files/en-us/web/mathml/element/mn/index.md b/files/en-us/web/mathml/element/mn/index.md index 4bc03693d7ef0f8..7b163aed4db134b 100644 --- a/files/en-us/web/mathml/element/mn/index.md +++ b/files/en-us/web/mathml/element/mn/index.md @@ -8,89 +8,135 @@ tags: - MathML:Token Elements browser-compat: mathml.elements.mn --- -
{{MathMLRef}}
- -

The MathML <mn> element represents a numeric literal which is normally a sequence of digits with a possible separator (a dot or a comma). However,  it is also allowed to have arbitrary text in it which is actually a numeric quantity, for example "eleven".

- -

Attributes

- -
-
class, id, style
-
Provided for use with stylesheets.
-
dir
-
The text direction. Possible values are either ltr (left to right) or rtl (right to left).
-
displaystyle
-
A Boolean value specifying whether more vertical space is used for displayed equations or, if set to false, a more compact layout is used to display formulas. The main effect is that larger versions of operators are displayed, when displaystyle is set to true. See also movablelimits on {{ MathMLElement("mo") }}.
-
href
-
Used to set a hyperlink to a specified URI.
-
mathbackground
-
The background color. You can use #rgb, #rrggbb and HTML color names.
-
mathcolor
-
The text color. You can use #rgb, #rrggbb and HTML color names.
-
mathsize
-
The size of the content. See length for possible values.
- Deprecated values are: small, normal and big. These will be removed in the future.
-
mathvariant
-
This attribute specifies the logical class of the number which varies in typography. That is, although the names suggest the typographic style for the class, semantically, items with the same class are treated "the same" within an expression, which might or might not involve displaying them with the named typography. The following values are allowed: -
    -
  • normal (Default value) ; Example
  • -
  • bold ; Example
  • -
  • italic ; Example
  • -
  • bold-italic ; Example
  • -
- -
    -
  • double-struck ; Example
  • -
  • bold-fraktur ; Example
  • -
  • script ; Example
  • -
  • bold-script ; Example
  • -
  • fraktur ; Example
  • -
- -
    -
  • sans-serif ; Example
  • -
  • bold-sans-serif ; Example
  • -
  • sans-serif-italic ; Example
  • -
  • sans-serif-bold-italic ; Example
  • -
  • monospace ; Example
  • -
- -
    -
  • initial ; مثال
  • -
  • tailed ; مثال
  • -
  • looped ; مثال
  • -
  • stretched ; مثال
  • -
-
-
- -

Examples

- -
<math>
-
-  <mn> 0 </mn>
-
-  <mn> 1.337 </mn>
-
-  <mn> twelve </mn>
-
-  <mn> XVI </mn>
-
-  <mn> 2e10 </mn>
-
-</math>
-
- -

Specifications

- -

{{Specifications}}

- -

Browser compatibility

- -

{{Compat}}

- -

Gecko-specific notes

- -
    -
  • Some mathvariant values are only implemented starting with Gecko 28.0 {{ geckoRelease("28.0") }} and require appropriate math fonts.
  • -
+{{MathMLRef}} + +The MathML `` element represents a numeric literal which is normally a sequence of digits with a possible separator (a dot or a comma). However,  it is also allowed to have arbitrary text in it which is actually a numeric quantity, for example "eleven". + +## Attributes + +- class, id, style + - : Provided for use with [stylesheets](/en-US/docs/Web/CSS). +- dir + - : The text direction. Possible values are either `ltr` (left to right) or `rtl` (right to left). +- `displaystyle` + - : A Boolean value specifying whether more vertical space is used for displayed equations or, if set to `false`, a more compact layout is used to display formulas. The main effect is that larger versions of operators are displayed, when `displaystyle` is set to `true`. See also `movablelimits` on {{ MathMLElement("mo") }}. +- href + - : Used to set a hyperlink to a specified URI. +- mathbackground + - : The background color. You can use `#rgb`, `#rrggbb` and [HTML color names](/en-US/docs/Web/CSS/color_value#color_keywords). +- mathcolor + - : The text color. You can use `#rgb`, `#rrggbb` and [HTML color names](/en-US/docs/Web/CSS/color_value#color_keywords). +- mathsize + - : The size of the content. See [length](/en-US/docs/Web/CSS/length) for possible values. + Deprecated values are: `small`, `normal` and `big`. These will be removed in the future. +- mathvariant + + - : This attribute specifies the logical class of the number which varies in typography. That is, although the names suggest the typographic style for the class, semantically, items with the same class are treated "the same" within an expression, which might or might not involve displaying them with the named typography. The following values are allowed: + + - `normal` (Default value) ; + + Example + + - `bold` ; + + Example + + - `italic` ; + + Example + + - `bold-italic` ; + + Example + + + + - `double-struck` ; + + Example + + - `bold-fraktur` ; + + Example + + - `script` ; + + Example + + - `bold-script` ; + + Example + + - `fraktur` ; + + Example + + + + - `sans-serif` ; + + Example + + - `bold-sans-serif` ; + + Example + + - `sans-serif-italic` ; + + Example + + - `sans-serif-bold-italic` ; + + Example + + - `monospace` ; + + Example + + + + - `initial` ; + + مثال + + - `tailed` ; + + مثال + + - `looped` ; + + مثال + + - `stretched` ; + + مثال + +## Examples + +```html + + +  0 + +  1.337 + +  twelve + +  XVI + +  2e10 + + +``` + +## Specifications + +{{Specifications}} + +## Browser compatibility + +{{Compat}} + +## Gecko-specific notes + +- Some `mathvariant` values are only implemented starting with Gecko 28.0 {{ geckoRelease("28.0") }} and require appropriate [math fonts](/en-US/docs/Mozilla/MathML_Project/Fonts). diff --git a/files/en-us/web/mathml/element/mo/index.md b/files/en-us/web/mathml/element/mo/index.md index c62c4f6ab1a732e..35a4bb640998c3c 100644 --- a/files/en-us/web/mathml/element/mo/index.md +++ b/files/en-us/web/mathml/element/mo/index.md @@ -8,133 +8,180 @@ tags: - MathML:Token Elements browser-compat: mathml.elements.mo --- -
{{MathMLRef}}
- -

The MathML <mo> element represents an operator in a broad sense. Besides operators in strict mathematical meaning, this element also includes "operators" like parentheses, separators like comma and semicolon, or "absolute value" bars.

- -

Attributes

- -
-
accent
-
If the operator is used as an under- or overscript this attribute specifies whether the operator should be treated as an accent.
- Allowed values are true or false.
-
class, id, style
-
Provided for use with stylesheets.
-
dir
-
The text direction. Possible values are either ltr (left to right) or rtl (right to left).
-
displaystyle
-
A Boolean value specifying whether more vertical space is used for displayed equations or, if set to false, a more compact layout is used to display formulas. The main effect is that larger versions of operators are displayed, when displaystyle is set to true. See also movablelimits on {{ MathMLElement("mo") }}.
-
fence
-
There is no visual effect for this attribute, but it specifies whether the operator is a fence (such as parentheses).
- Allowed values are true or false.
-
href
-
Used to set a hyperlink to a specified URI.
-
lspace
-
The amount of space before the operator (see length for values and units). The constant thickmathspace (5/18em) is the default value.
-
mathbackground
-
The background color. You can use #rgb, #rrggbb and HTML color names.
-
mathcolor
-
The text color. You can use #rgb, #rrggbb and HTML color names.
-
mathsize
-
The size of the content. See length for possible values.
- Deprecated values are: small, normal and big. These will be removed in the future.
-
mathvariant
-
This attribute specifies the logical class of the operator which varies in typography. That is, although the names suggest the typographic style for the class, semantically, items with the same class are treated "the same" within an expression, which might or might not involve displaying them with the named typography. The following values are allowed: -
    -
  • normal (Default value) ; Example
  • -
  • bold ; Example
  • -
  • italic ; Example
  • -
  • bold-italic ; Example
  • -
- -
    -
  • double-struck ; Example
  • -
  • bold-fraktur ; Example
  • -
  • script ; Example
  • -
  • bold-script ; Example
  • -
  • fraktur ; Example
  • -
- -
    -
  • sans-serif ; Example
  • -
  • bold-sans-serif ; Example
  • -
  • sans-serif-italic ; Example
  • -
  • sans-serif-bold-italic ; Example
  • -
  • monospace ; Example
  • -
- -
    -
  • initial ; مثال
  • -
  • tailed ; مثال
  • -
  • looped ; مثال
  • -
  • stretched ; مثال
  • -
-
-
maxsize
-
If stretchy is true, this attribute specifies the maximum size of the operator. Allowed values are: -
    -
  • infinity
  • -
  • an arbitrary length
  • -
-
-
minsize
-
If stretchy is true, this attribute specifies the minimum size of the operator. Allowed values are: -
    -
  • infinity
  • -
  • an arbitrary length
  • -
-
-
movablelimits
-
Specifies whether attached under- and overscripts move to sub- and superscript positions when displaystyle is false.
- Allowed values are either true or false.
-
rspace
-
The amount of space after the operator (see length for values and units). The constant thickmathspace (5/18em) is the default value.
-
separator
-
There is no visual effect for this attribute, but it specifies whether the operator is a separator (such as commas).
- Allowed values are true or false.
-
stretchy
-
Specifies whether the operator stretches to the size of the adjacent element.
- Allowed values are true or false.
-
symmetric
-
If stretchy is true, this attribute specifies whether the operator should be vertically symmetric around the imaginary math axis (centered fraction line).
- The default value is true if stretchy is set to true and otherwise false. Allowed values are true or false.
-
- -

Examples

- -
<math>
-
-<mrow>
-  <mn>5</mn>
-  <mo>+</mo>
-  <mn>5</mn>
-</mrow>
-
-<mrow>
-  <mo> [ </mo> <!-- default form value: prefix -->
-  <mrow>
-    <mn> 0 </mn>
-    <mo> ; </mo> <!-- default form value: infix -->
-    <mn> 1 </mn>
-  </mrow>
-  <mo> ) </mo> <!-- default form value: postfix -->
-</mrow>
-
-</math>
-
- -

Specifications

- -

{{Specifications}}

- -

Browser compatibility

- -

{{Compat}}

- -

Gecko-specific notes

- -
    -
  • Starting with Gecko 16.0 {{ geckoRelease("16.0") }} the default values for lspace and rspace have been corrected to match the MathML3 specification. They now default to the constant thickmathspace (5/18em).
  • -
  • Some mathvariant values are only implemented starting with Gecko 28.0 (Firefox 28.0 / Thunderbird 28.0 / SeaMonkey 2.25) and require appropriate math fonts.
  • -
  • Any linebreaking or indentation attributes are not implemented yet. See {{ bug("534962") }}.
  • -
+{{MathMLRef}} + +The MathML `` element represents an operator in a broad sense. Besides operators in strict mathematical meaning, this element also includes "operators" like parentheses, separators like comma and semicolon, or "absolute value" bars. + +## Attributes + +- accent + - : If the operator is used as an [under](/en-US/docs/Web/MathML/Element/munder)- or [overscript](/en-US/docs/Web/MathML/Element/mover) this attribute specifies whether the operator should be treated as an accent. + Allowed values are `true` or `false`. +- class, id, style + - : Provided for use with [stylesheets](/en-US/docs/Web/CSS). +- dir + - : The text direction. Possible values are either `ltr` (left to right) or `rtl` (right to left). +- `displaystyle` + - : A Boolean value specifying whether more vertical space is used for displayed equations or, if set to `false`, a more compact layout is used to display formulas. The main effect is that larger versions of operators are displayed, when `displaystyle` is set to `true`. See also `movablelimits` on {{ MathMLElement("mo") }}. +- fence + - : There is no visual effect for this attribute, but it specifies whether the operator is a fence (such as parentheses). + Allowed values are `true` or `false`. +- href + - : Used to set a hyperlink to a specified URI. +- lspace + - : The amount of space before the operator (see [length](/en-US/docs/Web/MathML/Attribute/Values#lengths) for values and units). The constant `thickmathspace` (5/18em) is the default value. +- mathbackground + - : The background color. You can use `#rgb`, `#rrggbb` and [HTML color names](/en-US/docs/Web/CSS/color_value#color_keywords). +- mathcolor + - : The text color. You can use `#rgb`, `#rrggbb` and [HTML color names](/en-US/docs/Web/CSS/color_value#color_keywords). +- mathsize + - : The size of the content. See [length](/en-US/docs/Web/CSS/length) for possible values. + Deprecated values are: `small`, `normal` and `big`. These will be removed in the future. +- mathvariant + + - : This attribute specifies the logical class of the operator which varies in typography. That is, although the names suggest the typographic style for the class, semantically, items with the same class are treated "the same" within an expression, which might or might not involve displaying them with the named typography. The following values are allowed: + + - `normal` (Default value) ; + + Example + + - `bold` ; + + Example + + - `italic` ; + + Example + + - `bold-italic` ; + + Example + + + + - `double-struck` ; + + Example + + - `bold-fraktur` ; + + Example + + - `script` ; + + Example + + - `bold-script` ; + + Example + + - `fraktur` ; + + Example + + + + - `sans-serif` ; + + Example + + - `bold-sans-serif` ; + + Example + + - `sans-serif-italic` ; + + Example + + - `sans-serif-bold-italic` ; + + Example + + - `monospace` ; + + Example + + + + - `initial` ; + + مثال + + - `tailed` ; + + مثال + + - `looped` ; + + مثال + + - `stretched` ; + + مثال + +- maxsize + + - : If `stretchy` is `true`, this attribute specifies the maximum size of the operator. Allowed values are: + + - `infinity` + - an arbitrary [length](/en-US/docs/Web/MathML/Attribute/Values#lengths) + +- minsize + + - : If `stretchy` is `true`, this attribute specifies the minimum size of the operator. Allowed values are: + + - `infinity` + - an arbitrary [length](/en-US/docs/Web/MathML/Attribute/Values#lengths) + +- movablelimits + - : Specifies whether attached under- and overscripts move to sub- and superscript positions when `displaystyle` is `false`. + Allowed values are either `true` or `false.` +- rspace + - : The amount of space after the operator (see [length](/en-US/docs/Web/MathML/Attribute/Values#lengths) for values and units). The constant `thickmathspace` (5/18em) is the default value. +- separator + - : There is no visual effect for this attribute, but it specifies whether the operator is a separator (such as commas). + Allowed values are `true` or `false`. +- stretchy + - : Specifies whether the operator stretches to the size of the adjacent element. + Allowed values are `true` or `false`. +- symmetric + - : If `stretchy` is `true`, this attribute specifies whether the operator should be vertically symmetric around the imaginary math axis (centered fraction line). + The default value is `true` if **stretchy** is set to `true` and otherwise `false`. Allowed values are `true` or `false`. + +## Examples + +```html + + +5+5 + + + + [ + 0 + ; +    1 + + ) + + + +``` + +## Specifications + +{{Specifications}} + +## Browser compatibility + +{{Compat}} + +## Gecko-specific notes + +- Starting with Gecko 16.0 {{ geckoRelease("16.0") }} the default values for `lspace` and `rspace` have been corrected to match the MathML3 specification. They now default to the constant `thickmathspace` (5/18em). +- Some `mathvariant` values are only implemented starting with Gecko 28.0 (Firefox 28.0 / Thunderbird 28.0 / SeaMonkey 2.25) and require appropriate [math fonts](/en-US/docs/Mozilla/MathML_Project/Fonts). +- Any [linebreaking](https://www.w3.org/TR/MathML3/chapter3.html#presm.lbattrs) or [indentation attributes](https://www.w3.org/TR/MathML3/chapter3.html#presm.lbindent.attrs) are not implemented yet. See {{ bug("534962") }}. diff --git a/files/en-us/web/mathml/element/mover/index.md b/files/en-us/web/mathml/element/mover/index.md index 9cc1e7b2579aaa8..fbf74c5f4aecf0a 100644 --- a/files/en-us/web/mathml/element/mover/index.md +++ b/files/en-us/web/mathml/element/mover/index.md @@ -8,64 +8,61 @@ tags: - MathML:Script and Limit Schemata browser-compat: mathml.elements.mover --- -
{{MathMLRef}}
+{{MathMLRef}} -

The MathML <mover> element is used to attach an accent or a limit over an expression. Use the following syntax: <mover> base overscript </mover>

+The MathML `` element is used to attach an accent or a limit over an expression. Use the following syntax: ` base overscript ` -

Attributes

+## Attributes -
-
accent
-
If true the over-script is an accent, which is drawn closer to the base expression.
- If false (default value) the over-script is a limit over the base expression.
-
align {{deprecated_inline}}
-
The alignment of the over-script. Possible values are: left, center, and right.
- This attribute is deprecated and will be removed in the future. Use CSS text-align instead.
-
class, id, style
-
Provided for use with stylesheets.
-
displaystyle
-
A Boolean value specifying whether more vertical space is used for displayed equations or, if set to false, a more compact layout is used to display formulas. The main effect is that larger versions of operators are displayed, when displaystyle is set to true. See also movablelimits on {{ MathMLElement("mo") }}.
-
href
-
Used to set a hyperlink to a specified URI.
-
mathbackground
-
The background color. You can use #rgb, #rrggbb and HTML color names.
-
mathcolor
-
The text color. You can use #rgb, #rrggbb and HTML color names.
-
+- accent + - : If `true` the over-script is an _accent_, which is drawn closer to the base expression. + If `false` (default value) the over-script is a _limit_ over the base expression. +- align {{deprecated_inline}} + - : The alignment of the over-script. Possible values are: `left`, `center`, and `right`. + This attribute is deprecated and will be removed in the future. Use CSS [`text-align`](/en-US/docs/Web/CSS/text-align) instead. +- class, id, style + - : Provided for use with [stylesheets](/en-US/docs/Web/CSS). +- `displaystyle` + - : A Boolean value specifying whether more vertical space is used for displayed equations or, if set to `false`, a more compact layout is used to display formulas. The main effect is that larger versions of operators are displayed, when `displaystyle` is set to `true`. See also `movablelimits` on {{ MathMLElement("mo") }}. +- href + - : Used to set a hyperlink to a specified URI. +- mathbackground + - : The background color. You can use `#rgb`, `#rrggbb` and [HTML color names](/en-US/docs/Web/CSS/color_value#color_keywords). +- mathcolor + - : The text color. You can use `#rgb`, `#rrggbb` and [HTML color names](/en-US/docs/Web/CSS/color_value#color_keywords). -

Examples

+## Examples -

Sample rendering: x+y+z

+Sample rendering: ![x+y+z](mover.png) -

Rendering in your browser: x + y + z

+Rendering in your browser: x + y + z -
<math>
+```html
+
 
-<mover accent="true">
-  <mrow>
-    <mi> x </mi>
-    <mo> + </mo>
-    <mi> y </mi>
-    <mo> + </mo>
-    <mi> z </mi>
-  </mrow>
-  <mo> &#x23DE; <!--TOP CURLY BRACKET--> </mo>
-</mover>
+
+  
+     x 
+     + 
+     y 
+     + 
+     z 
+  
+   
+
 
-</math>
-
+ +``` -

Specifications

+## Specifications -

{{Specifications}}

+{{Specifications}} -

Browser compatibility

+## Browser compatibility -

{{Compat}}

+{{Compat}} -

See also

+## See also -
    -
  • {{ MathMLElement("munder") }} (Underscript)
  • -
  • {{ MathMLElement("munderover") }} (Underscript-overscript pair)
  • -
+- {{ MathMLElement("munder") }} (Underscript) +- {{ MathMLElement("munderover") }} (Underscript-overscript pair) diff --git a/files/en-us/web/mathml/element/mpadded/index.md b/files/en-us/web/mathml/element/mpadded/index.md index f3d8c33db1db198..a3a60528225d744 100644 --- a/files/en-us/web/mathml/element/mpadded/index.md +++ b/files/en-us/web/mathml/element/mpadded/index.md @@ -8,64 +8,61 @@ tags: - MathML:General Layout Schemata browser-compat: mathml.elements.mpadded --- -
{{MathMLRef}}
+{{MathMLRef}} -

The MathML <mpadded> element is used to add extra padding and to set the general adjustment of position and size of enclosed contents.

+The MathML `` element is used to add extra padding and to set the general adjustment of position and size of enclosed contents. -

Attributes

+## Attributes -
-
class, id, style
-
Provided for use with stylesheets.
-
depth
-
Sets or increments the depth. Possible values: Any length or an increment/decrement (a length prefixed with "+" or "-") .
-
displaystyle
-
A Boolean value specifying whether more vertical space is used for displayed equations or, if set to false, a more compact layout is used to display formulas. The main effect is that larger versions of operators are displayed, when displaystyle is set to true. See also movablelimits on {{ MathMLElement("mo") }}.
-
height
-
Sets or increments the height. Possible values: Any length or an increment/decrement (a length prefixed with "+" or "-") .
-
href
-
Used to set a hyperlink to a specified URI.
-
lspace
-
Sets or increments the horizontal position. Possible values: Any length or an increment/decrement (a length prefixed with "+" or "-") .
-
mathbackground
-
The background color. You can use #rgb, #rrggbb and HTML color names.
-
mathcolor
-
The text color. You can use #rgb, #rrggbb and HTML color names.
-
voffset
-
Sets or increments the vertical position. Possible values: Any length or an increment/decrement (a length prefixed with "+" or "-") .
-
width
-
Sets or increments the width. Possible values: Any length or an increment/decrement (a length prefixed with "+" or "-") .
-
+- class, id, style + - : Provided for use with [stylesheets](/en-US/docs/Web/CSS). +- depth + - : Sets or increments the depth. Possible values: Any [length](/en-US/docs/Web/MathML/Attribute/Values#lengths) or an increment/decrement (a length prefixed with "+" or "-") . +- `displaystyle` + - : A Boolean value specifying whether more vertical space is used for displayed equations or, if set to `false`, a more compact layout is used to display formulas. The main effect is that larger versions of operators are displayed, when `displaystyle` is set to `true`. See also `movablelimits` on {{ MathMLElement("mo") }}. +- height + - : Sets or increments the height. Possible values: Any [length](/en-US/docs/Web/MathML/Attribute/Values#lengths) or an increment/decrement (a length prefixed with "+" or "-") . +- href + - : Used to set a hyperlink to a specified URI. +- lspace + - : Sets or increments the horizontal position. Possible values: Any [length](/en-US/docs/Web/MathML/Attribute/Values#lengths) or an increment/decrement (a length prefixed with "+" or "-") . +- mathbackground + - : The background color. You can use `#rgb`, `#rrggbb` and [HTML color names](/en-US/docs/Web/CSS/color_value#color_keywords). +- mathcolor + - : The text color. You can use `#rgb`, `#rrggbb` and [HTML color names](/en-US/docs/Web/CSS/color_value#color_keywords). +- voffset + - : Sets or increments the vertical position. Possible values: Any [length](/en-US/docs/Web/MathML/Attribute/Values#lengths) or an increment/decrement (a length prefixed with "+" or "-") . +- width + - : Sets or increments the width. Possible values: Any [length](/en-US/docs/Web/MathML/Attribute/Values#lengths) or an increment/decrement (a length prefixed with "+" or "-") . -

Pseudo-units

+### Pseudo-units -

It is possible to use the keywords "depth", "height", and "width" as a pseudo-unit for the attributes depth, height, lspace, voffset, and width. They represent each length of the same-named dimension.
- Prior to Gecko 7.0 {{ geckoRelease("7.0") }} the MathML2 pseudo-unit lspace was allowed, which is no longer present in the MathML3 Recommendation and has been removed now.

+It is possible to use the keywords `"depth`",` "height"`, and `"width"` as a pseudo-unit for the attributes `depth`, `height`, `lspace`, `voffset`, and `width`. They represent each length of the same-named dimension. +Prior to Gecko 7.0 {{ geckoRelease("7.0") }} the MathML2 pseudo-unit `lspace` was allowed, which is no longer present in the MathML3 Recommendation and has been removed now. -

Examples

+## Examples -
<math>
+```html
+
 
-  <mpadded height="+150px" width="100px" lspace="2height">
-    <mi> x </mi>
-    <mo> + </mo>
-    <mi> y </mi>
-  </mpadded>
+  
+     x 
+     + 
+     y 
 
-</math>
-
+ +``` -

Specifications

+## Specifications -

{{Specifications}}

+{{Specifications}} -

Browser compatibility

+## Browser compatibility -

{{Compat}}

+{{Compat}} -

See also

+## See also -
    -
  • {{ MathMLElement("mphantom") }}
  • -
  • {{ MathMLElement("mspace") }}
  • -
+- {{ MathMLElement("mphantom") }} +- {{ MathMLElement("mspace") }} diff --git a/files/en-us/web/mathml/element/mphantom/index.md b/files/en-us/web/mathml/element/mphantom/index.md index 4f77b5bf2f14423..e814821cb16647b 100644 --- a/files/en-us/web/mathml/element/mphantom/index.md +++ b/files/en-us/web/mathml/element/mphantom/index.md @@ -8,53 +8,50 @@ tags: - MathML:General Layout Schemata browser-compat: mathml.elements.mphantom --- -
{{MathMLRef}}
+{{MathMLRef}} -

The MathML <mphantom> element is rendered invisibly, but dimensions (such as height, width, and baseline position) are still kept.

+The MathML `` element is rendered invisibly, but dimensions (such as height, width, and baseline position) are still kept. -

Attributes

+## Attributes -
-
class, id, style
-
Provided for use with stylesheets.
-
displaystyle
-
A Boolean value specifying whether more vertical space is used for displayed equations or, if set to false, a more compact layout is used to display formulas. The main effect is that larger versions of operators are displayed, when displaystyle is set to true. See also movablelimits on {{ MathMLElement("mo") }}.
-
mathbackground
-
The background color. You can use #rgb, #rrggbb and HTML color names.
-
+- class, id, style + - : Provided for use with [stylesheets](/en-US/docs/Web/CSS). +- `displaystyle` + - : A Boolean value specifying whether more vertical space is used for displayed equations or, if set to `false`, a more compact layout is used to display formulas. The main effect is that larger versions of operators are displayed, when `displaystyle` is set to `true`. See also `movablelimits` on {{ MathMLElement("mo") }}. +- mathbackground + - : The background color. You can use `#rgb`, `#rrggbb` and [HTML color names](/en-US/docs/Web/CSS/color_value#color_keywords). -

Examples

+## Examples -

Sample rendering: x+  z

+Sample rendering: ![x+ z](mphantom.png) -

Rendering in your browser: x + y + z

+Rendering in your browser: x + y + z -
<math>
+```html
+
 
-<mrow>
-  <mi> x </mi>
-  <mo> + </mo>
-  <mphantom>
-    <mi> y </mi>
-    <mo> + </mo>
-  </mphantom>
-  <mi> z </mi>
-</mrow>
+
+   x 
+   + 
+  
+     y 
+     + 
+  
+   z 
+
 
-</math>
-
+ +``` -

Specifications

+## Specifications -

{{Specifications}}

+{{Specifications}} -

Browser compatibility

+## Browser compatibility -

{{Compat}}

+{{Compat}} -

See also

+## See also -
    -
  • {{ MathMLElement("mspace") }}
  • -
  • {{ MathMLElement("mpadded") }}
  • -
+- {{ MathMLElement("mspace") }} +- {{ MathMLElement("mpadded") }} diff --git a/files/en-us/web/mathml/element/mroot/index.md b/files/en-us/web/mathml/element/mroot/index.md index 8445064a08074f6..6207a028e23d8c6 100644 --- a/files/en-us/web/mathml/element/mroot/index.md +++ b/files/en-us/web/mathml/element/mroot/index.md @@ -8,51 +8,48 @@ tags: - MathML:General Layout Schemata browser-compat: mathml.elements.mroot --- -
{{MathMLRef}}
+{{MathMLRef}} -

The MathML <mroot> element is used to display roots with an explicit index. Two arguments are accepted, which leads to the syntax: <mroot> base index </mroot>.

+The MathML `` element is used to display roots with an explicit index. Two arguments are accepted, which leads to the syntax: ` base index `. -

Attributes

+## Attributes -
-
class, id, style
-
Provided for use with stylesheets.
-
displaystyle
-
A Boolean value specifying whether more vertical space is used for displayed equations or, if set to false, a more compact layout is used to display formulas. The main effect is that larger versions of operators are displayed, when displaystyle is set to true. See also movablelimits on {{ MathMLElement("mo") }}.
-
href
-
Used to set a hyperlink to a specified URL.
-
mathbackground
-
The background color. You can use #rgb, #rrggbb and HTML color names.
-
mathcolor
-
The text color and also the color of the root symbol itself. You can use #rgb, #rrggbb and HTML color names.
-
+- class, id, style + - : Provided for use with [stylesheets](/en-US/docs/Web/CSS). +- `displaystyle` + - : A Boolean value specifying whether more vertical space is used for displayed equations or, if set to `false`, a more compact layout is used to display formulas. The main effect is that larger versions of operators are displayed, when `displaystyle` is set to `true`. See also `movablelimits` on {{ MathMLElement("mo") }}. +- href + - : Used to set a hyperlink to a specified URL. +- mathbackground + - : The background color. You can use `#rgb`, `#rrggbb` and [HTML color names](/en-US/docs/Web/CSS/color_value#color_keywords). +- mathcolor + - : The text color and also the color of the root symbol itself. You can use `#rgb`, `#rrggbb` and [HTML color names](/en-US/docs/Web/CSS/color_value#color_keywords). -

Examples

+## Examples -

Sample Rendering: x

+Sample Rendering: ![x](mroot.png) -

Rendering in your browser: x 3

+Rendering in your browser: x 3 -
<math>
+```html
+
 
- <mroot>
-    <mi>x</mi>
-    <mn>3</mn>
- </mroot>
+ 
+    x
+    3
 
-</math>
-
+ +``` -

Specifications

+## Specifications -

{{Specifications}}

+{{Specifications}} -

Browser compatibility

+## Browser compatibility -

{{Compat}}

+{{Compat}} -

See also

+## See also -
    -
  • {{ MathMLElement("msqrt") }} (Square root without an index)
  • -
+- {{ MathMLElement("msqrt") }} (Square root without an index) diff --git a/files/en-us/web/mathml/element/mrow/index.md b/files/en-us/web/mathml/element/mrow/index.md index a0b86abd4089406..7680a2f36b9077d 100644 --- a/files/en-us/web/mathml/element/mrow/index.md +++ b/files/en-us/web/mathml/element/mrow/index.md @@ -8,68 +8,63 @@ tags: - MathML:General Layout Schemata browser-compat: mathml.elements.mrow --- -
{{MathMLRef}}
+{{MathMLRef}} -

The MathML <mrow> element is used to group sub-expressions, which usually contain one or more operators with their respective operands (such as {{ MathMLElement("mi") }} and {{ MathMLElement("mn") }}). This element renders as a horizontal row containing its arguments.

+The MathML `` element is used to group sub-expressions, which usually contain one or more [operators](/en-US/docs/Web/MathML/Element/mo) with their respective operands (such as {{ MathMLElement("mi") }} and {{ MathMLElement("mn") }}). This element renders as a horizontal row containing its arguments. -

When writing a MathML expression, you should group elements within an <mrow> in the same way as they are grouped in the mathematical interpretation of the expression. Proper grouping helps the rendering of the expression in several ways:

+When writing a MathML expression, you should group elements within an `` in the same way as they are grouped in the mathematical interpretation of the expression. Proper grouping helps the rendering of the expression in several ways: -
    -
  • It can improve the display by possibly affecting spacing.
  • -
  • It allows for more intelligent line-breaking and indentation.
  • -
  • It simplifies the interpretation of the expression by automated systems such as computer algebra systems and audio renderers.
  • -
+- It can improve the display by possibly affecting spacing. +- It allows for more intelligent line-breaking and indentation. +- It simplifies the interpretation of the expression by automated systems such as computer algebra systems and audio renderers. -

Attributes

+## Attributes -
-
class, id, style
-
Provided for use with stylesheets.
-
displaystyle
-
A Boolean value specifying whether more vertical space is used for displayed equations or, if set to false, a more compact layout is used to display formulas. The main effect is that larger versions of operators are displayed, when displaystyle is set to true. See also movablelimits on {{ MathMLElement("mo") }}.
-
dir
-
Overall directionality of formulas. Possible values are either ltr (left to right) or rtl (right to left).
-
href
-
Used to set a hyperlink to a specified URI.
-
mathbackground
-
The background color. You can use #rgb, #rrggbb and HTML color names.
-
mathcolor
-
The text color. You can use #rgb, #rrggbb and HTML color names.
-
+- class, id, style + - : Provided for use with [stylesheets](/en-US/docs/Web/CSS). +- `displaystyle` + - : A Boolean value specifying whether more vertical space is used for displayed equations or, if set to `false`, a more compact layout is used to display formulas. The main effect is that larger versions of operators are displayed, when `displaystyle` is set to `true`. See also `movablelimits` on {{ MathMLElement("mo") }}. +- dir + - : Overall directionality of formulas. Possible values are either `ltr` (left to right) or `rtl` (right to left). +- href + - : Used to set a hyperlink to a specified URI. +- mathbackground + - : The background color. You can use `#rgb`, `#rrggbb` and [HTML color names](/en-US/docs/Web/CSS/color_value#color_keywords). +- mathcolor + - : The text color. You can use `#rgb`, `#rrggbb` and [HTML color names](/en-US/docs/Web/CSS/color_value#color_keywords). -

Examples

+## Examples -
<math>
+```html
+
 
-  <mrow>
-    <mn> 1 </mn>
-    <mo> + </mo>
-    <mn> 1 </mn>
-  </mrow>
+  
+     1 
+     + 
+     1 
+  
 
-  <mrow>
-    <mo> ( </mo>
-    <mrow>
-      <mi> x </mi>
-      <mo> , </mo>
-      <mi> y </mi>
-    </mrow>
-    <mo> ) </mo>
-  </mrow>
+  
+     ( 
+    
+       x 
+       , 
+       y 
+    
+     ) 
+  
 
-</math>
-
+ +``` -

Specifications

+## Specifications -

{{Specifications}}

+{{Specifications}} -

Browser compatibility

+## Browser compatibility -

{{Compat}}

+{{Compat}} -

See also

+## See also -
    -
  • Grouping HTML elements: {{ HTMLElement("div") }}
  • -
+- Grouping HTML elements: {{ HTMLElement("div") }} diff --git a/files/en-us/web/mathml/element/ms/index.md b/files/en-us/web/mathml/element/ms/index.md index 37ccce75b053f2b..268995a17a9167b 100644 --- a/files/en-us/web/mathml/element/ms/index.md +++ b/files/en-us/web/mathml/element/ms/index.md @@ -8,85 +8,132 @@ tags: - MathML:Token Elements browser-compat: mathml.elements.ms --- -
{{MathMLRef}}
- -

The MathML <ms> element represents a string literal meant to be interpreted by programming languages and computer algebra systems. By default, string literals are displayed as enclosed by double quotes (&quot;); by using the lquote and rquote attributes, you can set custom characters to display. Note that quotation marks should not be specified unless they are part of the string literal. The content of an <ms> element is not an ASCII string per se, but rather a sequence of characters and {{ MathMLElement("malignmark") }} elements.

- -

Attributes

- -
-
class, id, style
-
Provided for use with stylesheets.
-
dir
-
The text direction. Possible values are either ltr (left to right) or rtl (right to left).
-
displaystyle
-
A Boolean value specifying whether more vertical space is used for displayed equations or, if set to false, a more compact layout is used to display formulas. The main effect is that larger versions of operators are displayed, when displaystyle is set to true. See also movablelimits on {{ MathMLElement("mo") }}.
-
lquote
-
The opening quote character (depends on dir) to enclose the content. The default value is "&quot;".
-
href
-
Used to set a hyperlink to a specified URI.
-
mathbackground
-
The background color. You can use #rgb, #rrggbb and HTML color names.
-
mathcolor
-
The text color. You can use #rgb, #rrggbb and HTML color names.
-
mathsize
-
The size of the content. See length for possible values.
- Deprecated values are: small, normal and big. These will be removed in the future.
-
mathvariant
-
This attribute specifies the logical class of the identifier, which varies in typography. That is, although the names suggest the typographic style for the class, semantically, items with the same class are treated "the same" within an expression, which might or might not involve displaying them with the named typography. The following values are allowed: -
    -
  • normal (Default value) ; Example
  • -
  • bold ; Example
  • -
  • italic ; Example
  • -
  • bold-italic ; Example
  • -
- -
    -
  • double-struck ; Example
  • -
  • bold-fraktur ; Example
  • -
  • script ; Example
  • -
  • bold-script ; Example
  • -
  • fraktur ; Example
  • -
- -
    -
  • sans-serif ; Example
  • -
  • bold-sans-serif ; Example
  • -
  • sans-serif-italic ; Example
  • -
  • sans-serif-bold-italic ; Example
  • -
  • monospace ; Example
  • -
- -
    -
  • initial ; مثال
  • -
  • tailed ; مثال
  • -
  • looped ; مثال
  • -
  • stretched ; مثال
  • -
-
-
rquote
-
The closing quote mark (depends on dir) to enclose the content. The default value is "&quot;".
-
- -

Examples

- -
<math>
-
-  <ms lquote="„" rquote="“"> abc </ms>
-
-</math>
-
- -

Specifications

- -

{{Specifications}}

- -

Browser compatibility

- -

{{Compat}}

- -

Gecko-specific notes

- -
    -
  • Some mathvariant values are only implemented starting with Gecko 28.0 (Firefox 28.0 / Thunderbird 28.0 / SeaMonkey 2.25) and require appropriate math fonts.
  • -
+{{MathMLRef}} + +The MathML `` element represents a _string literal_ meant to be interpreted by programming languages and computer algebra systems. By default, string literals are displayed as enclosed by double quotes (`"`); by using the `lquote` and `rquote` attributes, you can set custom characters to display. Note that quotation marks should not be specified unless they are part of the string literal. The content of an `` element is not an ASCII string per se, but rather a sequence of characters and {{ MathMLElement("malignmark") }} elements. + +## Attributes + +- class, id, style + - : Provided for use with [stylesheets](/en-US/docs/Web/CSS). +- dir + - : The text direction. Possible values are either `ltr` (left to right) or `rtl` (right to left). +- `displaystyle` + - : A Boolean value specifying whether more vertical space is used for displayed equations or, if set to `false`, a more compact layout is used to display formulas. The main effect is that larger versions of operators are displayed, when `displaystyle` is set to `true`. See also `movablelimits` on {{ MathMLElement("mo") }}. +- lquote + - : The opening quote character (depends on [`dir`](#attr-dir)) to enclose the content. The default value is "`"".` +- href + - : Used to set a hyperlink to a specified URI. +- mathbackground + - : The background color. You can use `#rgb`, `#rrggbb` and [HTML color names](/en-US/docs/Web/CSS/color_value#color_keywords). +- mathcolor + - : The text color. You can use `#rgb`, `#rrggbb` and [HTML color names](/en-US/docs/Web/CSS/color_value#color_keywords). +- mathsize + - : The size of the content. See [length](/en-US/docs/Web/CSS/length) for possible values. + Deprecated values are: `small`, `normal` and `big`. These will be removed in the future. +- mathvariant + + - : This attribute specifies the logical class of the identifier, which varies in typography. That is, although the names suggest the typographic style for the class, semantically, items with the same class are treated "the same" within an expression, which might or might not involve displaying them with the named typography. The following values are allowed: + + - `normal` (Default value) ; + + Example + + - `bold` ; + + Example + + - `italic` ; + + Example + + - `bold-italic` ; + + Example + + + + - `double-struck` ; + + Example + + - `bold-fraktur` ; + + Example + + - `script` ; + + Example + + - `bold-script` ; + + Example + + - `fraktur` ; + + Example + + + + - `sans-serif` ; + + Example + + - `bold-sans-serif` ; + + Example + + - `sans-serif-italic` ; + + Example + + - `sans-serif-bold-italic` ; + + Example + + - `monospace` ; + + Example + + + + - `initial` ; + + مثال + + - `tailed` ; + + مثال + + - `looped` ; + + مثال + + - `stretched` ; + + مثال + +- rquote + - : The closing quote mark (depends on [`dir`](#attr-dir)) to enclose the content. The default value is "`"".` + +## Examples + +```html + + + abc + + +``` + +## Specifications + +{{Specifications}} + +## Browser compatibility + +{{Compat}} + +## Gecko-specific notes + +- Some `mathvariant` values are only implemented starting with Gecko 28.0 (Firefox 28.0 / Thunderbird 28.0 / SeaMonkey 2.25) and require appropriate [math fonts](/en-US/docs/Mozilla/MathML_Project/Fonts). diff --git a/files/en-us/web/mathml/element/mspace/index.md b/files/en-us/web/mathml/element/mspace/index.md index 87c83903b624320..ae67eedb8938f64 100644 --- a/files/en-us/web/mathml/element/mspace/index.md +++ b/files/en-us/web/mathml/element/mspace/index.md @@ -8,58 +8,53 @@ tags: - MathML:Token Elements browser-compat: mathml.elements.mspace --- -
{{MathMLRef}}
+{{MathMLRef}} -

The MathML <mspace> element is used to display a blank space, whose size is set by its attributes.

+The MathML `` element is used to display a blank space, whose size is set by its attributes. -

Attributes

+## Attributes -
-
class, id, style
-
Provided for use with stylesheets.
-
depth
-
The desired depth (below the baseline) of the space (see length for values and units).
-
displaystyle
-
A Boolean value specifying whether more vertical space is used for displayed equations or, if set to false, a more compact layout is used to display formulas. The main effect is that larger versions of operators are displayed, when displaystyle is set to true. See also movablelimits on {{ MathMLElement("mo") }}.
-
height
-
The desired height (above the baseline) of the space (see length for values and units).
-
mathbackground
-
The background color. You can use #rgb, #rrggbb and HTML color names.
-
width
-
The desired width of the space (see length for values and units).
-
+- class, id, style + - : Provided for use with [stylesheets](/en-US/docs/Web/CSS). +- depth + - : The desired depth (below the baseline) of the space (see [length](/en-US/docs/Web/MathML/Attribute/Values#lengths) for values and units). +- `displaystyle` + - : A Boolean value specifying whether more vertical space is used for displayed equations or, if set to `false`, a more compact layout is used to display formulas. The main effect is that larger versions of operators are displayed, when `displaystyle` is set to `true`. See also `movablelimits` on {{ MathMLElement("mo") }}. +- height + - : The desired height (above the baseline) of the space (see [length](/en-US/docs/Web/MathML/Attribute/Values#lengths) for values and units). +- mathbackground + - : The background color. You can use `#rgb`, `#rrggbb` and [HTML color names](/en-US/docs/Web/CSS/color_value#color_keywords). +- width + - : The desired width of the space (see [length](/en-US/docs/Web/MathML/Attribute/Values#lengths) for values and units). -

Note that some common attributes like mathcolor, mathvariant or dir have no effect on <mspace>.

+Note that some common attributes like `mathcolor`, `mathvariant` or `dir` have no effect on ``. -

Examples

+## Examples -
<math>
+```html
+
 
-  <mspace depth="40px" height="20px" />
+  
 
-  <mspace width="100px" />
+  
 
-</math>
-
+ +``` -

Specifications

+## Specifications -

{{Specifications}}

+{{Specifications}} -

Browser compatibility

+## Browser compatibility -

{{Compat}}

+{{Compat}} -

Gecko-specific notes

+## Gecko-specific notes -
    -
  • Indentation attributes are not implemented yet (for Gecko see {{ bug("534962") }}).
  • -
  • Support for negative values for the width attribute has been implemented in Gecko 23.0 {{geckoRelease("23.0")}}.
  • -
+- [Indentation attributes](https://www.w3.org/TR/MathML3/chapter3.html#presm.lbindent.attrs) are not implemented yet (for Gecko see {{ bug("534962") }}). +- Support for negative values for the `width` attribute has been implemented in Gecko 23.0 {{geckoRelease("23.0")}}. -

See also

+## See also -
    -
  • {{ MathMLElement("mpadded") }}
  • -
  • {{ MathMLElement("mphantom") }}
  • -
+- {{ MathMLElement("mpadded") }} +- {{ MathMLElement("mphantom") }} diff --git a/files/en-us/web/mathml/element/msqrt/index.md b/files/en-us/web/mathml/element/msqrt/index.md index 3b07143cf025b77..693ad1214b9a6d7 100644 --- a/files/en-us/web/mathml/element/msqrt/index.md +++ b/files/en-us/web/mathml/element/msqrt/index.md @@ -8,50 +8,47 @@ tags: - MathML:General Layout Schemata browser-compat: mathml.elements.msqrt --- -
{{MathMLRef}}
+{{MathMLRef}} -

The MathML <msqrt> element is used to display square roots (no index is displayed). The square root accepts only one argument, which leads to the following syntax: <msqrt> base </msqrt>.

+The MathML `` element is used to display square roots (no index is displayed). The square root accepts only one argument, which leads to the following syntax: ` base `. -

Attributes

+## Attributes -
-
class, id, style
-
Provided for use with stylesheets.
-
displaystyle
-
A Boolean value specifying whether more vertical space is used for displayed equations or, if set to false, a more compact layout is used to display formulas. The main effect is that larger versions of operators are displayed, when displaystyle is set to true. See also movablelimits on {{ MathMLElement("mo") }}.
-
href
-
Used to set a hyperlink to a specified URI.
-
mathbackground
-
The background color. You can use #rgb, #rrggbb and HTML color names.
-
mathcolor
-
The text color and also the color of the root symbol itself. You can use #rgb, #rrggbb and HTML color names.
-
+- class, id, style + - : Provided for use with [stylesheets](/en-US/docs/Web/CSS). +- `displaystyle` + - : A Boolean value specifying whether more vertical space is used for displayed equations or, if set to `false`, a more compact layout is used to display formulas. The main effect is that larger versions of operators are displayed, when `displaystyle` is set to `true`. See also `movablelimits` on {{ MathMLElement("mo") }}. +- href + - : Used to set a hyperlink to a specified URI. +- mathbackground + - : The background color. You can use `#rgb`, `#rrggbb` and [HTML color names](/en-US/docs/Web/CSS/color_value#color_keywords). +- mathcolor + - : The text color and also the color of the root symbol itself. You can use `#rgb`, `#rrggbb` and [HTML color names](/en-US/docs/Web/CSS/color_value#color_keywords). -

Examples

+## Examples -

Sample rendering: root-x

+Sample rendering: ![root-x](msqrt.png) -

Rendering in your browser: x

+Rendering in your browser: x -
<math>
+```html
+
 
- <msqrt>
-    <mi>x</mi>
-  </msqrt>
+ 
+    x
+  
 
-</math>
-
+ +``` -

Specifications

+## Specifications -

{{Specifications}}

+{{Specifications}} -

Browser compatibility

+## Browser compatibility -

{{Compat}}

+{{Compat}} -

See also

+## See also -
    -
  • {{ MathMLElement("mroot") }} (Radical with an index)
  • -
+- {{ MathMLElement("mroot") }} (Radical with an index) diff --git a/files/en-us/web/mathml/element/mstyle/index.md b/files/en-us/web/mathml/element/mstyle/index.md index 66efbea60f58bd0..68836017a8b86a7 100644 --- a/files/en-us/web/mathml/element/mstyle/index.md +++ b/files/en-us/web/mathml/element/mstyle/index.md @@ -8,91 +8,84 @@ tags: - MathML:General Layout Schemata browser-compat: mathml.elements.mstyle --- -
{{MathMLRef}}
- -

The MathML <mstyle> element is used change the style of its children. It accepts all attributes of all MathML presentation elements with some exceptions and additional attributes listed below.

- -

Attributes

- -
-
dir
-
Overall directionality of formulas. Possible values are either ltr (left to right) or rtl (right to left).
-
displaystyle
-
A Boolean value specifying whether more vertical space is used for displayed equations or, if set to false, a more compact layout is used to display formulas. The main effect is that larger versions of operators are displayed, when displaystyle is set to true. See also movablelimits on {{ MathMLElement("mo") }}.
-
infixlinebreakstyle
-
Specifies the default linebreakstyle to use for infix operators. The values before, after and duplicate are allowed.
-
scriptlevel
-
Controls mostly the font-size. The higher the scriptlevel, the smaller the font size. This attribute accepts a non-negative integer, as well as a "+" or a "-" sign, which increments or decrements the current value. In addition, the scriptlevel attribute can never reduce the font size below scriptminsize in order to avoid unreadable small font sizes and depends on the multiplier specified in scriptsizemultiplier.
-
scriptminsize
-
Specifies a minimum font size allowed due to changes in scriptlevel. The default value is 8pt.
-
scriptsizemultiplier
-
Specifies the multiplier to be used to adjust font size due to changes in scriptlevel. The default value is 0.71.
-
- -

The <mstyle> element accepts all attributes of all presentation elements with the following exceptions:

- -
    -
  • height, depth or width do not apply to {{ MathMLELement("mpadded") }} or {{ MathMLELement("mtable") }}.
  • -
  • rowalign, columnalign, or groupalign do not apply to {{ MathMLELement("mtr") }}, {{ MathMLELement("mtd") }} or {{ MathMLELement("maligngroup") }}.
  • -
  • lspace or voffset do not apply to {{ MathMLELement("mpadded") }}.
  • -
  • align does not apply to {{ MathMLELement("mtable") }} or {{ MathMLELement("mstack") }}.
  • -
  • index cannot be set on <mstyle>.
  • -
  • actiontype on {{ MathMLElement("maction") }} cannot be set on <mstyle>.
  • -
- -

Examples

- -

Using displaystyle and mathcolor to effect style changes in the layout of the whole sum.

- -
<math>
-
-  <mstyle displaystyle="true" mathcolor="teal">
-    <mrow>
-
-      <munderover>
-        <mo stretchy="true" form="prefix">&sum;</mo>
-        <mrow>
-          <mi>i</mi>
-          <mo form="infix">=</mo>
-          <mn>1</mn>
-        </mrow>
-        <mi>n</mi>
-      </munderover>
-
-      <mstyle displaystyle="true">
-        <mfrac>
-          <mn>1</mn>
-          <mi>n</mi>
-        </mfrac>
-      </mstyle>
-
-    </mrow>
-  </mstyle>
-
-</math>
-
- -

Specifications

- -

{{Specifications}}

- -

Browser compatibility

- -

{{Compat}}

- -

Gecko-specific notes

- -
    -
  • Prior to Gecko 6.0 {{ geckoRelease("6.0") }} the implementation of <mstyle> was not complete and has been corrected. In particular, setting these attributes on mstyle had no effect to its children: - -
      -
    • The bevelled attribute on {{ MathMLElement("mfrac") }} elements.
    • -
    • The notation attribute on {{ MathMLElement("menclose") }} elements.
    • -
    • The open, close and separators attributes on {{ MathMLElement("mfenced") }} elements.
    • -
    • The accent and accentunder attributes on {{ MathMLElement("mover") }}, {{ MathMLElement("munder") }} and {{ MathMLElement("munderover") }} elements.
    • -
    • The selection attribute on {{ MathMLElement("maction") }} elements.
    • -
    • The mathvariant attribute on {{ MathMLElement("mi") }} elements.
    • -
    -
  • -
  • Starting with Gecko 29.0 {{geckoRelease("29.0")}}, the attributes accepted on the <mstyle> element have been restricted to those actually used in practice: id, class, style, href, mathcolor, mathbackground, scriptlevel, displaystyle, scriptsizemultiplier, scriptminsize, dir, mathsize, mathvariant, fontfamily, fontweight, fontstyle, fontsize, color, background.
  • -
+{{MathMLRef}} + +The MathML `` element is used change the style of its children. It accepts all attributes of all MathML presentation elements with some exceptions and additional attributes listed below. + +## Attributes + +- `dir` + - : Overall directionality of formulas. Possible values are either `ltr` (left to right) or `rtl` (right to left). +- `displaystyle` + - : A Boolean value specifying whether more vertical space is used for displayed equations or, if set to `false`, a more compact layout is used to display formulas. The main effect is that larger versions of operators are displayed, when `displaystyle` is set to `true`. See also `movablelimits` on {{ MathMLElement("mo") }}. +- `infixlinebreakstyle` + - : Specifies the default `linebreakstyle` to use for infix operators. The values `before`, `after` and `duplicate` are allowed. +- `scriptlevel` + - : Controls mostly the font-size. The higher the `scriptlevel`, the smaller the font size. This attribute accepts a non-negative integer, as well as a "+" or a "-" sign, which increments or decrements the current value. In addition, the `scriptlevel` attribute can never reduce the font size below `scriptminsize` in order to avoid unreadable small font sizes and depends on the multiplier specified in `scriptsizemultiplier`. +- `scriptminsize` + - : Specifies a minimum font size allowed due to changes in `scriptlevel`. The default value is 8pt. +- `scriptsizemultiplier` + - : Specifies the multiplier to be used to adjust font size due to changes in `scriptlevel`. The default value is 0.71. + +The `` element accepts [all attributes](/en-US/docs/Web/MathML/Attribute) of all presentation elements with the following exceptions: + +- `height`, `depth` or `width` do not apply to {{ MathMLELement("mpadded") }} or {{ MathMLELement("mtable") }}. +- `rowalign`, `columnalign`, or `groupalign` do not apply to {{ MathMLELement("mtr") }}, {{ MathMLELement("mtd") }} or {{ MathMLELement("maligngroup") }}. +- `lspace` or `voffset` do not apply to {{ MathMLELement("mpadded") }}. +- `align` does not apply to {{ MathMLELement("mtable") }} or {{ MathMLELement("mstack") }}. +- `index` cannot be set on ``. +- `actiontype` on {{ MathMLElement("maction") }} cannot be set on ``. + +## Examples + +Using `displaystyle` and `mathcolor` to effect style changes in the layout of the whole sum. + +```html + + + + + + + + + i + = + 1 + + n + + +  + + 1 + n + + + +   + + + +``` + +## Specifications + +{{Specifications}} + +## Browser compatibility + +{{Compat}} + +## Gecko-specific notes + +- Prior to Gecko 6.0 {{ geckoRelease("6.0") }} the implementation of `` was not complete and [has been corrected](https://bugzilla.mozilla.org/show_bug.cgi?id=569125). In particular, setting these attributes on `mstyle` had no effect to its children: + + - The `bevelled` attribute on {{ MathMLElement("mfrac") }} elements. + - The `notation` attribute on {{ MathMLElement("menclose") }} elements. + - The `open`, `close` and `separators` attributes on {{ MathMLElement("mfenced") }} elements. + - The `accent` and `accentunder` attributes on {{ MathMLElement("mover") }}, {{ MathMLElement("munder") }} and {{ MathMLElement("munderover") }} elements. + - The `selection` attribute on {{ MathMLElement("maction") }} elements. + - The `mathvariant` attribute on {{ MathMLElement("mi") }} elements. + +- Starting with Gecko 29.0 {{geckoRelease("29.0")}}, the attributes accepted on the `` element have been restricted to those actually used in practice: `id, class, style, href, mathcolor, mathbackground, scriptlevel, displaystyle, scriptsizemultiplier, scriptminsize, dir, mathsize, mathvariant, fontfamily, fontweight, fontstyle, fontsize, color, background`. diff --git a/files/en-us/web/mathml/element/msub/index.md b/files/en-us/web/mathml/element/msub/index.md index 7770771a0c1cc30..09b9911088b9108 100644 --- a/files/en-us/web/mathml/element/msub/index.md +++ b/files/en-us/web/mathml/element/msub/index.md @@ -8,58 +8,55 @@ tags: - MathML:Script and Limit Schemata browser-compat: mathml.elements.msub --- -
{{MathMLRef}}
+{{MathMLRef}} -

The MathML <msub> element is used to attach a subscript to an expression.

+The MathML `` element is used to attach a subscript to an expression. -

It uses the following syntax: <msub> base subscript </msub>.

+It uses the following syntax: ` base subscript `. -

Attributes

+## Attributes -
-
class, id, style
-
Provided for use with stylesheets.
-
displaystyle
-
A Boolean value specifying whether more vertical space is used for displayed equations or, if set to false, a more compact layout is used to display formulas. The main effect is that larger versions of operators are displayed, when displaystyle is set to true. See also movablelimits on {{ MathMLElement("mo") }}.
-
href
-
Used to set a hyperlink to a specified URI.
-
mathbackground
-
The background color. You can use #rgb, #rrggbb and HTML color names.
-
mathcolor
-
The text color. You can use #rgb, #rrggbb and HTML color names.
-
subscriptshift {{deprecated_inline}}
-
The minimum space by which to shift the subscript below the baseline of the expression, as a length value.
- This attribute is deprecated and will be removed in the future.
-
+- `class`, `id`, `style` + - : Provided for use with [stylesheets](/en-US/docs/Web/CSS). +- `displaystyle` + - : A Boolean value specifying whether more vertical space is used for displayed equations or, if set to `false`, a more compact layout is used to display formulas. The main effect is that larger versions of operators are displayed, when `displaystyle` is set to `true`. See also `movablelimits` on {{ MathMLElement("mo") }}. +- `href` + - : Used to set a hyperlink to a specified URI. +- `mathbackground` + - : The background color. You can use `#rgb`, `#rrggbb` and [HTML color names](/en-US/docs/Web/CSS/color_value#color_keywords). +- `mathcolor` + - : The text color. You can use `#rgb`, `#rrggbb` and [HTML color names](/en-US/docs/Web/CSS/color_value#color_keywords). +- `subscriptshift` {{deprecated_inline}} + - : The minimum space by which to shift the subscript below the baseline of the expression, as a [length value](/en-US/docs/Web/MathML/Attribute/Values#lengths). + This attribute is deprecated and will be removed in the future. -

Examples

+## Examples -

Sample rendering: x1

+Sample rendering: ![x1](msub.png) -

Rendering in your browser: X 1

+Rendering in your browser: X 1 -
<math>
+```html
+
 
-  <msub>
-    <mi>X</mi>
-    <mn>1</mn>
-  </msub>
+  
+    X
+    1
 
-</math>
-
+ +``` -

Specifications

+## Specifications -

{{Specifications}}

+{{Specifications}} -

Browser compatibility

+## Browser compatibility -

{{Compat}}

+{{Compat}} -

See also

+## See also -
    -
  • {{ MathMLElement("msup") }} (Superscript)
  • -
  • {{ MathMLElement("msubsup") }} (Subscript-superscript pair)
  • -
  • {{ MathMLElement("mmultiscripts") }} (Prescripts and tensor indices)
  • -
+- {{ MathMLElement("msup") }} (Superscript) +- {{ MathMLElement("msubsup") }} (Subscript-superscript pair) +- {{ MathMLElement("mmultiscripts") }} (Prescripts and tensor indices) diff --git a/files/en-us/web/mathml/element/msubsup/index.md b/files/en-us/web/mathml/element/msubsup/index.md index 8b1780108d28c0f..22579cf0f530923 100644 --- a/files/en-us/web/mathml/element/msubsup/index.md +++ b/files/en-us/web/mathml/element/msubsup/index.md @@ -8,62 +8,59 @@ tags: - MathML:Script and Limit Schemata browser-compat: mathml.elements.msubsup --- -
{{MathMLRef}}
+{{MathMLRef}} -

The MathML <msubsup> element is used to attach both a subscript and a superscript, together, to an expression.

+The MathML `` element is used to attach both a subscript and a superscript, together, to an expression. -

It uses the following syntax: <msubsup> base subscript superscript </msubsup>.

+It uses the following syntax: ` base subscript superscript `. -

Attributes

+## Attributes -
-
class, id, style
-
Provided for use with stylesheets.
-
displaystyle
-
A Boolean value specifying whether more vertical space is used for displayed equations or, if set to false, a more compact layout is used to display formulas. The main effect is that larger versions of operators are displayed, when displaystyle is set to true. See also movablelimits on {{ MathMLElement("mo") }}.
-
href
-
Used to set a hyperlink to a specified URI.
-
mathbackground
-
The background color. You can use #rgb, #rrggbb and HTML color names.
-
mathcolor
-
The text color. You can use #rgb, #rrggbb and HTML color names.
-
subscriptshift {{deprecated_inline}}
-
The minimum space by which to shift the subscript below the baseline of the expression, as a length value.
- This attribute is deprecated and will be removed in the future.
-
superscriptshift {{deprecated_inline}}
-
The minimum space by which to shift the superscript above the baseline of the expression, as a length value.
- This attribute is deprecated and will be removed in the future.
-
+- `class`, `id`, `style` + - : Provided for use with [stylesheets](/en-US/docs/Web/CSS). +- `displaystyle` + - : A Boolean value specifying whether more vertical space is used for displayed equations or, if set to `false`, a more compact layout is used to display formulas. The main effect is that larger versions of operators are displayed, when `displaystyle` is set to `true`. See also `movablelimits` on {{ MathMLElement("mo") }}. +- `href` + - : Used to set a hyperlink to a specified URI. +- `mathbackground` + - : The background color. You can use `#rgb`, `#rrggbb` and [HTML color names](/en-US/docs/Web/CSS/color_value#color_keywords). +- `mathcolor` + - : The text color. You can use `#rgb`, `#rrggbb` and [HTML color names](/en-US/docs/Web/CSS/color_value#color_keywords). +- `subscriptshift` {{deprecated_inline}} + - : The minimum space by which to shift the subscript below the baseline of the expression, as a [length value.](/en-US/docs/Web/MathML/Attribute/Values#lengths) + This attribute is deprecated and will be removed in the future. +- `superscriptshift` {{deprecated_inline}} + - : The minimum space by which to shift the superscript above the baseline of the expression, as a [length value.](/en-US/docs/Web/MathML/Attribute/Values#lengths) + This attribute is deprecated and will be removed in the future. -

Examples

+## Examples -

Sample rendering: x1

+Sample rendering: ![x1](msubsup.png) -

Rendering in your browser: 0 1

+Rendering in your browser: 0 1 -
<math displaystyle="true">
+```html
+
 
-  <msubsup>
-    <mo> &#x222B;<!--Integral --> </mo>
-    <mn> 0 </mn>
-    <mn> 1 </mn>
-  </msubsup>
+  
+     
+     0 
+     1 
+  
 
-</math>
-
+ +``` -

Specifications

+## Specifications -

{{Specifications}}

+{{Specifications}} -

Browser compatibility

+## Browser compatibility -

{{Compat}}

+{{Compat}} -

See also

+## See also -
    -
  • {{ MathMLElement("msub") }} (Subscript)
  • -
  • {{ MathMLElement("msup") }} (Superscript)
  • -
  • {{ MathMLElement("mmultiscripts") }} (Prescripts and tensor indices)
  • -
+- {{ MathMLElement("msub") }} (Subscript) +- {{ MathMLElement("msup") }} (Superscript) +- {{ MathMLElement("mmultiscripts") }} (Prescripts and tensor indices) diff --git a/files/en-us/web/mathml/element/msup/index.md b/files/en-us/web/mathml/element/msup/index.md index 0215175c8c61eb6..fc24a9866e8bc07 100644 --- a/files/en-us/web/mathml/element/msup/index.md +++ b/files/en-us/web/mathml/element/msup/index.md @@ -8,58 +8,55 @@ tags: - MathML:Script and Limit Schemata browser-compat: mathml.elements.msup --- -
{{MathMLRef}}
+{{MathMLRef}} -

The MathML <msup> element is used to attach a superscript to an expression.

+The MathML `` element is used to attach a superscript to an expression. -

It uses the following syntax: <msup> base superscript </msup>.

+It uses the following syntax: ` base superscript `. -

Attributes

+## Attributes -
-
class, id, style
-
Provided for use with stylesheets.
-
displaystyle
-
A Boolean value specifying whether more vertical space is used for displayed equations or, if set to false, a more compact layout is used to display formulas. The main effect is that larger versions of operators are displayed, when displaystyle is set to true. See also movablelimits on {{ MathMLElement("mo") }}.
-
href
-
Used to set a hyperlink to a specified URI.
-
mathbackground
-
The background color. You can use #rgb, #rrggbb and HTML color names.
-
mathcolor
-
The text color. You can use #rgb, #rrggbb and HTML color names.
-
superscriptshift {{deprecated_inline}}
-
The minimum space by which to shift the superscript up from the baseline of the expression, as a length value.
- This attribute is deprecated and will be removed in the future.
-
+- `class`, `id`, `style` + - : Provided for use with [stylesheets](/en-US/docs/Web/CSS). +- `displaystyle` + - : A Boolean value specifying whether more vertical space is used for displayed equations or, if set to `false`, a more compact layout is used to display formulas. The main effect is that larger versions of operators are displayed, when `displaystyle` is set to `true`. See also `movablelimits` on {{ MathMLElement("mo") }}. +- `href` + - : Used to set a hyperlink to a specified URI. +- `mathbackground` + - : The background color. You can use `#rgb`, `#rrggbb` and [HTML color names](/en-US/docs/Web/CSS/color_value#color_keywords). +- `mathcolor` + - : The text color. You can use `#rgb`, `#rrggbb` and [HTML color names](/en-US/docs/Web/CSS/color_value#color_keywords). +- `superscriptshift` {{deprecated_inline}} + - : The minimum space by which to shift the superscript up from the baseline of the expression, as a [length value.](/en-US/docs/Web/MathML/Attribute/Values#lengths) + This attribute is deprecated and will be removed in the future. -

Examples

+## Examples -

Sample rendering: x1

+Sample rendering: ![x1](msup.png) -

Rendering in your browser: X 2

+Rendering in your browser: X 2 -
<math>
+```html
+
 
-  <msup>
-    <mi>X</mi>
-    <mn>2</mn>
-  </msup>
+  
+    X
+    2
 
-</math>
-
+ +``` -

Specifications

+## Specifications -

{{Specifications}}

+{{Specifications}} -

Browser compatibility

+## Browser compatibility -

{{Compat}}

+{{Compat}} -

See also

+## See also -
    -
  • {{ MathMLElement("msub") }} (Subscript)
  • -
  • {{ MathMLElement("msubsup") }} (Subscript-superscript pair)
  • -
  • {{ MathMLElement("mmultiscripts") }} (Prescripts and tensor indices)
  • -
+- {{ MathMLElement("msub") }} (Subscript) +- {{ MathMLElement("msubsup") }} (Subscript-superscript pair) +- {{ MathMLElement("mmultiscripts") }} (Prescripts and tensor indices) diff --git a/files/en-us/web/mathml/element/mtable/index.md b/files/en-us/web/mathml/element/mtable/index.md index c7eb65d330c8f68..9fb91731c2c0e7d 100644 --- a/files/en-us/web/mathml/element/mtable/index.md +++ b/files/en-us/web/mathml/element/mtable/index.md @@ -8,97 +8,94 @@ tags: - MathML:Tabular Math browser-compat: mathml.elements.mtable --- -
{{MathMLRef}}
- -

The MathML <mtable> element allows you to create tables or matrices. Inside a <mtable> only {{ MathMLElement("mtr") }} and {{ MathMLElement("mtd") }} elements may appear. These elements are similar to {{ HTMLElement("table") }} , {{ HTMLElement("tr") }} and {{ HTMLElement("td") }} elements of HTML.

- -
-

Note: The <mtable> element resets the displaystyle attribute to false. If you want to use this element as an inline-block, you might want to set <mtable displaystyle="true">...</mtable>.

-
- -

Attributes

- -
-
align
-
Specifies the vertical alignment of the table with respect to its environment.
- Possible values are: -
    -
  • axis (default): The vertical center of the table aligns on the environment's axis (typically the minus sign).
  • -
  • baseline: The vertical center of the table aligns on the environment's baseline.
  • -
  • bottom: The bottom of the table aligns on the environments baseline.
  • -
  • center: See baseline.
  • -
  • top: The top of the table aligns on the environments baseline.
  • -
- In addition, values of the align attribute can end with a rownumber (e.g. align="center 3"). This allows you to align the specified row of the table rather than the whole table. A negative Integer value counts rows from the bottom of the table. Starting with Gecko 8.0 {{ geckoRelease("8.0") }} the interpretation of negative values has been corrected ({{ bug(601436) }}). In Gecko 17.0 {{geckoRelease("17.0")}} the parsing has been updated to treat whitespace correctly.
-
class, id, style
-
Provided for use with stylesheets.
-
columnalign
-
Specifies the horizontal alignment of the cells. Multiple values separated by space are allowed and apply to the corresponding columns (e.g. columnalign="left right center"). Possible values are: left, center (default) and right.
-
columnlines
-
Specifies column borders. Multiple values separated by space are allowed and apply to the corresponding columns (e.g. columnlines="none none solid"). Possible values are: none (default), solid and dashed.
-
columnspacing
-
Specifies the space between table columns.
-
displaystyle
-
A Boolean value specifying whether more vertical space is used for displayed equations or, if set to false, a more compact layout is used to display formulas. The main effect is that larger versions of operators are displayed, when displaystyle is set to true.
-
frame
-
Specifies borders of the entire table. Possible values are: none (default), solid and dashed.
-
framespacing
-
Specifies additional space added between the table and frame.
-
href
-
Used to set a hyperlink to a specified URI.
-
mathbackground
-
The background color. You can use #rgb, #rrggbb and HTML color names.
-
mathcolor
-
The text color. You can use #rgb, #rrggbb and HTML color names.
-
rowalign
-
Specifies the vertical alignment of the cells. Multiple values separated by space are allowed and apply to the corresponding rows (e.g. rowalign="top bottom axis"). Possible values are: axis, baseline (default), bottom, center and top.
-
rowlines
-
Specifies row borders. Multiple values separated by space are allowed and apply to the corresponding rows (e.g. rowlines="none none solid"). Possible values are: none (default), solid and dashed.
-
{{ unimplemented_inline() }} rowspacing
-
Specifies the space between table rows.
-
width
-
Specifies the width of the entire table. Accepts length values.
-
- -

Examples

- -

Alignment with row number

- -

Rendering:

- -
<math>
-
-    <mi>X</mi>
-    <mo>=</mo>
-    <mtable frame="solid" rowlines="solid" align="axis 3">
-        <mtr>
-             <mtd><mi>A</mi></mtd>
-             <mtd><mi>B</mi></mtd>
-        </mtr>
-        <mtr>
-             <mtd><mi>C</mi></mtd>
-             <mtd><mi>D</mi></mtd>
-        </mtr>
-        <mtr>
-             <mtd><mi>E</mi></mtd>
-             <mtd><mi>F</mi></mtd>
-        </mtr>
-    </mtable>
-
-</math>
-
- -

Specifications

- -

{{Specifications}}

- -

Browser compatibility

- -

{{Compat}}

- -

See also

- -
    -
  • {{ MathMLElement("mtd") }} (Table cell)
  • -
  • {{ MathMLElement("mtr") }} (Table row)
  • -
+{{MathMLRef}} + +The MathML `` element allows you to create tables or matrices. Inside a `` only {{ MathMLElement("mtr") }} and {{ MathMLElement("mtd") }} elements may appear. These elements are similar to {{ HTMLElement("table") }} , {{ HTMLElement("tr") }} and {{ HTMLElement("td") }} elements of [HTML](/en-US/docs/Web/HTML). + +> **Note:** The `` element resets the `displaystyle` attribute to `false`. If you want to use this element as an inline-block, you might want to set `...`. + +## Attributes + +- align + + - : Specifies the **vertical** alignment of the table with respect to its environment. + Possible values are: + + - `axis` (default): The vertical center of the table aligns on the environment's axis (typically the minus sign). + - `baseline`: The vertical center of the table aligns on the environment's baseline. + - `bottom`: The bottom of the table aligns on the environments baseline. + - `center`: See baseline. + - `top`: The top of the table aligns on the environments baseline. + + In addition, values of the `align` attribute can end with a _rownumber_ (e.g. `align="center 3"`). This allows you to align the specified row of the table rather than the whole table. A negative Integer value counts rows from the bottom of the table. Starting with Gecko 8.0 {{ geckoRelease("8.0") }} the interpretation of _negative_ values has been corrected ({{ bug(601436) }}). In Gecko 17.0 {{geckoRelease("17.0")}} the parsing has been updated to treat whitespace correctly. + +- class, id, style + - : Provided for use with [stylesheets](/en-US/docs/Web/CSS). +- columnalign + - : Specifies the horizontal alignment of the cells. Multiple values separated by space are allowed and apply to the corresponding columns (e.g. `columnalign="left right center"`). Possible values are: `left`, `center` (default) and `right`. +- columnlines + - : Specifies column borders. Multiple values separated by space are allowed and apply to the corresponding columns (e.g. `columnlines="none none solid"`). Possible values are: `none` (default), `solid` and `dashed`. +- columnspacing + - : Specifies the space between table columns. +- displaystyle + - : A Boolean value specifying whether more vertical space is used for displayed equations or, if set to `false`, a more compact layout is used to display formulas. The main effect is that larger versions of operators are displayed, when `displaystyle` is set to `true`. +- frame + - : Specifies borders of the entire table. Possible values are: `none` (default), `solid` and `dashed`. +- framespacing + - : Specifies additional space added between the table and frame. +- href + - : Used to set a hyperlink to a specified URI. +- mathbackground + - : The background color. You can use `#rgb`, `#rrggbb` and [HTML color names](/en-US/docs/Web/CSS/color_value#color_keywords). +- mathcolor + - : The text color. You can use `#rgb`, `#rrggbb` and [HTML color names](/en-US/docs/Web/CSS/color_value#color_keywords). +- rowalign + - : Specifies the vertical alignment of the cells. Multiple values separated by space are allowed and apply to the corresponding rows (e.g. `rowalign="top bottom axis"`). Possible values are: `axis`, `baseline` (default), `bottom`, `center` and `top`. +- rowlines + - : Specifies row borders. Multiple values separated by space are allowed and apply to the corresponding rows (e.g. `rowlines="none none solid"`). Possible values are: `none` (default), `solid` and `dashed`. +- {{ unimplemented_inline() }} rowspacing + - : Specifies the space between table rows. +- width + - : Specifies the width of the entire table. Accepts [length values](/en-US/docs/Web/MathML/Attribute/Values#lengths). + +## Examples + +### Alignment with row number + +Rendering: ![](mtable-1.png) + +```html + + + X + = + + + A + B + + + C + D + + + E + F + + + + +``` + +## Specifications + +{{Specifications}} + +## Browser compatibility + +{{Compat}} + +## See also + +- {{ MathMLElement("mtd") }} (Table cell) +- {{ MathMLElement("mtr") }} (Table row) diff --git a/files/en-us/web/mathml/element/mtd/index.md b/files/en-us/web/mathml/element/mtd/index.md index 168bdac50cb38ef..53b09420c69896a 100644 --- a/files/en-us/web/mathml/element/mtd/index.md +++ b/files/en-us/web/mathml/element/mtd/index.md @@ -8,46 +8,42 @@ tags: - MathML:Tabular Math browser-compat: mathml.elements.mtd --- -
{{MathMLRef}}
- -

The MathML <mtd> element represents a cell in a table or a matrix. It may only appear in a {{ MathMLElement("mtr") }} element. This element is similar to the {{ HTMLElement("td") }} element of HTML.

- -

Attributes

- -
-
class, id, style
-
Provided for use with stylesheets.
-
columnalign
-
Specifies the horizontal alignment of this cell and overrides values specified by {{ MathMLElement("mtable") }} or {{ MathMLElement("mtr") }}.
- Possible values are: left, center and right.
-
columnspan
-
A non-negative integer value that indicates on how many columns does the cell extend.
-
displaystyle
-
A Boolean value specifying whether more vertical space is used for displayed equations or, if set to false, a more compact layout is used to display formulas. The main effect is that larger versions of operators are displayed, when displaystyle is set to true. See also movablelimits on {{ MathMLElement("mo") }}.
-
href
-
Used to set a hyperlink to a specified URI.
-
mathbackground
-
The background color. You can use #rgb, #rrggbb and HTML color names.
-
mathcolor
-
The text color. You can use #rgb, #rrggbb and HTML color names.
-
rowalign
-
Specifies the vertical alignment of this cell and overrides values specified by {{ MathMLElement("mtable") }} or {{ MathMLElement("mtr") }}.
- Possible values are: axis, baseline, bottom, center and top.
-
rowspan
-
A non-negative integer value that indicates on how many rows does the cell extend.
-
- -

Specifications

- -

{{Specifications}}

- -

Browser compatibility

- -

{{Compat}}

- -

See also

- -
    -
  • {{ MathMLElement("mtable") }}
  • -
  • {{ MathMLElement("mtr") }}
  • -
+{{MathMLRef}} + +The MathML `` element represents a cell in a table or a matrix. It may only appear in a {{ MathMLElement("mtr") }} element. This element is similar to the {{ HTMLElement("td") }} element of [HTML](/en-US/docs/Web/HTML). + +## Attributes + +- class, id, style + - : Provided for use with [stylesheets](/en-US/docs/Web/CSS). +- columnalign + - : Specifies the horizontal alignment of this cell and overrides values specified by {{ MathMLElement("mtable") }} or {{ MathMLElement("mtr") }}. + Possible values are: `left`, `center` and `right`. +- columnspan + - : A non-negative integer value that indicates on how many columns does the cell extend. +- `displaystyle` + - : A Boolean value specifying whether more vertical space is used for displayed equations or, if set to `false`, a more compact layout is used to display formulas. The main effect is that larger versions of operators are displayed, when `displaystyle` is set to `true`. See also `movablelimits` on {{ MathMLElement("mo") }}. +- href + - : Used to set a hyperlink to a specified URI. +- mathbackground + - : The background color. You can use `#rgb`, `#rrggbb` and [HTML color names](/en-US/docs/Web/CSS/color_value#color_keywords). +- mathcolor + - : The text color. You can use `#rgb`, `#rrggbb` and [HTML color names](/en-US/docs/Web/CSS/color_value#color_keywords). +- rowalign + - : Specifies the vertical alignment of this cell and overrides values specified by {{ MathMLElement("mtable") }} or {{ MathMLElement("mtr") }}. + Possible values are: `axis`, `baseline`, `bottom`, `center` and `top`. +- rowspan + - : A non-negative integer value that indicates on how many rows does the cell extend. + +## Specifications + +{{Specifications}} + +## Browser compatibility + +{{Compat}} + +## See also + +- {{ MathMLElement("mtable") }} +- {{ MathMLElement("mtr") }} diff --git a/files/en-us/web/mathml/element/mtext/index.md b/files/en-us/web/mathml/element/mtext/index.md index 703f49d3b9f8379..0ea05c85452c10e 100644 --- a/files/en-us/web/mathml/element/mtext/index.md +++ b/files/en-us/web/mathml/element/mtext/index.md @@ -8,86 +8,135 @@ tags: - MathML:Token Elements browser-compat: mathml.elements.mtext --- -
{{MathMLRef}}
- -

The MathML <mtext> element is used to render arbitrary text with no notational meaning, such as comments or annotations.

- -

To display text with notational meaning, use {{ MathMLElement("mi") }} and {{ MathMLElement("mo") }} instead.

- -

Attributes

- -
-
class, id, style
-
Provided for use with stylesheets.
-
dir
-
The text direction. Possible values are either ltr (left to right) or rtl (right to left).
-
displaystyle
-
A Boolean value specifying whether more vertical space is used for displayed equations or, if set to false, a more compact layout is used to display formulas. The main effect is that larger versions of operators are displayed, when displaystyle is set to true. See also movablelimits on {{ MathMLElement("mo") }}.
-
href
-
Used to set a hyperlink to a specified URI.
-
mathbackground
-
The background color. You can use #rgb, #rrggbb and HTML color names.
-
mathcolor
-
The text color. You can use #rgb, #rrggbb and HTML color names.
-
mathsize
-
The size of the content. See length for possible values.
- Deprecated values are: small, normal and big. These will be removed in the future.
-
mathvariant
-
This attribute specifies the logical class of the identifier, which varies in typography. That is, although the names suggest the typographic style for the class, semantically, items with the same class are treated "the same" within an expression, which might or might not involve displaying them with the named typography. The following values are allowed: -
    -
  • normal (Default value) ; Example
  • -
  • bold ; Example
  • -
  • italic ; Example
  • -
  • bold-italic ; Example
  • -
- -
    -
  • double-struck ; Example
  • -
  • bold-fraktur ; Example
  • -
  • script ; Example
  • -
  • bold-script ; Example
  • -
  • fraktur ; Example
  • -
- -
    -
  • sans-serif ; Example
  • -
  • bold-sans-serif ; Example
  • -
  • sans-serif-italic ; Example
  • -
  • sans-serif-bold-italic ; Example
  • -
  • monospace ; Example
  • -
- -
    -
  • normal (Default) ; مثال
  • -
  • initial ; مثال
  • -
  • tailed ; مثال
  • -
  • looped ; مثال
  • -
  • stretched ; مثال
  • -
-
-
- -

Examples

- -
<math>
-
-  <mtext> Theorem of Pythagoras </mtext>
-
-  <mtext> /* comment here */ </mtext>
-
-</math>
-
- -

Specifications

- -

{{Specifications}}

- -

Browser compatibility

- -

{{Compat}}

- -

Gecko-specific notes

- -
    -
  • Some mathvariant values are only implemented starting with Gecko 28.0 (Firefox 28.0 / Thunderbird 28.0 / SeaMonkey 2.25) and require appropriate math fonts.
  • -
+{{MathMLRef}} + +The MathML \ element is used to render arbitrary text with _no_ notational meaning, such as comments or annotations. + +To display text _with_ notational meaning, use {{ MathMLElement("mi") }} and {{ MathMLElement("mo") }} instead. + +## Attributes + +- class, id, style + - : Provided for use with [stylesheets](/en-US/docs/Web/CSS). +- dir + - : The text direction. Possible values are either `ltr` (left to right) or `rtl` (right to left). +- `displaystyle` + - : A Boolean value specifying whether more vertical space is used for displayed equations or, if set to `false`, a more compact layout is used to display formulas. The main effect is that larger versions of operators are displayed, when `displaystyle` is set to `true`. See also `movablelimits` on {{ MathMLElement("mo") }}. +- href + - : Used to set a hyperlink to a specified URI. +- mathbackground + - : The background color. You can use `#rgb`, `#rrggbb` and [HTML color names](/en-US/docs/Web/CSS/color_value#color_keywords). +- mathcolor + - : The text color. You can use `#rgb`, `#rrggbb` and [HTML color names](/en-US/docs/Web/CSS/color_value#color_keywords). +- mathsize + - : The size of the content. See [length](/en-US/docs/Web/CSS/length) for possible values. + Deprecated values are: `small`, `normal` and `big`. These will be removed in the future. +- mathvariant + + - : This attribute specifies the logical class of the identifier, which varies in typography. That is, although the names suggest the typographic style for the class, semantically, items with the same class are treated "the same" within an expression, which might or might not involve displaying them with the named typography. The following values are allowed: + + - `normal` (Default value) ; + + Example + + - `bold` ; + + Example + + - `italic` ; + + Example + + - `bold-italic` ; + + Example + + + + - `double-struck` ; + + Example + + - `bold-fraktur` ; + + Example + + - `script` ; + + Example + + - `bold-script` ; + + Example + + - `fraktur` ; + + Example + + + + - `sans-serif` ; + + Example + + - `bold-sans-serif` ; + + Example + + - `sans-serif-italic` ; + + Example + + - `sans-serif-bold-italic` ; + + Example + + - `monospace` ; + + Example + + + + - `normal` (Default) ; + + مثال + + - `initial` ; + + مثال + + - `tailed` ; + + مثال + + - `looped` ; + + مثال + + - `stretched` ; + + مثال + +## Examples + +```html + + +  Theorem of Pythagoras + +  /* comment here */ + + +``` + +## Specifications + +{{Specifications}} + +## Browser compatibility + +{{Compat}} + +## Gecko-specific notes + +- Some `mathvariant` values are only implemented starting with Gecko 28.0 (Firefox 28.0 / Thunderbird 28.0 / SeaMonkey 2.25) and require appropriate [math fonts](/en-US/docs/Mozilla/MathML_Project/Fonts). diff --git a/files/en-us/web/mathml/element/mtr/index.md b/files/en-us/web/mathml/element/mtr/index.md index e25d5fa39d83e03..edcd24ec052665f 100644 --- a/files/en-us/web/mathml/element/mtr/index.md +++ b/files/en-us/web/mathml/element/mtr/index.md @@ -8,42 +8,38 @@ tags: - MathML:Tabular Math browser-compat: mathml.elements.mtr --- -
{{MathMLRef}}
+{{MathMLRef}} -

The MathML <mtr> element represents a row in a table or a matrix. It may only appear in a {{ MathMLElement("mtable") }} element. This element is similar to the {{ HTMLElement("tr") }} element of HTML.

+The MathML `` element represents a row in a table or a matrix. It may only appear in a {{ MathMLElement("mtable") }} element. This element is similar to the {{ HTMLElement("tr") }} element of [HTML](/en-US/docs/Web/HTML). -

Attributes

+## Attributes -
-
class, id, style
-
Provided for use with stylesheets.
-
columnalign
-
Overrides the horizontal alignment of cells specified by {{ MathMLElement("mtable") }} for this row.
- Possible values are: left, center and right.
-
displaystyle
-
A Boolean value specifying whether more vertical space is used for displayed equations or, if set to false, a more compact layout is used to display formulas. The main effect is that larger versions of operators are displayed, when displaystyle is set to true. See also movablelimits on {{ MathMLElement("mo") }}.
-
href
-
Used to set a hyperlink to a specified URI.
-
mathbackground
-
The background color. You can use #rgb, #rrggbb and HTML color names.
-
mathcolor
-
The text color. You can use #rgb, #rrggbb and HTML color names.
-
rowalign
-
Overrides the vertical alignment of cells specified by {{ MathMLElement("mtable") }} for this row.
- Possible values are: axis, baseline, bottom, center and top.
-
+- class, id, style + - : Provided for use with [stylesheets](/en-US/docs/Web/CSS). +- columnalign + - : Overrides the horizontal alignment of cells specified by {{ MathMLElement("mtable") }} for this row. + Possible values are: `left`, `center` and `right`. +- `displaystyle` + - : A Boolean value specifying whether more vertical space is used for displayed equations or, if set to `false`, a more compact layout is used to display formulas. The main effect is that larger versions of operators are displayed, when `displaystyle` is set to `true`. See also `movablelimits` on {{ MathMLElement("mo") }}. +- href + - : Used to set a hyperlink to a specified URI. +- mathbackground + - : The background color. You can use `#rgb`, `#rrggbb` and [HTML color names](/en-US/docs/Web/CSS/color_value#color_keywords). +- mathcolor + - : The text color. You can use `#rgb`, `#rrggbb` and [HTML color names](/en-US/docs/Web/CSS/color_value#color_keywords). +- rowalign + - : Overrides the vertical alignment of cells specified by {{ MathMLElement("mtable") }} for this row. + Possible values are: `axis`, `baseline`, `bottom`, `center` and `top`. -

Specifications

+## Specifications -

{{Specifications}}

+{{Specifications}} -

Browser compatibility

+## Browser compatibility -

{{Compat}}

+{{Compat}} -

See also

+## See also -
    -
  • {{ MathMLElement("mtable") }}
  • -
  • {{ MathMLElement("mtd") }}
  • -
+- {{ MathMLElement("mtable") }} +- {{ MathMLElement("mtd") }} diff --git a/files/en-us/web/mathml/element/munder/index.md b/files/en-us/web/mathml/element/munder/index.md index e573b79953bcc8b..596d1525cdbba93 100644 --- a/files/en-us/web/mathml/element/munder/index.md +++ b/files/en-us/web/mathml/element/munder/index.md @@ -8,64 +8,61 @@ tags: - MathML:Script and Limit Schemata browser-compat: mathml.elements.munder --- -
{{MathMLRef}}
+{{MathMLRef}} -

The MathML <munder> element is used to attach an accent or a limit under an expression. It uses the following syntax: <munder> base underscript </munder>

+The MathML `` element is used to attach an accent or a limit under an expression. It uses the following syntax: ` base underscript ` -

Attributes

+## Attributes -
-
accentunder
-
If true, the element is an accent, which is drawn closer to the base expression.
- If false (default value), the element is a limit under the base expression.
-
align {{deprecated_inline}}
-
The alignment of the underscript. Possible values are: left, center, and right.
- This attribute is deprecated and will be removed in the future. Use CSS text-align instead.
-
class, id, style
-
Provided for use with stylesheets.
-
displaystyle
-
A Boolean value specifying whether more vertical space is used for displayed equations or, if set to false, a more compact layout is used to display formulas. The main effect is that larger versions of operators are displayed, when displaystyle is set to true. See also movablelimits on {{ MathMLElement("mo") }}.
-
href
-
Used to set a hyperlink to a specified URI.
-
mathbackground
-
The background color. You can use #rgb, #rrggbb and HTML color names.
-
mathcolor
-
The text color. You can use #rgb, #rrggbb and HTML color names.
-
+- accentunder + - : If `true`, the element is an _accent_, which is drawn closer to the base expression. + If `false` (default value), the element is a _limit_ under the base expression. +- align {{deprecated_inline}} + - : The alignment of the underscript. Possible values are: `left`, `center`, and `right`. + This attribute is deprecated and will be removed in the future. Use CSS [`text-align`](/en-US/docs/Web/CSS/text-align) instead. +- class, id, style + - : Provided for use with [stylesheets](/en-US/docs/Web/CSS). +- `displaystyle` + - : A Boolean value specifying whether more vertical space is used for displayed equations or, if set to `false`, a more compact layout is used to display formulas. The main effect is that larger versions of operators are displayed, when `displaystyle` is set to `true`. See also `movablelimits` on {{ MathMLElement("mo") }}. +- href + - : Used to set a hyperlink to a specified URI. +- mathbackground + - : The background color. You can use `#rgb`, `#rrggbb` and [HTML color names](/en-US/docs/Web/CSS/color_value#color_keywords). +- mathcolor + - : The text color. You can use `#rgb`, `#rrggbb` and [HTML color names](/en-US/docs/Web/CSS/color_value#color_keywords). -

Examples

+## Examples -

Sample rendering: x+y+z

+Sample rendering: ![x+y+z](munder.png) -

Rendering in your browser: x + y + z

+Rendering in your browser: x + y + z -
<math>
+```html
+
 
-<munder accentunder="true">
-  <mrow>
-    <mi> x </mi>
-    <mo> + </mo>
-    <mi> y </mi>
-    <mo> + </mo>
-    <mi> z </mi>
-  </mrow>
-  <mo> &#x23DF; <!--BOTTOM CURLY BRACKET--> </mo>
-</munder>
+
+  
+     x 
+     + 
+     y 
+     + 
+     z 
+  
+   
+
 
-</math>
-
+ +``` -

Specifications

+## Specifications -

{{Specifications}}

+{{Specifications}} -

Browser compatibility

+## Browser compatibility -

{{Compat}}

+{{Compat}} -

See also

+## See also -
    -
  • {{ MathMLElement("mover") }} (Overscript)
  • -
  • {{ MathMLElement("munderover") }} (Underscript-overscript pair)
  • -
+- {{ MathMLElement("mover") }} (Overscript) +- {{ MathMLElement("munderover") }} (Underscript-overscript pair) diff --git a/files/en-us/web/mathml/element/munderover/index.md b/files/en-us/web/mathml/element/munderover/index.md index 1fbc3c03d371ab9..9cd70b7bb5dba3f 100644 --- a/files/en-us/web/mathml/element/munderover/index.md +++ b/files/en-us/web/mathml/element/munderover/index.md @@ -8,64 +8,61 @@ tags: - MathML:Script and Limit Schemata browser-compat: mathml.elements.munderover --- -
{{MathMLRef}}
+{{MathMLRef}} -

The MathML <munderover> element is used to attach accents or limits both under and over an expression.

+The MathML `` element is used to attach accents or limits both under and over an expression. -

It uses the following syntax: <munderover> base underscript overscript </munderover>

+It uses the following syntax: ` base underscript overscript ` -

Attributes

+## Attributes -
-
accent
-
If true, the overscript is an accent, which is drawn closer to the base expression.
- If false (default value), the overscript is a limit over the base expression.
-
accentunder
-
If true, the underscript is an accent, which is drawn closer to the base expression.
- If false (default value), the underscript is a limit under the base expression.
-
align {{deprecated_inline}}
-
The alignment of both underscript and overscript. Possible values are: left, center, and right.
- This attribute is deprecated and will be removed in the future. Use CSS text-align instead.
-
class, id, style
-
Provided for use with stylesheets.
-
displaystyle
-
A Boolean value specifying whether more vertical space is used for displayed equations or, if set to false, a more compact layout is used to display formulas. The main effect is that larger versions of operators are displayed, when displaystyle is set to true. See also movablelimits on {{ MathMLElement("mo") }}.
-
href
-
Used to set a hyperlink to a specified URI.
-
mathbackground
-
The background color. You can use #rgb, #rrggbb and HTML color names.
-
mathcolor
-
The text color. You can use #rgb, #rrggbb and HTML color names.
-
+- accent + - : If `true`, the overscript is an _accent_, which is drawn closer to the base expression. + If `false` (default value), the overscript is a _limit_ over the base expression. +- accentunder + - : If `true`, the underscript is an _accent_, which is drawn closer to the base expression. + If `false` (default value), the underscript is a _limit_ under the base expression. +- align {{deprecated_inline}} + - : The alignment of both underscript and overscript. Possible values are: `left`, `center`, and `right`. + This attribute is deprecated and will be removed in the future. Use CSS [`text-align`](/en-US/docs/Web/CSS/text-align) instead. +- class, id, style + - : Provided for use with [stylesheets](/en-US/docs/Web/CSS). +- `displaystyle` + - : A Boolean value specifying whether more vertical space is used for displayed equations or, if set to `false`, a more compact layout is used to display formulas. The main effect is that larger versions of operators are displayed, when `displaystyle` is set to `true`. See also `movablelimits` on {{ MathMLElement("mo") }}. +- href + - : Used to set a hyperlink to a specified URI. +- mathbackground + - : The background color. You can use `#rgb`, `#rrggbb` and [HTML color names](/en-US/docs/Web/CSS/color_value#color_keywords). +- mathcolor + - : The text color. You can use `#rgb`, `#rrggbb` and [HTML color names](/en-US/docs/Web/CSS/color_value#color_keywords). -

Examples

+## Examples -

Sample rendering: integral-0-infinity

+Sample rendering: ![integral-0-infinity](munderover.png) -

Rendering in your browser: 0

+Rendering in your browser: 0 -
<math displaystyle="true">
+```html
+
 
-  <munderover >
-    <mo> &#x222B; <!--INTEGRAL--> </mo>
-    <mn> 0 </mn>
-    <mi> &#x221E; <!--INFINITY--> </mi>
-  </munderover>
+  
+     
+     0 
+     
+  
 
-</math>
-
+ +``` -

Specifications

+## Specifications -

{{Specifications}}

+{{Specifications}} -

Browser compatibility

+## Browser compatibility -

{{Compat}}

+{{Compat}} -

See also

+## See also -
    -
  • {{ MathMLElement("munder") }} (Underscript)
  • -
  • {{ MathMLElement("mover") }} (Overscript)
  • -
+- {{ MathMLElement("munder") }} (Underscript) +- {{ MathMLElement("mover") }} (Overscript) diff --git a/files/en-us/web/mathml/element/semantics/index.md b/files/en-us/web/mathml/element/semantics/index.md index 11a6416c803a7a1..192e390d07a2446 100644 --- a/files/en-us/web/mathml/element/semantics/index.md +++ b/files/en-us/web/mathml/element/semantics/index.md @@ -4,102 +4,98 @@ slug: Web/MathML/Element/semantics tags: - MathML - MathML Reference - - 'MathML:Element' + - MathML:Element browser-compat: mathml.elements.semantics --- -
{{MathMLRef}}
- -

In MathML there are two ways to mark up mathematics: Presentation MathML is used to control the layout of equations, whereas Content MathML is designed to encode the semantic mathematical meaning and to make expressions understandable to computer algebra systems. The MathML elements <semantics>, <annotation> and <annotation-xml> are used to combine presentation and content markup and to provide both, layout information and semantic meaning of mathematical expressions.

- -

The <semantics> element acts as a container element associating annotations and must have child elements (it will raise an invalid markup error otherwise). The <annotation> element is the container element containing semantic information in a non-XML format, whereas the <annotation-xml> element contains content in an XML format, e.g. Content MathML or OpenMath.

- -

The rules of determining the visible child in a <semantics> element are the following:

- -
    -
  • If no rule other rule applies: By default only the first child is rendered, which is supposed to be presentation markup.
  • -
  • If the first child is a presentation MathML element other than <annotation> or <annotation-xml>, render the first child.
  • -
  • If no Presentation MathML is found, render the first <annotation> or <annotation-xml> child element of <semantics>.
    - Beware that <annotation-xml> elements are only recognized, if the encoding attribute is set to one of the following: -
      -
    • "application/mathml-presentation+xml"
    • -
    • "MathML-Presentation"
    • -
    • "SVG1.1"
    • -
    • "text/html"
    • -
    • "image/svg+xml"
    • -
    • "application/xml".
    • -
    - Note that "application/mathml+xml" is not mentioned here as it does not distinguish between Content or Presentation MathML.
  • -
- -

Attributes

- -

The following attributes can be set on <annotation> and <annotation-xml>:

- -
-
definitionURL
-
The location of the annotation key symbol.
-
displaystyle
-
A Boolean value specifying whether more vertical space is used for displayed equations or, if set to false, a more compact layout is used to display formulas. The main effect is that larger versions of operators are displayed, when displaystyle is set to true. See also movablelimits on {{ MathMLElement("mo") }}.
-
encoding
-
The encoding of the semantic information in the annotation (e.g. "MathML-Content", "MathML-Presentation", "application/openmath+xml", "image/png")
-
cd
-
The content dictionary that contains the annotation key symbol.
-
name
-
The name of the annotation key symbol.
-
src
-
The location of an external source for semantic information.
-
- -

Example

- -
<math>
-  <semantics>
-
-    <!-- Presentation MathML -->
-    <mrow>
-      <msup>
-        <mi>x</mi>
-        <mn>2</mn>
-      </msup>
-      <mo>+</mo>
-      <mi>y</mi>
-    </mrow>
-
-    <!-- Content MathML -->
-    <annotation-xml encoding="MathML-Content">
-      <apply>
-        <plus/>
-        <apply>
-          <power/>
-          <ci>x</ci>
-          <cn type="integer">2</cn>
-        </apply>
-        <ci>y</ci>
-      </apply>
-    </annotation-xml>
-
-    <!-- annotate an image -->
-    <annotation encoding="image/png" src="some/path/formula.png"/>
-
-    <!-- annotate TeX -->
-    <annotation encoding="application/x-tex">
+{{MathMLRef}}
+
+In MathML there are two ways to mark up mathematics: _Presentation_ MathML is used to control the layout of equations, whereas _Content_ MathML is designed to encode the semantic mathematical meaning and to make expressions understandable to computer algebra systems. The MathML elements ``, `` and `` are used to combine presentation and content markup and to provide both, layout information and semantic meaning of mathematical expressions.
+
+The `` element acts as a container element associating annotations and must have child elements (it will raise an _invalid markup_ error otherwise). The `` element is the container element containing semantic information in a non-XML format, whereas the `` element contains content in an XML format, e.g. Content MathML or OpenMath.
+
+The rules of determining the visible child in a `` element are the following:
+
+- If no rule other rule applies: By default only the first child is rendered, which is supposed to be presentation markup.
+- If the first child is a presentation MathML element other than `` or ``, render the first child.
+- If no Presentation MathML is found, render the first `` or `` child element of ``.
+  Beware that `` elements are only recognized, if the encoding attribute is set to one of the following:
+
+  - `"application/mathml-presentation+xml"`
+  - `"MathML-Presentation"`
+  - `"SVG1.1"`
+  - `"text/html"`
+  - `"image/svg+xml"`
+  - `"application/xml`".
+
+  Note that `"application/mathml+xml"` is _not_ mentioned here as it does not distinguish between Content or Presentation MathML.
+
+## Attributes
+
+The following attributes can be set on `` and ``:
+
+- definitionURL
+  - : The location of the annotation key symbol.
+- `displaystyle`
+  - : A Boolean value specifying whether more vertical space is used for displayed equations or, if set to `false`, a more compact layout is used to display formulas. The main effect is that larger versions of operators are displayed, when `displaystyle` is set to `true`. See also `movablelimits` on {{ MathMLElement("mo") }}.
+- encoding
+  - : The encoding of the semantic information in the annotation (e.g. "MathML-Content", "MathML-Presentation", "application/openmath+xml", "image/png")
+- cd
+  - : The content dictionary that contains the annotation key symbol.
+- name
+  - : The name of the annotation key symbol.
+- src
+  - : The location of an external source for semantic information.
+
+## Example
+
+```html
+
+  
+
+    
+    
+      
+        x
+        2
+      
+      +
+      y
+    
+
+    
+    
+      
+        
+        
+          
+          x
+          2
+        
+        y
+      
+    
+
+    
+    
+
+    
+    
       x^{2} + y
-    </annotation>
+    
 
-  </semantics>
-</math>
+ + +``` -

Specifications

+## Specifications -

{{Specifications}}

+{{Specifications}} -

Browser compatibility

+## Browser compatibility -

{{Compat}}

+{{Compat}} -

Gecko-specific notes

+## Gecko-specific notes -
    -
  • The algorithm of determining the visible child in <semantics> has been corrected in {{geckoRelease("23")}} to match the MathML specification. In prior versions the first child element has been rendered.
  • -
  • In Gecko <annotation> and <annotation-xml> elements are ignored if the src attribute is set.
  • -
+- The algorithm of determining the visible child in `` has been corrected in {{geckoRelease("23")}} to match the MathML specification. In prior versions the first child element has been rendered. +- In Gecko `` and `` elements are ignored if the `src` attribute is set. diff --git a/files/en-us/web/mathml/examples/deriving_the_quadratic_formula/index.md b/files/en-us/web/mathml/examples/deriving_the_quadratic_formula/index.md index feeccb71c5755f3..38d6105f09ee901 100644 --- a/files/en-us/web/mathml/examples/deriving_the_quadratic_formula/index.md +++ b/files/en-us/web/mathml/examples/deriving_the_quadratic_formula/index.md @@ -10,429 +10,151 @@ tags: - MathML - NeedsBeginnerUpdate --- -

This page outlines the derivation of the Quadratic Formula.

+This page outlines the derivation of the Quadratic Formula. -

We take a quadratic equation in its general form, and solve for x:

+We take a quadratic equation in its general form, and solve for x: -

- - - - - - - - a - - - x - 2 - - - + - b - - x - - + - c - - = - 0 - - - - - - - - - a - - - x - 2 - - - + - b - - x - - - = - - - c - - - - - - - - - - x - 2 - - - + - - - b - - a - - - x - - - = - - - - - c - - a - - - - Divide out leading coefficient. - - - - - - - - - - - x - 2 - - - + - - - b - - a - - - x - + - - - - - b - - - 2 - a - - - - 2 - - - = - - - - - c - ( - 4 - a - ) - - - a - ( - 4 - a - ) - - - - + - - - - b - 2 - - - - 4 - - a - 2 - - - - - - Complete the square. - - - - - - - - - ( - x - + - - - b - - - 2 - a - - - ) - ( - x - + - - - b - - - 2 - a - - - ) - = - - - - b - 2 - - - - 4 - a - c - - - 4 - - a - 2 - - - - - - - Discriminant revealed. - - - - - - - - - - - - ( - x - + - - - b - - - 2 - a - - - ) - - 2 - - = - - - - b - 2 - - - - 4 - a - c - - - 4 - - a - 2 - - - - - - - - - - - - - - - - - - x - + - - - b - - - 2 - a - - - - = - - - - - b - 2 - - - - 4 - a - c - - - 4 - - a - 2 - - - - - - - - - - - - - - - - - - - x - - = - - - - - b - - - 2 - a - - - ± - - { - C - } - - - - - - b - 2 - - - - 4 - a - c - - - 4 - - a - 2 - - - - - - - - There's the vertex formula. - - - - - - - - - - - x - - = - - - - - b - ± - - { - C - } - - - - b - 2 - - - - 4 - a - c - - - - 2 - a - - - - - - - - - - - - -

+a + +x +2 ++ b + +x ++ c += +0 +a + +x +2 ++ b + +x += +- +c +x +2 ++ b +a + +x += +- +c +a +Divide out leading coefficient. +x +2 ++ b +a + +x ++ b +2 +a +2 += +- +c +( +4 +a +) +a +( +4 +a +) ++ b +2 +4 +a +2 +Complete the square. +( +x ++ b +2 +a +) +( +x ++ b +2 +a +) += +b +2 +- 4 +a +c +4 +a +2 +Discriminant revealed. +( +x ++ b +2 +a +) +2 += +b +2 +- 4 +a +c +4 +a +2 +x ++ b +2 +a += +b +2 +- 4 +a +c +4 +a +2 +x += +- +b +2 +a +± +{ +C +} +b +2 +- 4 +a +c +4 +a +2 +There's the vertex formula. +x += +- +b +± +{ +C +} +b +2 +- 4 +a +c +2 +a diff --git a/files/en-us/web/mathml/examples/index.md b/files/en-us/web/mathml/examples/index.md index a3736abfcdbf91c..9b171935eecfc8a 100644 --- a/files/en-us/web/mathml/examples/index.md +++ b/files/en-us/web/mathml/examples/index.md @@ -8,13 +8,11 @@ tags: - MathML - NeedsBeginnerUpdate --- -

Below you'll find some examples you can look at to help you to understand how to use MathML to display increasingly complex mathematical concepts in Web content.

+Below you'll find some examples you can look at to help you to understand how to use MathML to display increasingly complex mathematical concepts in Web content. -
-
Pythagorean Theorem
-
Small example showing a proof of the Pythagorean Theorem.
-
Deriving the Quadratic Formula
-
Outlines the derivation of the Quadratic Formula.
-
MathML Torture Test
-
Large set of test markup.
-
+- [Pythagorean Theorem](/en-US/docs/Web/MathML/Examples/MathML_Pythagorean_Theorem) + - : Small example showing a proof of the Pythagorean Theorem. +- [Deriving the Quadratic Formula](/en-US/docs/Web/MathML/Examples/Deriving_the_Quadratic_Formula) + - : Outlines the derivation of the Quadratic Formula. +- [MathML Torture Test](https://fred-wang.github.io/MathFonts/mozilla_mathml_test/) + - : Large set of test markup. diff --git a/files/en-us/web/mathml/examples/mathml_pythagorean_theorem/index.md b/files/en-us/web/mathml/examples/mathml_pythagorean_theorem/index.md index 31a47ee42e4f114..0ade79fc34b6eb0 100644 --- a/files/en-us/web/mathml/examples/mathml_pythagorean_theorem/index.md +++ b/files/en-us/web/mathml/examples/mathml_pythagorean_theorem/index.md @@ -10,120 +10,27 @@ tags: - MathML - NeedsBeginnerUpdate --- -

We will now prove the Pythagorean theorem:

+We will now prove the Pythagorean theorem: -

Statement: In a right angled triangle, the square of the hypotenuse is equal to the sum of the - squares of the other two sides.

+**Statement**: In a right angled triangle, the square of the hypotenuse is equal to the sum of the +squares of the other two sides. -

i.e, If a and b are the legs and c is the hypotenuse then - - -   a - 2 - - + - - b - 2 - - = - - c - 2 - - - .

+i.e, If a and b are the legs and c is the hypotenuse then +  a 2 ++ b 2 += c 2 +. -

Proof:  We can prove the theorem algebraically by showing that the area of the big square - equals the area of the inner square (hypotenuse squared) plus the area of the four triangles:

+**Proof:**  We can prove the theorem algebraically by showing that the area of the big square +equals the area of the inner square (hypotenuse squared) plus the area of the four triangles: - - - - - - - ( - a - + - b - ) - - 2 - - - - = - - - - c - 2 - - + - 4 - - ( - - 1 - 2 - - a - b - ) - - - - - - a - 2 - - + - 2 - a - b - + - - b - 2 - - - - = - - - - c - 2 - - + - 2 - a - b - - - - - - a - 2 - - + - - b - 2 - - - - = - - - - c - 2 - - - - - +( a + b ) 2 = c 2 ++ 4 ( +1 2 a b ) +a 2 ++ 2 a b + b 2 += c 2 ++ 2 a b +a 2 ++ b 2 += c 2 diff --git a/files/en-us/web/mathml/fonts/index.md b/files/en-us/web/mathml/fonts/index.md index b26fea0788abf1c..ec0109f0bb8bbc9 100644 --- a/files/en-us/web/mathml/fonts/index.md +++ b/files/en-us/web/mathml/fonts/index.md @@ -6,135 +6,131 @@ tags: - MathML - Project --- -

Fonts with appropriate Unicode coverage and Open Font Format features are required for good math rendering. - This page describes how users can install and use such math fonts with Mozilla's MathML engine. - Note that most of these instructions may as well apply to other Web rendering engines.

+Fonts with appropriate Unicode coverage and Open Font Format features are required for good math rendering. +This page describes how users can install and use such math fonts with Mozilla's MathML engine. +Note that most of these instructions may as well apply to other Web rendering engines. -

Installation Instructions

+## Installation Instructions -

Windows

+### Windows -

Install the Latin Modern Math and STIX fonts as follows:

+Install the _Latin Modern Math_ and _STIX_ fonts as follows: -
    -
  1. Download latinmodern-math-1959.zip.
  2. -
  3. Open the ZIP archive, move inside the latinmodern-math-1959 directory and then inside the otf directory. You will find a latinmodern-math font file.
  4. -
  5. Open the latinmodern-math font file and click the Install button.
  6. -
  7. Download static_otf.zip.
  8. -
  9. Open the static_otf.zip ZIP archive, and then move inside the static_otf directory. Among the files there, you will find a STIXTwoMath-Regular file.
  10. -
  11. Open the STIXTwoMath-Regular file and click the Install button. If desired, you may also do the same for the other font files.
  12. -
+1. Download [latinmodern-math-1959.zip](http://www.gust.org.pl/projects/e-foundry/lm-math/download/latinmodern-math-1959.zip). +2. Open the ZIP archive, move inside the `latinmodern-math-1959` directory and then inside the `otf` directory. You will find a `latinmodern-math` font file. +3. Open the `latinmodern-math` font file and click the `Install` button. +4. Download [static_otf.zip](https://github.com/stipub/stixfonts/raw/master/zipfiles/static_otf.zip). +5. Open the `static_otf.zip` ZIP archive, and then move inside the `static_otf` directory. Among the files there, you will find a `STIXTwoMath-Regular` file. +6. Open the `STIXTwoMath-Regular` file and click the `Install` button. If desired, you may also do the same for the other font files. -
-

Note: Cambria Math is installed by default on Windows 7 and later versions and should ensure relatively good MathML rendering. An enhancement request has been submitted to Microsoft to install Latin Modern Math and STIX by default.

-
+> **Note:** _Cambria Math_ is installed by default on Windows 7 and later versions and should ensure relatively good MathML rendering. [An enhancement request has been submitted to Microsoft to install Latin Modern Math and STIX by default](https://windows.uservoice.com/forums/265757-windows-feature-suggestions/suggestions/9727281-add-new-math-fonts-latin-modern-math-and-stix-2). -

OS X

+### OS X -

Install the Latin Modern Math and STIX fonts as follows:

+Install the _Latin Modern Math_ and _STIX_ fonts as follows: -
    -
  1. Download latinmodern-math-1959.zip.
  2. -
  3. Extract the ZIP archive, move inside the latinmodern-math-1959 directory and then inside the otf directory. You will find a latinmodern-math font file.
  4. -
  5. Double-click the latinmodern-math font file click the "Install the font" button from the window that opens.
  6. -
  7. Download static_otf.zip.
  8. -
  9. Open the static_otf.zip ZIP archive, and then move inside the static_otf directory. Among the files there, you will find a STIXTwoMath-Regular.otf file.
  10. -
  11. Open the STIXTwoMath-Regular.otf file and click the Install Font button from the window that opens. If desired, you may also do the same for the other font files.
  12. -
+1. Download [latinmodern-math-1959.zip](http://www.gust.org.pl/projects/e-foundry/lm-math/download/latinmodern-math-1959.zip). +2. Extract the ZIP archive, move inside the `latinmodern-math-1959` directory and then inside the `otf` directory. You will find a `latinmodern-math` font file. +3. Double-click the `latinmodern-math` font file click the "Install the font" button from the window that opens. +4. Download [static_otf.zip](https://github.com/stipub/stixfonts/raw/master/zipfiles/static_otf.zip). +5. Open the `static_otf.zip` ZIP archive, and then move inside the `static_otf` directory. Among the files there, you will find a `STIXTwoMath-Regular.otf` file. +6. Open the `STIXTwoMath-Regular.otf` file and click the **Install Font** button from the window that opens. If desired, you may also do the same for the other font files. -
-

Note: A deprecated version of STIX is preinstalled starting with OS X Lion and should ensure relatively good MathML rendering. Enhancement requests have been submitted to Apple to ship OpenType MATH fonts in the default installation. If you have a developer account, these are problems 16841023 and 17021145.

-
+> **Note:** A deprecated version of STIX is preinstalled starting with OS X Lion and should ensure relatively good MathML rendering. Enhancement requests have been submitted to Apple to ship OpenType MATH fonts in the default installation. If you have a developer account, these are problems 16841023 and 17021145. -

Linux

+### Linux -

Install the Latin Modern Math, STIX or XITS fonts, which are generally available from your package manager.

+Install the _Latin Modern Math_, _STIX_ or _XITS_ fonts, which are generally available from your package manager. -

On Debian/Ubuntu/Mint and other Debian-based distributions, use the following command:

+On Debian/Ubuntu/Mint and other Debian-based distributions, use the following command: -
sudo apt-get install fonts-lmodern fonts-stix
+```bash +sudo apt-get install fonts-lmodern fonts-stix +``` -

On Fedora and other Fedora-based distributions, use the following command (stix-math-fonts is often already installed):

+On Fedora and other Fedora-based distributions, use the following command (`stix-math-fonts` is often already installed): -
sudo dnf install texlive-lm-math stix-math-fonts
+```bash +sudo dnf install texlive-lm-math stix-math-fonts +``` -

On openSUSE and other openSUSE-based distributions, use the following command:

+On openSUSE and other openSUSE-based distributions, use the following command: -
sudo zypper install texlive-lm-math stix-fonts
+```plain +sudo zypper install texlive-lm-math stix-fonts +``` -

On other Linux distributions, consider installing appropriate texlive packages, which includes Latin Modern Math and XITS:

+On other Linux distributions, consider installing appropriate `texlive` packages, which includes _Latin Modern Math_ and _XITS_: -
sudo pacman -S texlive-core texlive-fontsextra # Arch Linux
+```bash
+sudo pacman -S texlive-core texlive-fontsextra # Arch Linux
 sudo urpmi texlive-dist texlive-fontsextra # Mageia
-
+``` -

However, you might need to ensure that the fonts are known by your system. Typically,  use a fontconfig configuration /etc/fonts/conf.avail/09-texlive-fonts.conf that points to the opentype directory of TeXLive, such as:

+However, you might need to ensure that the fonts are known by your system. Typically,  use a fontconfig configuration `/etc/fonts/conf.avail/09-texlive-fonts.conf` that points to the `opentype` directory of TeXLive, such as: -
<?xml version="1.0"?>
-<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
-<fontconfig>
-  <dir>/your/path/to/texmf-dist/fonts/opentype</dir>
-</fontconfig>
+```plain + + + + /your/path/to/texmf-dist/fonts/opentype + +``` -

Finally, add this configuration file to the system font location list and regenerate the fontconfig cache:

+Finally, add this configuration file to the system font location list and regenerate the fontconfig cache: -
ln -sf /etc/fonts/conf.avail/09-texlive-fonts.conf /etc/fonts/conf.d/
+```plain
+ln -sf /etc/fonts/conf.avail/09-texlive-fonts.conf /etc/fonts/conf.d/
 fc-cache -sf
-
+``` -

Android

+### Android -

You must use the MathML-fonts add-on.

+You must use the [MathML-fonts add-on](https://addons.mozilla.org/firefox/addon/mathml-fonts/). -
-

Note: There is an enhancement request opened on the Noto bug tracker to improve math support.

-
+> **Note:** There is an [enhancement request](https://github.com/googlei18n/noto-fonts/issues/330) opened on the Noto bug tracker to improve math support. -

Firefox OS

+### Firefox OS -

You must use the MathML-fonts add-on.

+You must use the [MathML-fonts add-on](https://addons.mozilla.org/firefox/addon/mathml-fonts/). -
-

Note: We plan to bundle a MATH font in the default installation.

-
+> **Note:** We [plan to bundle](https://bugzilla.mozilla.org/show_bug.cgi?id=775060) a [MATH font](#Fonts_with_a_MATH_table) in the default installation. -

Other systems

+### Other systems -

On other systems, consider installing a MATH font using your package manager. Note that these fonts are generally delivered with TeX distributions such as TeX Live, but you might need to follow specific instructions so that your system is aware of the fonts. As a last resort, install the MathML fonts add-on.

+On other systems, consider installing a [MATH font](#Fonts_with_a_MATH_table) using your package manager. Note that these fonts are generally delivered with TeX distributions such as [TeX Live](https://www.tug.org/texlive/), but you might need to follow specific instructions so that your system is aware of the fonts. As a last resort, install the [MathML fonts add-on](https://addons.mozilla.org/firefox/addon/mathml-fonts/). -

Advanced setup

+## Advanced setup -

Arabic Mathematical Alphabetic Symbols

+### Arabic Mathematical Alphabetic Symbols -

Currently, very few fonts have appropriate glyphs for the Arabic Mathematical Alphabetic Symbols. If you are likely to need these characters, we recommend to install the XITS or Amiri fonts.

+Currently, very few fonts have appropriate glyphs for the Arabic Mathematical Alphabetic Symbols. If you are likely to need these characters, we recommend to install the XITS or [Amiri](https://www.amirifont.org/) fonts. -

Installation without Administrator Privilege

+### Installation without Administrator Privilege -

If you need to install fonts on a system without adminstrator privilege, the easiest option is to use math font the MathML-fonts add-on. Note that using the add-on is not optimal since it forces your Gecko browser to load a CSS stylesheet on each page you visit as well as Web math fonts on all pages with MathML content. A better alternative on UNIX systems is to install the OTF files for Latin Modern Math and STIX into some local font folder and (if necessary) to run fc-cache on it. On OS X and Linux, the standard paths are ~/Library/Fonts/ and ~/.fonts.

+If you need to install fonts on a system without adminstrator privilege, the easiest option is to use math font the [MathML-fonts add-on](https://addons.mozilla.org/firefox/addon/mathml-fonts/). Note that using the add-on is not optimal since it forces your Gecko browser to load a CSS stylesheet on each page you visit as well as Web math fonts on all pages with MathML content. A better alternative on UNIX systems is to install the OTF files for [Latin Modern Math](http://www.gust.org.pl/projects/e-foundry/lm-math/download/latinmodern-math-1959.zip) and [STIX](https://github.com/stipub/stixfonts) into some local font folder and (if necessary) to run `fc-cache` on it. On OS X and Linux, the standard paths are `~/Library/Fonts/` and `~/.fonts`. -

Fonts with a MATH table

+### Fonts with a MATH table -

You can actually render MathML using any font with a MATH table and related Open Font Format features. A list of such math fonts is provided below. You can use the advanced font preference menu to configure the default font for mathematics. Alternatively, you can try the MathML-fontsettings add-on.

+You can actually render MathML using any font with a MATH table and related Open Font Format features. A list of such math fonts is provided below. You can use the _advanced font preference menu_ to configure the default font for mathematics. Alternatively, you can try the [MathML-fontsettings add-on](https://addons.mozilla.org/en-US/firefox/addon/mathml-font-settings/). - +- [Asana Math](https://www.ctan.org/tex-archive/fonts/Asana-Math/) +- [Cambria Math](https://www.microsoft.com/typography/fonts/family.aspx?FID=360) +- [DejaVu Math TeX Gyre](https://sourceforge.net/projects/dejavu/files/dejavu/) +- [Garamond Math](https://github.com/YuanshengZhao/Garamond-Math) (under development) +- [Latin Modern Math](http://www.gust.org.pl/projects/e-foundry/lm-math) +- [Libertinus Math](https://github.com/khaledhosny/libertinus) +- [STIX Math](https://github.com/stipub/stixfonts) +- [TeX Gyre Bonum Math](http://www.gust.org.pl/projects/e-foundry/tg-math/download/index_html#Bonum_Math) +- [TeX Gyre Pagella Math](http://www.gust.org.pl/projects/e-foundry/tg-math/download/index_html#Pagella_Math) +- [TeX Gyre Schola Math](http://www.gust.org.pl/projects/e-foundry/tg-math/download/index_html#Schola_Math) +- [TeX Gyre Termes Math](http://www.gust.org.pl/projects/e-foundry/tg-math/download/index_html#Termes_Math) +- [XITS Math](https://github.com/khaledhosny/xits-math/releases) +- [Fira Math](https://github.com/firamath/firamath) (sans-serif typeface, under development) +- [GFS Neohellenic Math](https://greekfontsociety-gfs.gr/typefaces/Math) (sans-serif typeface) -

Using mathematical fonts on Web pages

+### Using mathematical fonts on Web pages -

Starting with Gecko 31.0 (Firefox 31.0 / Thunderbird 31.0 / SeaMonkey 2.28), it is now easy to set up the CSS style (and optional WOFF fonts) to use on your Web site. - See the Authoring MathML page for details. - You can use FontTools to edit the MATH table and create your own mathematical fonts.

+Starting with Gecko 31.0 (Firefox 31.0 / Thunderbird 31.0 / SeaMonkey 2.28), it is now easy to set up the CSS style (and optional WOFF fonts) to use on your Web site. +See the [Authoring MathML page](/en-US/docs/Web/MathML/Authoring#mathematical_fonts) for details. +You can use [FontTools](https://github.com/behdad/fonttools) to edit the MATH table and create your own mathematical fonts. diff --git a/files/en-us/web/mathml/fonts/test/index.md b/files/en-us/web/mathml/fonts/test/index.md index 61f29e753bab9a2..28223d8506a9020 100644 --- a/files/en-us/web/mathml/fonts/test/index.md +++ b/files/en-us/web/mathml/fonts/test/index.md @@ -2,98 +2,98 @@ title: Test slug: Web/MathML/Fonts/Test --- -

You should see a grid with perfectly straight black lines. If not, please consider installing some MathML fonts.

+You should see a grid with perfectly straight black lines. If not, please consider installing some [MathML fonts](/en-US/docs/Web/MathML/Fonts). -

Test grid

+## Test grid -
+```html
 
-<div style="width: 540px; height: 540px; background: #eef;">
-  <div style="position: absolute;">
-    <div style="position: absolute; left: 20px; top: 20px;">
-      <div style="position: absolute;">
-        <div style="position: absolute; top: 0; left: 0;">
-          <math><mo minsize="500px">√</mo></math></div>
-        <div style="position: absolute; top: 0; left: 30px;">
-          <math><mo minsize="500px">√</mo></math></div>
-        <div style="position: absolute; top: 0; left: 60px;">
-          <math><mo minsize="500px">√</mo></math></div>
-        <div style="position: absolute; top: 0; left: 90px;">
-          <math><mo minsize="500px">√</mo></math></div>
-        <div style="position: absolute; top: 0; left: 120px;">
-          <math><mo minsize="500px">√</mo></math></div>
-        <div style="position: absolute; top: 0; left: 150px;">
-          <math><mo minsize="500px">√</mo></math></div>
-        <div style="position: absolute; top: 0; left: 180px;">
-          <math><mo minsize="500px">√</mo></math></div>
-        <div style="position: absolute; top: 0; left: 210px;">
-          <math><mo minsize="500px">√</mo></math></div>
-        <div style="position: absolute; top: 0; left: 240px;">
-          <math><mo minsize="500px">√</mo></math></div>
-        <div style="position: absolute; top: 0; left: 270px;">
-          <math><mo minsize="500px">√</mo></math></div>
-        <div style="position: absolute; top: 0; left: 300px;">
-          <math><mo minsize="500px">√</mo></math></div>
-        <div style="position: absolute; top: 0; left: 330px;">
-          <math><mo minsize="500px">√</mo></math></div>
-        <div style="position: absolute; top: 0; left: 360px;">
-          <math><mo minsize="500px">√</mo></math></div>
-        <div style="position: absolute; top: 0; left: 390px;">
-          <math><mo minsize="500px">√</mo></math></div>
-        <div style="position: absolute; top: 0; left: 420px;">
-          <math><mo minsize="500px">√</mo></math></div>
-        <div style="position: absolute; top: 0; left: 450px;">
-          <math><mo minsize="500px">√</mo></math></div>
-      </div>
-      <div style="position: absolute;">
-        <div style="position: absolute; top: 0; left: 0;">
-          <math> <mover><mo>⏜</mo><mspace width="500px"></mspace></mover> </math></div>
-        <div style="position: absolute; top: 30px; left: 0;">
-          <math> <mover><mo>⏜</mo><mspace width="500px"></mspace></mover> </math></div>
-        <div style="position: absolute; top: 60px; left: 0;">
-          <math> <mover><mo>⏜</mo><mspace width="500px"></mspace></mover> </math></div>
-        <div style="position: absolute; top: 90px; left: 0;">
-          <math> <mover><mo>⏜</mo><mspace width="500px"></mspace></mover> </math></div>
-        <div style="position: absolute; top: 120px; left: 0;">
-          <math> <mover><mo>⏜</mo><mspace width="500px"></mspace></mover> </math></div>
-        <div style="position: absolute; top: 150px; left: 0;">
-          <math> <mover><mo>⏜</mo><mspace width="500px"></mspace></mover> </math></div>
-        <div style="position: absolute; top: 180px; left: 0;">
-          <math> <mover><mo>⏜</mo><mspace width="500px"></mspace></mover> </math></div>
-        <div style="position: absolute; top: 210px; left: 0;">
-          <math> <mover><mo>⏜</mo><mspace width="500px"></mspace></mover> </math></div>
-        <div style="position: absolute; top: 240px; left: 0;">
-          <math> <mover><mo>⏜</mo><mspace width="500px"></mspace></mover> </math></div>
-        <div style="position: absolute; top: 270px; left: 0;">
-          <math> <mover><mo>⏜</mo><mspace width="500px"></mspace></mover> </math></div>
-        <div style="position: absolute; top: 300px; left: 0;">
-          <math> <mover><mo>⏜</mo><mspace width="500px"></mspace></mover> </math></div>
-        <div style="position: absolute; top: 330px; left: 0;">
-          <math> <mover><mo>⏜</mo><mspace width="500px"></mspace></mover> </math></div>
-        <div style="position: absolute; top: 360px; left: 0;">
-          <math> <mover><mo>⏜</mo><mspace width="500px"></mspace></mover> </math></div>
-        <div style="position: absolute; top: 390px; left: 0;">
-          <math> <mover><mo>⏜</mo><mspace width="500px"></mspace></mover> </math></div>
-        <div style="position: absolute; top: 420px; left: 0;">
-          <math> <mover><mo>⏜</mo><mspace width="500px"></mspace></mover> </math></div>
-        <div style="position: absolute; top: 450px; left: 0;">
-          <math> <mover><mo>⏜</mo><mspace width="500px"></mspace></mover> </math></div>
-      </div>
-      <div style="position: absolute;">
-        <div style="position: absolute; background: #eef; top: -20px; height: 40px; width: 500px;">
-           </div>
-        <div style="position: absolute; background: #eef; top: 480px; height: 40px; width: 500px;">
-           </div>
-      </div>
-      <div style="position: absolute;">
-        <div style="position: absolute; background: #eef; left: -20px; width: 40px; height: 500px;">
-           </div>
-        <div style="position: absolute; background: #eef; left: 480px; width: 40px; height: 500px;">
-           </div>
-      </div>
-    </div>
-  </div>
-</div>
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+  
+
+  
+
+
+
+  
+
+  
+
+
+
+
+``` {{EmbedLiveSample("Test_grid", 100, 570)}} diff --git a/files/en-us/web/mathml/index.md b/files/en-us/web/mathml/index.md index adf054534ae3267..183643b96b6bfc2 100644 --- a/files/en-us/web/mathml/index.md +++ b/files/en-us/web/mathml/index.md @@ -8,52 +8,44 @@ tags: - Web - XML --- -
{{MathMLRef}}
+{{MathMLRef}} -

Mathematical Markup Language (MathML) is a dialect of XML for describing mathematical notation and capturing both its structure and content.

+**Mathematical Markup Language (MathML)** is a dialect of [XML](/en-US/docs/Web/XML) for describing mathematical notation and capturing both its structure and content. -

Here you'll find links to documentation, examples, and tools to help you work with this powerful technology. For a quick overview, see the slides for the innovation fairs at Mozilla Summit 2013.

+Here you'll find links to documentation, examples, and tools to help you work with this powerful technology. For a quick overview, see the [slides for the innovation fairs at Mozilla Summit 2013](https://fred-wang.github.io/MozSummitMathML/index.html). -

MathML reference

+## MathML reference -
-
MathML element reference
-
Details about each MathML element and compatibility information for desktop and mobile browsers.
-
MathML attribute reference
-
Information about MathML attributes that modify the appearance or behavior of elements.
-
MathML examples
-
MathML samples and examples to help you understand how it works.
-
Authoring MathML
-
Suggestions and tips for writing MathML, including suggested MathML editors and how to integrate their output into Web content.
-
+- [MathML element reference](/en-US/docs/Web/MathML/Element) + - : Details about each MathML element and compatibility information for desktop and mobile browsers. +- [MathML attribute reference](/en-US/docs/Web/MathML/Attribute) + - : Information about MathML attributes that modify the appearance or behavior of elements. +- [MathML examples](/en-US/docs/Web/MathML/Examples) + - : MathML samples and examples to help you understand how it works. +- [Authoring MathML](/en-US/docs/Web/MathML/Authoring) + - : Suggestions and tips for writing MathML, including suggested MathML editors and how to integrate their output into Web content. -

Getting help from the community

+## Getting help from the community - +- [mozilla.dev.tech.mathml Google Group](https://groups.google.com/g/mozilla.dev.tech.mathml) +- [Wiki used by Mozilla contributors](https://wiki.mozilla.org/MathML:Home_Page) +- [W3C Math Home](https://www.w3.org/Math/) +- [www-math w3.org mail archive](https://lists.w3.org/Archives/Public/www-math/) -

Tools

+## Tools - +- [W3C Validator](https://validator.w3.org) +- [Mathzilla Firefox add-on collection](https://addons.mozilla.org/firefox/collections/fred_wang/mathzilla/) +- [TeXZilla](https://github.com/fred-wang/TeXZilla) — Javascript LaTeX to MathML converter ([live demo](https://fred-wang.github.io/TeXZilla/), [Firefox add-on](https://addons.mozilla.org/en-US/firefox/addon/texzilla/), [using in a Web Page, JS program etc](https://github.com/fred-wang/TeXZilla/wiki/Using-TeXZilla)) +- [LaTeXML](https://dlmf.nist.gov/LaTeXML/) - Convert LaTeX documents into HTML+MathML Web pages +- [MathJax](https://www.mathjax.org/) - Cross-browser JavaScript display engine for mathematics. To force MathJax to use native MathML, try [this Mozilla add-on](https://addons.mozilla.org/en-US/firefox/addon/native-mathml/), this [Safari extension](https://fred-wang.github.io/mathjax-native-mathml-safari/mathjax-native-mathml.safariextz) or this [GreaseMonkey script](https://openuserjs.org/scripts/fred.wang/MathJax_Native_MathML/). - +## Related topics - +- [CSS](/en-US/docs/Web/CSS) +- [HTML](/en-US/docs/Web/HTML) +- [SVG](/en-US/docs/Web/SVG) -

Browser compatibility

+## Browser compatibility -

{{Compat("mathml.elements.math", 0)}}

+{{Compat("mathml.elements.math", 0)}} diff --git a/files/en-us/web/mathml/index/index.md b/files/en-us/web/mathml/index/index.md index 40e6cf594344c86..d3f39fb8137690a 100644 --- a/files/en-us/web/mathml/index/index.md +++ b/files/en-us/web/mathml/index/index.md @@ -5,6 +5,6 @@ tags: - Index - MathML --- -
{{MathMLRef}}
+{{MathMLRef}} -

{{Index("/en-US/docs/Web/MathML")}}

+{{Index("/en-US/docs/Web/MathML")}}