Expand description
Internal library for the math-core crate for rendering MathML.
This library allows you to construct an AST representing MathML and then render it to a string.
§Example
use math_core_renderer_internal::ast::Node;
use math_core_renderer_internal::symbol;
use math_core_renderer_internal::attribute::{MathSpacing, LetterAttr};
let ast = Node::Row {
nodes: &[
&Node::Underset {
target: &Node::Operator {
op: symbol::N_ARY_SUMMATION.as_op(),
attr: None,
left: Some(MathSpacing::Zero),
right: None,
},
symbol: &Node::IdentifierChar('i', LetterAttr::Default),
},
&Node::IdentifierChar('i', LetterAttr::Default),
],
attr: None,
};
let mut output = String::new();
ast.emit(&mut output, 0).unwrap();
assert_eq!(
output,
"<mrow><munder><mo lspace=\"0\">∑</mo><mi>i</mi></munder><mi>i</mi></mrow>"
);