<mi>
Baseline 2023
Newly available
Since January 2023, this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.
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-
Try and use bold characters e.g. "𝐀".
italic
Deprecated-
Try and use italic characters e.g. "𝐴".
bold-italic
Deprecated-
Try and use bold-italic characters e.g. "𝑨".
double-struck
Deprecated-
Try and use double-struck characters e.g. "𝔸".
bold-fraktur
Deprecated-
Try and use bold-fraktur characters e.g. "𝕬".
script
Deprecated-
Try and use script characters e.g. "𝒜".
bold-script
Deprecated-
Try and use bold-script characters e.g. "𝓐".
fraktur
Deprecated-
Try and use fraktur characters e.g. "𝔄".
sans-serif
Deprecated-
Try and use sans-serif characters e.g. "𝖠".
bold-sans-serif
Deprecated-
Try and use bold-sans-serif characters e.g. "𝗔".
sans-serif-italic
Deprecated-
Try and use sans-serif-italic characters e.g. "𝘈".
sans-serif-bold-italic
Deprecated-
Try and use sans-serif-bold-italic characters e.g. "𝘼".
monospace
Deprecated-
Try and use monospace characters e.g. "𝙰".
initial
Deprecated-
Try and use initial characters e.g. "𞸢".
tailed
Deprecated-
Try and use tailed characters e.g. "𞹂".
looped
Deprecated-
Try and use looped characters e.g. "𞺂".
stretched
Deprecated-
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
BCD tables only load in the browser