<mi>

The MathML <mi> element indicates that the content should be rendered as an identifier such as function names, variables or symbolic constants. You can also have arbitrary text in it to mark up terms.

Attributes

class, id, style
Provided for use with stylesheets.
dir
The text direction. Possible values are either ltr (left to right) or rtl (right to left).
href
Used to set a hyperlink to a specified URI.
mathbackground
The background color. You can use #rgb, #rrggbb and HTML color names.
mathcolor
The text color. You can use #rgb, #rrggbb and HTML color names.
mathsize
The size of the content. Possible values are:
  • small: Font is rendered smaller than the current font size.
  • normal: Equivalent to 100% or 1em.
  • big: Font is rendered larger than the current font size.
  • a custom length.
  • or a unitless value which multiplies the default.
mathvariant (partially implemented, see bug 114365 & bug 162405)
This logical class of the identifier, which varies in typography. That is, although the names suggest the typographic style for the class, semantically, items with the same class are treated "the same" within an expression, which might or might not involve displaying them with the named typography. The following values are allowed:
  • normal (Default value for more than one character)
  • bold
  • italic (Default value for a single character)
  • bold-italic
  • double-struck Unimplemented
  • bold-fraktur Unimplemented (bold works)
  • script Unimplemented
  • bold-script Unimplemented (bold works)
  • fraktur Unimplemented
  • sans-serif
  • bold-sans-serif
  • sans-serif-italic
  • sans-serif-bold-italic
  • monospace
  • initial Unimplemented
  • tailed Unimplemented
  • looped Unimplemented
  • stretched Unimplemented

Examples

<math> 

  <mi> y </mi>  

  <mi> sin </mi>

  <mi mathvariant="monospace"> x </mi>

  <mi mathvariant="bold"> &pi; </mi>

</math>

Browser compatibility

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support Not supported (24 only) 1.0 (1.7 or earlier) Not supported 9.5 5.1
dir attribute Not supported 12.0 (12.0) Not supported Not supported Not supported
href attribute Not supported WebKit bug 85733 7.0 (7.0) Not supported Not supported Not supported WebKit bug 85733
mathsize attribute Not supported (24 only) 1.0 (1.7 or earlier) Not supported Not supported 5.1
mathvariant attribute Not supported (24 only) partially supported (see above) Not supported partially supported (see above) [*] partially supported (see above) [*]
Feature Android Chrome for Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support Not supported Not supported 1.0 (1.9.2) Not supported Not supported Not supported
dir attribute Not supported Not supported 12.0 (12.0) Not supported Not supported Not supported
href attribute Not supported Not supported 7.0 (7.0) Not supported Not supported Not supported
mathsize attribute Not supported Not supported 1.0 (1.9.2) Not supported Not supported Not supported
mathvariant attribute Not supported Not supported partially supported (see above) Not supported Not supported Not supported

[*] The font style does not change to normal when the content is more than a single character.

Gecko-specific notes

  • Starting with Gecko 20.0 (Firefox 20.0 / Thunderbird 20.0 / SeaMonkey 2.17) a unitless value for mathsize is allowed.

Specifications

Specification Status Comment
MathML 3.0 Recommendation Current specification
MathML 2.0 Recommendation Initial specification

 

Document Tags and Contributors

Contributors to this page: Sheppy, jswisher, fscholz
Last updated by: fscholz,