pub struct MathCoreConfig {
pub pretty_print: PrettyPrint,
pub macros: FxHashMap<String, String>,
}
Expand description
Configuration object for the LaTeX to MathML conversion.
§Example usage
use math_core::{MathCoreConfig, PrettyPrint};
use rustc_hash::FxHashMap;
// 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 mut macros: FxHashMap<String, String> = Default::default();
macros.insert(
"d".to_string(),
r"\mathrm{d}".to_string(),
);
macros.insert(
"bb".to_string(),
r"\mathbb{#1}".to_string(), // with argument
);
let config = MathCoreConfig {
pretty_print: PrettyPrint::Auto,
macros,
..Default::default()
};
Fields§
§pretty_print: PrettyPrint
A configuration for pretty-printing the MathML output. See PrettyPrint
for details.
macros: FxHashMap<String, String>
A map of LaTeX macros; the keys are macro names and the values are their definitions.
Trait Implementations§
Source§impl Debug for MathCoreConfig
impl Debug for MathCoreConfig
Source§impl Default for MathCoreConfig
impl Default for MathCoreConfig
Source§fn default() -> MathCoreConfig
fn default() -> MathCoreConfig
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for MathCoreConfig
impl RefUnwindSafe for MathCoreConfig
impl Send for MathCoreConfig
impl Sync for MathCoreConfig
impl Unpin for MathCoreConfig
impl UnwindSafe for MathCoreConfig
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