2

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:

\documentclass{article}
\usepackage[xhtml,mathml]{tex4ht}

\begin{document}
We define
\[ x = 3 \]
and continue the discussion.
\end{document}

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)

1 Answer 1

3

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

\catcode`\:=11
\catcode`\@=11
\Configure{[]}
  {\SaveEndP
   \Configure{@math}{display="block"}%
   \csname a:mathml[]\endcsname
   \DviMath\Tg<\a:mathml mrow\Hnewline>$$\DisplayMathtrue }
  {$$\Tg</\a:mathml mrow>\EndDviMath\csname b:mathml[]\endcsname}
\catcode`\:=12
\catcode`\@=12
1
  • 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, 2012 at 15:16

You must log in to answer this question.

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