Tags shouldn't affect row height in equations (#5458)

This commit is contained in:
Max 2024-11-26 12:37:53 +00:00 committed by GitHub
parent 6d35972c3d
commit fd5e642fb4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 13 additions and 1 deletions

View File

@ -419,7 +419,10 @@ impl MathRunFrameBuilder {
}
fn affects_row_height(fragment: &MathFragment) -> bool {
!matches!(fragment, MathFragment::Align | MathFragment::Linebreak)
!matches!(
fragment,
MathFragment::Align | MathFragment::Linebreak | MathFragment::Tag(_)
)
}
/// Create the spacing between two fragments in a given style.

Binary file not shown.

After

Width:  |  Height:  |  Size: 329 B

View File

@ -260,6 +260,15 @@ $ q &= sum_k ln A \
// Test numbering on empty equations.
#math.equation(numbering: "1", block: true, [])
--- math-equation-tag-affects-row-height ---
// Tags should not affect the row height of equations.
#box($ - - $, fill: silver)
#box($ #metadata(none) - - $, fill: silver) \
#box($ a \ - - $, fill: silver)
#box($ a \ #metadata(none) - - $, fill: silver)
#box($ - - \ a $, fill: silver)
#box($ #metadata(none) - - \ a $, fill: silver)
--- issue-4187-alignment-point-affects-row-height ---
// In this bug, a row of "-" only should have a very small height; but
// after adding an alignment point "&", the row gains a larger height.