sesaparcours
    Preparing search index...

    Type Alias ParseLatexOptions

    type ParseLatexOptions = {
        parseArgumentsOfUnknownLatexCommands: boolean;
        parseNumbers: "auto" | "rational" | "decimal" | "never";
        parseUnknownIdentifier: (
            identifier: string,
            parser: Parser,
        ) => "symbol" | "function" | "unknown";
        preserveLatex: boolean;
        skipSpace: boolean;
    }
    Index

    Properties

    parseArgumentsOfUnknownLatexCommands: boolean

    When an unknown LaTeX command is encountered, attempt to parse any arguments it may have.

    For example, \foo{x+1} would produce ['\foo', ['Add', 'x', 1]] if this property is true, ['LatexSymbols', '\foo', '<{>', 'x', '+', 1, '<{>'] otherwise.

    parseNumbers: "auto" | "rational" | "decimal" | "never"

    When parsing a decimal number (e.g. 3.1415):

    • "auto" or "decimal": if a decimal number parse it as an approximate decimal number with a whole part and a fractional part
    • "rational": if a decimal number, parse it as an exact rational number with a numerator and a denominator. If not a decimal number, parse it as a regular number.
    • "never": do not parse numbers, instead return each token making up the number (minus sign, digits, decimal marker, etc...).

    Note: if the number includes repeating digits (e.g. 1.33(333)), it will be parsed as a decimal number even if this setting is "rational".

    Default: "auto"

    parseUnknownIdentifier: (
        identifier: string,
        parser: Parser,
    ) => "symbol" | "function" | "unknown"

    This handler is invoked when the parser encounters an identifier that does not have a corresponding entry in the dictionary.

    The identifier argument is a valid identifier (see https://cortexjs.io/math-json/#identifiers for the definition of a valid identifier).

    The handler can return:

    • "symbol": the identifier is a constant or variable name.

    • "function": the identifier is a function name. If an apply function operator (typically, parentheses) follow, they will be parsed as arguments to the function.

    • "unknown": the identifier is not recognized.

    preserveLatex: boolean

    If true, the expression will be decorated with the LaTeX fragments corresponding to each elements of the expression.

    The top-level expression, that is the one returned by parse(), will include the verbatim LaTeX input that was parsed. The sub-expressions may contain a slightly different LaTeX, for example with consecutive spaces replaced by one, with comments removed and with some low-level LaTeX commands replaced, for example \egroup and \bgroup.

    Default: false

    skipSpace: boolean

    If true, ignore space characters in math mode.

    Default: true