jgm/texmath

How to disable OMML <m:nor /> in .docx equations?

blsz opened this issue · 4 comments

blsz commented

In pandoc demos example #⁠30, math.tex is converted to example30.docx. The LaTeX \sin operator is assigned the <m:nor /> OMML element in the document.xml of the example30.docx output.

As a result, the text "sin" inherits the font of the parent styles Normal > Body Text. At first glance, this looks correct because the parent style in example30.docx is set to "Cambria (body)". When the paragraph style is changed to Arial, as is required by some publications, the text "sin" also changes to Arial while the rest of the equation remains "Cambria Math". Equations would look more elegant if Cambria or Cambria Math were used throughout the entire equation and surrounding fonts did not affect any characters within the equation unless specified by the user.

Is it possible to completely prevent the use of <m:nor /> OMML in the .docx output?

<m:r>
    <m:rPr>
        <m:nor />
        <m:sty m:val="p" />
    </m:rPr>
    <m:t>sin</m:t>
</m:r>

https://pandoc.org/demo/math.tex

https://pandoc.org/demo/example30.docx

jgm commented

This is really an issue for jgm/texmath - I suggest you submit it there.
(For some reason, GitHub won't allow me to transfer it there.)

It isn't possible to adjust this, no. We could think about arguments for changing how it works, though.

blsz commented

Do you mean jgm/pandoc? I may close this issue and transfer it.

Thank you for considering the change. I think the argument would also apply to \text{}, \mathrm{}, and anything else resulting in m:nor styling.

jgm commented

Whoops, my mistake, I thought this was jgm/pandoc. OK! This is the right place for it.

jgm commented

I agree, that m:nor shouldn't be there. I'm going to take it out.