{{MathMLRef}}
Β
The <mi>
MathML element indicates that the content should be rendered as an identifier, such as a function name, variable or symbolic constant.
By default <mi>
elements that contain multiple characters are a rendered as normal text, while single character characters are rendered as italic: the same formatting behaviour as the CSS text-transform
property with a value of math-auto
.
The mathvariant
attribute with a value of normal
can be used to reset a single character to the normal font.
In order to use a particular form of a character such as bold/italic, serif, sans-serif, script/calligraphy, monospaced, double-struck, and so on, you should use the appropriate Mathematical Alphanumeric Symbols.
[!NOTE] In a previous specification (MathML3), the
mathvariant
attribute was used to define logical classes that could apply the character formatting for mathematical alphanumeric symbols. The associated values are now deprecated, and expected to be removed from browsers in future releases.
Attributes
-
mathvariant
-
: The only value allowed in the current specification is
normal
(case insensitive):normal
- : Use default/normal rendering, removing automatic styling of single characters to italic.
Deprecated legacy values are:
bold
{{deprecated_inline}}
Β- : Try and use bold characters e.g. βπβ.
italic
{{deprecated_inline}}
Β- : Try and use italic characters e.g. βπ΄β.
bold-italic
{{deprecated_inline}}
Β- : Try and use bold-italic characters e.g. βπ¨β.
double-struck
{{deprecated_inline}}
Β- : Try and use double-struck characters e.g. βπΈβ.
bold-fraktur
{{deprecated_inline}}
Β- : Try and use bold-fraktur characters e.g. βπ¬β.
script
{{deprecated_inline}}
Β- : Try and use script characters e.g. βπβ.
bold-script
{{deprecated_inline}}
Β- : Try and use bold-script characters e.g. βπβ.
fraktur
{{deprecated_inline}}
Β- : Try and use fraktur characters e.g. βπβ.
sans-serif
{{deprecated_inline}}
Β- : Try and use sans-serif characters e.g. βπ β.
bold-sans-serif
{{deprecated_inline}}
Β- : Try and use bold-sans-serif characters e.g. βπβ.
sans-serif-italic
{{deprecated_inline}}
Β- : Try and use sans-serif-italic characters e.g. βπβ.
sans-serif-bold-italic
{{deprecated_inline}}
Β- : Try and use sans-serif-bold-italic characters e.g. βπΌβ.
monospace
{{deprecated_inline}}
Β- : Try and use monospace characters e.g. βπ°β.
initial
{{deprecated_inline}}
Β- : Try and use initial characters e.g. βπΈ’β.
tailed
{{deprecated_inline}}
Β- : Try and use tailed characters e.g. βπΉβ.
looped
{{deprecated_inline}}
Β- : Try and use looped characters e.g. βπΊβ.
stretched
{{deprecated_inline}}
Β- : Try and use stretched characters e.g. βπΉ’β.
-
This element also accepts the global MathML attributes.
Examples
<math display="block">
<!-- Multiple characters render as "normal" text -->
<mi>sin</mi>
</math>
<hr />
<math display="block">
<!-- Single characters render as italic by default (i.e. "A" renders as "π΄") -->
<mi>A</mi>
</math>
<hr />
<math display="block">
<!-- Use mathvariant="normal" to make single character render as normal text -->
<mi mathvariant="normal">F</mi>
</math>
<hr />
<math display="block">
<!-- To use a specific variant, such as "B" in Fraktur -->
<mi>π
</mi>
</math>
{{ EmbedLiveSample('mi_example', 400, 100) }}
Β
Technical summary
Implicit ARIA role | None |
---|
Specifications
{{Specifications}}
Β
Browser compatibility
{{Compat}}
Β