[tex4ht] [bug #226] Spurious elements in mathml output of \mathit, \mathrm, \mathbf etc

William F Hammond hammond at csc.albany.edu
Sun Aug 3 02:26:17 CEST 2014


Michal Hoftich <puszcza-hackers at gnu.org.ua> writes:

> . . .
> Details:
>
> As was pointed out by David Carlisle, there are spurious `<mi>` elements in
> the output of $\mathit{hello }\mathbf{world}$ when converted to mathml:
> <math 
>  xmlns="http://www.w3.org/1998/Math/MathML"  
> display="inline" ><mstyle mathvariant="italic"><mi 
>>h</mi><mi 
>>e</mi><mi 
>>l</mi><mi 
>>l</mi><mi 
>>o</mi></mstyle>...
>
> it should be
>
> <mstyle mathvariant="italic">hello</mstyle>

No.  Loose character data is not allowed in <mstyle>.

The LaTeX markup $\mathit{hello}$ is insufficient for
knowing whether or not "hello" is intended to
be the name of a mathematical symbol.

That is, assuming amsmath, I would like to see something
in the LaTeX source like \mathit{\text{hello}} or
\mathit{\operatorname{hello}}.

If "hello" is intended to be a symbol name,
then <mi mathvariant="italic">hello</mi>, but if it's
not a symbol name, then one probably should use
<mtext mathvariant="italic">hello</mtext> for (minimal)
commenting inside math.

There are various inconsistencies afloat.

For example, with the LaTeX markup
$\mathbf{\operatorname{Hom}(X,Y)}$ should "Hom", which
should be upright, be bold or not?  There is a division on
this between tex4ht and latexml and *also* a division
between pdflatex and xelatex (with fontspec and
unicode-math).

\operatorname is a command taking symbol names, while
\mathbf is a command taking expressions.  My thought is that
it should be bold, i.e., I would vote for tex4ht and
xelatex+unicode-math.  That said, just as I am not fond of
seeing <mstyle> in MathML, I would prefer to see the use
of things like \mathrm, \mathbf, and \mathit exercised
symbol by symbol.

                                    -- Bill




More information about the tex4ht mailing list