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

letters do not align to baseline in multicharacter identifiers (WebKit) #3351

Open
xworld21 opened this issue Mar 31, 2025 · 1 comment
Open

Comments

@xworld21
Copy link

Issue Summary

Characters are not aligned to the baseline on WebKit:
Image
The alignment error changes with the font size as well, as you can see in the screenshot. Changing zoom level in the browser also changes the alignment of the characters.

I can't say for sure from which version of Safari this happens. I don't test Safari often and I was told about this only recently.

Steps to Reproduce:

<math>
  <mrow>
    <mi>sin</mi>
  </mrow>
</math>
<span style="font-size: 180%">
  <math>
    <mrow>
      <mi>sin</mi>
    </mrow>
  </math>
</span>
<script id="MathJax-script" async="" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/mml-chtml.js"></script>

Technical details:

  • MathJax Version: 3.2.2
  • Client OS: macOS 14.7.2
  • Browser: Safari 18.2

I am using the following MathJax configuration: no configuration

and loading MathJax via

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

Supporting information:

Live example: https://codepen.io/xworld21/pen/MYWzEyW

My screenshot is from a non-HiDPI screen.

@dpvc
Copy link
Member

dpvc commented Apr 6, 2025

This is a duplicate of several other issues. See, for example, #3325 and #2866. This is a WebKit bug, and one that MathJax can't do much about. In v4, the situation for multi-character identifiers (like your sin) is improved, but that doesn't take care of all the situations that are affected. Switching to SVG may be the best option for WebKit users.

@dpvc dpvc added the Duplicate label Apr 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants