Skip to main content

preprocess

Function preprocess 

Source
pub fn preprocess(raw_input: &str) -> String
Expand description

Normalize raw math input for the tokenizer.

Rewrites that preserve math meaning: {a \over b} → \frac, {n \choose k} → \binom, \tfrac/\dfrac → \frac, plain-TeX font switches, \mbox → \text.

§Examples

use latex_rust::preprocess;

assert!(preprocess(r"{a \over b}").contains(r"\frac"));