diff options
Diffstat (limited to 'library/src/math')
| -rw-r--r-- | library/src/math/mod.rs | 22 | ||||
| -rw-r--r-- | library/src/math/op.rs | 2 | ||||
| -rw-r--r-- | library/src/math/style.rs | 22 |
3 files changed, 23 insertions, 23 deletions
diff --git a/library/src/math/mod.rs b/library/src/math/mod.rs index 6df1d87a..c1e352d1 100644 --- a/library/src/math/mod.rs +++ b/library/src/math/mod.rs @@ -47,7 +47,7 @@ use crate::text::{ /// Create a module with all math definitions. pub fn module() -> Module { let mut math = Scope::deduplicating(); - math.define("formula", FormulaNode::id()); + math.define("equation", EquationNode::id()); math.define("text", TextNode::id()); // Grouping. @@ -106,7 +106,7 @@ pub fn module() -> Module { Module::new("math").with_scope(math) } -/// A mathematical formula. +/// A mathematical equation. /// /// Can be displayed inline with text or as a separate block. /// @@ -125,25 +125,25 @@ pub fn module() -> Module { /// /// ## Syntax /// This function also has dedicated syntax: Write mathematical markup within -/// dollar signs to create a formula. Starting and ending the formula with at +/// dollar signs to create an equation. Starting and ending the equation with at /// least one space lifts it into a separate block that is centered /// horizontally. For more details about math syntax, see the /// [main math page]($category/math). /// -/// Display: Formula +/// Display: Equation /// Category: math #[node(Show, Finalize, Layout, LayoutMath)] -pub struct FormulaNode { - /// Whether the formula is displayed as a separate block. +pub struct EquationNode { + /// Whether the equation is displayed as a separate block. #[default(false)] pub block: bool, - /// The content of the formula. + /// The contents of the equation. #[required] pub body: Content, } -impl Show for FormulaNode { +impl Show for EquationNode { fn show(&self, _: &mut Vt, styles: StyleChain) -> SourceResult<Content> { let mut realized = self.clone().pack().guarded(Guard::Base(NodeId::of::<Self>())); if self.block(styles) { @@ -153,7 +153,7 @@ impl Show for FormulaNode { } } -impl Finalize for FormulaNode { +impl Finalize for EquationNode { fn finalize(&self, realized: Content, _: StyleChain) -> Content { realized .styled(TextNode::set_weight(FontWeight::from_number(450))) @@ -163,7 +163,7 @@ impl Finalize for FormulaNode { } } -impl Layout for FormulaNode { +impl Layout for EquationNode { fn layout( &self, vt: &mut Vt, @@ -209,7 +209,7 @@ pub trait LayoutMath { fn layout_math(&self, ctx: &mut MathContext) -> SourceResult<()>; } -impl LayoutMath for FormulaNode { +impl LayoutMath for EquationNode { fn layout_math(&self, ctx: &mut MathContext) -> SourceResult<()> { self.body().layout_math(ctx) } diff --git a/library/src/math/op.rs b/library/src/math/op.rs index bd81aa0e..dae43c3a 100644 --- a/library/src/math/op.rs +++ b/library/src/math/op.rs @@ -2,7 +2,7 @@ use typst::eval::Scope; use super::*; -/// A text operator in a math formula. +/// A text operator in an equation. /// /// ## Example /// ```example diff --git a/library/src/math/style.rs b/library/src/math/style.rs index 60bad6a5..a3383a0c 100644 --- a/library/src/math/style.rs +++ b/library/src/math/style.rs @@ -11,7 +11,7 @@ use super::*; /// Category: math #[node(LayoutMath)] pub struct BoldNode { - /// The piece of formula to style. + /// The content to style. #[required] pub body: Content, } @@ -36,7 +36,7 @@ impl LayoutMath for BoldNode { /// Category: math #[node(LayoutMath)] pub struct UprightNode { - /// The piece of formula to style. + /// The content to style. #[required] pub body: Content, } @@ -58,7 +58,7 @@ impl LayoutMath for UprightNode { /// Category: math #[node(LayoutMath)] pub struct ItalicNode { - /// The piece of formula to style. + /// The content to style. #[required] pub body: Content, } @@ -80,7 +80,7 @@ impl LayoutMath for ItalicNode { /// Category: math #[node(LayoutMath)] pub struct SerifNode { - /// The piece of formula to style. + /// The content to style. #[required] pub body: Content, } @@ -105,7 +105,7 @@ impl LayoutMath for SerifNode { /// Category: math #[node(LayoutMath)] pub struct SansNode { - /// The piece of formula to style. + /// The content to style. #[required] pub body: Content, } @@ -130,7 +130,7 @@ impl LayoutMath for SansNode { /// Category: math #[node(LayoutMath)] pub struct CalNode { - /// The piece of formula to style. + /// The content to style. #[required] pub body: Content, } @@ -155,7 +155,7 @@ impl LayoutMath for CalNode { /// Category: math #[node(LayoutMath)] pub struct FrakNode { - /// The piece of formula to style. + /// The content to style. #[required] pub body: Content, } @@ -180,7 +180,7 @@ impl LayoutMath for FrakNode { /// Category: math #[node(LayoutMath)] pub struct MonoNode { - /// The piece of formula to style. + /// The content to style. #[required] pub body: Content, } @@ -210,7 +210,7 @@ impl LayoutMath for MonoNode { /// Category: math #[node(LayoutMath)] pub struct BbNode { - /// The piece of formula to style. + /// The content to style. #[required] pub body: Content, } @@ -224,7 +224,7 @@ impl LayoutMath for BbNode { } } -/// Text properties in a formula. +/// Text properties in math. #[derive(Debug, Copy, Clone, Eq, PartialEq)] pub struct MathStyle { /// The style variant to select. @@ -298,7 +298,7 @@ impl MathStyle { } } -/// The size of elements in a formula. +/// The size of elements in an equation. /// /// See the TeXbook p. 141. #[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
