I'm using TeX4ht and I noticed that the displayed equations always forces the current paragraph to end. For example, if I write:

We define
\[ x = 3 \]
and continue the discussion.

I would expect only one paragraph produced, but TeX4ht produces two (one before, and one after the equation).

Here is a minimal working example, to be compiled first with latex, then with tex4ht:


We define
\[ x = 3 \]
and continue the discussion.

Any idea of a workaround, or a solution?

(I think that I figured out that the TeX4ht file which produces those paragraph ending is html-mml.4ht, but I'm not sure how to fix it)


You might add the following after \begin{document} and rerun:

   \csname a:mathml[]\endcsname
   \DviMath\Tg<\a:mathml mrow\Hnewline>$$\DisplayMathtrue }
  {$$\Tg</\a:mathml mrow>\EndDviMath\csname b:mathml[]\endcsname}
  • Thank you. That's a good start, but it does not quite work. First, after the equation, a p tag is produced, which should not be there. Second, that solution works only for the \[\] environment, not for the equation environment, for example... – Olivier Oct 6 '12 at 15:16

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.