.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "LaTeXML::Core::KeyVal 3pm" .TH LaTeXML::Core::KeyVal 3pm 2024-02-27 "perl v5.38.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME "LaTeXML::Core::KeyVal" \- Key\-Value Definitions in LaTeXML .SH DESCRIPTION .IX Header "DESCRIPTION" Provides an interface to define and access KeyVal definition. Used in conjunction with \f(CW\*(C`LaTeXML::Core::KeyVals\*(C'\fR to fully implement KeyVal pairs. It extends LaTeXML::Common::Object. .SS "Exposed Methods" .IX Subsection "Exposed Methods" .ie n .IP """DefKeyVal(\fIkeyset\fR, \fIkey\fR, \fItype\fR, \fIdefault\fR, \fI%options\fR); """ 4 .el .IP "\f(CWDefKeyVal(\fR\f(CIkeyset\fR\f(CW, \fR\f(CIkey\fR\f(CW, \fR\f(CItype\fR\f(CW, \fR\f(CIdefault\fR\f(CW, \fR\f(CI%options\fR\f(CW); \fR" 4 .IX Item "DefKeyVal(keyset, key, type, default, %options); " Defines a new KeyVal Parameter in the given \fIkeyset\fR, \fIkey\fR and with optional prefix \fIoption{prefix}\fR. For descriptions of further parameters, see \fILaTeXML::Core::KeyVal::define\fR. .ie n .IP """HasKeyVal(\fIprefix\fR, \fIkeyset\fR, \fIkey\fR); """ 4 .el .IP "\f(CWHasKeyVal(\fR\f(CIprefix\fR\f(CW, \fR\f(CIkeyset\fR\f(CW, \fR\f(CIkey\fR\f(CW); \fR" 4 .IX Item "HasKeyVal(prefix, keyset, key); " Checks if the given KeyVal pair exists. .ie n .IP """DisableKeyVal(\fIprefix\fR, \fIkeyset\fR, \fIkey\fR); """ 4 .el .IP "\f(CWDisableKeyVal(\fR\f(CIprefix\fR\f(CW, \fR\f(CIkeyset\fR\f(CW, \fR\f(CIkey\fR\f(CW); \fR" 4 .IX Item "DisableKeyVal(prefix, keyset, key); " Disables the given KeyVal so that it can not be used. .SS Constructors .IX Subsection "Constructors" .ie n .IP """>" 4 .el .IP "\f(CW>" 4 .IX Item ">" Creates a new \fIKeyVal\fR object. This serves as a simple reference to the given KeyVal object, regardless of its existence or not. .SS "KeyVal Key Definition" .IX Subsection "KeyVal Key Definition" .ie n .IP """$keyval\->define($type, $default, %options);""" 4 .el .IP "\f(CW$keyval\->define($type, $default, %options);\fR" 4 .IX Item "$keyval->define($type, $default, %options);" (Re\-)defines this Key of kind 'kind'. Defines a keyword \fIkey\fR used in keyval arguments for the set \fIkeyset\fR and, and if the option \fIcode\fR is given, defines appropriate macros when used with the \fIkeyval\fR package (or extensions thereof). .Sp If \fItype\fR is given, it defines the type of value that must be supplied, such as \f(CW\*(AqDimension\*(Aq\fR. If \fIdefault\fR is given, that value will be used when \fIkey\fR is used without an equals and explicit value in a keyvals argument. .Sp A \fIscope\fR option can be given, which can be used to defined the key-value pair globally instead of in the current scope. .Sp Several more \fIoption\fRs can be given. These implement the behaviour of the xkeyval package. .Sp The \fIprefix\fR parameter can be used to configure a custom prefix for the macros to be defined. The \fIkind\fR parameter can be used to configure special types of xkeyval pairs. .Sp The 'ordinary' kind behaves like a normal keyval parameter. .Sp The 'command' kind defines a command key, that when run stores the value of the key in a special macro, which can be further specefied by the \fImacroprefix\fR option. .Sp The 'choice' kind defines a choice key, which takes additional options \&\fIchoices\fR (to specify which choices are valid values), \fImismatch\fR (to be run if an invalid choice is made) and \fIbin\fR (see xkeyval documentation for details). .Sp The 'boolean' kind defines a special choice key that takes possible values true and false, and defines a new Conditional according to the assumed value. The name of this conditional can be specified with the \fImacroprefix\fR option. .Sp The kind parameter only takes effect when \fIcode\fR is given, otherwise only meta-data is stored. .ie n .IP """$keyval\->defineOrdinary($code);""" 4 .el .IP \f(CW$keyval\->defineOrdinary($code);\fR 4 .IX Item "$keyval->defineOrdinary($code);" Helper function to define \f(CW$STATE\fR necessary for an ordinary key. .ie n .IP """$keyval\->defineCommand($code, $macroprefix);""" 4 .el .IP "\f(CW$keyval\->defineCommand($code, $macroprefix);\fR" 4 .IX Item "$keyval->defineCommand($code, $macroprefix);" Helper function to define \f(CW$STATE\fR necessary for a command key. .ie n .IP """$keyval\->defineChoice($code, $mismatch, $choices, $normalize, $bin);""" 4 .el .IP "\f(CW$keyval\->defineChoice($code, $mismatch, $choices, $normalize, $bin);\fR" 4 .IX Item "$keyval->defineChoice($code, $mismatch, $choices, $normalize, $bin);" Helper function to define \f(CW$STATE\fR necessary for an choice key. .ie n .IP """$keyval\->defineBoolean($code, $mismatch, $macroprefix);""" 4 .el .IP "\f(CW$keyval\->defineBoolean($code, $mismatch, $macroprefix);\fR" 4 .IX Item "$keyval->defineBoolean($code, $mismatch, $macroprefix);" Helper function to define \f(CW$STATE\fR necessary for a boolean key. .SH AUTHOR .IX Header "AUTHOR" Tom Wiesing .SH COPYRIGHT .IX Header "COPYRIGHT" Public domain software, produced as part of work done by the United States Government & not subject to copyright in the US.