Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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)

share|improve this question

1 Answer 1

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
share|improve this answer
    
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

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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