Skip to content

class MathNode

  • supers: Node

A math node, which occurs only in horizontal lists, appears before and after mathematical formulas. The subtype field is beginmath before the formula and endmath after it. There is a surround field, which represents the amount of surrounding space inserted by \mathsurround.

Example:

assert.node_type("math", nil, {
  id = "math (11)",
  subtypes = { "beginmath (0)", "endmath (1)" },
  fields = {
    "prev (-1)",
    "next (0)",
    "id (1)",
    "subtype (2)",
    "attr (3)",
    "surround (4)",
    "width (5)",
    "stretch (6)",
    "shrink (7)",
    "stretch_order (8)",
    "shrink_order (9)",
  },
})

Reference:

😱 Types incomplete or incorrect? 🙏 Please contribute!


fields


MathNode.subtype


MathNode.subtype : MathNodeSubtype

MathNode.attr


MathNode.attr : Node {
    next: Node?,
    prev: Node?,
    id: integer,
    subtype: integer,
    head: Node?,
    attr: Node,
}

A list of attributes.

MathNode.surround


MathNode.surround : integer

The width of the \mathsurround kern.