class DiscNode
- supers: Node
A disc node, which occurs only in horizontal lists, specifies a
“discretionary” line break. If such a break occurs at a node, the
text that starts at pre
will precede the break, the text
that starts at post
will follow the break, and text that
appears in replace
will be ignored.
Example:
assert.node_type("disc", nil, {
id = "disc (7)",
subtypes = {
"discretionary (0)",
"explicit (1)",
"automatic (2)",
"regular (3)",
"first (4)",
"second (5)",
},
fields = {
"prev (-1)",
"next (0)",
"id (1)",
"subtype (2)",
"attr (3)",
"pre (4)",
"post (5)",
"replace (6)",
"penalty (7)",
},
})
Reference:
- Corresponding C source code: texnodes.c#L758-L763
- Donald Ervin Knuth. “TeX: The Program”: section 145, page 53 tex.pdf
😱 Types incomplete or incorrect? 🙏 Please contribute!
fields
DiscNode.subtype
DiscNode.attr
DiscNode.attr : Node {
next: Node?,
prev: Node?,
id: integer,
subtype: integer,
head: Node?,
attr: Node,
}
A list of attributes.
DiscNode.pre
DiscNode.pre : Node {
next: Node?,
prev: Node?,
id: integer,
subtype: integer,
head: Node?,
attr: Node,
}
A pointer to the pre-break text.
DiscNode.post
DiscNode.post : Node {
next: Node?,
prev: Node?,
id: integer,
subtype: integer,
head: Node?,
attr: Node,
}
A pointer to the post-break text.
DiscNode.replace
DiscNode.replace : Node {
next: Node?,
prev: Node?,
id: integer,
subtype: integer,
head: Node?,
attr: Node,
}
A pointer to the no-break text.
DiscNode.penalty
The penalty associated with the break, normally hyphenpenalty
or exhyphenpenalty
.