tex4ht with mathml option generates <mi>a</mi><mi>b</mi><mi>c</mi> from $abc$. Is there a way to get <mi>abc</mi> output?

MWE (foo.tex):


tex4ht run htlatex foo 'html,mathml'

1 Answer 1


If you want to generate <mi>abc</mi> the latex input should be \mathrm{abc}

  • you are absolutely right. That's my ignorance of mathml. Mathml renders single char as italic and multi-characters are rendered as roman. To have multi-characters rendered as italic, I need to set <mi mathvariant="italic">abc<mi> , what I actually meant in my question. Now I see, my question is quite pointless, as setting mathvariant attribute does make sense to a sequence of characters, but does not make sense to a single character. Therefore, thank you for enlightening me and i accept you answer.
    – deimi
    Commented Oct 3, 2014 at 8:54
  • 1
    @deimi it's not just the mathml markup $abc$ is incorrect TeX markup for a multiletter identifier: it is designed to use the math italic font and look like the implied product of three variables, \mathit{abc} on the other hand uses the text italic font and is designed to look like a single italic identifier (and makes a single mi in mathml) Commented Oct 3, 2014 at 8:58

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .