Skip to content

Unexpandable controls

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

Bases: yex.control.control.Control

These are the most basic primitives, which carry out some kind of action when they are called.

List of all current Unexpandable subclasses#

This list excludes parameters; see that documentation for a list of those.

Identifier Class Description
$ A_0024 Switches inline maths mode on or off. 🚧
/ A_002f Adds an italic correction.
\above Above 🚧
\abovewithdelims Abovewithdelims 🚧
\accent Accent
\advance Advance Adds two quantities.
\afterassignment Afterassignment
\aftergroup Aftergroup
\arithmetic Arithmetic Adds, multiplies, or divides two quantities.
\array Array A set of registers of a particular type.
\atop Atop 🚧
\atopwithdelims Atopwithdelims 🚧
\batchmode Batchmode
\botmark Botmark 🚧
\box Box
\boxdimensions BoxDimensions
\catcode Catcode A table mapping characters to their categories.
\cleaders Cleaders 🚧
\columns Columns
\copy Copy
\count Count
\cr Cr
\crcr Crcr
\debugging Debugging
\def Def
\defined_by_chardef Defined_by_chardef
\delcode Delcode
\delimiter Delimiter
\dimen Dimen
\displaylimits Displaylimits 🚧
\displaystyle Displaystyle 🚧
\divide Divide Divides two quantities.
\dp Dp
\dump Dump
\edef Edef
\eqno Eqno 🚧
\error_handling_mode Error_handling_mode
\errorstopmode Errorstopmode
\firstmark Firstmark 🚧
\font Font
\fontsetter FontSetter When you use \font to define a font, it puts one of these into the controls table. Then when you call it, it changes the current font.
\fontname Fontname Inserts the name of the current font.
\futurelet Futurelet
\gdef Gdef
\generalisedfraction GeneralisedFraction 🚧
\global Global
\halign Halign
\ht Ht
\hyphenation Hyphenation
\indent Indent
\insert Insert
\lccode Lccode
\leaders Leaders 🚧
\left Left 🚧
\leqno Leqno 🚧
\let Let TODO
\limits Limits 🚧
\long Long
\mark Mark 🚧
\mathaccent Mathaccent 🚧
\mathbin Mathbin 🚧
\mathchar Mathchar 🚧
\mathchoice Mathchoice 🚧
\mathclose Mathclose 🚧
\mathcode Mathcode
\mathinner Mathinner 🚧
\mathop Mathop 🚧
\mathopen Mathopen 🚧
\mathord Mathord 🚧
\mathpunct Mathpunct 🚧
\mathrel Mathrel 🚧
\meaning Meaning
\mskip Mskip 🚧
\multiply Multiply Multiplies two quantities.
\muskip Muskip
\noalign Noalign
\noboundary Noboundary
\noindent Noindent
\nolimits Nolimits 🚧
\nonscript Nonscript 🚧
\nonstopmode Nonstopmode
\nullfont Nullfont Selects the null font, which contains no characters.
\omit Omit
\outer Outer
\over Over 🚧
\overline Overline 🚧
\overwithdelims Overwithdelims 🚧
\patterns Patterns
\radical Radical 🚧
\register Register A wrapper so we can pass out references to entries in a Array, and have them update the original values.
\right Right 🚧
- S_002d
\scriptfont Scriptfont
\scriptscriptfont Scriptscriptfont
\scriptscriptstyle Scriptscriptstyle 🚧
\scriptstyle Scriptstyle 🚧
\scrollmode Scrollmode
\setlanguage Setlanguage
\settabs Settabs
\sfcode Sfcode
\show Show
\showthe Showthe
\skip Skip
\span Span
\special Special An instruction to the output driver.
\splitbotmark Splitbotmark 🚧
\splitfirstmark Splitfirstmark 🚧
\tenrm Tenrm Selects the default font.
\textfont Textfont
\textstyle Textstyle 🚧
\toks Toks
\topmark Topmark 🚧
\uccode Uccode
\underline Underline 🚧
\unhbox Unhbox
\unhcopy Unhcopy
\unkern Unkern 🚧
\unpenalty Unpenalty 🚧
\unskip Unskip 🚧
\unvbox Unvbox
\unvcopy Unvcopy
\vadjust Vadjust
\valign Valign
\wd Wd
\xdef Xdef
\xleaders Xleaders 🚧

Classes marked 🚧 are not yet implemented.

The mode flags#

There are three flags saying which modes we can run in. True means the control is permitted; False means it's forbidden; a string which is the name of a mode forces a switch to that mode before it's used.

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

horizontal = True class-attribute instance-attribute #

Whether this control can run in horizontal mode. See the class docstring for details.

math = True class-attribute instance-attribute #

Whether this control can run in math mode. See the class docstring for details.

vertical = True class-attribute instance-attribute #

Whether this control can run in vertical mode. See the class docstring for details.

query(parser) #

Queries this control. See the class's docstring for more information.

In the superclass, we simply return self.value.

Some of our subclasses replace this using the on_query method in a decorated control. See the @control decorator to find out more.

Source code in yex/control/control.py
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
def query(self,
          parser: 'yex.parse.Parser') -> Any:
    """
    Queries this control. See the class's docstring
    for more information.

    In the superclass, we simply return `self.value`.

    Some of our subclasses replace this using the
    `on_query` method in a decorated control.
    See [the @control decorator](yex.decorator.control.md)
    to find out more.
    """

    return self.value