<mi>
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since January 2023.
The<mi>MathML element indicates that the content should be rendered as anidentifier, 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 behavior as the CSStext-transform property with a value ofmath-auto.Themathvariant attribute with a value ofnormal 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 appropriateMathematical Alphanumeric Symbols.
Note:In a previous specification (MathML3), themathvariant 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.
In this article
Attributes
mathvariantThe only value allowed in the current specification is
normal(case insensitive):normalUse default/normal rendering, removing automatic styling of single characters to italic.
Deprecated legacy values are:
boldDeprecatedTry and use bold characters e.g., "𝐀".
italicDeprecatedTry and use italic characters e.g., "𝐴".
bold-italicDeprecatedTry and use bold-italic characters e.g., "𝑨".
double-struckDeprecatedTry and use double-struck characters e.g., "𝔸".
bold-frakturDeprecatedTry and use bold-fraktur characters e.g., "𝕬".
scriptDeprecatedTry and use script characters e.g., "𝒜".
bold-scriptDeprecatedTry and use bold-script characters e.g., "𝓐".
frakturDeprecatedTry and use fraktur characters e.g., "𝔄".
sans-serifDeprecatedTry and use sans-serif characters e.g., "𝖠".
bold-sans-serifDeprecatedTry and use bold-sans-serif characters e.g., "𝗔".
sans-serif-italicDeprecatedTry and use sans-serif-italic characters e.g., "𝘈".
sans-serif-bold-italicDeprecatedTry and use sans-serif-bold-italic characters e.g., "𝘼".
monospaceDeprecatedTry and use monospace characters e.g., "𝙰".
initialDeprecatedTry and use initial characters e.g., "𞸢".
tailedDeprecatedTry and use tailed characters e.g., "𞹂".
loopedDeprecatedTry and use looped characters e.g., "𞺂".
stretchedDeprecatedTry and use stretched characters e.g., "𞹢".
This element also accepts theglobal 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>Technical summary
| Implicit ARIA role | None |
|---|
Specifications
| Specification |
|---|
| MathML Core> # dfn-mi> |