mathjax / MathJax

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

Overrightarrow rendering problem #3259

Open dl7 opened 1 month ago

dl7 commented 1 month ago

Issue Summary

There is already a closed issue that describes the problem in detail, but the bug still exists in the latest version (3.2.2)

Steps to Reproduce:

  1. Open this codepen
  2. In Chrome arrow extender is slightly offset (this is CHTML rendering): 1

In SVG rendering there is no such problem: 2

The visibility of the shift depends on the font size or page zoom. By increasing the font size or zoom, you can get rid of the error. 3

Technical details:

I am loading MathJax via

<script src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
dpvc commented 1 month ago

These are browser rendering problems. As you have shown, a zoomed version renders properly, meaning the browser is not rendering the original size correctly. That is due to pixel rounding that is being done differently for the stretchy piece from the arrow head at the end. Both are positioned the same by MathJax, but rendered differently by the browser. The fact that you can get different results by zooming shows that this is not a MathJax positioning error, as the same exact positioning acts differently at different magnifications. Indeed, the extender is sometimes too low and sometimes too high depending on the magnification, so MathJax won't be able to compensate for this effect.