[tex4ht] dbmlatex conversion...

CV Radhakrishnan cvr at river-valley.org
Wed Oct 24 09:08:17 CEST 2012

On 10/23/12 23:30, Zdzislaw Meglicki wrote:
> Absolutely stripped of everything non-essential. Here's the example (sorry, I 
> should have done this before).

Many thanks for this.

> \begin{eqnarray*}
> a &=& ( A \\ 
>   &&\quad -\, B )
> \end{eqnarray*}

Although, this is legal in TeX world, tex4ht won't generate right kind
of MathML. In other words, MathML generated will not be passed by
parsers. Hence, conversions that rely on MathML will not be
successful. oolatex, dblatex, etc do want parsable MathML from your
TeX math. Given below is the MathML generated by TeX4ht with dummy
elements added to make it parsable.

      <mtable class="eqnarray-star"
       columnalign="right center left">
          <mtd class="eqnarray-1">
          <mtd class="eqnarray-2">
            <mo class="MathClass-rel">=</mo>

Each opening delimiter starts with <mrow> followed by the delimiter
which makes the tagging scheme look like: <mrow><mo>(</mo> followed by
elements for subsequent math atoms. In the same fashion, each closing
delimiter ends with a closing </mrow> which will look like
<mo>)</mo></morw>. Therefore, when there is no ")", we miss a closing
</mrow> element. In the same vein, we lose an opening <mrow> when
there is no opening parenthesis. Improperly nested elements disrupt
XML rules and leaves it unusable.

          <mtd class="eqnarray-3">
            <mrow>  <!-- this has no closing element-->
              <mo class="MathClass-open">(</mo>
            </mrow> <!-- dummy element added manually-->
          <mtd class="eqnarray-4">
            <mtext class="eqnarray"></mtext>
          <mtd class="eqnarray-1"></mtd>
          <mtd class="eqnarray-2"></mtd>
          <mtd class="eqnarray-3">
            <mrow>  <!-- dummy element added manually-->
                <mspace width="1em" class="quad" />
                <mo class="MathClass-bin">-</mo>
              <mo class="MathClass-close">)</mo>
            </mrow>  <!-- this has no opening element-->
          <mtd class="eqnarray-4">
            <mtext class="eqnarray"></mtext>

As you will understand from the above, the problem is not with tex4ht,
but perfect MathML cannot be generated from given input.

If MathML is needed from your TeX math, definitely these rules shall
be taken care of while writing. The problem of incompatibilities
between different markup languages was in fact a theme in one of the
talks of TUG 2010 by Prof William Hammond which is available at

Best regards

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4503 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://tug.org/pipermail/tex4ht/attachments/20121024/70b34d20/attachment.bin>

More information about the tex4ht mailing list