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

Updates to handle smallmatrix properly #582

Merged
merged 1 commit into from
Mar 8, 2021
Merged

Updates to handle smallmatrix properly #582

merged 1 commit into from
Mar 8, 2021

Conversation

dpvc
Copy link
Member

@dpvc dpvc commented Jan 27, 2021

This PR implements the proper table layout for the smallmatrix and subarray environments. These use the useHeight property that is supposed to to change how the matrix is laid out (by not adding extra height and depth to make sure rows are full height, as usual). That feature was not implemented, so this PR adds support for useHeight.

These environments are typeset in script style, which had been handled by adding an mstyle around the table with scriptlevel="1", but this had the side-effect of making the math axis be the script-size math axis (too low). So the script level is now set through an internal property instead (which causes the table to scale down its children). That required handling the relative size change of children in the bounding box computations.

The MathML serializer was modified to expose the small matrix internal properties as data attributes, and the MathML input to read those and restore the internal properties.

Finally, the mrow stretchy operator heights didn't take scaled children into proper account when figuring the heights, so there is a fix there as well. There should probably be a getChildBBox() function that computes a properly scaled version of the BBox, since that ends up being a common issue that has caused problems before. (That will also be needed in order to handle borders, margins, and padding CSS, which v2 does, but v3 doesn't.) I will make that a separate PR, as it will touch on lots of files.

@dpvc
Copy link
Member Author

dpvc commented Jan 27, 2021

Note, this will affect some of the tests, as the MathML is modified for smallmatrix and subarray environments.

@dpvc dpvc requested a review from zorkow January 27, 2021 21:37
@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.

Looks good.
There's not effect on the current tests as this does not change the JSON output structure.

@dpvc dpvc merged commit 780bebd into develop Mar 8, 2021
@dpvc dpvc deleted the smallmatrix branch March 8, 2021 20:38
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