mathjax / MathJax

Beautiful and accessible math in all browsers
http://www.mathjax.org/
Apache License 2.0
10.18k stars 1.16k forks source link

Issues with a few stretchy accents #2768

Open jmitsdarfer opened 3 years ago

jmitsdarfer commented 3 years ago

Issue Summary

Most stretchy accents are appearing as we'd expect in MathJax [reverse vector (x20d6), tilde (x303), underbar (x332), vector (x20d7), and circumflex (x302)], but we're having trouble with three of them: double bar overhead (x33f), double headed arrow accent (x20e1), and vinculum (x305).

Here's how they're looking for us in MathJax currently:

image

Here's the tagging that was used:

`

x y z
<mrow>
  <mo accent="true" stretchy="true">&#x33F;</mo>
</mrow>

x y z x y z x y z ̃ x y z ̲ x y z x y z ̅ x y z ̂

`

Is this a bug? Is the only way to solve these by using different characters for the accents, i.e.,

image

`

x y z
      <mrow>
        <mo stretchy="true">=</mo>
      </mrow>
    </mover>`

image

`

x y z
      <mrow>
        <mo stretchy="true">&#x2194;</mo>
      </mrow>
    </mover>`

image

`

x y z
      <mrow>
        <mo stretchy="true">&#xAF;</mo>
      </mrow>
    </mover>`

Technical details:

MathJax Version: master - latest commit: MathJax.js v2.7.9 Client OS: Windows Browser: Version 93.0.4577.63 (Official Build) (64-bit) Renderer: HTML-CSS

dpvc commented 3 years ago

MathJax needs to have data about how to stretch each stretchy character, and not every potentially stretchy character has that data (most of it was taken from the font's OpenType MATH table, which lists the stretchy characters). But you can add more characters to the delimiter table as needed. For example, adding

MathJax.Hub.Register.StartupHook("HTML-CSS Jax Ready", function () {
  var HTMLCSS = MathJax.OutputJax['HTML-CSS'];
  var DELIMITERS = HTMLCSS.FONTDATA.DELIMITERS;
  DELIMITERS[0x0305] = {dir: "H", alias: 0x00AF};
  DELIMITERS[0x033F] = {dir: "H", alias: 0x003D};
  DELIMITERS[0x20E1] = {dir: "H", alias: 0x2194};
});

to your configuration would define the stretchy data for the three missing (by making them act like the ones that you mentioned, for which stretchy data is available). Is that good enough?

jmitsdarfer commented 3 years ago

@dpvc Yep, that seems good enough, and I tested it and they looked great. Thank you! Hey, also, I noticed you replied to this question from a few days ago but I have a couple other questions from July that haven't been answered yet: https://github.com/mathjax/MathJax/issues/2742 and https://github.com/mathjax/MathJax/issues/2739. Do you think you or someone else could please take a look at these some time soon too? Thanks!

dpvc commented 3 years ago

I'm trying to work through a backlog of questions, and have been working from recent backwards. Due to personal reasons, I have not been able to respond to nearly anyone for the past month or more, and now my teaching schedule limits by availability. There is also a funding issue that is also limiting my hours for MathJax; perhaps the ACS would be willing to become a MathJax sponsor?

Do you think you or someone else could please take a look at these some time soon too?

There really is no one else to do it. There are two developers for MathJax, and your questions fall into my area of expertise, so I am the one who has to answer them. The line breaking questions are a bit more complicated than this one, and will take more time to answer, so gave you a response here first, since it would get you something more quickly. I will get to the others as soon as I am able.

jmitsdarfer commented 3 years ago

@dpvc Thank you for the explanation. When the more recent question was answered but not the older ones, it made me wonder if they got lost somehow. I am in the process of checking with ACS leadership about sponsorship and will follow up on that as soon as I can.