@mathjax/src
    Preparing search index...

    Class CommonWrapper<N, T, D, JX, WW, WF, WC, CC, VV, DD, FD, FC>

    The base CommonWrapper class

    Type Parameters

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    _breakCount: number = -1

    The cached number of linebreaks

    bbox: BBox

    The bounding box for this node

    bboxComputed: boolean = false

    Whether the bounding box has been computed yet

    childNodes: WW[]

    The children of this node

    dom: N[] = null

    The DOM tree generated for this wrapper

    factory: WF

    The factory used to create more wrappers

    font: FD = null

    Easy access to the font parameters

    lineBBox: LineBBox[] = []

    Sizes of lines into which the element is broken

    node: MmlNode
    parent: WW = null

    The parent of this node

    removedStyles: StringMap = null

    Styles that must be handled directly by the wrappers (mostly having to do with fonts)

    stretch: DD = ...

    Delimiter data for stretching this node (NOSTRETCH means not yet determined)

    styleData: StyleData = null

    The padding and border information from the style attribute

    styles: Styles = null

    The explicit styles set by the node

    variant: string = ''

    The mathvariant for this node

    BOLDVARIANTS: { [name: string]: StringMap } = ...

    The translation of mathvariant to bold styles, or to remove bold from a mathvariant.

    ITALICVARIANTS: { [name: string]: StringMap } = ...

    The translation of mathvariant to italic styles, or to remove italic from a mathvariant.

    kind: string = 'unknown'

    The wrapper kind

    removeStyles: string[] = ...

    Styles that should not be passed on from style attribute

    skipAttributes: { [name: string]: boolean } = ...

    Non-MathML attributes on MathML elements NOT to be copied to the corresponding DOM elements. If set to false, then the attribute WILL be copied. Most of these (like the font attributes) are handled in other ways.

    styles: StyleJson = {}

    Any styles needed for the class

    Accessors

    • get fixesPWidth(): boolean

      Returns boolean

      True if children with percentage widths should be resolved by this container

    • get linebreakOptions(): {
          inline: boolean;
          LinebreakVisitor: null;
          lineleading: number;
          width: string;
      }

      Easy access to the linebreak options

      Returns { inline: boolean; LinebreakVisitor: null; lineleading: number; width: string }

      The linebreak options

    Methods

    • Parameters

      • direction: string

        The direction to stretch this node

      Returns boolean

      Whether the node can stretch in that direction

    • Parameters

      • bbox: BBox

        The bounding box to modify (either this.bbox, or an empty one)

      • recompute: boolean = false

        True if we are recomputing due to changes in children that have percentage widths

      Returns void

    • Compute the bounding box for the i-th line (for when it is not in the cache).

      Parameters

      • i: number

        The number of the line whose sizes are to be obtained

      Returns LineBBox

      The bounding box of the specified segment

    • Set the CSS for a token element having an explicit font (rather than regular mathvariant).

      Parameters

      • fontFamily: string

        The font family to use

      • fontWeight: string

        The font weight to use

      • fontStyle: string

        The font style to use

      Returns string

      The explicit font marker

    • Parameters

      • W: number

        The total width

      • bbox: BBox

        The bbox to be aligned

      • align: string

        How to align (left, center, right)

      Returns number

      The x position of the aligned width

    • Parameters

      • H: number

        The total height

      • D: number

        The total depth

      • h: number

        The height to be aligned

      • d: number

        The depth to be aligned

      • align: string

        How to align (top, bottom, center, axis, baseline)

      Returns number

      The y position of the aligned baseline

    • Return the wrapped node's bounding box, either the cached one, if it exists, or computed directly if not.

      Parameters

      • save: boolean = true

        Whether to cache the bbox or not (used for stretchy elements)

      Returns BBox

      The computed bounding box

    • Find the (embellished) mo or mspace where a break occurs

      Parameters

      • bbox: LineBBox

        The LineBBox for the line whose initial breakpoint is needed

      Returns [WW, WW]

      The embellished mo node and its core mo

    • Parameters

      • _i: number

        The index of the child element whose alignment is needed

      Returns string

      The alignment child element

    • Parameters

      • child: WW

        The child node whose i-th line bbox is to be obtained

      • i: number

        The number of the line whose bbox is to be obtained

      Returns LineBBox

      The bounding box of the specified line

    • Get the bounding box for the i-th line (first and last may be part of a surrounding line). Get the bbox from the lineBBox cache, or compute it, as needed.

      Parameters

      • i: number

        The number of the segment whose sizes are to be obtained

      Returns LineBBox

      The bounding box of the specified segment

    • Return the wrapped node's bounding box that includes borders and padding

      Parameters

      • save: boolean = true

        Whether to cache the bbox or not (used for stretchy elements)

      Returns BBox

      The computed bounding box

    • Determine the scaling factor to use for this wrapped node, and set the styles for it.

      Returns void

    • Add the style attribute, but remove any font-related styles (since these are handled separately by the variant)

      Returns void

    • Get the spacing using the TeX rules

      Parameters

      • isTop: boolean

        True when this is a top-level embellished operator

      • hasSpacing: boolean

        True when there is an explicit or inherited 'form' attribute

      Returns void

    • The height and depth without linebreaks

      Returns [number, number]

      The height and depth

    • Parameters

      • variant: string

        The variant in which to look for the character

      • n: number

        The number of the character to look up

      Returns CharDataArray<CC>

      The full CharData object, with CharOptions guaranteed to be defined

    • Parameters

      • i: number

        The index of the child element whose container is needed

      Returns number

      The inner width as a container (for percentage widths)

    • Parameters

      • type: string

        The tag name of the HTML node to be created

      • def: OptionList = {}

        The properties to set for the created node

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

        The child nodes for the created HTML node

      Returns N

      The generated HTML tree

    • Mark BBox to be computed again (e.g., when an mo has stretched)

      Parameters

      • bubble: boolean = true

        True to invalidate parent BBoxes

      Returns void

    • Returns boolean

      True if this is the top-most container of an embellished operator that is itself an embellished operator (the maximal embellished operator for its core)

    • Parameters

      • length: Property

        A dimension (giving number and units) or number to be converted to ems

      • size: number = 1

        The default size of the dimension (for percentage values)

      • scale: number = null

        The current scaling factor (to handle absolute units)

      Returns number

      The dimension converted to ems

    • Parameters

      • kind: string

        The kind of MmlNode to create

      • properties: PropertyList = {}

        The properties to set initially

      • children: MmlNode[] = []

        The child nodes to add to the created node

      Returns MmlNode

      The newly created MmlNode

    • Parameters

      • m: number

        A number to be shown as a percent

      Returns string

      The number m as a percent

    • Parameters

      • indentalign: string

        The indentalign to process

      • indentshift: string

        The indentshift to process

      • align: string = ''

        The default alignment for 'auto'

      • shift: string = ''

        The default indentshift for 'auto'

      • width: number = ...

        The container width for relative shifts

      Returns [string, number]

      The alignment and indentation shift (normal and last) for the Mo

    • Parameters

      • m: number

        A number of em's to be shown as pixels

      • M: number = -LENGTHS.BIGDIMEN

        The minimum number of pixels to allow

      Returns string

      The number with units of px

    • Parameters

      • chars: number[]

        The array of unicode character numbers to remap

      Returns number[]

      The converted array

    • Recursively resolve any percentage widths in the child nodes using the given container width (or the child width, if none was passed). Overriden for mtables in order to compute the width.

      Parameters

      • recompute: boolean

        True if we are recomputing due to changes in children

      • w: number = null

        The width of the container (from which percentages are computed)

      • clear: boolean = true

        True if pwidth marker is to be cleared

      Returns boolean

      True if a percentage width was found

    • Parameters

      • text: string

        The text to turn into unicode locations

      • name: string = ...

        The name of the variant for the characters

      Returns number[]

      Array of numbers represeting the string's unicode character positions