Skip to content

class Node

A node that comprise actual typesetting commands. A few fields are present in all nodes regardless of their type, these are:

Reference:

😱 Types incomplete or incorrect? 🙏 Please contribute!


fields


Node.next


Node.next : Node?

the next node in a list, or nil

Node.prev


Node.prev : Node?

That prev field is always present, but only initialized on explicit request: when the function node.slide() is called, it will set up the prev fields to be a backwards pointer in the argument node list. By now most of TeX's node processing makes sure that the prev nodes are valid but there can be exceptions, especially when the internal magic uses a leading temp nodes to temporarily store a state.

Node.id


Node.id : integer

the node’s type (id) number

Node.subtype


Node.subtype : integer

the node subtype identifier. The subtype is sometimes just a dummy entry because not all nodes actually use the subtype, but this way you can be sure that all nodes accept it as a valid field name, and that is often handy in node list traversal.

Node.head


Node.head : Node?

Node.attr


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

A list of attributes.. almost all nodes also have an attr field