Here, \(H_n^i(X)\)

Compiled by tex4ebook, the result expands each symbol of \(H_n^i(X)\) into a line. I wonder why that happens, and a fix.

  • I can confirm that this happens with tex4ebook. With make4ht, math is converted as an image and it looks correctly. Moreover, \subsection and \subsubsection are not converted as headings in both cases. So it looks like a brokent TeX4ht support for amsart. I will look into this, in the meantime article class with amsmath package works correctly.
    – michal.h21
    Commented Nov 7, 2020 at 21:41

1 Answer 1


This issue is caused by a bug in theorem handling in TeX4ht. It seems that paragraph handling is confused after theorem end. Normally, a paragraph should be started before word "Here". But in this case, several paragraphs are inserted inside your math, which results in in parts of this expression split over multiple lines.

I've fixed it in TeX4ht sources. In the meantime, you can use the following .cfg file:

% \Configure{()}{\PicMath$}{$\EndPicMath}

     \HCode{<div class="newtheorem">}\par\noindent\HCode{<span class="head">}}
  {\edef\MathPar{\ifvmode par-\fi}\IgnorePar\endgraf\EndP
   \HCode{<div class="\MathPar math-display" \csname a:LRdir\endcsname >}}
  {\HCode{</div>}\par\ShowPar}  {}  {class="\MathPar math-display" }
\Css{div.par-math-display, div.math-display{margin-left: auto; margin-right: auto;text-align:center;}}

This is the result:

enter image description here

  • Here is another issue: in place of theorem environment, if you use a displayed formula $$x^2+y^2=z^2$$, you will also see the same phenomenon. It could be fixed by replacing $$ (which is indeed deprecated in LaTeX) by \[ and \] throughout, but is it possible to fix without that replacement?
    – Yai0Phah
    Commented Nov 9, 2020 at 16:37
  • @Yai0Phah I see. this is actually bug in tex4ebook itself, because it redefines some Math configurations and it introduces this issue in this case
    – michal.h21
    Commented Nov 9, 2020 at 20:48
  • @Yai0Phah I've added configuration for this issue to the config file in my answer
    – michal.h21
    Commented Nov 9, 2020 at 22:05

You must log in to answer this question.

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