mathvariant
The mathvariant global attribute sets a logical class for textual elements, which is visually
distinguished by using special Mathematical Alphanumeric Symbols.
Except for mi elements with a single character,
which are by convention italic, no special classes are used by default.
Note: When possible, directly use Mathematical Alphanumeric Symbols instead of an explicit mathvariant attribute.
Syntax
html
<math>
<!-- a normal "A" -->
<mtext>A</mtext>
<!-- an italic "A" i.e. "๐ด" -->
<mtext mathvariant="italic">A</mtext>
<!-- an italic "A" i.e. "๐ด"
(automatic italicization for 'mi' elements with one character) -->
<mi>A</mi>
<!-- a normal "A" -->
<mi mathvariant="normal">A</mi>
<!-- a normal "cos" -->
<mi>cos</mi>
<!-- a bold "cos" i.e. "๐๐จ๐ฌ" -->
<mi mathvariant="bold">cos</mi>
<!-- a double-struck "A" i.e. "๐ธ" -->
<mi mathvariant="double-struck">A</mi>
<!-- a fraktur "A" i.e. "๐" -->
<mi mathvariant="fraktur">A</mi>
<!-- a looped "ุจ" i.e. "๐บ" -->
<mi mathvariant="looped">ุจ</mi>
<!-- a stretched "ุจ" i.e. "๐นก" -->
<mi mathvariant="stretched">ุจ</mi>
</math>
Values
normal-
Use default rendering (no transformations applied).
bold-
Try and use bold characters e.g. "๐".
italic-
Try and use italic characters e.g. "๐ด".
bold-italic-
Try and use bold-italic characters e.g. "๐จ".
double-struck-
Try and use double-struck characters e.g. "๐ธ".
bold-fraktur-
Try and use bold-fraktur characters e.g. "๐ฌ".
script-
Try and use script characters e.g. "๐".
bold-script-
Try and use bold-script characters e.g. "๐".
fraktur-
Try and use fraktur characters e.g. "๐".
sans-serif-
Try and use sans-serif characters e.g. "๐ ".
bold-sans-serif-
Try and use bold-sans-serif characters e.g. "๐".
sans-serif-italic-
Try and use sans-serif-italic characters e.g. "๐".
sans-serif-bold-italic-
Try and use sans-serif-bold-italic characters e.g. "๐ผ".
monospace-
Try and use monospace characters e.g. "๐ฐ".
initial-
Try and use initial characters e.g. "๐ธข".
tailed-
Try and use tailed characters e.g. "๐น".
looped-
Try and use looped characters e.g. "๐บ".
stretched-
Try and use stretched characters e.g. "๐นข".
Specifications
| Specification |
|---|
| MathML Core # dfn-mathvariant |
Browser compatibility
BCD tables only load in the browser