From f1025071edfb787309a75d4bb68bec0c2bd906bb Mon Sep 17 00:00:00 2001 From: Laurenz Date: Sat, 24 Jun 2023 15:05:59 +0200 Subject: Tidy up --- library/src/math/attach.rs | 7 +++---- library/src/math/row.rs | 8 ++++---- library/src/math/underover.rs | 3 +-- 3 files changed, 8 insertions(+), 10 deletions(-) (limited to 'library/src/math') diff --git a/library/src/math/attach.rs b/library/src/math/attach.rs index 158e5f0d..fedeb908 100644 --- a/library/src/math/attach.rs +++ b/library/src/math/attach.rs @@ -125,11 +125,10 @@ pub struct LimitsElem { #[required] pub body: Content, - /// Whether to apply limits in inline equations. + /// Whether to also force limits in inline equations. /// - /// It is useful to disable this setting - /// in most cases of applying limits globally - /// (inside show rules or new elements) + /// When applying limits globally (e.g., through a show rule), it is + /// typically a good idea to disable this. #[default(true)] pub inline: bool, } diff --git a/library/src/math/row.rs b/library/src/math/row.rs index 1704dbf1..687f82b8 100644 --- a/library/src/math/row.rs +++ b/library/src/math/row.rs @@ -85,11 +85,11 @@ impl MathRow { self.0.iter() } - /// It is very unintuitive, but in current state of things - /// `MathRow` can contain several actual rows. - /// That function deconstructs it to "single" rows. + /// Extract the sublines of the row. /// - /// Hopefully that cloner is only a temporary hack + /// It is very unintuitive, but in current state of things, a `MathRow` can + /// contain several actual rows. That function deconstructs it to "single" + /// rows. Hopefully this is only a temporary hack. pub fn rows(&self) -> Vec { self.0 .split(|frag| matches!(frag, MathFragment::Linebreak)) diff --git a/library/src/math/underover.rs b/library/src/math/underover.rs index df3ba582..29c0e543 100644 --- a/library/src/math/underover.rs +++ b/library/src/math/underover.rs @@ -206,9 +206,8 @@ fn layout( let body = body.into_fragment(ctx); let glyph = GlyphFragment::new(ctx, c, span); let stretched = glyph.stretch_horizontal(ctx, body.width(), Abs::zero()); - let body = MathRow::new(vec![body]); - let mut rows = vec![body, stretched.into()]; + let mut rows = vec![MathRow::new(vec![body]), stretched.into()]; ctx.style(if reverse { ctx.style.for_subscript() } else { -- cgit v1.2.3