mirror of
https://github.com/typst/typst
synced 2025-05-14 17:15:28 +08:00
Disable line numbers for block equations (#5163)
This commit is contained in:
parent
0253c3d883
commit
5df07ee1f7
@ -17,7 +17,7 @@ use crate::layout::{
|
|||||||
use crate::math::{
|
use crate::math::{
|
||||||
scaled_font_size, MathContext, MathRunFrameBuilder, MathSize, MathVariant,
|
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::syntax::Span;
|
||||||
use crate::text::{
|
use crate::text::{
|
||||||
families, variant, Font, FontFamily, FontList, FontWeight, LocalName, TextElem,
|
families, variant, Font, FontFamily, FontList, FontWeight, LocalName, TextElem,
|
||||||
@ -180,6 +180,7 @@ impl ShowSet for Packed<EquationElem> {
|
|||||||
if self.block(styles) {
|
if self.block(styles) {
|
||||||
out.set(AlignElem::set_alignment(Alignment::CENTER));
|
out.set(AlignElem::set_alignment(Alignment::CENTER));
|
||||||
out.set(BlockElem::set_breakable(false));
|
out.set(BlockElem::set_breakable(false));
|
||||||
|
out.set(ParLine::set_numbering(None));
|
||||||
out.set(EquationElem::set_size(MathSize::Display));
|
out.set(EquationElem::set_size(MathSize::Display));
|
||||||
} else {
|
} else {
|
||||||
out.set(EquationElem::set_size(MathSize::Text));
|
out.set(EquationElem::set_size(MathSize::Text));
|
||||||
|
BIN
tests/ref/line-numbers-equation-number.png
Normal file
BIN
tests/ref/line-numbers-equation-number.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 428 B |
@ -247,3 +247,12 @@ Line 3
|
|||||||
[DDD], [DDD],
|
[DDD], [DDD],
|
||||||
[This is], move(dy: 3pt)[tough]
|
[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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user