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

Spacing in expression with greek letters and powers (MathJax 3) #2406

Closed
dainiak opened this issue Apr 15, 2020 · 2 comments
Closed

Spacing in expression with greek letters and powers (MathJax 3) #2406

dainiak opened this issue Apr 15, 2020 · 2 comments
Labels
Accepted Issue has been reproduced by MathJax team Fixed Test Needed v3 v3.1
Milestone

Comments

@dainiak
Copy link
Contributor

dainiak commented Apr 15, 2020

Issue Summary

MathJax v2 renders like this:
image
Whereas MathJax v3.0.5 renders the formula almost with no spacing between the base and the power:
image

Also there is a difference in vertical alignment of the power, arguably MJv2 does a better job here, making the formula vertically tighter.
Otherwise using MJv3 with pleasure, thank you!

Steps to Reproduce:

$\beta^{p^k\cdot(p-1)}$

Technical details:

  • MathJax Version: 2.7.4 vs 3.0.5
  • Client OS: Windows 10
  • Browser: Chrome 81.0.4044.92
@dpvc dpvc added the Accepted Issue has been reproduced by MathJax team label Apr 17, 2020
@dpvc
Copy link
Member

dpvc commented Apr 17, 2020

There do seem to be some spacing issues there.

There are several heights used in TeX depending on the style (e.g., display versus text), and whether the style should be further "cramped" (like inside a square root or fraction). It looks like the display height is being used where text height should be used. I will need to look into that, as well as the horizontal distances.

@dpvc
Copy link
Member

dpvc commented Mar 18, 2021

I have finally gotten the chance to work on this (as I was working on other super- and subscript issues), and it turns out that the vertical positioning in v2 was wrong, and the v3 heights are correct. The horizontal positioning is wrong, however, and that is due to the fact that MathJax doesn't have all the italic correction information that TeX does. MathJax "fakes" that data, but that doesn't always work well. In v2, the layout put the scriptspace tex font parameter spacing in the wrong place, which accounts for the extra spacing there, but v3 corrected that error. In order to compensate for the missing italic correction information, I've made a pull request that adds a small space between the base and the exponent. It is not exactly like in TeX, but is an improvement.

@dpvc dpvc removed their assignment Mar 18, 2021
dpvc added a commit to mathjax/MathJax-src that referenced this issue Mar 19, 2021
Add a small separation between base and scripts.  (mathjax/MathJax#2406)
@dpvc dpvc added Merged Merged into develop branch and removed Ready for Review labels Mar 19, 2021
@dpvc dpvc added Fixed v3.1 and removed Merged Merged into develop branch labels Apr 27, 2021
@dpvc dpvc closed this as completed Apr 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Accepted Issue has been reproduced by MathJax team Fixed Test Needed v3 v3.1
Projects
None yet
Development

No branches or pull requests

2 participants