summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--crates/typst/src/math/equation.rs3
-rw-r--r--tests/ref/line-numbers-equation-number.pngbin0 -> 428 bytes
-rw-r--r--tests/suite/layout/line-numbers.typ9
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
new file mode 100644
index 00000000..9b4959eb
--- /dev/null
+++ b/tests/ref/line-numbers-equation-number.png
Binary files differ
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