From c2ca3615d72ab6e7f2c29018f4a1e525b898e11d Mon Sep 17 00:00:00 2001 From: Laurenz Date: Thu, 14 Mar 2024 09:44:03 +0100 Subject: [PATCH] Fix sizing of nested equations (#3664) --- crates/typst/src/math/equation.rs | 2 ++ tests/ref/bugs/3658-math-size.png | Bin 0 -> 531 bytes tests/typ/bugs/3658-math-size.typ | 5 +++++ 3 files changed, 7 insertions(+) create mode 100644 tests/ref/bugs/3658-math-size.png create mode 100644 tests/typ/bugs/3658-math-size.typ diff --git a/crates/typst/src/math/equation.rs b/crates/typst/src/math/equation.rs index eb8f8f660..c5cb91322 100644 --- a/crates/typst/src/math/equation.rs +++ b/crates/typst/src/math/equation.rs @@ -176,6 +176,8 @@ impl ShowSet for Packed { if self.block(styles) { out.set(AlignElem::set_alignment(Alignment::CENTER)); out.set(EquationElem::set_size(MathSize::Display)); + } else { + out.set(EquationElem::set_size(MathSize::Text)); } out.set(TextElem::set_weight(FontWeight::from_number(450))); out.set(TextElem::set_font(FontList(vec![FontFamily::new( diff --git a/tests/ref/bugs/3658-math-size.png b/tests/ref/bugs/3658-math-size.png new file mode 100644 index 0000000000000000000000000000000000000000..94c8d3881665e94730d52c0551a164c9eef0f306 GIT binary patch literal 531 zcmeAS@N?(olHy`uVBq!ia0y~yU}OQZ+c!*V!_SH=6B{2iEw})dIwN>) zdi1F`f?@2lK3VX+VuomGG3T$eikma*MuGc`$cQ<2Q*zRB*c^XN{}{E*^w7I=+0`=a z?^<4eo$FrS@^jU{S6gz6TlS|1rS396boP8;roq!&QjX=5W?hn)wykdMO=X#X@zbpj zIi8%TmbX{%Tk*1K&%9E53;wG=-5Hb561%q~y<>xfl(&?gx75ZH5qFZRc~PAGV-82` zL`emfiIEB=ZD~+<=eJDutZrG^)#G%Jy*7*?~b6A+Y-0W)(fAO>r9)gn%#1H+w``b61K;m-MP@z;5+pIQ=+2Lw(AiO np+UwXurKY8+SCppu)8J9;wXMll