UNPKG

latex-math

Version:

Parses LaTeX math strings—typically extracted from Markdown—and converts them into an abstract syntax tree (AST).

25 lines (24 loc) 857 B
import { Plugin } from "unified"; import * as Ast from "@unified-latex/unified-latex-types"; type PluginOptions = { /** * List of environments whose body should be parsed in math mode */ mathEnvs: string[]; /** * List of macros whose bodies should be parsed in math mode */ mathMacros: string[]; } | undefined; /** * Reparse math environments/macro contents that should have been parsed in math mode but weren't. */ export declare const unifiedLatexReparseMath: Plugin<PluginOptions[], Ast.Root, Ast.Root>; /** * Construct the inner function for the `unifiedLatexReparseMath` plugin. This function should not be used by libraries. */ export declare function unifiedLatexReparseMathConstructPlugin({ mathEnvs, mathMacros, }: { mathEnvs: string[]; mathMacros: string[]; }): (tree: Ast.Root) => void; export {};