Documentation
¶
Index ¶
Constants ¶
View Source
const InfPenalty = 10000.0
InfPenalty is TeX's "infinite" penalty (∞ = forbidden break, −∞ = forced).
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Item ¶
type Item struct {
Kind ItemKind
Width float64
Height, Depth float64 // box only (glyph metrics)
R rune // box only (the glyph, 0 if none)
Stretch, Shrink float64 // glue only
Penalty float64 // penalty only
Flagged bool // penalty only (e.g. a hyphen) — consecutive flags are penalised
}
Item is one element of a horizontal list.
type Line ¶
type Line struct {
Start, End int // item index range [Start, End) actually set on the line
Ratio float64 // glue adjustment ratio r (−1 fully shrunk … +tolerance stretched)
}
Line describes one output line of a broken paragraph.
func KnuthPlass ¶
KnuthPlass breaks items into lines of the given width, minimising total demerits (linePenalty is TeX's \linepenalty). It returns the chosen lines in order and ok=false if no sequence of feasible breaks exists within tolerance.
Click to show internal directories.
Click to hide internal directories.