pub struct MathML { /* private fields */ }Expand description
MathML post-processor.
Port of LaTeXML::Post::MathML.
Handles both Presentation and Content MathML conversion.
Implementations§
Source§impl MathML
impl MathML
Sourcepub fn new_presentation() -> Self
pub fn new_presentation() -> Self
Create a Presentation MathML processor.
Sourcepub fn new_content() -> Self
pub fn new_content() -> Self
Create a Content MathML processor.
Sourcepub fn with_intent_literal(self, enable: bool) -> Self
pub fn with_intent_literal(self, enable: bool) -> Self
Enable intent=“:literal” on all <math> elements.
Perl: ar5iv.sty.ltxml monkey-patches outerWrapper for this.
Sourcepub fn with_linebreaking(self, width: u32) -> Self
pub fn with_linebreaking(self, width: u32) -> Self
Enable line-breaking with the given width.
Sourcepub fn with_keep_xmath(self, keep: bool) -> Self
pub fn with_keep_xmath(self, keep: bool) -> Self
Keep XMath nodes in the output alongside MathML.
Sourcepub fn with_invisible_times(self, emit: bool) -> Self
pub fn with_invisible_times(self, emit: bool) -> Self
Set whether to emit invisible times (U+2062) in MathML output. When false, invisible times is replaced with zero-width space (U+200B). Perl: –noinvisibletimes
Sourcepub fn with_plane1(self, plane1: bool, hack_plane1: bool) -> Self
pub fn with_plane1(self, plane1: bool, hack_plane1: bool) -> Self
Set the Plane-1 remapping mode. plane1 off keeps ASCII text plus a
mathvariant attribute; hack_plane1 remaps only the poorly-supported
variants and implies plane1. Perl --plane1 / --hackplane1.
Sourcepub fn with_mathtex(self, enable: bool) -> Self
pub fn with_mathtex(self, enable: bool) -> Self
Enable TeX source annotation in MathML output (–mathtex).
Sourcepub fn secondary(self) -> Self
pub fn secondary(self) -> Self
Mark this processor as a parallel-markup secondary (e.g. the Content-MathML
format under a Presentation primary). Secondaries get their format-specific
id_suffix and are folded into the primary’s <m:semantics> rather than
emitted as a standalone <m:math>. Port of MathProcessor’s secondary role.
Sourcepub fn with_secondaries(self, secondaries: Vec<Box<dyn MathProcessor>>) -> Self
pub fn with_secondaries(self, secondaries: Vec<Box<dyn MathProcessor>>) -> Self
Attach parallel-markup secondaries to this (primary) processor. Their
conversions are merged into one <m:semantics> by
combine_parallel
during the primary’s pass. Mirrors Perl MathProcessor’s primary holding
its parallel secondaries.
Trait Implementations§
Source§impl MathProcessor for MathML
impl MathProcessor for MathML
Source§fn convert_node(
&self,
doc: &PostDocument,
xmath: &Node,
) -> Option<MathConversion>
fn convert_node( &self, doc: &PostDocument, xmath: &Node, ) -> Option<MathConversion>
Source§fn combine_parallel(
&self,
_doc: &PostDocument,
xmath: &Node,
primary: MathConversion,
secondaries: Vec<MathConversion>,
) -> MathConversion
fn combine_parallel( &self, _doc: &PostDocument, xmath: &Node, primary: MathConversion, secondaries: Vec<MathConversion>, ) -> MathConversion
Source§fn outer_wrapper(
&self,
_doc: &PostDocument,
xmath: &Node,
conversion: NodeData,
) -> NodeData
fn outer_wrapper( &self, _doc: &PostDocument, xmath: &Node, conversion: NodeData, ) -> NodeData
m:math). Read moreSource§fn raw_id_suffix(&self) -> &str
fn raw_id_suffix(&self) -> &str
Source§fn is_secondary(&self) -> bool
fn is_secondary(&self) -> bool
Source§fn can_convert(&self, _doc: &PostDocument, math: &Node) -> bool
fn can_convert(&self, _doc: &PostDocument, math: &Node) -> bool
Source§fn parallel_secondaries(&self) -> &[Box<dyn MathProcessor>]
fn parallel_secondaries(&self) -> &[Box<dyn MathProcessor>]
process_math_node, each secondary’s convert_node runs against
the still-live XMath and the results are folded into one <m:semantics>
via combine_parallel. Empty by
default (standalone, single-format).
Port of Perl MathProcessor’s primary→secondary parallel model.Source§fn preprocess(&self, _doc: &PostDocument, _nodes: &[Node])
fn preprocess(&self, _doc: &PostDocument, _nodes: &[Node])
Source§impl Processor for MathML
impl Processor for MathML
Source§fn to_process(&self, doc: &PostDocument) -> Vec<Node>
fn to_process(&self, doc: &PostDocument) -> Vec<Node>
Source§fn process(&mut self, doc: PostDocument, nodes: Vec<Node>) -> ProcessResult
fn process(&mut self, doc: PostDocument, nodes: Vec<Node>) -> ProcessResult
to_process.
Returns the resulting document(s) — splitting may produce multiple.