@mathjax/src
    Preparing search index...

    Class ChtmlWrapper<N, T, D>

    The base ChtmlWrapper class

    Type Parameters

    • N

      The HTMLElement node class

    • T

      The Text node class

    • D

      The Document class

    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: ChtmlWrapper<N, T, D>[]

    The children of this node

    dom: N[] = null

    The DOM tree generated for this wrapper

    The factory used to create more wrappers

    font: ChtmlFontData = null

    Easy access to the font parameters

    lineBBox: LineBBox[] = []

    Sizes of lines into which the element is broken

    node: MmlNode
    parent: ChtmlWrapper = 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: ChtmlDelimiterData = ...

    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

    autoStyle: boolean = true

    If true, this causes a style for the node type to be generated automatically that sets display:inline-block (as needed for the output for MmlNodes).

    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'
    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 breakCount(): number

      Returns number

      The number of breakpoints in the node

    • get containerWidth(): number

      Easy access to the container width

      Returns number

      The container width

    • 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

      • n: number

        A unicode code point to be converted to a character className reference.

      Returns string

      The className for the character

    • 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

    • Parameters

      • parents: N[]

        The HTML elements in which the node is to be created

      Returns N[]

      The roots of the HTML tree for the wrapped node's output

    • 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

      • 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

    • 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

    • 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

    • Copy RDFa, aria, and other tags from the MathML to the CHTML output nodes. Don't copy those in the skipAttributes list, or anything that already exists as a property of the node (e.g., no "onlick", etc.). If a name in the skipAttributes object is set to false, then the attribute WILL be copied. Add the class to any other classes already in use.

      Returns void

    • Add the foreground and background colors (Only look at explicit attributes, since inherited ones will be applied to a parent element, and we will inherit from that)

      Returns void

    • Add an anchor for hrefs and insert hot boxes into the DOM containers

      Parameters

      • parents: N[]

        The HTML nodes in which the output is to be placed

      Returns N[]

      The roots of the HTML tree for the node's output

    • 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

      • 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

    • 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

      • chtml: N

        The HTML 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

      • chtml: N

        The HTML node to scale

      • rscale: number

        The relatie scale to apply

      Returns N

      The HTML node (for chaining)

    • Create the standard CHTML elements for the given wrapped node.

      Parameters

      • parents: N[]

        The HTML elements in which the node is to be created

      Returns N[]

      The roots of the HTML tree for the wrapped node's output

    • Parameters

      • text: string

        The text from which to create an HTML text node

      Returns T

      The generated text node with the given text

    • Create the HTML for the wrapped node.

      Parameters

      • parents: N[]

        The HTML nodes where the output is to be added

      Returns void

    • Create the HTML for an embellished mo, if this is one.

      Parameters

      • parents: N[]

        The HTML nodes where the output is to be added

      Returns boolean

      True when embellished output is produced, false if not

    • 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