@mathjax/src
    Preparing search index...

    Class SVG<N, T, D>

    Implements the SVG 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

    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

    fontCache: FontCache<N, T, D>

    Stores the information about the cached character glyphs

    linebreaks: Linebreaks<
        N,
        T,
        D,
        CommonOutputJax<
            N,
            T,
            D,
            SvgWrapper<N, T, D>,
            SvgWrapperFactory<N, T, D>,
            SvgWrapperClass<N, T, D>,
            SvgCharOptions,
            SvgVariantData,
            SvgDelimiterData,
            SvgFontData,
            typeof SvgFontData,
        >,
        SvgWrapper<N, T, D>,
        SvgWrapperFactory<N, T, D>,
        SvgWrapperClass<N, T, D>,
        SvgCharOptions,
        SvgVariantData,
        SvgDelimiterData,
        SvgFontData,
        typeof SvgFontData,
    >

    The linebreak visitor to use for automatic linebreaks

    math: MathItem<N, T, D>

    the MathItem currently being processed

    minwidth: number = 0

    Minimum width for tables with labels,

    nodeMap: Map<MmlNode, SvgWrapper<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

    shift: number = 0

    The shift for the main equation

    styleJson: StyleJsonSheet

    Used for collecting styles needed for the output jax

    svgStyles: N = null

    The SVG stylesheet, once it is constructed

    table: SvgWrapper

    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

    commonStyles: StyleJson = ...

    The default styles for SVG

    FONTCACHEID: string = 'MJX-SVG-global-cache'

    The ID for the SVG element that stores the cached font paths

    NAME: string = 'SVG'

    The name of the output jax

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

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

    Accessors

    • get forceInlineBreaks(): boolean

      Returns boolean

    • get name(): string

      Returns string

      The name for this output jax class

    Methods

    • Parameters

      • nsvg: N

        The svg where the break is to be added

      • dimen: number

        The size of the break

      • forced: boolean

        Whether the break is forced or not

      Returns void

    • Clear the font cache (use for resetting the global font cache)

      Returns void

    • Parameters

      • h: number

        The height of the SVG to create

      • d: number

        The depth of the SVG to create

      • w: number

        The width of the SVG to create

      Returns [N, N]

      The svg element and its initial g child

    • Parameters

      • m: number

        A number to be shown in ex

      Returns string

      The number with units of ex

    • Checks if there is already a font-cache element in the page

      Parameters

      Returns boolean

      True if a font cache already exists in the page

    • 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

      • wrapper: SvgWrapper<N, T, D>

        The MML node wrapper whose SVG gets inline breaks

      • svg: N

        The SVG node that is breaking

      • g: N

        The group in which the math is typeset

      Returns void

    • 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

    • 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

    • Parameters

      • svg: N

        The svg node whose indentation is to be adjusted

      • align: string

        The alignment for the node

      • shift: number

        The indent (positive or negative) for the node

      Returns void

    • Parameters

      • kind: string

        The kind of node to create

      • properties: OptionList = {}

        The properties to set for the element

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

        The child nodes for this node

      Returns N

      The newly created node in the SVG namespace

    • 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

    • Typeset the math and add minwidth (from mtables), or set the alignment and indentation of the finalized expression.

      Parameters

      • wrapper: SvgWrapper<N, T, D>

        The wrapped math to typeset

      • svg: N

        The main svg element for the typeet math

      • g: N

        The group in which the math is typeset

      Returns void

    • Parameters

      • text: string

        The text to be displayed

      • variant: string

        The name of the variant for the text

      Returns N

      The text element containing the text