LaTeXM...:Object(3pm)

🌸 NAME 🌸

Okay so the manual name is LaTeXM...:Object(3pm) β€” from the User Contributed Perl Documentation crew, no less β€” and the module in the spotlight is LaTeXML::Common::Object: the abstract base class for most LaTeXML objects. πŸ’…βœ¨

πŸ’– DESCRIPTION πŸ’–

LaTeXML::Common::Object is the abstract base class for all the other objects β€” both the data objects and the control objects. It passes down common methods for stringification and comparison operations, which makes coding simpler and makes error reporting a little prettier. Obsessed. 🫢

🧚 Generic functions 🧚

  • $string = Stringify($object); β€” Returns a string that identifies $object, for debugging. It works on any values and objects, but on blessed objects it invokes the stringify method. This is more informative than the default Perl conversion to a string. πŸ”
  • $string = ToString($object); β€” Converts $object to a string, trying when possible to generate straight text without TeX markup. This is most useful for converting Tokens or Boxes to document content or attribute values, or values to be used for pathnames, keywords, etc. Generally, though, it is not possible to convert Whatsits generated by Constructors into clean strings without TeX markup. It works on any values and objects, but on blessed objects it invokes the toString method. 🌈
  • $boolean = Equals($x,$y); β€” Compares the two objects for equality. It works on any values and objects, but on blessed objects it invokes the equals method, which does a deep comparison of the two objects. βš–οΈ
  • $tokens = Revert($object); β€” Returns a Tokens list containing the TeX that would create $object. Heads up: this is not necessarily the original TeX code; expansions or other substitutions may have taken place. πŸŒ€

πŸŽ€ Methods πŸŽ€

  • $string = $object->stringify; β€” Returns a readable representation of $object, useful for debugging. πŸͺž
  • $string = $object->toString; β€” Returns the string content of $object; most useful for extracting a clean, usable, Unicode string from tokens or boxes that might represent a filename or such. To the extent possible, this should provide a string that can be used as XML content, or attribute values, or for filenames or whatever. However, control sequences defined as Constructors may leave TeX code in the value. 🧡
  • $boole = $object->equals($other); β€” Returns whether $object and $other are equal. It should perform a deep comparison, but the default implementation just compares for object identity. (Yes, the signature says $boole β€” we're keeping it exactly as written, bestie. πŸ’€)
  • $boole = $object->isaToken; β€” Returns whether $object is a LaTeXML::Core::Token. πŸͺ™
  • $boole = $object->isaBox; β€” Returns whether $object is a LaTeXML::Core::Box. πŸ“¦
  • $boole = $object->isaDefinition; β€” Returns whether $object is a LaTeXML::Core::Definition. πŸ“š
  • $digested = $object->beDigested; β€” Does whatever is needed to digest the object, and returns the digested representation. Tokens would be digested into boxes; some objects, such as numbers, can just return themselves. 🍽️
  • $object->beAbsorbed($document); β€” Do whatever is needed to absorb $object into $document, typically by invoking appropriate methods on $document. πŸ«‚

🫢 AUTHOR 🫢

Shoutout to Bruce Miller <bruce.miller@nist.gov> β€” iconic. 🌟

Public domain software, produced as part of work done by the United States Government & not subject to copyright in the US. πŸ›οΈ


Cute sign-off: this page comes from perl v5.40.1, dated 2025-11-16, and it's the LaTeXM...:Object(3pm) manual page β€” mwah, bye bestie! πŸ’‹πŸ’–

πŸ“¦ where this page comes from