@mathjax/src
    Preparing search index...

    Interface MathItem<N, T, D>

    The MathItem interface

    The MathItem is the object that holds the information about a particular expression on the page, including pointers to where it is in the document, its compiled version (in the internal format), its typeset version, its bounding box, and so on.

    interface MathItem<N, T, D> {
        display: boolean;
        inputData: OptionList;
        inputJax: InputJax<N, T, D>;
        isEscaped: boolean;
        math: string;
        metrics: Metrics;
        root: MmlNode;
        start: Location<N, T>;
        typesetRoot: N;
        clear(): void;
        compile(document: MathDocument<N, T, D>): void;
        convert(document: MathDocument<N, T, D>, end?: number): void;
        removeFromDocument(restore: boolean): void;
        render(document: MathDocument<N, T, D>): void;
        rerender(document: MathDocument<N, T, D>, start?: number): void;
        reset(restore?: boolean): void;
        setMetrics(em: number, ex: number, cwidth: number, scale: number): void;
        state(state?: number, restore?: boolean): number;
        typeset(document: MathDocument<N, T, D>): void;
        updateDocument(document: MathDocument<N, T, D>): void;
    }

    Type Parameters

    • N

      The HTMLElement node class

    • T

      The Text node class

    • D

      The Document class

    Hierarchy (View Summary)

    Implemented by

    Index

    Properties

    display: boolean

    Whether the math is in display mode or inline mode

    inputData: OptionList

    Extra data needed by the input or output jax, as needed

    inputJax: InputJax<N, T, D>

    The input jax used to process the math

    isEscaped: boolean

    Whether this item is an escaped character or not

    math: string

    The string representing the expression to be processed

    metrics: Metrics

    The metric information at the location of the math (the em-size, scaling factor, etc.)

    root: MmlNode

    The internal format for this expression (once compiled)

    start: Location<N, T>

    The start and ending locations in the document of this expression

    typesetRoot: N

    The typeset version of the expression (once typeset)

    Methods

    • Clear any data (the MathItem's container is being removed)

      Returns void

    • Converts the expression by calling the render actions until the state matches the end state

      Parameters

      • document: MathDocument<N, T, D>

        The MathDocument in which the math resides

      • Optionalend: number

        The state to end rerendering at (default = LAST)

      Returns void

    • Removes the typeset version from the document, optionally replacing the original form of the expression and its delimiters.

      Parameters

      • restore: boolean

        True if the original version is to be restored

      Returns void

    • Rerenders an already rendered item and inserts it into the document

      Parameters

      • document: MathDocument<N, T, D>

        The MathDocument in which the math resides

      • Optionalstart: number

        The state to start rerendering at (default = RERENDER)

      Returns void

    • Reset the item to its unprocessed state

      Parameters

      • Optionalrestore: boolean

        True if the original form should be restored to the document when rolling back a typeset version

      Returns void

    • Sets the metric information for this expression

      Parameters

      • em: number

        The size of 1 em in pixels

      • ex: number

        The size of 1 ex in pixels

      • cwidth: number

        The container width in pixels

      • scale: number

        The scaling factor (unitless)

      Returns void

    • Set or return the current processing state of this expression, optionally restoring the document if rolling back an expression that has been added to the document.

      Parameters

      • Optionalstate: number

        The state to set for the expression

      • Optionalrestore: boolean

        True if the original form should be restored to the document when rolling back a typeset version

      Returns number

      The current state