Skip to content

Expandable controls

yex.control.Expandable(is_long=False, is_outer=False, from_human=True, name=None, doc=None, *args, **kwargs) #

Bases: yex.control.control.Control

When you run an expandable control, it does nothing except create more tokens.

Expandable controls include all macros, and some control flow primitives:

Identifier Class Description
\chardef Chardef
\countdef Countdef
\dimendef Dimendef
\macro Macro Any macro defined using \def.
\mathchardef Mathchardef
\muskipdef Muskipdef
\registerdef Registerdef
\skipdef Skipdef
\toksdef Toksdef

TeΧbook: 211-212

Source code in yex/control/control.py
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
def __init__(self,
             is_long: bool = False,
             is_outer: bool = False,
             from_human: bool = True,
             name: Union[str, None] = None,
             doc: Union['yex.Document', None] = None,
             *args, **kwargs):

    self.is_long = is_long
    self.is_outer = is_outer
    self.from_human = from_human
    self.doc = doc

    if name is None:
        self.name = self.__class__.__name__.lower()
    else:
        self.name = name