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

NAME

6       "LaTeXML::Core::State" - stores the current state of processing.
7

DESCRIPTION

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 mimicing 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 thier 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 therefor also be scoped).  The recognized configuration
60           parameters are:
61
62            VERBOSITY         : the level of verbosity for debugging
63                                output, with 0 being default.
64            STRICT            : whether errors (eg. undefined macros)
65                                are fatal.
66            INCLUDE_COMMENTS  : whether to preserve comments in the
67                                source, and to add occasional line
68                                number comments. (Default true).
69            PRESERVE_NEWLINES : whether newlines in the source should
70                                be preserved (not 100% TeX-like).
71                                By default this is true.
72            SEARCHPATHS       : a list of directories to search for
73                                sources, implementations, etc.
74
75       "$STATE->pushValue($name,$value);"
76           This is like "->assign", but pushes a value onto the end of the
77           stored value, which should be a LIST reference.  Scoping is not
78           handled here (yet?), it simply pushes the value onto the last
79           binding of $name.
80
81       "$boole = $STATE->isValuebound($type,$name,$frame);"
82           Returns whether the value $name is bound. If  $frame is given,
83           check whether it is bound in the $frame-th frame, with 0 being the
84           top frame.
85
86   Category Codes
87       "$value = $STATE->lookupCatcode($char);"
88           Lookup the current catcode associated with the the character $char.
89
90       "$STATE->assignCatcode($char,$catcode,$scope);"
91           Set $char to have the given $catcode, with the assignment made
92           according to the given scoping rule.
93
94           This method is also used to specify whether a given character is
95           active in math mode, by using "math:$char" for the character, and
96           using a value of 1 to specify that it is active.
97
98   Definitions
99       "$defn = $STATE->lookupMeaning($token);"
100           Get the "meaning" currently associated with $token, either the
101           definition (if it is a control sequence or active character)
102            or the token itself if it shouldn't be executable.  (See
103           LaTeXML::Core::Definition)
104
105       "$STATE->assignMeaning($token,$defn,$scope);"
106           Set the definition associated with $token to $defn.  If $globally
107           is true, it makes this the global definition rather than bound
108           within the current group.  (See LaTeXML::Core::Definition, and
109           LaTeXML::Package)
110
111       "$STATE->installDefinition($definition, $scope);"
112           Install the definition into the current stack frame under its
113           normal control sequence.
114
115   Named Scopes
116       Named scopes can be used to set variables or redefine control sequences
117       within a scope other than the standard TeX grouping. For example, the
118       LaTeX implementation will automatically activate any definitions that
119       were defined with a named scope of, say "section:4", during the portion
120       of the document that has the section counter equal to 4.  Similarly, a
121       scope named "label:foo" will be activated in portions of the document
122       where "\label{foo}" is in effect.
123
124       "$STATE->activateScope($scope);"
125           Installs any definitions that were associated with the named
126           $scope.  Note that these are placed in the current grouping frame
127           and will disappear when that grouping ends.
128
129       "$STATE->deactivateScope($scope);"
130           Removes any definitions that were associated with the named $scope.
131           Normally not needed, since a scopes definitions are locally bound
132           anyway.
133
134       "$sp = $STATE->convertUnit($unit);"
135           Converts a TeX unit of the form '10em' (or whatever TeX unit) into
136           scaled points.  (Defined here since in principle it could track the
137           size of ems and so forth (but currently doesn't))
138

AUTHOR

140       Bruce Miller <bruce.miller@nist.gov>
141
143       Public domain software, produced as part of work done by the United
144       States Government & not subject to copyright in the US.
145
146
147
148perl v5.32.0                      2020-11-17           LaTeXML::Core::State(3)
Impressum