LaTeXM...:Token(3pm)
π LaTeXM...:Token(3pm) π
from the User Contributed Perl Documentation β okay bestie, let's get into it π«Ά
πΈ NAME πΈ
LaTeXML::Core::Token β representation of a Token: a pair of character and category code (catcode); It extends LaTeXML::Common::Object.
β¨ Exported functions β¨
$catcode = CC_ESCAPE;β the page gives you this line for the category-code constants, and here's the whole squad:
CC_BEGIN, CC_END, CC_MATH, CC_ALIGN, CC_EOL,
CC_PARAM, CC_SUPER, CC_SUB, CC_IGNORE,
CC_SPACE, CC_LETTER, CC_OTHER, CC_ACTIVE,
CC_COMMENT, CC_INVALID, CC_CS.
tiny note, fr fr: [The last 2 are (apparent) extensions, with catcodes 16 and 17, respectively].
$token = Token($string,$cc);β creates aLaTeXML::Core::Tokenwith the given content and catcode. The following shorthand versions are also exported for convenience:
T_BEGIN, T_END, T_MATH, T_ALIGN, T_PARAM,
T_SUB, T_SUPER, T_SPACE, T_LETTER($letter),
T_OTHER($char), T_ACTIVE($char),
T_COMMENT($comment), T_CS($cs)
@tokens = Explode($string);β returns a list of the tokens corresponding to the characters in$string. All tokens have catcodeCC_OTHER, except for spaces which have catcodeCC_SPACE. periodt π@tokens = ExplodeText($string);β returns a list of the tokens corresponding to the characters in$string. All (roman) letters have catcodeCC_LETTER, all others have catcodeCC_OTHER, except for spaces which have catcodeCC_SPACE. πΈUnTeX($object, $suppress_linebreaks);β converts$objectto a string containing TeX that created it (or could have). Note that this is not necessarily the original TeX code; expansions or other substitutions may have taken place. π
Line-breaking of the generated TeX can be explicitly requested or disabled by passing 0 or 1 as the second $suppress_linebreaks argument. The default behavior of line-breaking is controlled by the global State value SUPPRESS_UNTEX_LINEBREAKS. iykyk.
π Methods π
@tokens = $object->unlist;β return a list of the tokens making up this$object. slay.$string = $object->toString;β return a string representing$object.$string = $token->getCSName;β return the string or character part of the$token; for the special category codes, returns the standard string (eg.T_BEGIN->getCSNamereturns"{"). cute.$string = $token->getString;β return the string or character part of the$token.$code = $token->getCharcode;β return the character code of the character part of the$token, or256if it is a control sequence. π$code = $token->getCatcode;β return the catcode of the$token.
π AUTHOR π
pBruce Miller <bruce.miller@nist.gov>
yes bestie, pBruce is literally what the page says π but no hate, we respect the icon.
π COPYRIGHT π
Public domain software, produced as part of work done by the United States Government & not subject to copyright in the US.
mwah π that's the whole page. perl v5.40.1, dated 2025-11-16. periodt. π¦
π¦ 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