From 53c306e32cd9622f7f2af66e08b6846712e78633 Mon Sep 17 00:00:00 2001 From: Leedehai <18319900+Leedehai@users.noreply.github.com> Date: Wed, 22 May 2024 13:04:46 -0400 Subject: Fix equation resizing when adding the equation number (#4179) --- ...math-equation-number-align-multiline-expand.png | Bin 518 -> 1250 bytes ...h-equation-number-align-multiline-no-expand.png | Bin 0 -> 1050 bytes tests/suite/math/equation.typ | 67 +++++++++++++++++---- 3 files changed, 56 insertions(+), 11 deletions(-) create mode 100644 tests/ref/math-equation-number-align-multiline-no-expand.png (limited to 'tests') diff --git a/tests/ref/math-equation-number-align-multiline-expand.png b/tests/ref/math-equation-number-align-multiline-expand.png index b6546433..f3e67c23 100644 Binary files a/tests/ref/math-equation-number-align-multiline-expand.png and b/tests/ref/math-equation-number-align-multiline-expand.png differ diff --git a/tests/ref/math-equation-number-align-multiline-no-expand.png b/tests/ref/math-equation-number-align-multiline-no-expand.png new file mode 100644 index 00000000..ca451d19 Binary files /dev/null and b/tests/ref/math-equation-number-align-multiline-no-expand.png differ diff --git a/tests/suite/math/equation.typ b/tests/suite/math/equation.typ index d4fba36b..e7ae677e 100644 --- a/tests/suite/math/equation.typ +++ b/tests/suite/math/equation.typ @@ -194,22 +194,67 @@ $ q &= sum_k ln A \ // numbering's layout box. Note we use pattern "1" here, not "(1)", since // the parenthesis exceeds the numbering's layout box, due to the default // settings of top-edge and bottom-edge of the TextElem that laid it out. +#let equations = [ + #box($ - - - $, fill: silver) + #box( + $ - - - \ + a = b $, + fill: silver) + #box( + $ a = b \ + - - - $, + fill: silver) +] + #set math.equation(numbering: "1", number-align: top) -#box( -$ - &- - \ - a &= b $, -fill: silver) +#equations #set math.equation(numbering: "1", number-align: horizon) -#box( -$ - - - $, -fill: silver) +#equations #set math.equation(numbering: "1", number-align: bottom) -#box( -$ a &= b \ - - &- - $, -fill: silver) +#equations + +--- math-equation-number-align-multiline-no-expand --- +// Tests that if the numbering's layout box doesn't vertically exceed the +// box of the equation frame's boundary, the latter's frame size remains. +// So, in the grid below, frames in each row should have the same height. +#set math.equation(numbering: "1") +#grid( + columns: 4 * (1fr,), + column-gutter: 3 * (2pt,), + row-gutter: 2pt, + align: horizon, + [ + #set math.equation(number-align: horizon) + #box($ - - \ a \ sum $, fill: silver) + ], + [ + #set math.equation(number-align: bottom) + #box($ - - \ a \ sum $, fill: silver) + ], + [ + #set math.equation(number-align: horizon) + #box($ sum \ a \ - - $, fill: silver) + ], + [ + #set math.equation(number-align: top) + #box($ sum \ a \ - - $, fill: silver) + ], + + [ + #set math.equation(number-align: horizon) + #box($ - - $, fill: silver) + ], + [ + #set math.equation(number-align: top) + #box($ - - $, fill: silver) + ], + [ + #set math.equation(number-align: bottom) + #box($ - - $, fill: silver) + ], +) --- issue-numbering-hint --- // In this bug, the hint and error messages for an equation -- cgit v1.2.3