@mathjax/src
    Preparing search index...

    Class StartupAbstract

    The implementation of the startup module

    Index

    Properties

    adaptor: DOMADAPTOR = null

    The DOMAdaptor instance (created after everything is loaded)

    constructors: { [name: string]: any } = {}

    The constructors (or other data) registered by the loaded packages

    defaultOptionError: (message: string, _key: string) => void = OPTIONS.optionError

    The default OptionError function

    document: MATHDOCUMENT = null

    The MathDocument instance being used (based on the browser DOM or configuration value)

    elements: any[] = null

    The elements to process (set when typeset or conversion method is called)

    The array of handler extensions

    handler: HANDLER = null

    The Handler instance (created after everything is loaded)

    hasTypeset: boolean = false

    This is true when MathJax.typeset() or MathJax.typesetPromise() have been called (used by the menu code to tell if a rerender action is needed when a component is loaded dynamically).

    input: JAXARRAY = ...

    The array of InputJax instances (created after everything is loaded)

    output: OUTPUTJAX = null

    The OutputJax instance (created after everything is loaded)

    pagePromise: Promise<void> = ...

    A promise that is resolved when the page contents are available for processing.

    promise: Promise<any> = ...

    The promise for the startup process (the initial typesetting). It is resolved or rejected in the ready() function.

    promiseReject: (reason: any) => void

    The function that rejects the first promise defined below (called in the defaultReady() function when MathJax's initial typesetting fails)

    promiseResolve: (value?: any) => any

    The function that resolves the first promise defined below (called in the defaultReady() function when MathJax is finished with its initial typesetting)

    Methods

    • The default pageReady() function called when the page is ready to be processed, which returns a promise that does any initial font loading, plus the initial typesetting, if needed.

      Setting Mathjax.startup.pageReady in the configuration will override this.

      Returns Promise<void>

      Promise resolving when page is ready to process.

    • The default ready() function called when all the packages have been loaded, which creates the various objects needed by MathJax, creates the methods based on the loaded components, and does the initial typesetting.

      Setting MathJax.startup.ready in the configuration will override this, but you can call MathJax.startup.defaultReady() within your own ready function if needed, or can use the individual methods below to perform portions of the default startup actions.

      Returns void

    • Returns DOMADAPTOR

      The instance of the registered DOMAdator (the registered constructor in this case is a function that creates the adaptor, not a class)

    • Create the document with the given input and output jax

      Parameters

      • root: any = null

        The Document to use as the root document (or null to use the configured document)

      Returns MathDocument<any, any, any>

      The MathDocument with the configured input and output jax

    • Returns HANDLER

      The instance of the registered Handler, extended by the registered extensions

    • Make the typeset and conversion methods based on the registered components

      If there are both input and output jax, Make Typeset() and TypesetPromise() methods using the given jax, and TypesetClear() to clear the existing math items For each input jax Make input2mml() and input2mmlPromise() conversion methods and inputReset() method If there is a registered output jax Make input2output() and input2outputPromise conversion methods and outputStylesheet() method Create the MathJax.done() method. Create the MathJax.whenReady() method.

      Returns void

    • Make the input2mml(math, options?) and input2mmlPromise(math, options?) methods, where "input" is replaced by the name of the input jax (e.g., "tex2mml").

      These convert the math to its serialized MathML representation. The second wraps the conversion in handleRetriesFor() and returns the resulting promise.

      Parameters

      • name: string

        The name of the input jax

      • input: INPUTJAX

        The input jax itself

      Returns void

    • Make the input2output(math, options?) and input2outputPromise(math, options?) methods, and outputStylesheet() method, where "input" and "output" are replaced by the jax names (e.g., tex2chtml() and chtmlStyleSheet()).

      The first two perform the document's convert() call, with the Promise version wrapped in handlerRetriesFor() and returning the resulting promise. The return value is the DOM object for the converted math. Use MathJax.startup.adaptor.outerHTML(result) to get the serialized string version of the output.

      The outputStylesheet() method returns the styleSheet object for the output. Use MathJax.startup.adaptor.innerHTML(MathJax.outputStylesheet()) to get the serialized version of the stylesheet. The getMetricsFor(node, display) method returns the metric data for the given node

      Parameters

      • iname: string

        The name of the input jax

      • oname: string

        The name of the output jax

      • input: INPUTJAX

        The input jax instance

      Returns void

    • Creates the inputReset() method, where "input" is replaced by the input jax name (e.g., "texReset()).

      The texReset() method clears the equation numbers and labels

      Parameters

      • name: string

        The name of the input jax

      • input: INPUTJAX

        The input jax itself

      Returns void

    • Create the Typeset(elements?), TypesetPromise(elements?), and TypesetClear() methods.

      The first two call the document's render() function, the latter wrapped in handleRetriesFor() and returning the resulting promise.

      TypeseClear() clears all the MathItems from the document.

      Returns void

    • Parameters

      • name: string

        The identifier for the constructor

      • constructor: any

        The constructor function for the named object

      Returns void

    • Perform the typesetting with handling of retries

      Parameters

      • elements: any[]

        The list of elements to typeset

      Returns Promise<any>

      The promise that resolves when elements are typeset

    • Parameters

      • name: string

        The identifier for the DOMAdaptor to use

      • force: boolean = false

        True to force the DOMAdaptor to be used even if one is already registered

      Returns void

    • Parameters

      • name: string

        The identifier for the Handler to use

      • force: boolean = false

        True to force the Handler to be used even if one is already registered

      Returns void

    • Parameters

      • name: string

        The identifier for the InputJax to use

      • force: boolean = false

        True to force the InputJax to be used even if the configuration already included an array of input jax

      Returns void

    • Parameters

      • name: string

        The identifier for the OutputJax to use

      • force: boolean = false

        True to force the OutputJax to be used even if one is already registered

      Returns void