Make4ht without /newcommand within the document works pretty well with up and down indexes, see the case of 1_definition.html in This Git repository enter image description here But when the document involves, for example, a \newcommand \coeffX [4][X]{\mathbf{#1}_{{#2},{#3}}(#4)} the final result is done not so beautiful way, ie enter image description here where X is defined by \newcommand \coeffX [4][X]{\mathbf{#1}_{{#2},{#3}}(#4)}. See the case of index.html in This Git repository.

Question: Is there any way to fix this issue?

  • 1
    it is impossible to debug an image, please add a code block with a complete small document that makes that image Dec 1, 2019 at 22:55
  • in particular, how are you calling \coeffX Dec 1, 2019 at 22:56
  • I call it as: \coeffX{m}{t}{j}
    – PKK
    Dec 1, 2019 at 22:57
  • @DavidCarlisle, Source Files are added.
    – PKK
    Dec 1, 2019 at 23:04
  • 2
    a small inline example is much better than a link to an external site, the question here is archived forever but the external link has fewer guarantees, Dec 1, 2019 at 23:08

1 Answer 1


This is a common issue regarding sub- and superscripts in TeX4ht. The _ and ^ characters are not active in the preamble, so commands defined here don't work correctly. It is best to use the \sp and \sb commands instead:

\newcommand \coeffX [4][X]{\mathbf{#1}\sb{#2,#3}(#4)}

This is the result:

enter image description here

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.