htmlfontsmathml

Why do MathML identifiers look different?


The letters in a MathML <mi> tag look different (only if it's a single letter in the <mi>):

<div> abc </div>
<math> <mi>a</mi> <mi>b</mi> <mi>c</mi> <mi>abc</mi> </math>

how does this happen? I tested that it's different with different fonts, is this a special mode of the font? Can I activate it without MathML?


Solution

  • This is expected behavior.

    From the documentation for the <mi> element:

    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 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.

    It's just the italic face of the font. To activate it without MathML, you could style text using CSS with font-style: italic;