Skip to content

yex.box.DiscretionaryBreak

yex.box.DiscretionaryBreak(prebreak, postbreak, nobreak) #

Bases: yex.box.gismo.Gismo

A pair of strings that appear before and after a break, along with another string that appears if there isn't a break.

For example,

tra\discretionary{f-}{fi}{ffi}c

If this occurs at the end of a line, it's equivalent to

... traf-
fic ...

Otherwise it's equivalent to

traffic
This gives you control over the ligature that's produced.

Created with the \discretionary keyword.

TeΧbook: p95

Source code in yex/box/gismo.py
272
273
274
275
276
277
278
279
280
def __init__(self,
        prebreak,
        postbreak,
        nobreak,
        ):
    super().__init__()
    self.prebreak = prebreak
    self.postbreak = postbreak
    self.nobreak = nobreak