LaTeXM...tomach(3pm)

πŸ’– LaTeXML::Core::Stomach β€” aka LaTeXM...tomach(3pm) πŸ’–

okay bestie, this is the LaTeXM...tomach(3pm) manual page from the User Contributed Perl Documentation, and the main character is LaTeXML::Core::Stomach β€” it digests tokens into boxes, lists, etc. ✨ No cap, it's giving core-core energy. 🫢

✨ NAME ✨

"LaTeXML::Core::Stomach" β€” digests tokens into boxes, lists, etc. πŸ’…

🌸 DESCRIPTION 🌸

okay so "LaTeXML::Core::Stomach" digests tokens read from a LaTeXML::Core::Gullet (they will have already been expanded). It extends LaTeXML::Common::Object. πŸ¦‹

There are basically four cases when digesting a LaTeXML::Core::Token:

  • A plain character β€” is simply converted to a LaTeXML::Core::Box recording the current LaTeXML::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 the LaTeXML::Core::State), although they may also contribute digested material. As with macros, any arguments to the primitive are read from the LaTeXML::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::Constructor, produces a LaTeXML::Core::Whatsit which 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 digested LaTeXML::Core::List after reading and digesting a body from the its Gullet. The body extends until the current level of boxing or environment is closed. 🫢
  • $list = $stomach->digest($tokens); β€” return the LaTeXML::Core::List resuting 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 fromt he 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 $stomach is not currently in $mode. This also ends a level of grouping. 🫢

πŸ‘‘ AUTHOR πŸ‘‘

Bruce Miller <bruce.miller@nist.gov> πŸ’–

Public domain software, produced as part of work done by the United States Government & not subject to copyright in the US. 🌈


okay that's the whole page, bestie: source/version perl v5.40.1, date 2025-11-16, and the manual is LaTeXM...tomach(3pm) from User Contributed Perl Documentation. mwah πŸ’‹ periodt.

πŸ“¦ where this page comes from