Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong codes for "phi" and "varphi" in ASCIIMathML #353

Closed
ghost opened this issue Nov 16, 2012 · 9 comments

Comments

Projects
None yet
3 participants
@ghost
Copy link

commented Nov 16, 2012

it seems that the Unicode characters for "phi" and "varphi" in ASCIIMathML are wrong (inverted):

"phi" uses "\u03C6" instead of "\u03D5"
"varphi" uses "\u03D5" instead of "\u03C6"

See: http://jsfiddle.net/qhawu/

@fred-wang

This comment has been minimized.

Copy link
Contributor

commented Nov 16, 2012

I have not checked, but I think varphi and phi are reverted in LaTeX and MathML. So probably ASCIIMathML follows the MathML convention, here.

@PaulTopping

This comment has been minimized.

Copy link

commented Nov 16, 2012

Unicode got it wrong in an early version and corrected it in a later version. Obviously this creates all kinds of problems since there are fonts and other implementations that still contain the old, wrong Unicode assignments. In fact, my guess is that they outnumber the ones that have it right. A total mess! If you search online for “phi varphi Unicode”, you can see a lot of mentions of the problem.

@dpvc

This comment has been minimized.

Copy link
Member

commented Nov 19, 2012

The AsciiMath translation is done via an actual copy of AsciiMathML.js, and so this is the choice that Peter Jipsen made in writing AsciiMath originally. That may, as Paul suggests, have been due to the early incorrect Unicode mapping, and it has never been updated.

You can, however, add configuration to your page that will switch the values. If you add:

<script type="text/x-mathjax-config">
MathJax.Hub.Register.StartupHook("AsciiMath Jax Config",function () {
  var symbols = MathJax.InputJax.AsciiMath.AM.symbols;
  for (var i = 0, m = symbols.length; i < m; i++) {
    if (symbols[i].input === "phi")    {symbols[i].output = "\u03D5"}
    if (symbols[i].input === "varphi") {symbols[i].output = "\u03C6"; i = m}
  }
});
</script>

to the page somewhere before the script that loads MathJax.js itself, that should change the two character codes for you.

@ghost

This comment has been minimized.

Copy link
Author

commented Nov 27, 2012

I think I will adopt that solution. Thank you very much.

@ghost ghost closed this Nov 27, 2012

@dpvc

This comment has been minimized.

Copy link
Member

commented Nov 27, 2012

I'm reopening the issue because I am thinking about whether to fix it in the next release.

@dpvc dpvc reopened this Nov 27, 2012

@ghost ghost assigned dpvc Apr 20, 2013

dpvc pushed a commit to dpvc/MathJax that referenced this issue Feb 14, 2014

@dpvc

This comment has been minimized.

Copy link
Member

commented Feb 14, 2014

I have added a configuration parameter that allows you to switch these two unicode values. It is on by default, so phi and varphi should produce the same results as LaTeX's \phi and \varphi.

dpvc pushed a commit to dpvc/MathJax that referenced this issue Feb 15, 2014

@dpvc dpvc added Merged and removed Ready for Review labels Feb 15, 2014

@dpvc

This comment has been minimized.

Copy link
Member

commented Feb 15, 2014

=> Merged.

@ghost

This comment has been minimized.

Copy link
Author

commented Apr 1, 2014

Thank you very much!

@dpvc dpvc referenced this issue Apr 11, 2014

Closed

w3c test union3 #17

dpvc pushed a commit to dpvc/MathJax that referenced this issue Apr 21, 2014

dpvc pushed a commit to dpvc/MathJax that referenced this issue Apr 21, 2014

dpvc pushed a commit to mathjax/MathJax-test that referenced this issue Apr 21, 2014

@dpvc

This comment has been minimized.

Copy link
Member

commented Apr 21, 2014

=> In Test Suite.

AsciiMath/issue353.html

@dpvc dpvc added v2.4 and removed Merged labels Jun 30, 2014

@pkra pkra referenced this issue Jul 8, 2014

Closed

Asciimathml meta issue for 2.x #857

5 of 5 tasks complete

@drlippman drlippman referenced this issue Aug 19, 2014

Closed

phi / varphi #14

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.