pub struct UnicodeMath { /* private fields */ }Expand description
UnicodeMath post-processor.
Port of LaTeXML::Post::UnicodeMath.
Implementations§
Source§impl UnicodeMath
impl UnicodeMath
pub fn new() -> Self
Sourcepub fn with_keep_xmath(self, keep: bool) -> Self
pub fn with_keep_xmath(self, keep: bool) -> Self
Keep the XMath beside the converted string (--keepXMath), as the MathML
processors do.
Trait Implementations§
Source§impl Default for UnicodeMath
impl Default for UnicodeMath
Source§impl MathProcessor for UnicodeMath
impl MathProcessor for UnicodeMath
Source§fn convert_node(
&self,
doc: &PostDocument,
xmath: &Node,
) -> Option<MathConversion>
fn convert_node( &self, doc: &PostDocument, xmath: &Node, ) -> Option<MathConversion>
Convert an XMath node to this processor’s format. Read more
Source§fn raw_id_suffix(&self) -> &str
fn raw_id_suffix(&self) -> &str
Raw ID suffix for this format (e.g., “.pmml”, “.cmml”, “.om”).
Primary format returns empty string; secondaries return their suffix. Read more
Source§fn is_secondary(&self) -> bool
fn is_secondary(&self) -> bool
Whether this processor is a secondary (parallel) processor.
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
Combine parallel markup from primary conversion + secondaries. Read more
Source§fn parallel_secondaries(&self) -> &[Box<dyn MathProcessor>]
fn parallel_secondaries(&self) -> &[Box<dyn MathProcessor>]
Parallel-markup secondaries held by this (primary) processor. During the
primary’s
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 id_suffix(&self) -> &str
fn id_suffix(&self) -> &str
ID suffix: empty for primary, raw_id_suffix for secondary. Read more
Source§fn can_convert(&self, _doc: &PostDocument, _math: &Node) -> bool
fn can_convert(&self, _doc: &PostDocument, _math: &Node) -> bool
Whether this processor can convert the given math node.
Default: always true. Read more
Source§fn preprocess(&self, _doc: &PostDocument, _nodes: &[Node])
fn preprocess(&self, _doc: &PostDocument, _nodes: &[Node])
Optional preprocessing before conversion begins. Read more
Source§fn outer_wrapper(
&self,
_doc: &PostDocument,
_xmath: &Node,
conversion: NodeData,
) -> NodeData
fn outer_wrapper( &self, _doc: &PostDocument, _xmath: &Node, conversion: NodeData, ) -> NodeData
Wrap the converted XML in the appropriate outer element (e.g.,
m:math). Read moreSource§impl Processor for UnicodeMath
impl Processor for UnicodeMath
Source§fn process(&mut self, doc: PostDocument, nodes: Vec<Node>) -> ProcessResult
fn process(&mut self, doc: PostDocument, nodes: Vec<Node>) -> ProcessResult
Standalone (no MathML primary): Perl inherits MathProcessor::process
(Post.pm L290-342), whose processNode wraps the string as
<ltx:text class="ltx_math_application/x-unicodemath"> in place of the XMath
(L394-396) — what latexmlmath --unicodemath reads back (bin/latexmlmath
L244-248).
Source§fn to_process(&self, doc: &PostDocument) -> Vec<Node>
fn to_process(&self, doc: &PostDocument) -> Vec<Node>
Return the nodes to be processed; by default the document element.
This allows processors to focus on specific kinds of nodes,
or to skip processing if there are none to process.
Source§fn resource_directory(&self) -> Option<&str>
fn resource_directory(&self) -> Option<&str>
Resource directory for generated resources (images, etc.).
Source§fn resource_prefix(&self) -> Option<&str>
fn resource_prefix(&self) -> Option<&str>
Resource prefix for generated resource filenames.
Source§fn desired_resource_pathname(
&self,
_doc: &PostDocument,
_node: &Node,
_source: Option<&str>,
_type_ext: Option<&str>,
) -> Option<PathBuf>
fn desired_resource_pathname( &self, _doc: &PostDocument, _node: &Node, _source: Option<&str>, _type_ext: Option<&str>, ) -> Option<PathBuf>
Hint for a desired resource pathname.
Auto Trait Implementations§
impl Freeze for UnicodeMath
impl RefUnwindSafe for UnicodeMath
impl Send for UnicodeMath
impl Sync for UnicodeMath
impl Unpin for UnicodeMath
impl UnsafeUnpin for UnicodeMath
impl UnwindSafe for UnicodeMath
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more