@mathjax/src
    Preparing search index...

    Subclass of the TexParser but for handling text-mode material

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    configuration: default

    A parser configuration.

    currentCS: string = ''

    The last command sequence

    envStack: EnvList[]

    Saved stack environments for processing braces

    i: number = 0

    Current position in the string that is parsed.

    level: string | number

    The scriptlevel of this text-mode material

    macroCount: number = 0

    Counter for recursive macros.

    nodes: MmlNode[]

    The accumulated MmlNodes generated by parsing the text-mode material

    stack: Stack

    The stack for items and created nodes.

    text: string

    The accumulated text material to go into an mtext element

    Accessors

    • get string(): string

      Returns string

      The string that is currently parsed.

    • set string(str: string): void

      Sets the string that should be parsed.

      Parameters

      • str: string

        The new string to parse.

      Returns void

    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.

    • 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.

    • Throw an error

      Parameters

      • id: string

        The id for the message string

      • message: string

        The English version of the message

      • ...args: string[]

        Any substitution args for the message

      Returns void

    • 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 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.

    • Process the argument as text with the given environment settings

      Parameters

      • name: string

        The macro that is calling for a parameter

      • env: EnvList

        The environment to use

      Returns MmlNode

      The node with the parsed text element

    • 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.