2

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):

\documentclass{article}
\begin{document}
$abc$
\end{document}

tex4ht run htlatex foo 'html,mathml'

5

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 Oct 3 '14 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) – David Carlisle Oct 3 '14 at 8:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.