pub struct MathCoreConfig {
pub pretty_print: PrettyPrint,
pub macros: Vec<(String, String)>,
pub xml_namespace: bool,
pub ignore_unknown_commands: bool,
pub annotation: bool,
pub allow_unreliable_rendering: bool,
pub unicode_substitution: UnicodeSubstitution,
pub css_classes: CssClassNames,
pub indentation: Indentation,
}Expand description
Configuration object for the LaTeX to MathML conversion.
§Example usage
use math_core::{MathCoreConfig, PrettyPrint};
// Default values
let config = MathCoreConfig::default();
// Specifying pretty-print behavior
let config = MathCoreConfig {
pretty_print: PrettyPrint::Always,
..Default::default()
};
// Specifying pretty-print behavior and custom macros
let macros = vec![
("d".to_string(), r"\mathrm{d}".to_string()),
("bb".to_string(), r"\mathbb{#1}".to_string()), // with argument
];
let config = MathCoreConfig {
pretty_print: PrettyPrint::Auto,
macros,
..Default::default()
};Fields§
§pretty_print: PrettyPrintA configuration for pretty-printing the MathML output. See PrettyPrint for details.
macros: Vec<(String, String)>A list of LaTeX macros; each tuple contains (macro_name, macro_definition).
xml_namespace: boolIf true, include xmlns="http://www.w3.org/1998/Math/MathML" in the <math> tag.
ignore_unknown_commands: boolIf true, unknown commands will be rendered as red text in the output, instead of
returning an error.
annotation: boolIf true, wrap the MathML output in <semantics> tags with an
<annotation encoding="application/x-tex"> child containing the original LaTeX source.
allow_unreliable_rendering: boolIf true, allow rendering commands that produce MathML Core output that is unreliably
rendered by browsers.
unicode_substitution: UnicodeSubstitutionIf not UnicodeSubstitution::Never, substitute certain LaTeX commands with their Unicode
equivalents in the MathML output.
css_classes: CssClassNamesCSS class names for various elements in the output.
indentation: IndentationThe indentation unit used when pretty-printing the MathML output. Either a number of spaces
(e.g. 2) or the string "tab" for a tab character. See Indentation.