Updates to handle smallmatrix properly #582
Merged
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 implements the proper table layout for the
smallmatrix
andsubarray
environments. These use theuseHeight
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 foruseHeight
.These environments are typeset in script style, which had been handled by adding an
mstyle
around the table withscriptlevel="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 agetChildBBox()
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.