Skip to content

\lastbox

yex.keyword.Lastbox(doc) #

Source code in yex/keyword/box.py
38
39
40
41
42
43
44
45
46
47
48
49
50
@control()
def Lastbox(doc):

    if not doc.mode.list:
        logger.debug("lastbox: doc.mode.list is empty; returning nothing")
    elif not isinstance(doc.mode.list[-1], yex.box.Box):
        logger.debug((
            "lastbox: last element of doc.mode.list is %s, "
            "which is not a box; returning nothing"),
            doc.mode.list[-1])
    else:
        result = doc.mode.list.pop()
        return result