Skip to main content

parse_with_options

Function parse_with_options 

Source
pub fn parse_with_options(
    input: &str,
    options: &ParseOptions,
) -> Result<(MathNode, ColorTable), ParseError>
Expand description

Parse a math string with explicit ParseOptions, returning the AST and the color table after \definecolor.

§Errors

Same as parse. Input nesting deeper than options.max_depth returns ParseError::Malformed.

§Examples

use latex_rust::{parse_with_options, ParseOptions};

let tight = ParseOptions::new().with_max_depth(4);
assert!(parse_with_options(r"\frac{1}{\frac{1}{\frac{1}{2}}}", &tight).is_err());