LaTeXML...Stomach(3)
π¦ NAME π¦
okay bestie, this is the LaTeXML...Stomach(3) page from User Contributed Perl Documentation π. The star of the show is "LaTeXML::Core::Stomach" β a certified icon that digests tokens into boxes, lists, etc. β¨ No cap, that's the whole name situation.
π DESCRIPTION π
okay so picture this: LaTeXML::Core::Stomach digests tokens read from a LaTeXML::Core::Gullet (they will have already been expanded, periodt). It extends LaTeXML::Common::Object. π«Ά
There are basically four cases when digesting a LaTeXML::Core::Token:
- A plain character β gets the glow-up into a
LaTeXML::Core::Boxrecording the currentLaTeXML::Common::Font. π - A primitive β If a control sequence represents
LaTeXML::Core::Definition::Primitive, the primitive is invoked, executing its stored subroutine. This is typically done for side effect (changing the state in theLaTeXML::Core::State), although they may also contribute digested material. As with macros, any arguments to the primitive are read from theLaTeXML::Core::Gullet. - Grouping (or environment bodies) β are collected into a
LaTeXML::Core::List. π¦ - Constructors β A special class of control sequence, called a
LaTeXML::Core::Definition::Constructorproduces aLaTeXML::Core::Whatsitwhich remembers the control sequence and arguments that created it, and defines its own translation into"XML"elements, attributes and data. Arguments to a constructor are read from the gullet and also digested.
π§ Digestion
$list = $stomach->digestNextBody;β Return the digestedLaTeXML::Core::Listafter reading and digesting abodyfrom its Gullet. The body extends until the current level of boxing or environment is closed. π$list = $stomach->digest($tokens);β Return theLaTeXML::Core::Listresulting from digesting the given tokens. This is typically used to digest arguments to primitives or constructors.@boxes = $stomach->invokeToken($token);β Invoke the given (expanded) token. If it corresponds to a Primitive or Constructor, the definition will be invoked, reading any needed arguments from the current input source. Otherwise, the token will be digested. A List of Box's, Lists, Whatsit's is returned. π@boxes = $stomach->regurgitate;β Removes and returns a list of the boxes already digested at the current level. This peculiar beast is used by things like\choose(which is a Primitive in TeX, but a Constructor in LaTeXML). π
π Grouping
$stomach->bgroup;β Begin a new level of binding by pushing a new stack frame, and a new level of boxing the digested output. πΈ$stomach->egroup;β End a level of binding by popping the last stack frame, undoing whatever bindings appeared there, and also decrementing the level of boxing.$stomach->begingroup;β Begin a new level of binding by pushing a new stack frame.$stomach->endgroup;β End a level of binding by popping the last stack frame, undoing whatever bindings appeared there.
π Modes
$stomach->beginMode($mode);β Begin processing in$mode; one of'text','display-math'or'inline-math'. This also begins a new level of grouping and switches to a font appropriate for the mode. β¨$stomach->endMode($mode);β End processing in$mode; an error is signalled if$stomachis not currently in$mode. This also ends a level of grouping. π¦
π AUTHOR π
Bruce Miller <bruce.miller@nist.gov> β absolute legend for making this page. π
π COPYRIGHT π
Public domain software, produced as part of work done by the United States Government & not subject to copyright in the US.
and that's the whole vibe, bestie π
. This page is from perl v5.42.3, dated 2024-02-26, with LaTeXML...Stomach(3) in the footer β slay and goodbye π«Άβ¨.
π¦ where this page comes from
- nixos 26.05: perl5.42.3-LaTeXML 0.8.8
- nixpkgs unstable: perl5.42.3-LaTeXML 0.8.8
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms