bugtex4ht - Bugs: bug #226, Spurious elements in mathml output...

Show feedback again

You are not allowed to post comments on this tracker with your current authentification level.

bug #226: Spurious elements in mathml output of \mathit, \mathrm, \mathbf etc

Submitted by:  Michal Hoftich <michal_h21>
Submitted on:  Thu Jul 31 20:49:24 2014  
Category: NonePriority: 5 - Normal
Severity: 5 - NormalStatus: None
Privacy: PublicAssigned to: None
Open/Closed: Closed

(Jump to the original submission Jump to the original submission)

Wed Nov 27 11:28:11 2019, comment #6:

I've uploaded new make4ht version to CTAN. It contains new DOM filter: mathmlfixes. It should fix issues with nested token elements in MathML.

Michal Hoftich <michal_h21>
Project Member
Fri Nov 22 15:29:06 2019, comment #5:

I've found an issue with this approach - the \PauseMathClass will prevent correct tagging of nested structures. For example:


This will result in

<mover class='mml-overline' accent='false'><mrow>b</mrow><mo accent='true'>¯</mo></mover>

The b character should be placed in <mi> element. So I think we should revert back to the use of <mstyle>.

The original issue of spurious <mi> elements for longer texts can be fixed using post-processing - make4ht provides common_domfilters extension, which does exactly this.

Michal Hoftich <michal_h21>
Project Member
Sat Feb 14 02:39:39 2015, comment #4:

Installed patch, thanks as always, but leaving open since other issues remain (I believe).

Karl Berry <karl>
Project Administrator
Wed Feb 11 16:49:44 2015, comment #3:

Here is a patch to output `<mi mathvariant="...">`.

(file #195)

Michal Hoftich <michal_h21>
Project Member
Wed Feb 4 02:29:40 2015, comment #2:

for the record, further discussion in the thread starting at http://tug.org/pipermail/tex4ht/2014q3/001002.html.

Karl Berry <karl>
Project Administrator
Tue Aug 5 01:48:18 2014, comment #1:

hi michal - i see \\pausemathclass is used in a number of places in the sources. i have no particular insight into why eitan removed it for \mathit, etc. (if i'm understanding your note correctly). i think we should try making the change, unless CVR chimes in with some reason not to.


Karl Berry <karl>
Project Administrator
Thu Jul 31 20:49:24 2014, original submission:

As was pointed out by David Carlisle, there are spurious `<mi>` elements in the output of $\mathit{hello }\mathbf{world}$ when converted to mathml:

display="inline" ><mstyle mathvariant="italic"><mi


it should be

<mstyle mathvariant="italic">hello</mstyle>

configuration of these commands is as follows:

{\bgroup \Tg<\a:mathml mstyle mathvariant="\ifx
\bold:version\math@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

\Configure{mathrm}{\Tg<\a:mathml mi \mml:class="mathrm">\PauseMathClass}%
{\EndPauseMathClass\Tg</\a:mathml mi>}%
\Configure{mathbf}{\Tg<\a:mathml mi \mml:class="mathbf"
{\EndPauseMathClass\Tg</\a:mathml mi>}%

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:

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.

Michal Hoftich <michal_h21>
Project Member


Attached Files
file #195:  mathml.patch added by michal_h21 (2kB - text/x-patch)
file #179:  pause.cfg added by michal_h21 (879B - application/octet-stream)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -unavailable- added by karl (Posted a comment)
  • -unavailable- added by michal_h21 (Submitted the item)

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.


    Please enter the title of George Orwell's famous dystopian book (it's a date):



    6 latest changes follow.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed Jul 1 13:10:21 2020michal_h21Open/ClosedOpen=>Closed
    Sat Feb 14 02:39:39 2015karlSummarySpurious elements in mathml output of \\mathit, \\mathrm, \\mathbf etc=>Spurious elements in mathml output of \mathit, \mathrm, \mathbf etc
    Wed Feb 11 16:49:44 2015michal_h21Attached File-=>Added mathml.patch, #195
    Wed Feb 4 02:29:40 2015karlSummarySpurious elements in mathml output of \\mathit, \\mathrm, \\mathbf etc=>Spurious elements in mathml output of \mathit, \mathrm, \mathbf etc
    Tue Aug 5 01:48:18 2014karlSummarySpurious elements in mathml output of \\mathit, \\mathrm, \\mathbf etc=>Spurious elements in mathml output of \mathit, \mathrm, \mathbf etc
    Thu Jul 31 20:49:24 2014michal_h21Attached File-=>Added pause.cfg, #179
    Show feedback again

    Back to the top

    Powered by Savane 3.1-cleanup+gray