1LaTeXML::Core::Token(3)User Contributed Perl DocumentatioLnaTeXML::Core::Token(3)
2
3
4

NAME

6       "LaTeXML::Core::Token" - representation of a Token: a pair of character
7       and category code (catcode); It extends LaTeXML::Common::Object.
8
9   Exported functions
10       "$catcode = CC_ESCAPE;"
11           Constants for the category codes:
12
13             CC_BEGIN, CC_END, CC_MATH, CC_ALIGN, CC_EOL,
14             CC_PARAM, CC_SUPER, CC_SUB, CC_IGNORE,
15             CC_SPACE, CC_LETTER, CC_OTHER, CC_ACTIVE,
16             CC_COMMENT, CC_INVALID, CC_CS.
17
18           [The last 2 are (apparent) extensions, with catcodes 16 and 17,
19           respectively].
20
21       "$token = Token($string,$cc);"
22           Creates a LaTeXML::Core::Token with the given content and catcode.
23           The following shorthand versions are also exported for convenience:
24
25             T_BEGIN, T_END, T_MATH, T_ALIGN, T_PARAM,
26             T_SUB, T_SUPER, T_SPACE, T_LETTER($letter),
27             T_OTHER($char), T_ACTIVE($char),
28             T_COMMENT($comment), T_CS($cs)
29
30       "@tokens = Explode($string);"
31           Returns a list of the tokens corresponding to the characters in
32           $string.  All tokens have catcode CC_OTHER, except for spaces which
33           have catcode CC_SPACE.
34
35       "@tokens = ExplodeText($string);"
36           Returns a list of the tokens corresponding to the characters in
37           $string.  All (roman) letters have catcode CC_LETTER, all others
38           have catcode CC_OTHER, except for spaces which have catcode
39           CC_SPACE.
40
41       "UnTeX($object);"
42           Converts $object to a string containing TeX that created it (or
43           could have).  Note that this is not necessarily the original TeX
44           code; expansions or other substitutions may have taken place.
45
46   Methods
47       "@tokens = $object->unlist;"
48           Return a list of the tokens making up this $object.
49
50       "$string = $object->toString;"
51           Return a string representing $object.
52
53       "$string = $token->getCSName;"
54           Return the string or character part of the $token; for the special
55           category codes, returns the standard string (eg.
56           "T_BEGIN->getCSName" returns "{").
57
58       "$string = $token->getString;"
59           Return the string or character part of the $token.
60
61       "$code = $token->getCharcode;"
62           Return the character code of the character part of the $token, or
63           256 if it is a control sequence.
64
65       "$code = $token->getCatcode;"
66           Return the catcode of the $token.
67

AUTHOR

69       pBruce Miller <bruce.miller@nist.gov>
70
72       Public domain software, produced as part of work done by the United
73       States Government & not subject to copyright in the US.
74
75
76
77perl v5.34.0                      2021-11-24           LaTeXML::Core::Token(3)
Impressum