Disable line numbers for block equations (#5163)

This commit is contained in:
Laurenz 2024-10-08 17:58:05 +02:00 committed by GitHub
parent b7725a7442
commit 9ee80762a5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 11 additions and 1 deletions

View File

@ -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));

Binary file not shown.

After

Width:  |  Height:  |  Size: 428 B

View File

@ -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