Home
keyreader-guide.
Contents
1. keytype 1 keyname 1 default 1 callback 1 keytype 2 keyname 2 default 2 callback 2 d terie keyname n default n callback n f ee Ea The list parser for keylist is invariably semicolon Hence if the user has semicolon in callback it has to be wrapped in curly braces to hide it from T X s scanner keytype can be any member of the list ord ordinary key cmd command key bool boolean key choice choice key For choice keys keylist has the syntax 8 d 9 keytype 1 keyname 1 default 1 alt callback 1 PAGE 2 OF 8 The keyreader package 17th January 2012 10 keytype 2 keyname 2 default 2 alt callback 2 12 Beete t keyname n default n alt callback n 13 5 The alternate values also called nominations or admissible list of user input alt has the syntax Syntax of alternate list for choice keys 14 value 1 do callback 1 15 value 2 do callback 2 16 17 value n do callback n The list parser in this case is invariably comma The star x sign on krddefinekeys is an optional suffix If it is present then only definable i e non existent keys will be defined The existence of a key depends on kprefix and kfamily since keys are name spaced Note 2 1 Choice keys defined by krddefinekeys are of the starred x variant of choice keys see the xkeyval package guide H
2. krddefinekeys The boolean ifkrddef is true when krddefinekeys is defining keys and false otherwise The essence of it is that since keys are set as soon as they are defined by krddefinekeys some actions should not be executed at this time until the keys are being set by the user Using the keys defined in the above example let us make comma and comma active and see how the keyreader package will deal with them Example 2 2 Active comma and equals sign Make comma and equal active to test the list normalization scheme of keyreader pacakge begingroup catcode 13 catcode 13 gdef keylista fam famb keyb keyc keya green keyb iden keyc false keyd left keye somevalue gdef keylistb krdsetrmkeys KV fam famb endgroup def reserved a krdsetkeys KV expandafter reserved a keylista keylistb 37 38 39 40 41 42 43 44 45 46 47 48 The output of the following example is shown in Figure 1 Example 2 3 49 documentclass article 50 usepackage keyreader 51 usepackage xcolor 52 makeatletter PAGE 4 OF 8 The keyreader package 17th January 2012 76 TT 78 79 80 81 82 83 84 86 87 88 89 90 91 92 93 94 95 96 97 98 newdimen shadowsize krddef inekeys KV ebox mp bool frame true bool sha
3. warranties of merchantability and fitness for a particular purpose MMXII Contents 1 Motivation 1 2 4 Disablingkeys 6 2 5 Options processing 6 2 User commands 2 1 Defining keys 22 ee eee es 2 3 Version history 6 22 Sewing kee oos eee eee ee 3 2 0 Examples o c ow eae ee ea ER 4 Index 8 1 Motivation The keyreader package predated the 1txkeys package and was developed to make key parsing by the xkeyval package robust in the sense of preserving outer braces in key values throughout The package is available at http mirror ctan org macros latex contrib keyreader This user manual corresponds to version 0 4b of the package 1 The University of Central Lancashire Preston UK amusa22 gmail com The keyreader package 17th January 2012 parsing and enabling the parsing of key values with unbalanced conditionals as well as reduce the amount of typing that is required for defining several keys To achieve robustness in key parsing the setkeys command of the xkeyval package has been patched and renamed krdsetkeys The xkeyval package s setkeys remains unchanged to avoid breaking existing codes that rely on it s current form Some other low level commands of xkeyval package have been patched and renamed The keyreader package provides commands for compactly defining and setting all types of key ordinary command boolean and choice Also the keyreade
4. 0 the dimexpr ht0 dp0 relax llap raisebox shadowsize box0 hskip shadowsize endgroup makeatother begin document ebox eboxi ebox framecolor gray boxsize 2cm align right ebox2 ebox shadow false boxsize 1 5cm align left ebox3 ebox framesize 1pt framecolor green shadowcolor blue ebox4 ebox frame false shadow shadowcolor yellow framesize 5pt ebox5 end document Figure 1 Output of example 2 3 eboxl ebox2 2 4 ebox3 eboxd Disabling keys The command krddisablekeys has the same use syntax as the disable keys command of the xkeyval package but will issue an error instead of a warning when an attempt is made to set a disabled key 2 5 Options processing The commands krdDeclareOption krdExecute0ptions and krdProcessOptions are aliases for DeclareOptionX ExecuteOptionsX and ProcessOptionsxX of the xkeyval package 3 Version history The following change history highlights significant changes that affect user utilities and interfaces changes of technical nature are not documented in this section Version 0 4b 2012 01 14 The command krdsetkeys can now parse key values with unbalanced conditionals Version 0 4a 2011 12 23 The key list in krddefinekeys shouldn t have been normalized with respect to forward slash Version 0 4 2011 12 20 Several of the former functions of the pack
5. The keyreader Package A robust interface to xkeyval package Ahmed Musa 2010 2012 Ahmed Musa 17th January 2012 Summary The keyreader package provides robustness and some extensions to the xkeyval pack age It preserves braces in key values throughout parsing and saves estate when defining keys Also the command krdsetkeys allows unbalanced conditionals to be parsed as values of keys Furthermore when the command krddefinekeys is used keys are initialized as soon as they are defined and unlike in the xkeyval package admissible alternate values of choice keys can have individual callbacks The looping macros of the xkeyval package are redefined to increase robustness The command define key of the xkeyval package has had two of its subordinate commands redefined to offset a complaint about the grabbing of the key s callback when defining keys with define key This user manual assumes that the reader is familiar with some of the functions and user interfaces of the xkeyval package This work i e all the files in the keyreader package bundle may be distributed and or modified under the conditions of the TEX Project Public License LPPL either version 1 3 of this license or any later version The LPPL maintenance status of this software is author maintained This software is provided as it is without warranty of any kind either expressed or implied including but not limited to the implied
6. age have been transferred to the 1txkeys package with even more robustness The package now provides mainly a compact and robust interface to the features of the xkeyval package Version 0 3 2011 03 26 Bug fix PAGE 6 OF 8 The keyreader package Version 0 2 2011 02 25 The interface for defining new keys now accepts conditionals in key macros functions 17th January 2012 A mechanism is provided for automatic setting up and execution of key functions with default key values Version 0 1 2010 01 10 First public release PAGE 7 OF 8 The keyreader package 17th January 2012 INDEX Index numbers refer to page numbers A active comma and equals sign Declarelpti ni REEL AN d ee tee disable keys disabling keys examples V secouteiekienst 0 NEEN essence NN EEN Meegiieekarethekien ee SES radang aas krddefinekeys krddisablekeys ENEE KrdEXScubeOptlons c ccd cs ceewson ENKEN krdpostsetkeyS oc SEN SEENEN SE EES a krdpresetkeys kroProcessOptions e NEE ENEE EES ne VEER 3 KEE 3 O options Droceseing 0c eee 6 P Packages ise cn scotia add peu ad etnei teini ioiei EE 1 4 VCXRS YS i tcccceGhat Ee EREE teen a eds 1 2 6 EE 1 3 6 VPRecessUPtiGnsd 2135 EELER RER 6 S KEE 3 AEN Gant STEESEL E 3 U user Commands ANNER EEN eee deve NN NEIEN 2 PAGE 8 OF 8
7. dow true cmd framecolor black cmd shadecolor white cmd shadowcolor gray cmd framesize 4pt cmd boxsize 1 columnwidth cmd shadowsize 1pt choice align center center do let mp alignright hfil let mp alignleft hfil right do let mp alignright hfill let mp alignleft relax left do let mp alignright relax let mp alignleft hfill justified do let mp alignright relax let mp alignleft relax def userinput 1 d savekeys KV ebox frame framecolor framesize Preset keys have no tail keys krdpresetkeys KV febox 7 frame framecolor black framesize 0 5pt boxsize align A Postset keys have no head keys krdpostsetkeys KV ebox shadow usevalue frame shadowcolor usevalue framecolor 40 shadowsize usevalue framesize 4 newcommand ebox 2 setkeys KV febox 1 7 What happens if we use the following instead of the above setkeys Preset and postset keys wouldn t be set when 1 is empty krdifblank 1 setkeys KV ebox 1 begingroup ifmpO frame fboxrule dimexpr mp framesize relax else fboxrule Opt fi ifmp shadow shadowsize dimexpr mp shadowsize relax else shadowsize Opt fi setbox0 hbox fcolorbox mp framecolor mp shadecolor hbox to mp boxsizet mp alignright 2 mp alignleft yh th yh hskip shadowsize color mp shadowcolor PAGE 5 OF 8 The keyreader package 17th January 2012 rule dp0 wd
8. ence they will always convert the user input into lowercase before matching it against the alternate admissible list of values specified at key definition time The matching as done by krdsetkeys is catcode agnostic 2 2 Setting keys The command krdsetkeys is a more robust counterpart of the xkeyval package s setkeys in the sense that it preserves all outer braces in the values of keys and allows the parsing of key values with unbalanced conditionals The new command krdsetkeys has the same syntax as the original setkeys of the xkeyval package namely 18 krdsetkeys kprefix families na key value As usual the star x and plus sign are optional suffixes The starred x variant will save all undeclared keys in the list XKV rm possibly for setting later with the command setrmkeys and will not report any unknown key as undeclared The plus variant will set the given keys in all the given families instead of in just one family The combination will set the listed keys in all the given families and append unknown keys to the container XKV rm na is the list of keys that shouldn t be set in the current run The command krdsetkeys isn t exactly xkeyval package s setkeys since the former is more robust and avoids the selective sanitization of key value list that is done by setkeys The macro krdsetkeys normalizes the key value or comma separated key list Therefore users of
9. r package introduces the concept of callbacks for the alternate admissible values of choice keys defined via the command krddefinekeys Moreover when krddefinekeys is used keys are automatically set initialized as soon as they are defined This provides default definitions for the key macros and functions Boolean keys are initialized with a value of false irrespective of their default values The keyreader package has been used as a development platform for the 1txkeys package because the xkeyval package on which the keyreader package is based has been quite stable for some years its inherent shortcomings not withstanding Has the user ever tried to pass to xkeyval package s setkeys an unbalanced conditional as the value of a key He she will quickly be hit by the error message Incomplete ifx all text was ignored after line or something similar This limitation has been removed by the keyreader package 2 User commands 2 1 Defining keys The syntax for defining keys is New macro krddefinekeys 1 krddefinekeys kprefix kfamily mprefix keylist The optional kprefix and mandatory kfamily have unambiguous connotations The optional mprefix is the macro prefix in the parlance of the xkeyval package The default values of kprefix and mprefix are KRD and krdmp respectively In the case of ordinary command and boolean keys keylist has the syntax Syntax of key keylist
10. the keyreader package should always call the command krdsetkeys instead of setkeys Both have the same user interface The setkeys command of the xkeyval package s remains unchanged The xkeyval package s command setrmkeys which sets remaining keys has also been modified to krdsetrmkeys while keeping setrmkeys unchanged Users of the keyreader package should use krdsetrmkeys in place of setrmkeys PAGE 3 OF 8 The keyreader package 17th January 2012 2 3 Examples krddef inekeys KV fam pnt 1 throughout here refers to the user input for the key ord keya black def xx 1 1 1 cmd keyb fisrtofone def y 1 1 1 bool keyc true def z 1 1 1 choice keyd center center do def vcp align center def w 1 1 1 left do def vcp align flushleft right do def vcp align flushright justified do def vcp align relax ifkrddef else def xa 1 1 1 fi ord keye keye default def y 1 1 1 19 20 21 22 23 24 25 26 27 28 29 30 31 32 F krdsetkeys KV fam keyb keya green keyb iden keyc false keyd left Setting keys with values having unbalanced conditionals krdsetkeys KV fam keye iffalse keye value 33 34 35 36 The braces around green the value of keya will be preserved throughout parsing It should be remembered that keys are automatically set as soon as they are defined by
Download Pdf Manuals
Related Search
keyreader guide.
Related Contents
FRI-0112 取扱説明書 Milweld MW 140 Plus Specifications CC_AP_20_2011.qxd:CASE E COSE BASE Sony SLV-M11HF User's Manual Betriebsanleitung ZLV - 5.0 Personen-Lift 昇 降 式 移 動 足 場 『ハイスタ−』取扱説明書 Black & Decker BLP7600GUC Owner's Manual Elegant Home Fashions HDT586 Instructions / Assembly 取扱説明書 - Panasonic Copyright © All rights reserved.
Failed to retrieve file