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

Fix issues with line breaks and spacing in SVG output. (mathjax/MathJax#3166) #1043

Merged
merged 1 commit into from
Feb 1, 2024

Conversation

dpvc
Copy link
Member

@dpvc dpvc commented Jan 26, 2024

This issue fixes several issues with in-line line breaking in SVG mode that arise when extra spacing is placed around operators, as is done by \implies, or A\;+\;B, for example. When in-line breaks are allowed, SVG output will lose the spacing around the operator (both the extra spacing as well as the normal operator spacing).

Both issues are cause primarily by the computeLineBBox() function for the SVG mspace wrapper. The size of the space was lost because the width was not being added to the LineBBox, and the operator spacing was lost because the isFirst property was assuming that the mspace had no width (i.e., was used for line-breaking only).

I also moved * scale inside a conditional since there is no need to multiply 0 by the scale.

The LineBBox.append() is modified to make sure that originalL is not lost if it has already been set earlier on.

Resolves issue mathjax/MathJax#3166.

@dpvc dpvc requested a review from zorkow January 26, 2024 15:24
@dpvc dpvc added this to the v4.0 milestone Jan 26, 2024
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 3894352 into develop Feb 1, 2024
@dpvc dpvc deleted the issue3166 branch February 1, 2024 12:58
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.

2 participants