LaTeXM...:Gullet(3pm)
π NAME π
okay so bestie, this is the LaTeXM...:Gullet(3pm) page β User Contributed Perl Documentation β and the main character is LaTeXML::Core::Gullet, the class that expands expandable tokens and parses common token sequences. slay.
β¨ DESCRIPTION β¨
A LaTeXML::Core::Gullet reads tokens (LaTeXML::Core::Token) from a LaTeXML::Core::Mouth. It is responsible for expanding macros and expandable control sequences if the current definition associated with the token in LaTeXML::Core::State is an LaTeXML::Core::Definition::Expandable definition. It also provides a whole lineup of methods for reading input like arguments and optional arguments, plus parsing LaTeXML::Common::Number, LaTeXML::Common::Dimension, etc, according to TeX's rules. no cap.
It extends LaTeXML::Common::Object.
π«Ά Managing Input π«Ά
$gullet->openMouth($mouth, $noautoclose);β the manpage literally asks βIs this public?β It prepares to read tokens from$mouth. If$noautocloseis true, the Mouth will not be automatically closed when it is exhausted.$gullet->closeMouth;β yep, another βIs this public?β It finishes reading from the current mouth, and reverts to the one in effect before the last openMouth.$gullet->flush;β also asks βIs this public?β It clears all inputs. bye-bye, input pile π$gullet->getLocator;β returns an object describing the current location in the input stream.
π§ Low-level methods π§
$tokens = $gullet->expandTokens($tokens);β returns theLaTeXML::Core::Tokensresulting from expanding all the tokens in$tokens. This is actually only used in a few circumstances where the arguments to an expandable need explicit expansion; usually expansion happens at the right time.$token = $gullet->readToken;β returns the next token from the input source, or undef if there is no more input.$token = $gullet->readXToken($toplevel,$commentsok);β returns the next unexpandable token from the input source, or undef if there is no more input. If the next token is expandable, it is expanded, and its expansion is reinserted into the input. If$commentsok, a comment read or pending will be returned.$gullet->unread(@tokens);β pushes the@tokensback into the input stream to be re-read. rewind era.
πΈ Mid-level methods πΈ
$token = $gullet->readNonSpace;β reads and returns the next non-space token from the input after discarding any spaces.$gullet->skipSpaces;β skips the next spaces from the input.$gullet->skip1Space($expanded);β skips the next token from the input if it is a space. IfC($expanded>is true, expands (like" <one optional space" >).$tokens = $gullet->readBalanced;β reads a sequence of tokens from the input until the balancing'}'(assuming the'{'has already been read). Returns aLaTeXML::Core::Tokens, except in an array context, returns the collected tokens and the closing token.$boole = $gullet->ifNext($token);β returns true if the next token in the input matches$token; the possibly matching token remains in the input.$tokens = $gullet->readMatch(@choices);β reads and returns whichever of@choicesmatches the input, or undef if none do. Each of the choices is anLaTeXML::Core::Tokens.$keyword = $gullet->readKeyword(@keywords);β reads and returns whichever of@keywords(each a string) matches the input, or undef if none do. This is similar to readMatch, but case and catcodes are ignored. Also, leading spaces are skipped.$tokens = $gullet->readUntil(@delims);β reads and returns a (balanced) sequence ofLaTeXML::Core::Tokensuntil matching one of the tokens in@delims. In a list context, it also returns which of the delimiters ended the sequence.
π¦ High-level methods π¦
$tokens = $gullet->readArg;β reads and returns a TeX argument; the next Token or Tokens (if surrounded by braces).$tokens = $gullet->readOptional($default);β reads and returns a LaTeX optional argument; returns$defaultif there is no'[', otherwise the contents of the[].$thing = $gullet->readValue($type);β reads an argument of a given type: one of'Number','Dimension','Glue','MuGlue'or'any'.$value = $gullet->readRegisterValue($type);β reads a control sequence token (and possibly its arguments) that names a register, and returns the value. Returns undef if the next token isn't such a register.$number = $gullet->readNumber;β reads aLaTeXML::Common::Numberaccording to TeX's rules of the various things that can be used as a numerical value.$dimension = $gullet->readDimension;β reads aLaTeXML::Common::Dimensionaccording to TeX's rules of the various things that can be used as a dimension value.$mudimension = $gullet->readMuDimension;β reads aLaTeXML::Core::MuDimensionaccording to TeX's rules of the various things that can be used as a mudimension value.$glue = $gullet->readGlue;β reads aLaTeXML::Common::Glueaccording to TeX's rules of the various things that can be used as a glue value.$muglue = $gullet->readMuGlue;β reads aLaTeXML::Core::MuGlueaccording to TeX's rules of the various things that can be used as a muglue value. numbers and glue, handled. periodt.
π AUTHOR π
Bruce Miller <bruce.miller@nist.gov> β that's the author section, bestie. iconic.
π COPYRIGHT π
Public domain software, produced as part of work done by the United States Government & not subject to copyright in the US.
mwah π β this page is perl v5.40.1, dated 2025-11-16, and it lives under LaTeXM...:Gullet(3pm).
π¦ where this page comes from
- ubuntu resolute: latexml 0.8.8-4 Β· PD
- ubuntu stonking: latexml 0.8.8-4 Β· PD
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms