1LaTeXML::Core::KeyVal(3U)ser Contributed Perl DocumentatiLoanTeXML::Core::KeyVal(3)
2
3
4

NAME

6       "LaTeXML::Core::KeyVal" - Key-Value Defintions in LaTeXML
7

DESCRIPTION

9       Provides an interface to define and access KeyVal definition.  Used in
10       conjunction with "LaTeXML::Core::KeyVals" to fully implement KeyVal
11       pairs. It extends LaTeXML::Common::Object.
12
13   Exposed Methods
14       "DefKeyVal(keyset, key, type, default, %options); "
15           Defines a new KeyVal Parameter in the given keyset, key and with
16           optional prefix option{prefix}. For descriptions of further
17           parameters, see LaTeXML::Core::KeyVal::define.
18
19       "HasKeyVal(prefix, keyset, key); "
20           Checks if the given KeyVal pair exists.
21
22       "DisableKeyVal(prefix, keyset, key); "
23           Disables the given KeyVal so that it can not be used.
24
25   Constructors
26       "<LaTeXML::Core::KeyVal-"new(preset, keyset, key); >>
27           Creates a new KeyVal object. This serves as a simple reference to
28           the given KeyVal object, regardless of its existence or not.
29
30   KeyVal Accessors
31       "$prefix = $keyval->getPrefix;"
32           Gets the prefix of this KeyVal object.
33
34       "$keyset = $keyval->getKeySet;"
35           Gets the keyset of this KeyVal object.
36
37       "$key = $keyval->getKey;"
38           Gets the key of this KeyVal object.
39
40       "$prefix = $keyval->getFullPrefix;"
41           Gets the full prefix of this keyval object, to be used when
42           composing macros.
43
44       "$prefix = $keyval->getHeader;"
45           Gets the header of this keyval object, to be used when composing
46           macros.
47
48   Keyval Property Getters
49       "$value = $keyval->getProp($prop);"
50           Gets the value of a given property of this KeyVal. Intended for
51           internal use only.
52
53       "$value = $keyval->setProp($prop, $value, $scope);"
54           Sets the value of the given property with the given value and
55           scope. Intended for internal use only.
56
57       "$type = $keyval->getType();"
58           Gets the type of this KeyVal object, as found in $STATE.
59
60       "$keyval->setType($type);"
61           Sets the type of this KeyVal object, as found in $STATE.
62
63       "$default = $keyval->getDefault();"
64           Gets the default of this KeyVal object, as found in $STATE.
65
66       "$keyval->setDefault($default, $setMacros);"
67           Sets the default of this KeyVal object, and optionally sets the
68           macros as well.
69
70   KeyVal Key Definition
71       "$defined = $keyval->isDefined($checkMacros);"
72           Checks if this KeyVal item is actually defined. If checkMacros is
73           set to true, also check if macros are defined.
74
75       "$keyval->define($type, $default, %options);"
76           (Re-)defines this Key of kind 'kind'.  Defines a keyword key used
77           in keyval arguments for the set keyset and, and if the option code
78           is given, defines appropriate macros when used with the keyval
79           package (or extensions thereof).
80
81           If type is given, it defines the type of value that must be
82           supplied, such as 'Dimension'.  If default is given, that value
83           will be used when key is used without an equals and explicit value
84           in a keyvals argument.
85
86           A scope option can be given, which can be used to defined the key-
87           value pair globally instead of in the current scope.
88
89           Several more options can be given. These implement the behaviour of
90           the xkeyval package.
91
92           The prefix parameter can be used to configure a custom prefix for
93           the macros to be defined. The kind parameter can be used to
94           configure special types of xkeyval pairs.
95
96           The 'ordinary' kind behaves like a normal keyval parameter.
97
98           The 'command' kind defines a command key, that when run stores the
99           value of the key in a special macro, which can be further specefied
100           by the macroprefix option.
101
102           The 'choice' kind defines a choice key, which takes additional
103           options choices (to specify which choices are valid values),
104           mismatch (to be run if an invalid choice is made) and bin (see
105           xkeyval documentation for details).
106
107           The 'boolean' kind defines a special choice key that takes possible
108           values true and false, and defines a new Conditional according to
109           the assumed value. The name of this conditional can be specified
110           with the macroprefix option.
111
112           The kind parameter only takes effect when code is given, otherwise
113           only meta-data is stored.
114
115       "$keyval->defineOrdinary($code);"
116           Helper function to define $STATE neccesary for an ordinary key.
117
118       "$keyval->defineCommand($code, $macroprefix);"
119           Helper function to define $STATE neccesary for a command key.
120
121       "$keyval->defineChoice($code, $mismatch, $choices, $normalize, $bin);"
122           Helper function to define $STATE neccesary for an choice key.
123
124       "$keyval->defineBoolean($code, $mismatch, $macroprefix);"
125           Helper function to define $STATE neccesary for a boolean key.
126
127       "disabled = $keyval->isDisabled();"
128           Checks if this keyval property is disabled.
129
130       "$keyval->disable();"
131           Disables this KeyVal object in $STATE.
132
133   Value Related
134       "$expansion = $keyval->setKeys($value, $useDefault, $checkExistence,
135       $checkDisabled, $setInternals);"
136           Expands this KeyVal into a Tokens() to be used with \setkeys.
137           value contains the value to be used in the expansion, useDefault
138           indicates if the value argument should be ignored and the default
139           should be used instead.  If checkExistence is set to 1 and the
140           macro does not exist, undef is returned.  If checkDisabled is set
141           to 1 and the macro is disabled, an empty Tokens() is returns.  If
142           $setInternals is set, sets XKeyVal internal macros.
143
144       "$reversion = $keyval->digest($stomach, $value);"
145           Digests this KeyVal with the given stomach and value.
146
147       "$reversion = $keyval->revert($value, $useDefault, $compact, $isFirst,
148       $punct, $assign);"
149           Reverts this KeyVal with a given value (or the default if IsDefault
150           is set) and punctuation and assignment tokens.  If compact is
151           given, spaces will be omitted when possible.  The isDefault
152           parameter indicates if appropriate seperation tokens should be
153           inserted.
154
155       "$str = $keyval->toString();"
156           Turns this KeyVal object into a string.
157

AUTHOR

159       Tom Wiesing <tom.wiesing@gmail.com>
160
162       Public domain software, produced as part of work done by the United
163       States Government & not subject to copyright in the US.
164
165
166
167perl v5.28.1                      2017-11-22          LaTeXML::Core::KeyVal(3)
Impressum