From bf5edbbbbb75120d065d1c9587ccfa4eed4fdca1 Mon Sep 17 00:00:00 2001 From: Laurenz Date: Fri, 25 Nov 2022 10:36:31 +0100 Subject: Tidy up --- library/src/math/mod.rs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'library/src/math/mod.rs') diff --git a/library/src/math/mod.rs b/library/src/math/mod.rs index 1ea03d70..3b1d66e9 100644 --- a/library/src/math/mod.rs +++ b/library/src/math/mod.rs @@ -4,6 +4,8 @@ mod tex; use std::fmt::Write; +use typst::model::Guard; + use self::tex::{layout_tex, Texify}; use crate::prelude::*; use crate::text::FontFamily; @@ -28,21 +30,21 @@ impl MathNode { } impl Show for MathNode { - fn show(&self, _: Tracked, styles: StyleChain) -> SourceResult { + fn show(&self, _: Tracked, styles: StyleChain) -> Content { let mut map = StyleMap::new(); map.set_family(FontFamily::new("NewComputerModernMath"), styles); let mut realized = self .clone() .pack() - .guarded(RecipeId::Base(NodeId::of::())) + .guarded(Guard::Base(NodeId::of::())) .styled_with_map(map); if self.display { realized = realized.aligned(Axes::with_x(Some(Align::Center.into()))) } - Ok(realized) + realized } } @@ -50,10 +52,10 @@ impl LayoutInline for MathNode { fn layout_inline( &self, world: Tracked, - _: &Regions, styles: StyleChain, + _: &Regions, ) -> SourceResult { - layout_tex(&self.texify(), self.display, world, styles) + layout_tex(world, &self.texify(), self.display, styles) } } -- cgit v1.2.3