Expand description
Convert LaTeX math to MathML Core.
For more background on what that means and on what to do with the resulting MathML code, see the repo’s README: https://github.com/tmke8/math-core
§Usage
The main struct of this library is LatexToMathML
. In order to use the library, create an
instance of this struct and then call one of the convert functions. The constructor of the
struct expects a config object in the form of an instance of MathCoreConfig
.
Basic use looks like this:
use math_core::{LatexToMathML, MathCoreConfig, MathDisplay};
let latex = r#"\erf ( x ) = \frac{ 2 }{ \sqrt{ \pi } } \int_0^x e^{- t^2} \, dt"#;
let config = MathCoreConfig::default();
let converter = LatexToMathML::new(&config).unwrap();
let mathml = converter.convert_with_local_counter(latex, MathDisplay::Block).unwrap();
println!("{}", mathml);
§Features
serde
: With this feature,MathCoreConfig
implements serde’sDeserialize
.
Structs§
- Latex
Error - Represents an error that occurred during LaTeX parsing or rendering.
- Latex
ToMathML - A converter that transforms LaTeX math equations into MathML Core.
- Math
Core Config - Configuration object for the LaTeX to MathML conversion.
Enums§
- Math
Display - Display mode for the LaTeX math equations.
- Pretty
Print - Configuration for pretty-printing the MathML output.