Skip to content

yex.wrap.Paragraphs

yex.wrap.Paragraphs(doc, produce_page) #

A sequence of paragraphs, waiting to be broken up into pages.

Source code in yex/wrap/paragraphs.py
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
def __init__(self, doc,
        produce_page,
        ):

    self.doc = doc

    self.items = []
    self.produce_page = produce_page

    self.trace = doc.get_control(r'\tracingpages')
    self.goal = doc.get(r'\vsize')
    self.maxdepth = doc.get(r'\maxdepth')

    self.total_height = None
    self.best_so_far = None
    self._must_adjust_topskip = False

    self.trace.info(
            '%% '
            f'goal height={self.goal.__repr__(show_unit=False)}, '
            f'max depth={self.maxdepth.__repr__(show_unit=False)}'
            )

    logger.debug("%s: created new Paragraphs", self)

    self._add_topskip()