@mathjax/src
    Preparing search index...

    Class CHTML<N, T, D>

    Implements the CHTML class (extends AbstractOutputJax)

    Type Parameters

    • N

      The HTMLElement node class

    • T

      The Text node class

    • D

      The Document class

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    adaptor: DOMAdaptor<N, T, D> = null

    The MathDocument's DOMAdaptor

    chtmlStyles: N = null

    The CHTML stylesheet, once it is constructed

    container: N

    The container element for the math

    containerWidth: number

    The container width for linebreaking;

    document: MathDocument<N, T, D>

    The MathDocument for the math we find

    The wrapper factory for the MathML nodes

    The data for the font in use

    linebreaks: Linebreaks<
        N,
        T,
        D,
        CommonOutputJax<
            N,
            T,
            D,
            ChtmlWrapper<N, T, D>,
            ChtmlWrapperFactory<N, T, D>,
            ChtmlWrapperClass<N, T, D>,
            ChtmlCharOptions,
            ChtmlVariantData,
            ChtmlDelimiterData,
            ChtmlFontData,
            typeof ChtmlFontData,
        >,
        ChtmlWrapper<N, T, D>,
        ChtmlWrapperFactory<N, T, D>,
        ChtmlWrapperClass<N, T, D>,
        ChtmlCharOptions,
        ChtmlVariantData,
        ChtmlDelimiterData,
        ChtmlFontData,
        typeof ChtmlFontData,
    >

    The linebreak visitor to use for automatic linebreaks

    math: MathItem<N, T, D>

    the MathItem currently being processed

    nodeMap: Map<MmlNode, ChtmlWrapper<N, T, D>>

    A map from the nodes in the expression currently being processed to the wrapper nodes for them (used by functions like core() to locate the wrappers from the core nodes)

    options: OptionList

    The actual options supplied to the output jax

    postFilters: FunctionList

    Filters to run after the output is processed

    pxPerEm: number

    The pixels per em for the math item being processed

    styleJson: StyleJsonSheet

    Used for collecting styles needed for the output jax

    The top-level table, if any

    testDisplay: N

    Node used to test for display metric data

    testInline: N

    Node used to test for in-line metric data

    unknownCache: UnknownVariantMap

    Cache of unknonw character bounding boxes for this element

    wrapperUsage: Usage<string>

    The usage information for the wrapper classes

    commonStyles: StyleJson = ...

    The default styles for CommonHTML

    NAME: string = 'CHTML'

    The name of this output jax

    OPTIONS: OptionList = ...
    STYLESHEETID: string = 'MJX-CHTML-styles'

    The ID for the stylesheet element for the styles for the SVG output

    Accessors

    • get forceInlineBreaks(): boolean

      Returns boolean

      True when in-line breaks need to be forced (e.g., for SVG output)

    • get name(): string

      Returns string

      The name for this output jax class

    Methods

    • Clear the cache of which items need their styles to be output

      Returns void

    • Parameters

      • m: number

        A number to be shown with a fixed number of digits

      • n: number = 3

        The number of digits to use

      Returns string

      The formatted number

    • Parameters

      • type: string

        The type of HTML node to create

      • def: OptionList = {}

        The properties to set on the HTML node

      • content: (N | T)[] = []

        Array of child nodes to set for the HTML node

      • Optionalns: string

        The namespace for the element

      Returns N

      The newly created DOM tree

    • Parameters

      • marked: boolean

        Whether the node has already been marked

      • forcebreak: boolean

        Whether the break is to be forced

      • linebreak: string

        The break type

      • node: MmlNode

        The parent node to mark

      • child: MmlNode

        The child node to mark

      • mo: MmlNode = null

        The core mo to mark

      Returns boolean

      The modified marked variable

    • Measure the width of a text element by placing it in the page and looking up its size (fake the height and depth, since we can't measure that)

      Parameters

      • textNode: N

      Returns { d: number; h: number; w: number }

    • Get the size of a text node, caching the result, and using a cached result, if there is one.

      Parameters

      • text: N

        The text element to measure

      • chars: string

        The string contained in the text node

      • variant: string

        The variant for the text

      • font: CssFontData = ...

        The family, italic, and bold data for explicit fonts

      Returns UnknownBBox

      The width, height and depth for the text

    • Set the document where HTML nodes will be created via the adaptor Set up global values Recursively set the TeX classes for the nodes Set the scaling for the DOM node Create the nodeMap (maps MathML nodes to corresponding wrappers) Create the HTML output for the root MathML node in the container Clear the nodeMape Execute the post-filters

      Parameters

      • math: MathItem<N, T, D>

        The math item to convert

      • node: N

        The contaier to place the result into

      • html: MathDocument<N, T, D> = null

        The document containing the math

      Returns void