LaTeXML...::State(3)
π NAME π
Okay so bestie, this is the LaTeXML::Core::State page from the User Contributed Perl Documentation. "LaTeXML::Core::State" β stores the current state of processing. Periodt.
β¨ DESCRIPTION β¨
A LaTeXML::Core::State object stores the current state of processing. Itβs recording catcodes, variables values, definitions and so forth, and itβs also mimicking TeXβs scoping rules. Itβs giving very organized main character energy.
π«Ά Access to State and Processing π«Ά
$STATE->getStomach;β Returns the current Stomach used for digestion.$STATE->getModel;β Returns the current Model representing the document model.
πΈ Scoping πΈ
Okay so the assignment methods below generally take a $scope argument, and thatβs what decides how the assignment is made. The allowed values and their implications are:
globalβ global assignment.localβ local assignment, within the current grouping.undefβ global if\globalpreceded, else local (default).<name>β stores the assignment in ascopewhich can be loaded later.
If no scoping is specified, then the assignment will be global if a preceding \global has set the global flag; otherwise the value will be assigned within the current grouping. No cap.
$STATE->pushFrame;β Starts a new level of grouping. Note that this is lower level than\bgroup; See LaTeXML::Core::Stomach.$STATE->popFrame;β Ends the current level of grouping. Note that this is lower level than\egroup; See LaTeXML::Core::Stomach.$STATE->setPrefix($prefix);β Sets a prefix (eg.globalfor\global, etc) for the next operation, if applicable.$STATE->clearPrefixes;β Clears any prefixes.
π Values π
$value = $STATE->lookupValue($name);β Lookup the current value associated with the the string$name. (Yes, the doubled βtheβ is right there in the original β we keep the facts, bestie.)$STATE->assignValue($name,$value,$scope);β Assign$valueto be associated with the the string$name, according to the given scoping rule.
Values are also used to specify most configuration parameters (which can therefore also be scoped). The recognized configuration parameters are:
STRICTβ whether errors (eg. undefined macros) are fatal.INCLUDE_COMMENTSβ whether to preserve comments in the source, and to add occasional line number comments. (Default true).PRESERVE_NEWLINESβ whether newlines in the source should be preserved (not 100% TeX-like). By default this is true.SEARCHPATHSβ a list of directories to search for sources, implementations, etc.$STATE->pushValue($name,$value);β This is like->assign, but pushes a value onto the end of the stored value, which should be a LIST reference. Scoping is not handled here (yet?), it simply pushes the value onto the last binding of$name.$boole = $STATE->isValuebound($type,$name,$frame);β Returns whether the value$nameis bound. If$frameis given, check whether it is bound in the$frame-th frame, with 0 being the top frame.
π Category Codes π
$value = $STATE->lookupCatcode($char);β Lookup the current catcode associated with the the character$char.$STATE->assignCatcode($char,$catcode,$scope);β Set$charto have the given$catcode, with the assignment made according to the given scoping rule.
This method is also used to specify whether a given character is active in math mode, by using math:$char for the character, and using a value of 1 to specify that it is active. Iconic.
π¦ Definitions π¦
$defn = $STATE->lookupMeaning($token);β Get the"meaning"currently associated with$token, either the definition (if it is a control sequence or active character) or the token itself if it shouldnβt be executable. (See LaTeXML::Core::Definition)$STATE->assignMeaning($token,$defn,$scope);β Set the definition associated with$tokento$defn. If$globallyis true, it makes this the global definition rather than bound within the current group. (See LaTeXML::Core::Definition, and LaTeXML::Package)$STATE->installDefinition($definition, $scope);β Install the definition into the current stack frame under its normal control sequence.
π Named Scopes π
Named scopes can be used to set variables or redefine control sequences within a scope other than the standard TeX grouping. For example, the LaTeX implementation will automatically activate any definitions that were defined with a named scope of, say, section:4, during the portion of the document that has the section counter equal to 4. Similarly, a scope named label:foo will be activated in portions of the document where \label{foo} is in effect. Thatβs the kind of scoping drama I live for.
$STATE->activateScope($scope);β Installs any definitions that were associated with the named$scope. Note that these are placed in the current grouping frame and will disappear when that grouping ends.$STATE->deactivateScope($scope);β Removes any definitions that were associated with the named$scope. Normally not needed, since a scopes definitions are locally bound anyway.$sp = $STATE->convertUnit($unit);β Converts a TeX unit of the form'10em'(or whatever TeX unit) into scaled points. (Defined here since in principle it could track the size of ems and so forth (but currently doesnβt))
π AUTHOR π
Bruce Miller <bruce.miller@nist.gov>
π COPYRIGHT π
Public domain software, produced as part of work done by the United States Government & not subject to copyright in the US.
Bye bestie π β this page was served by perl v5.42.3, dated 2024-02-26, and itβs the LaTeXML...::State(3) manual page. Slay.
π¦ where this page comes from
- nixos 26.05: perl5.42.3-LaTeXML 0.8.8
- nixpkgs unstable: perl5.42.3-LaTeXML 0.8.8
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms