Don't mark mrows as fences if the parens aren't stretchy #583
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR resolves an issue reported by Peter where enrichment causes spacing differences with parentheses following a function, e.g.
f(x)
gets treated likef\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 getstexClass
ofINNER
, 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.