diff options
Diffstat (limited to 'library/src/math')
| -rw-r--r-- | library/src/math/matrix.rs | 22 | ||||
| -rw-r--r-- | library/src/math/mod.rs | 70 | ||||
| -rw-r--r-- | library/src/math/style.rs | 56 |
3 files changed, 84 insertions, 64 deletions
diff --git a/library/src/math/matrix.rs b/library/src/math/matrix.rs index a32750ff..92199774 100644 --- a/library/src/math/matrix.rs +++ b/library/src/math/matrix.rs @@ -1,13 +1,14 @@ use super::*; +/// # Vector /// A column vector. /// -/// # Parameters +/// ## Parameters /// - elements: Content (positional, variadic) /// The elements of the vector. /// -/// # Tags -/// - math +/// ## Category +/// math #[func] #[capable(Texify)] #[derive(Debug, Hash)] @@ -59,24 +60,25 @@ pub enum Delimiter { castable! { Delimiter, - /// Delimit matrices with parentheses. + /// Delimit vector with parentheses. "(" => Self::Paren, - /// Delimit matrices with brackets. + /// Delimit vector with brackets. "[" => Self::Bracket, - /// Delimit matrices with curly braces. + /// Delimit vector with curly braces. "{" => Self::Brace, - /// Delimit matrices with vertical bars. + /// Delimit vector with vertical bars. "|" => Self::Bar, } +/// # Cases /// A case distinction. /// -/// # Parameters +/// ## Parameters /// - branches: Content (positional, variadic) /// The branches of the case distinction. /// -/// # Tags -/// - math +/// ## Category +/// math #[func] #[capable(Texify)] #[derive(Debug, Hash)] diff --git a/library/src/math/mod.rs b/library/src/math/mod.rs index 5342a954..c8d15796 100644 --- a/library/src/math/mod.rs +++ b/library/src/math/mod.rs @@ -14,17 +14,18 @@ use self::tex::layout_tex; use crate::prelude::*; use crate::text::{FontFamily, LinebreakNode, SpaceNode, SymbolNode, TextNode}; +/// # Math /// A piece of a mathematical formula. /// -/// # Parameters +/// ## Parameters /// - items: Content (positional, variadic) /// The individual parts of the formula. /// /// - block: bool (named) /// Whether the formula is displayed as a separate block. /// -/// # Tags -/// - math +/// ## Category +/// math #[func] #[capable(Show, Layout, Inline, Texify)] #[derive(Debug, Clone, Hash)] @@ -259,14 +260,15 @@ impl Texify for Content { } } +/// # Atom /// An atom in a math formula: `x`, `+`, `12`. /// -/// # Parameters +/// ## Parameters /// - text: EcoString (positional, required) /// The atom's text. /// -/// # Tags -/// - math +/// ## Category +/// math #[func] #[capable(Texify)] #[derive(Debug, Hash)] @@ -305,17 +307,18 @@ impl Texify for AtomNode { } } +/// # Accent /// An accented node. /// -/// # Parameters +/// ## Parameters /// - base: Content (positional, required) /// The base to which the accent is applied. /// /// - accent: Content (positional, required) /// The accent to apply to the base. /// -/// # Tags -/// - math +/// ## Category +/// math #[func] #[capable(Texify)] #[derive(Debug, Hash)] @@ -390,17 +393,18 @@ impl Texify for AccNode { } } +/// # Fraction /// A fraction. /// -/// # Parameters +/// ## Parameters /// - num: Content (positional, required) /// The fraction's numerator. /// /// - denom: Content (positional, required) /// The fraction's denominator. /// -/// # Tags -/// - math +/// ## Category +/// math #[func] #[capable(Texify)] #[derive(Debug, Hash)] @@ -431,17 +435,18 @@ impl Texify for FracNode { } } +/// # Binomial /// A binomial. /// -/// # Parameters +/// ## Parameters /// - upper: Content (positional, required) /// The binomial's upper index. /// /// - lower: Content (positional, required) /// The binomial's lower index. /// -/// # Tags -/// - math +/// ## Category +/// math #[func] #[capable(Texify)] #[derive(Debug, Hash)] @@ -472,9 +477,10 @@ impl Texify for BinomNode { } } +/// # Script /// A sub- and/or superscript. /// -/// # Parameters +/// ## Parameters /// - base: Content (positional, required) /// The base to which the applies the sub- and/or superscript. /// @@ -484,8 +490,8 @@ impl Texify for BinomNode { /// - sup: Content (named) /// The superscript. /// -/// # Tags -/// - math +/// ## Category +/// math #[func] #[capable(Texify)] #[derive(Debug, Hash)] @@ -528,14 +534,15 @@ impl Texify for ScriptNode { } } +/// # Alignment Point /// A math alignment point: `&`, `&&`. /// -/// # Parameters +/// ## Parameters /// - index: usize (positional, required) /// The alignment point's index. /// -/// # Tags -/// - math +/// ## Category +/// math #[func] #[capable(Texify)] #[derive(Debug, Hash)] @@ -554,14 +561,15 @@ impl Texify for AlignPointNode { } } +/// # Square Root /// A square root. /// -/// # Parameters +/// ## Parameters /// - body: Content (positional, required) /// The expression to take the square root of. /// -/// # Tags -/// - math +/// ## Category +/// math #[func] #[capable(Texify)] #[derive(Debug, Hash)] @@ -583,14 +591,15 @@ impl Texify for SqrtNode { } } +/// # Floor /// A floored expression. /// -/// # Parameters +/// ## Parameters /// - body: Content (positional, required) /// The expression to floor. /// -/// # Tags -/// - math +/// ## Category +/// math #[func] #[capable(Texify)] #[derive(Debug, Hash)] @@ -612,14 +621,15 @@ impl Texify for FloorNode { } } +/// # Ceil /// A ceiled expression. /// -/// # Parameters +/// ## Parameters /// - body: Content (positional, required) /// The expression to ceil. /// -/// # Tags -/// - math +/// ## Category +/// math #[func] #[capable(Texify)] #[derive(Debug, Hash)] diff --git a/library/src/math/style.rs b/library/src/math/style.rs index 344aa071..4a9c43b8 100644 --- a/library/src/math/style.rs +++ b/library/src/math/style.rs @@ -1,13 +1,14 @@ use super::*; +/// # Serif /// Serif (roman) font style. /// -/// # Parameters +/// ## Parameters /// - body: Content (positional, required) /// The piece of formula to style. /// -/// # Tags -/// - math +/// ## Category +/// math #[func] #[capable(Texify)] #[derive(Debug, Hash)] @@ -29,14 +30,15 @@ impl Texify for SerifNode { } } +/// # Sans-serif /// Sans-serif font style. /// -/// # Parameters +/// ## Parameters /// - body: Content (positional, required) /// The piece of formula to style. /// -/// # Tags -/// - math +/// ## Category +/// math #[func] #[capable(Texify)] #[derive(Debug, Hash)] @@ -58,14 +60,15 @@ impl Texify for SansNode { } } +/// # Bold /// Bold font style. /// -/// # Parameters +/// ## Parameters /// - body: Content (positional, required) /// The piece of formula to style. /// -/// # Tags -/// - math +/// ## Category +/// math #[func] #[capable(Texify)] #[derive(Debug, Hash)] @@ -87,14 +90,15 @@ impl Texify for BoldNode { } } +/// # Italic /// Italic font style. /// -/// # Parameters +/// ## Parameters /// - body: Content (positional, required) /// The piece of formula to style. /// -/// # Tags -/// - math +/// ## Category +/// math #[func] #[capable(Texify)] #[derive(Debug, Hash)] @@ -116,14 +120,15 @@ impl Texify for ItalNode { } } +/// # Calligraphic /// Calligraphic font style. /// -/// # Parameters +/// ## Parameters /// - body: Content (positional, required) /// The piece of formula to style. /// -/// # Tags -/// - math +/// ## Category +/// math #[func] #[capable(Texify)] #[derive(Debug, Hash)] @@ -145,14 +150,15 @@ impl Texify for CalNode { } } +/// # Fraktur /// Fraktur font style. /// -/// # Parameters +/// ## Parameters /// - body: Content (positional, required) /// The piece of formula to style. /// -/// # Tags -/// - math +/// ## Category +/// math #[func] #[capable(Texify)] #[derive(Debug, Hash)] @@ -174,14 +180,15 @@ impl Texify for FrakNode { } } +/// # Monospace /// Monospace font style. /// -/// # Parameters +/// ## Parameters /// - body: Content (positional, required) /// The piece of formula to style. /// -/// # Tags -/// - math +/// ## Category +/// math #[func] #[capable(Texify)] #[derive(Debug, Hash)] @@ -203,14 +210,15 @@ impl Texify for MonoNode { } } +/// # Doublestruck /// Blackboard bold (double-struck) font style. /// -/// # Parameters +/// ## Parameters /// - body: Content (positional, required) /// The piece of formula to style. /// -/// # Tags -/// - math +/// ## Category +/// math #[func] #[capable(Texify)] #[derive(Debug, Hash)] |
