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

Use superscript for scriptChild in msubsup. (mathjax/MathJax#3097) #999

Merged
merged 1 commit into from
Sep 15, 2023

Conversation

dpvc
Copy link
Member

@dpvc dpvc commented Aug 30, 2023

This PR fixes a problem with the placement of msubsup scripts when when the depth of either script is large. The problem was due to the getU() method using this.scriptChild, where sciptChild was always set to childNodes[1]; for msubsup nodes, it should be childNodes[2], the superscript. The solution is to override scriptChild in the CommonMsubsupMixin wrapper. (I also cached the superscript depth and subscript height values that are used in several places).

The issue would show up if the superscript has large depth, as in

$$\int_0^{\Rule{3pt}{0pt}{20pt}}$$

which produces

bad-int

or if the subscript has large depth, as in

$$x_{\Rule{3pt}{0pt}{20pt}}^2$$

which produces

bad-x

With this PR, both produce the proper results:

good

Resolves issue mathjax/MathJax#3097.

@dpvc dpvc requested a review from zorkow August 30, 2023 13:58
@dpvc dpvc added this to the v4.0 milestone Aug 30, 2023
Copy link
Member

@zorkow zorkow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm.

@dpvc dpvc merged commit f2ff031 into develop Sep 15, 2023
@dpvc dpvc deleted the issue3097 branch September 15, 2023 12:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants