files/en-us/web/mathml/reference/element/mi/index.md
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 {{cssxref("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
mathvariantattribute 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.
mathvariant
: The only value allowed in the current specification is normal (case insensitive):
normal
Deprecated legacy values are:
bold {{deprecated_inline}}
italic {{deprecated_inline}}
bold-italic {{deprecated_inline}}
double-struck {{deprecated_inline}}
bold-fraktur {{deprecated_inline}}
script {{deprecated_inline}}
bold-script {{deprecated_inline}}
fraktur {{deprecated_inline}}
sans-serif {{deprecated_inline}}
bold-sans-serif {{deprecated_inline}}
sans-serif-italic {{deprecated_inline}}
sans-serif-bold-italic {{deprecated_inline}}
monospace {{deprecated_inline}}
initial {{deprecated_inline}}
tailed {{deprecated_inline}}
looped {{deprecated_inline}}
stretched {{deprecated_inline}}
This element also accepts the global MathML attributes.
<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) }}
{{Specifications}}
{{Compat}}