<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 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 behavior 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:
boldDeprecated-
Try and use bold characters e.g., "𝐀".
italicDeprecated-
Try and use italic characters e.g., "𝐴".
bold-italicDeprecated-
Try and use bold-italic characters e.g., "𝑨".
double-struckDeprecated-
Try and use double-struck characters e.g., "𝔸".
bold-frakturDeprecated-
Try and use bold-fraktur characters e.g., "𝕬".
scriptDeprecated-
Try and use script characters e.g., "𝒜".
bold-scriptDeprecated-
Try and use bold-script characters e.g., "𝓐".
frakturDeprecated-
Try and use fraktur characters e.g., "𝔄".
sans-serifDeprecated-
Try and use sans-serif characters e.g., "𝖠".
bold-sans-serifDeprecated-
Try and use bold-sans-serif characters e.g., "𝗔".
sans-serif-italicDeprecated-
Try and use sans-serif-italic characters e.g., "𝘈".
sans-serif-bold-italicDeprecated-
Try and use sans-serif-bold-italic characters e.g., "𝘼".
monospaceDeprecated-
Try and use monospace characters e.g., "𝙰".
initialDeprecated-
Try and use initial characters e.g., "𞸢".
tailedDeprecated-
Try and use tailed characters e.g., "𞹂".
loopedDeprecated-
Try and use looped characters e.g., "𞺂".
stretchedDeprecated-
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>
Technical summary
| Implicit ARIA role | None |
|---|
Specifications
| Specification |
|---|
| MathML Core> # dfn-mi> |
Browser compatibility
Loading…