diff --git a/library/src/math/style.rs b/library/src/math/style.rs index 05ff64dcc..b6549ee95 100644 --- a/library/src/math/style.rs +++ b/library/src/math/style.rs @@ -170,11 +170,11 @@ pub fn display( /// and superscripts do. #[named] #[default(false)] - cramp: bool, + cramped: bool, ) -> Content { MathStyleElem::new(body) .with_size(Some(MathSize::Display)) - .with_cramp(Some(cramp)) + .with_cramped(Some(cramped)) .pack() } @@ -198,11 +198,11 @@ pub fn inline( /// and superscripts do. #[named] #[default(false)] - cramp: bool, + cramped: bool, ) -> Content { MathStyleElem::new(body) .with_size(Some(MathSize::Text)) - .with_cramp(Some(cramp)) + .with_cramped(Some(cramped)) .pack() } @@ -225,11 +225,11 @@ pub fn script( /// and superscripts do. #[named] #[default(true)] - cramp: bool, + cramped: bool, ) -> Content { MathStyleElem::new(body) .with_size(Some(MathSize::Script)) - .with_cramp(Some(cramp)) + .with_cramped(Some(cramped)) .pack() } @@ -253,11 +253,11 @@ pub fn sscript( /// and superscripts do. #[named] #[default(true)] - cramp: bool, + cramped: bool, ) -> Content { MathStyleElem::new(body) .with_size(Some(MathSize::ScriptScript)) - .with_cramp(Some(cramp)) + .with_cramped(Some(cramped)) .pack() } @@ -284,7 +284,7 @@ pub struct MathStyleElem { pub size: Option, /// Whether to limit height of exponents - pub cramp: Option, + pub cramped: Option, } impl LayoutMath for MathStyleElem { @@ -303,7 +303,7 @@ impl LayoutMath for MathStyleElem { if let Some(size) = self.size(StyleChain::default()) { style = style.with_size(size); } - if let Some(cramped) = self.cramp(StyleChain::default()) { + if let Some(cramped) = self.cramped(StyleChain::default()) { style = style.with_cramped(cramped); } ctx.style(style); diff --git a/tests/typ/math/style.typ b/tests/typ/math/style.typ index 5ee0636f0..37b0e6d81 100644 --- a/tests/typ/math/style.typ +++ b/tests/typ/math/style.typ @@ -16,7 +16,7 @@ $A, italic(A), upright(A), bold(A), bold(upright(A)), \ // Test forcing math size $a/b, display(a/b), display(a)/display(b), inline(a/b), script(a/b), sscript(a/b) \ mono(script(a/b)), script(mono(a/b))\ - script(a^b, cramp: #true), script(a^b, cramp: #false)$ + script(a^b, cramped: #true), script(a^b, cramped: #false)$ --- // Test a few style exceptions.