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

Don't mark mrows as fences if the parens aren't stretchy #583

Merged
merged 1 commit into from
Feb 9, 2021

Conversation

dpvc
Copy link
Member

@dpvc dpvc commented Jan 28, 2021

This PR resolves an issue reported by Peter where enrichment causes spacing differences with parentheses following a function, e.g. f(x) gets treated like f\left(x\right) after enrichment. This is due to the extra <mrow> that is put around the (x), which in turn is treated by the MathML input jax as a fenced group, which gets texClass of INNER, and so gets extra space.

This PR changes the heuristic for marking fenced groups so that they are marked only if the fences are actually stretchy (e.g., could have come from \left...\right), and not otherwise. That should preserve the spacing from TeX output that gets enhanced. It might still alter MathML output unless it is marked carefully, but that was the case in the past as well, since putting the <mrow> around the parentheses might prevent the parentheses from stretching to match larger content in the rest of the expression. That is a good thing.

@dpvc dpvc requested a review from zorkow January 28, 2021 18:20
@pkra
Copy link
Contributor

pkra commented Jan 28, 2021

That's great - thanks for diving into this!

@dpvc
Copy link
Member Author

dpvc commented Jan 28, 2021

@pkra, it's good to get that worked out. Trying to get MathML input to match TeX output is challenging in some situations, this being one. I think this fix should improve the results considerably.

@dpvc dpvc added this to the 3.1.3 milestone Jan 31, 2021
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.

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.

3 participants