LaTeXML...::Token(3)

πŸ“¦ version 0.8.8, in nixos 26.05, nixpkgs unstable

🌸 NAME 🌸

okay bestie, this is the LaTeXML...::Token(3) page from the User Contributed Perl Documentation, and the module is LaTeXML::Core::Token. It's the representation of a Token: a pair of character and category code (catcode); It extends LaTeXML::Common::Object. That's the whole vibe, no cap.

✨ Exported functions ✨

  • $catcode = CC_ESCAPE; β€” constants for the category codes:
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, bestie: the last 2 are (apparent) extensions, with catcodes 16 and 17, respectively. iykyk πŸ’…
  • $token = Token($string,$cc); β€” Creates a LaTeXML::Core::Token with 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 catcode CC_OTHER, except for spaces which have catcode CC_SPACE. slay.
  • @tokens = ExplodeText($string); β€” Returns a list of the tokens corresponding to the characters in $string. All (roman) letters have catcode CC_LETTER, all others have catcode CC_OTHER, except for spaces which have catcode CC_SPACE. iconic behavior fr fr.
  • UnTeX($object, $suppress_linebreaks); β€” Converts $object to 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. obsessed with a configurable line-break moment tbh.

πŸŽ€ Methods πŸŽ€

  • @tokens = $object->unlist; β€” Return a list of the tokens making up this $object.
  • $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->getCSName returns {).
  • $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, or 256 if it is a control sequence. not me remembering 256 like it's a birthday πŸŽ‚
  • $code = $token->getCatcode; β€” Return the catcode of the $token.

πŸ‘‘ AUTHOR πŸ‘‘

The author line literally says pBruce Miller <bruce.miller@nist.gov> β€” keeping it exactly as printed, no autocorrect energy here. 🫢

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

xoxo, your Unix bestie πŸ’… β€” rendered by perl v5.42.3, dated 2024-02-26, for LaTeXML...::Token(3). periodt. 🌈

πŸ“¦ where this page comes from