mathjax / MathJax

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

Bug: Text subscripts have inconsistent baselines for each character in word #3308

Closed cdhw2018 closed 1 week ago

cdhw2018 commented 1 week ago

Issue Summary

When using a roman text string as a subscript, for example, \[ H{\text{vol}}(s) = \frac{V{\text{out}}(s)}{V_{\text{in}}(s)} \], letters in the text subscripts have slightly different vertical positions, i.e. a 'ragged' baseline. The precise appearance varies depending on the browser's zoom level but never looks 'right'. Both CHTML and SVG rendering exhibit this issue; I've tried various LaTeX and TeX idioms to specify 'subscript word using roman text' but the results are always the same; I've tried three browsers, Firefox and Safari on macOS and Safari on iPadOS and the rendering is not correct on any of them but the effect is slightly less pronounced with Firefox for this example.

Steps to Reproduce

  1. Live example is the first equation in section 8.1 of https://www.macspice.com/tut/worksheet-08.html

This is a bug because a text subscript should should have a single baseline used by all the letters in the text

Technical details

Thanks

As a user who can remember when one's only option was to put gif screenshots of equations into webpages, I'd like to thank everybody involved in developing and supporting Mathjax, it's a superb solution to the problem of equations-in-webpages.

dpvc commented 1 week ago

This is a duplicate of #3004 and several earlier issues, and is due to a bug in WebKit (the display engine that underlies Safari). Version 4 (now out in beta release) includes changes to fix the problem in the situation you are seeing, and reduces it in other situations, though it can't eliminate it entirely.

My comment there gives several potential workarounds for v3 if you are not interested in moving to v4 yet.

cdhw2018 commented 1 week ago

Many thanks for the prompt reply. I've switched to using v4.0.0-beta.3 from the jsdeliver cdn and the issue does indeed seem to have gone away.