Skip to content

yex.box.Breakpoint

yex.box.Breakpoint(penalty=0) #

Bases: yex.box.gismo.Gismo

A point at which the words in an HBox could wrap to the next line.

This is not a Gismo in TeΧ, but it's included as one here for convenience. Chapter 14 of the TeΧbook explains the algorithm.

Attributes:

Name Type Description
penalty int

the cost of breaking at this breakpoint.

number int

the number used to identify this breakpoint in logs. It may be None.

Source code in yex/box/gismo.py
392
393
394
395
396
397
398
399
400
def __init__(self, penalty=0):

    super().__init__()
    self.penalty = penalty
    self.number = None
    self.via = None
    self.total_demerits = None
    self.hbox = None
    self.line_number = 0