MathJax icon indicating copy to clipboard operation
MathJax copied to clipboard

Overrightarrow rendering problem

Open dl7 opened this issue 1 year ago • 1 comments

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:

  • MathJax Version: 3.2.2
  • Client OS: (e.g., Windows 10)
  • Browser: (Chrome 126.0.6478.127; Firefox 128.0)

I am loading MathJax via

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

dl7 avatar Jul 12 '24 11:07 dl7

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.

dpvc avatar Jul 22 '24 11:07 dpvc

The process used for stretchy characters in v4.0 has been redesigned, and should handle this situation better. Marking as fixed in v4.0.

dpvc avatar Aug 13 '25 14:08 dpvc