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

<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

See also