1LaTeXML::Core::State(3)User Contributed Perl DocumentatioLnaTeXML::Core::State(3)
2
3
4
6 "LaTeXML::Core::State" - stores the current state of processing.
7
9 A "LaTeXML::Core::State" object stores the current state of processing.
10 It recording catcodes, variables values, definitions and so forth, as
11 well as mimicking TeX's scoping rules.
12
13 Access to State and Processing
14 "$STATE->getStomach;"
15 Returns the current Stomach used for digestion.
16
17 "$STATE->getModel;"
18 Returns the current Model representing the document model.
19
20 Scoping
21 The assignment methods, described below, generally take a $scope
22 argument, which determines how the assignment is made. The allowed
23 values and their implications are:
24
25 global : global assignment.
26 local : local assignment, within the current grouping.
27 undef : global if \global preceded, else local (default)
28 <name> : stores the assignment in a `scope' which
29 can be loaded later.
30
31 If no scoping is specified, then the assignment will be global if a
32 preceding "\global" has set the global flag, otherwise the value will
33 be assigned within the current grouping.
34
35 "$STATE->pushFrame;"
36 Starts a new level of grouping. Note that this is lower level than
37 "\bgroup"; See LaTeXML::Core::Stomach.
38
39 "$STATE->popFrame;"
40 Ends the current level of grouping. Note that this is lower level
41 than "\egroup"; See LaTeXML::Core::Stomach.
42
43 "$STATE->setPrefix($prefix);"
44 Sets a prefix (eg. "global" for "\global", etc) for the next
45 operation, if applicable.
46
47 "$STATE->clearPrefixes;"
48 Clears any prefixes.
49
50 Values
51 "$value = $STATE->lookupValue($name);"
52 Lookup the current value associated with the the string $name.
53
54 "$STATE->assignValue($name,$value,$scope);"
55 Assign $value to be associated with the the string $name, according
56 to the given scoping rule.
57
58 Values are also used to specify most configuration parameters
59 (which can therefore also be scoped). The recognized configuration
60 parameters are:
61
62 STRICT : whether errors (eg. undefined macros)
63 are fatal.
64 INCLUDE_COMMENTS : whether to preserve comments in the
65 source, and to add occasional line
66 number comments. (Default true).
67 PRESERVE_NEWLINES : whether newlines in the source should
68 be preserved (not 100% TeX-like).
69 By default this is true.
70 SEARCHPATHS : a list of directories to search for
71 sources, implementations, etc.
72
73 "$STATE->pushValue($name,$value);"
74 This is like "->assign", but pushes a value onto the end of the
75 stored value, which should be a LIST reference. Scoping is not
76 handled here (yet?), it simply pushes the value onto the last
77 binding of $name.
78
79 "$boole = $STATE->isValuebound($type,$name,$frame);"
80 Returns whether the value $name is bound. If $frame is given,
81 check whether it is bound in the $frame-th frame, with 0 being the
82 top frame.
83
84 Category Codes
85 "$value = $STATE->lookupCatcode($char);"
86 Lookup the current catcode associated with the the character $char.
87
88 "$STATE->assignCatcode($char,$catcode,$scope);"
89 Set $char to have the given $catcode, with the assignment made
90 according to the given scoping rule.
91
92 This method is also used to specify whether a given character is
93 active in math mode, by using "math:$char" for the character, and
94 using a value of 1 to specify that it is active.
95
96 Definitions
97 "$defn = $STATE->lookupMeaning($token);"
98 Get the "meaning" currently associated with $token, either the
99 definition (if it is a control sequence or active character)
100 or the token itself if it shouldn't be executable. (See
101 LaTeXML::Core::Definition)
102
103 "$STATE->assignMeaning($token,$defn,$scope);"
104 Set the definition associated with $token to $defn. If $globally
105 is true, it makes this the global definition rather than bound
106 within the current group. (See LaTeXML::Core::Definition, and
107 LaTeXML::Package)
108
109 "$STATE->installDefinition($definition, $scope);"
110 Install the definition into the current stack frame under its
111 normal control sequence.
112
113 Named Scopes
114 Named scopes can be used to set variables or redefine control sequences
115 within a scope other than the standard TeX grouping. For example, the
116 LaTeX implementation will automatically activate any definitions that
117 were defined with a named scope of, say "section:4", during the portion
118 of the document that has the section counter equal to 4. Similarly, a
119 scope named "label:foo" will be activated in portions of the document
120 where "\label{foo}" is in effect.
121
122 "$STATE->activateScope($scope);"
123 Installs any definitions that were associated with the named
124 $scope. Note that these are placed in the current grouping frame
125 and will disappear when that grouping ends.
126
127 "$STATE->deactivateScope($scope);"
128 Removes any definitions that were associated with the named $scope.
129 Normally not needed, since a scopes definitions are locally bound
130 anyway.
131
132 "$sp = $STATE->convertUnit($unit);"
133 Converts a TeX unit of the form '10em' (or whatever TeX unit) into
134 scaled points. (Defined here since in principle it could track the
135 size of ems and so forth (but currently doesn't))
136
138 Bruce Miller <bruce.miller@nist.gov>
139
141 Public domain software, produced as part of work done by the United
142 States Government & not subject to copyright in the US.
143
144
145
146perl v5.34.0 2022-01-19 LaTeXML::Core::State(3)