diff options
| author | Laurenz <laurmaedje@gmail.com> | 2024-10-08 17:58:05 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2024-10-15 15:06:36 +0200 |
| commit | 5df07ee1f7519ee633e209daeda65ad1db535ddc (patch) | |
| tree | 6a89dea20a43fce5be738d8e1a54a425e27e5476 | |
| parent | 0253c3d8836079697ceee9690bba08c29d6828a4 (diff) | |
Disable line numbers for block equations (#5163)
| -rw-r--r-- | crates/typst/src/math/equation.rs | 3 | ||||
| -rw-r--r-- | tests/ref/line-numbers-equation-number.png | bin | 0 -> 428 bytes | |||
| -rw-r--r-- | tests/suite/layout/line-numbers.typ | 9 |
3 files changed, 11 insertions, 1 deletions
diff --git a/crates/typst/src/math/equation.rs b/crates/typst/src/math/equation.rs index 963a35c5..babcbb8b 100644 --- a/crates/typst/src/math/equation.rs +++ b/crates/typst/src/math/equation.rs @@ -17,7 +17,7 @@ use crate::layout::{ use crate::math::{ scaled_font_size, MathContext, MathRunFrameBuilder, MathSize, MathVariant, }; -use crate::model::{Numbering, Outlinable, ParElem, Refable, Supplement}; +use crate::model::{Numbering, Outlinable, ParElem, ParLine, Refable, Supplement}; use crate::syntax::Span; use crate::text::{ families, variant, Font, FontFamily, FontList, FontWeight, LocalName, TextElem, @@ -180,6 +180,7 @@ impl ShowSet for Packed<EquationElem> { if self.block(styles) { out.set(AlignElem::set_alignment(Alignment::CENTER)); out.set(BlockElem::set_breakable(false)); + out.set(ParLine::set_numbering(None)); out.set(EquationElem::set_size(MathSize::Display)); } else { out.set(EquationElem::set_size(MathSize::Text)); diff --git a/tests/ref/line-numbers-equation-number.png b/tests/ref/line-numbers-equation-number.png Binary files differnew file mode 100644 index 00000000..9b4959eb --- /dev/null +++ b/tests/ref/line-numbers-equation-number.png diff --git a/tests/suite/layout/line-numbers.typ b/tests/suite/layout/line-numbers.typ index 25f96d98..10241976 100644 --- a/tests/suite/layout/line-numbers.typ +++ b/tests/suite/layout/line-numbers.typ @@ -247,3 +247,12 @@ Line 3 [DDD], [DDD], [This is], move(dy: 3pt)[tough] ) + +--- line-numbers-equation-number --- +#set page(margin: (left: 2.5em)) +#set par.line(numbering: "1") +#set math.equation(numbering: "(1)") + +A +$ x $ +B |
