Expand description
Office Math Markup Language (OMML) support for the ooxml library.
This crate provides types and parsing for mathematical formulas in Word, Excel, and PowerPoint documents.
§Example
use ooxml_omml::{MathZone, parse_math_zone};
let xml = r#"<m:oMath xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math">
<m:f>
<m:num><m:r><m:t>1</m:t></m:r></m:num>
<m:den><m:r><m:t>2</m:t></m:r></m:den>
</m:f>
</m:oMath>"#;
let zone = parse_math_zone(xml.as_bytes()).unwrap();
assert_eq!(zone.text(), "(1)/(2)");§Supported Elements
- Fractions (
m:f) - Radicals (
m:rad) - N-ary operators like summation and integrals (
m:nary) - Subscripts and superscripts (
m:sSub,m:sSup,m:sSubSup) - Delimiters/parentheses (
m:d) - Matrices (
m:m) - Functions (
m:func) - Accents (
m:acc) - And more…
Re-exports§
pub use error::Error;pub use error::Result;pub use math::Accent;pub use math::Bar;pub use math::BorderBox;pub use math::Delimiter;pub use math::EquationArray;pub use math::Fraction;pub use math::FractionType;pub use math::Function;pub use math::GroupChar;pub use math::Limit;pub use math::LimitLocation;pub use math::MathBox;pub use math::MathElement;pub use math::MathRun;pub use math::MathRunProperties;pub use math::MathScript;pub use math::MathStyle;pub use math::MathZone;pub use math::Matrix;pub use math::Nary;pub use math::Phantom;pub use math::PreScript;pub use math::Radical;pub use math::Script;pub use math::SubSuperscript;pub use math::VerticalPosition;pub use math::parse_math_zone;pub use math::parse_math_zone_from_reader;pub use math::serialize_math_zone;