Skip to main content

MathExt

Trait MathExt 

Source
pub trait MathExt {
    // Required method
    fn math_expressions(&self) -> Vec<MathExpression>;

    // Provided method
    fn has_math(&self) -> bool { ... }
}
Expand description

Extension methods for types that may contain OMML math (ECMA-376 Part 1 §22.1).

Math in DOCX uses <m:oMath> (inline) or <m:oMathPara> (display/block) elements from the namespace http://schemas.openxmlformats.org/officeDocument/2006/math. Because the OMML namespace is separate from the WordprocessingML namespace, the generated parser stores these elements in extra_children on Paragraph. This trait walks those raw nodes to detect and extract math.

Required Methods§

Source

fn math_expressions(&self) -> Vec<MathExpression>

Return all math expressions contained in this element.

Provided Methods§

Source

fn has_math(&self) -> bool

Return true if this element contains at least one math expression.

Implementors§

Source§

impl MathExt for Body

Available on crate feature extra-children only.
Source§

impl MathExt for Paragraph

Available on crate feature extra-children only.