fred-wang / TeXZilla

LALR Javascript LaTeX-to-MathML converter compatible with Unicode
http://fred-wang.github.io/TeXZilla/
130 stars 21 forks source link

Prime sign treated as superscript #52

Closed notcome closed 6 years ago

notcome commented 6 years ago

Consider the input "A'". TeXZilla.toMathMLString("A'") gives:

<math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><msup><mi>A</mi><mo>′</mo></msup><annotation encoding="TeX">A'</annotation></semantics></math>

Unfortunately, the macro \prime seems unsupported. Moreover, typing the Unicode character "’" gives a parse error. They are all workarounds I am aware of.

<math xmlns=\"http://www.w3.org/1998/Math/MathML\"><semantics><merror><mtext>Parse error on line 1:
\\(A’\\)
----^
</mtext></merror><annotation encoding=\"TeX\">A’</annotation></semantics></math>
notcome commented 6 years ago

Never mind…I just learned that prime sign is a superscript. It just looks quite small on both Safari and Firefox. How should we deal with that?

notcome commented 6 years ago

https://www.w3.org/TR/MathML3/chapter7.html#chars.pseudo-scripts

I guess this is not implemented in WebKit (and Firefox, but that is out of my reach). I will open a bug about it.

PS: This is Minsheng’s GitHub account. I just realized that it is not so obvious from my username. : )

notcome commented 6 years ago

https://bugs.webkit.org/show_bug.cgi?id=181829

fred-wang commented 6 years ago

It should be implemented in Gecko since https://bugzilla.mozilla.org/show_bug.cgi?id=442637 ; you need a math font with the appropriate mapping via the ssty features.

notcome commented 6 years ago

You are right. It turns out that the interactive LaTeX to MathML page I was using employs MathJax. I do know MathJax does not have that issue, and I cannot reproduce that anywhere else. Quite strange.

fred-wang commented 6 years ago

MathJax does not rely on OpenType font features but just changes the text in the mo element, AFAIK.