Rename cramp to cramped

This commit is contained in:
Laurenz 2023-06-09 14:48:23 +02:00
parent 58ca0e8db5
commit 903f440b28
2 changed files with 11 additions and 11 deletions

View File

@ -170,11 +170,11 @@ pub fn display(
/// and superscripts do. /// and superscripts do.
#[named] #[named]
#[default(false)] #[default(false)]
cramp: bool, cramped: bool,
) -> Content { ) -> Content {
MathStyleElem::new(body) MathStyleElem::new(body)
.with_size(Some(MathSize::Display)) .with_size(Some(MathSize::Display))
.with_cramp(Some(cramp)) .with_cramped(Some(cramped))
.pack() .pack()
} }
@ -198,11 +198,11 @@ pub fn inline(
/// and superscripts do. /// and superscripts do.
#[named] #[named]
#[default(false)] #[default(false)]
cramp: bool, cramped: bool,
) -> Content { ) -> Content {
MathStyleElem::new(body) MathStyleElem::new(body)
.with_size(Some(MathSize::Text)) .with_size(Some(MathSize::Text))
.with_cramp(Some(cramp)) .with_cramped(Some(cramped))
.pack() .pack()
} }
@ -225,11 +225,11 @@ pub fn script(
/// and superscripts do. /// and superscripts do.
#[named] #[named]
#[default(true)] #[default(true)]
cramp: bool, cramped: bool,
) -> Content { ) -> Content {
MathStyleElem::new(body) MathStyleElem::new(body)
.with_size(Some(MathSize::Script)) .with_size(Some(MathSize::Script))
.with_cramp(Some(cramp)) .with_cramped(Some(cramped))
.pack() .pack()
} }
@ -253,11 +253,11 @@ pub fn sscript(
/// and superscripts do. /// and superscripts do.
#[named] #[named]
#[default(true)] #[default(true)]
cramp: bool, cramped: bool,
) -> Content { ) -> Content {
MathStyleElem::new(body) MathStyleElem::new(body)
.with_size(Some(MathSize::ScriptScript)) .with_size(Some(MathSize::ScriptScript))
.with_cramp(Some(cramp)) .with_cramped(Some(cramped))
.pack() .pack()
} }
@ -284,7 +284,7 @@ pub struct MathStyleElem {
pub size: Option<MathSize>, pub size: Option<MathSize>,
/// Whether to limit height of exponents /// Whether to limit height of exponents
pub cramp: Option<bool>, pub cramped: Option<bool>,
} }
impl LayoutMath for MathStyleElem { impl LayoutMath for MathStyleElem {
@ -303,7 +303,7 @@ impl LayoutMath for MathStyleElem {
if let Some(size) = self.size(StyleChain::default()) { if let Some(size) = self.size(StyleChain::default()) {
style = style.with_size(size); 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); style = style.with_cramped(cramped);
} }
ctx.style(style); ctx.style(style);

View File

@ -16,7 +16,7 @@ $A, italic(A), upright(A), bold(A), bold(upright(A)), \
// Test forcing math size // Test forcing math size
$a/b, display(a/b), display(a)/display(b), inline(a/b), script(a/b), sscript(a/b) \ $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))\ 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. // Test a few style exceptions.