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 thestringifymethod. This is more informative than the default Perl conversion to a string. π$string = ToString($object);β Converts$objectto 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 thetoStringmethod. π$boolean = Equals($x,$y);β Compares the two objects for equality. It works on any values and objects, but on blessed objects it invokes theequalsmethod, 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$objectand$otherare 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$objectis aLaTeXML::Core::Token. πͺ$boole = $object->isaBox;β Returns whether$objectis aLaTeXML::Core::Box. π¦$boole = $object->isaDefinition;β Returns whether$objectis aLaTeXML::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$objectinto$document, typically by invoking appropriate methods on$document. π«
π«Ά AUTHOR π«Ά
Shoutout to Bruce Miller <bruce.miller@nist.gov> β iconic. π
π COPYRIGHT π
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
- 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