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

Michal Hoftich puszcza-hackers at gnu.org.ua
Thu Jul 31 19:49:24 CEST 2014


URL:
  <http://puszcza.gnu.org.ua/bugs/?226>

                 Summary: Spurious elements in mathml output of \mathit,
\mathrm, \mathbf etc
                 Project: tex4ht
            Submitted by: michal_h21
            Submitted on: Thu 31 Jul 2014 08:49:24 PM EEST
                Category: None
                Priority: 5 - Normal
                Severity: 5 - Normal
                  Status: None
                 Privacy: Public
             Assigned to: None
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any

    _______________________________________________________

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>

configuration of these commands is as follows:

\Configure{mathit}%               
  {\bgroup \Tg<\a:mathml mstyle mathvariant="\ifx
   \bold:version\math at version bold-\fi italic">}%
  {\Tg</\a:mathml mstyle>\egroup }%


I've found that generation of these spurious `<mi>` elements can be suppressed
with `\PauseMathClass` command. There is Eitan's comment in
tex4ht-mathml.tex:


-----------
Used to be       

\begin{verbatim}               
   \Configure{mathrm}{\Tg<\a:mathml mi \mml:class="mathrm">\PauseMathClass}%
{\EndPauseMathClass\Tg</\a:mathml mi>}%
   \Configure{mathbf}{\Tg<\a:mathml mi \mml:class="mathbf"
mathvariant="bold">\PauseMathClass}%
{\EndPauseMathClass\Tg</\a:mathml mi>}%
\end{verbatim}
------------

so it seems that `\PauseMathClass` was used in the past, but for some reason
it is not now. 

I created config file with `\PauseMathClass` in configuration of `\math...`
commands, which converts example correctly to:

------------
<math 
 xmlns="http://www.w3.org/1998/Math/MathML"  
display="inline" ><mstyle mathvariant="italic">hello</mstyle><mstyle
mathvariant="bold">world</mstyle></math> 
------------

If no issues are found and we don't find why `\PauseMathChar` isn't used in
the configurations, when it was used in the past, I will make patch for the
literary sources.



    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Thu 31 Jul 2014 08:49:24 PM EEST  Name: pause.cfg  Size: 879B   By:
michal_h21

<http://puszcza.gnu.org.ua/bugs/download.php?file_id=179>

    _______________________________________________________

Reply to this item at:

  <http://puszcza.gnu.org.ua/bugs/?226>

_______________________________________________
  Message sent via/by Puszcza
  http://puszcza.gnu.org.ua/




More information about the tex4ht mailing list