@mathjax/src
    Preparing search index...

    The main Tex Parser class.

    Hierarchy (View Summary)

    Index

    Constructors

    • Parameters

      • _string: string

        The string to parse.

      • env: EnvList

        The intial environment representing the current parse state of the overall expression translation.

      • configuration: default

        A parser configuration.

      Returns default

    Properties

    configuration: default

    A parser configuration.

    currentCS: string = ''

    The last command sequence

    i: number = 0

    Current position in the string that is parsed.

    macroCount: number = 0

    Counter for recursive macros.

    stack: Stack

    The stack for items and created nodes.

    Accessors

    Methods

    • Checks if a token is contained in one of the token mappings of the specified kind.

      Parameters

      • kind: HandlerType

        Configuration name.

      • token: string

        The token to parse.

      Returns boolean

      True if the token is contained in the given types of token mapping.

    • Convert delimiter to character.

      Parameters

      • c: string

        The delimiter name.

      Returns string

      The corresponding character.

    • Convenience method to create nodes with the node factory of the current configuration.

      Parameters

      • kind: string

        The kind of node to create.

      • ...rest: any[]

        The remaining arguments for the creation method.

      Returns MmlNode

      The newly created node.

    • Get and return a TeX argument (either a single character or control sequence, or the contents of the next set of braces).

      Parameters

      • _name: string

        Name of the current control sequence.

      • noneOK: boolean = false

        True if no argument is OK.

      Returns string

      The next argument.

    • Get an optional LaTeX argument in brackets.

      Parameters

      • _name: string

        Name of the current control sequence.

      • Optionaldef: string

        The default value for the optional argument.

      • matchBrackets: boolean = false

        True if indernal brackets must match.

      Returns string

      The optional argument.

    • Get the name of a delimiter (check it in the delimiter list).

      Parameters

      • name: string

        Name of the current control sequence.

      • braceOK: boolean = false

        Are braces around the delimiter OK.

      Returns string

      The delimiter name.

    • Get a delimiter or empty argument

      Parameters

      • name: string

        Name of the current control sequence.

      Returns string

      The delimiter.

    • Get a dimension (including its units).

      Parameters

      • name: string

        Name of the current control sequence.

      Returns string

      The dimension string.

    • Get everything up to the given control sequence (token)

      Parameters

      • _name: string

        Name of the current control sequence.

      • token: string

        The element until where to parse.

      Returns string

      The text between the current position and the given token.

    • Maps a token to its "parse value" if it exists.

      Parameters

      • kind: HandlerType

        Configuration name.

      • token: string

        The token to parse.

      Returns any

      A boolean, Character, or Macro.

    • Parses the input with the specified kind of map.

      Parameters

      • kind: HandlerType

        Configuration name.

      • input: ParseInput

        Input to be parsed.

      Returns ParseResult

      The output of the parsing function.

    • Parse the arguments of a control sequence in a new parser instance.

      Parameters

      • name: string

        Name of the current control sequence.

      Returns MmlNode

      The parsed node.

    • Parses a given string up to a given token in a new parser instance.

      Parameters

      • name: string

        Name of the current control sequence.

      • token: string

        A Token at which to end parsing.

      Returns MmlNode

      The parsed node.

    • Pushes a new item onto the stack. The item can also be a Mml node, but if the mml item is an inferred row, push its children instead.

      Parameters

      • arg: MmlNode | StackItem

        The new item.

      Returns void