diff options
| author | Leedehai <18319900+Leedehai@users.noreply.github.com> | 2024-02-26 10:57:21 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-02-26 15:57:21 +0000 |
| commit | e9ee00a7c0df083663ff5ccca162238b88525e14 (patch) | |
| tree | 2768efeaf6b4f81eb791ef8fd3843cddccc1ad69 /tests/typ | |
| parent | 7ed257a3c7d9aa69e9f127e78a918b862c4d4f74 (diff) | |
Add vertical alignment to equation number [Better Equation Numbering Pt.3] (#3482)
Diffstat (limited to 'tests/typ')
| -rw-r--r-- | tests/typ/math/equation-number.typ | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/tests/typ/math/equation-number.typ b/tests/typ/math/equation-number.typ index aefa308a..3de611b3 100644 --- a/tests/typ/math/equation-number.typ +++ b/tests/typ/math/equation-number.typ @@ -94,3 +94,52 @@ $ a + b = c $ --- // Error: 52-58 expected `start`, `left`, `right`, or `end`, found center #set math.equation(numbering: "(1)", number-align: center) + +--- +// Error: 52-67 expected `start`, `left`, `right`, or `end`, found center +#set math.equation(numbering: "(1)", number-align: center + bottom) + +--- +#set math.equation(numbering: "(1)") + +$ p &= ln a b \ + &= ln a + ln b $ + +--- +#set math.equation(numbering: "(1)", number-align: top+start) + +$ p &= ln a b \ + &= ln a + ln b $ + +--- +#show math.equation: set align(left) +#set math.equation(numbering: "(1)", number-align: bottom) + +$ q &= ln sqrt(a b) \ + &= 1/2 (ln a + ln b) $ + +--- +// Tests that if the numbering's layout box vertically exceeds the box of +// the equation frame's boundary, the latter's frame is resized correctly +// to encompass the numbering. #box() below delineates the resized frame. +// +// A row with "-" only has a height that's smaller than the height of the +// 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. +#set math.equation(numbering: "1", number-align: top) +#box( +$ - &- - \ + a &= b $, +fill: silver) + +#set math.equation(numbering: "1", number-align: horizon) +#box( +$ - - - $, +fill: silver) + +#set math.equation(numbering: "1", number-align: bottom) +#box( +$ a &= b \ + - &- - $, +fill: silver) |
