Skip to main content

parse_with_macros

Function parse_with_macros 

Source
pub fn parse_with_macros(
    input: &str,
    macros: &HashMap<String, MacroDef>,
) -> MathExpr
Expand description

Parse a LaTeX math string with user-defined macro expansion.

Macros are expanded before parsing. The macros map keys must include the backslash (e.g., "\\R"). Each expansion step decrements an internal depth counter; if the counter reaches zero the expansion is aborted and an MathExpr::Error is returned for the affected expression.