diff options
author | Karl Berry <karl@freefriends.org> | 2020-11-25 22:23:57 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2020-11-25 22:23:57 +0000 |
commit | 2a54fce06ef18f1bce21d4252173306c1a6493fb (patch) | |
tree | 703dd36b1c2487879865d84a5ca9b1419fc0af71 /Master/texmf-dist/doc | |
parent | 744bfdd5aeaea286bd724647ffd26bf0f5559c41 (diff) |
xkeyval less runtime
git-svn-id: svn://tug.org/texlive/trunk@57006 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc')
-rw-r--r-- | Master/texmf-dist/doc/latex/xkeyval/xkveca.cls | 54 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/xkeyval/xkvecb.cls | 45 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/xkeyval/xkvesa.sty | 54 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/xkeyval/xkvesb.sty | 52 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/xkeyval/xkvesc.sty | 47 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/xkeyval/xkvex1.tex | 153 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/xkeyval/xkvex2.tex | 356 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/xkeyval/xkvex3.tex | 93 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/xkeyval/xkvex4.tex | 106 |
9 files changed, 960 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/latex/xkeyval/xkveca.cls b/Master/texmf-dist/doc/latex/xkeyval/xkveca.cls new file mode 100644 index 00000000000..cf4abd12587 --- /dev/null +++ b/Master/texmf-dist/doc/latex/xkeyval/xkveca.cls @@ -0,0 +1,54 @@ +%% +%% This is file `xkveca.cls', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% xkeyval.dtx (with options: `xkveca') +%% +%% --------------------------------------- +%% Copyright (C) 2004-2020 Hendri Adriaens +%% --------------------------------------- +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2003/12/01 or later. +%% +%% This work has the LPPL maintenance status "maintained". +%% +%% This Current Maintainer of this work is Hendri Adriaens. +%% +%% This work consists of the file xkeyval.dtx and derived files +%% keyval.tex, xkvtxhdr.tex, xkeyval.sty, xkeyval.tex, xkvview.sty, +%% xkvltxp.sty, xkvutils.tex, pst-xkey.tex, pst-xkey.sty, xkveca.cls, +%% xkvecb.cls, xkvesa.sty, xkvesb.sty, xkvesc.sty, xkvex1.tex, +%% xkvex2.tex, xkvex3.tex and xkvex4.tex. +%% +%% The following files constitute the xkeyval bundle and must be +%% distributed as a whole: readme, xkeyval.pdf, keyval.tex, +%% pst-xkey.sty, pst-xkey.tex, xkeyval.sty, xkeyval.tex, xkvview.sty, +%% xkvltxp.sty, xkvtxhdr.tex, xkvutils.tex, pst-xkey.dtx and xkeyval.dtx. +%% +\ProvidesClass{xkveca} +\usepackage{xkeyval} +\let\keyi\@empty +\let\keyvi\@empty +\DeclareOptionX{keyi}{\def\keyi{#1}} +%% this key has a default value +\DeclareOptionX{keyvi}[{test 6}]{\def\keyvi{#1}} +%% pass option to class xkvesb.cls +\PassOptionsToClass{notitlepage}{xkvecb} +\PassOptionsToClass{keyviii={test 8}}{xkvecb} +%% pass unknown options to article +\DeclareOptionX*{\PassOptionsToClass{\CurrentOption}{article}} +%% process options +\ProcessOptionsX +%% load another class +\LoadClass{xkvecb} +\endinput +%% +%% End of file `xkveca.cls'. diff --git a/Master/texmf-dist/doc/latex/xkeyval/xkvecb.cls b/Master/texmf-dist/doc/latex/xkeyval/xkvecb.cls new file mode 100644 index 00000000000..195adf7656c --- /dev/null +++ b/Master/texmf-dist/doc/latex/xkeyval/xkvecb.cls @@ -0,0 +1,45 @@ +%% +%% This is file `xkvecb.cls', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% xkeyval.dtx (with options: `xkvecb') +%% +%% --------------------------------------- +%% Copyright (C) 2004-2020 Hendri Adriaens +%% --------------------------------------- +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2003/12/01 or later. +%% +%% This work has the LPPL maintenance status "maintained". +%% +%% This Current Maintainer of this work is Hendri Adriaens. +%% +%% This work consists of the file xkeyval.dtx and derived files +%% keyval.tex, xkvtxhdr.tex, xkeyval.sty, xkeyval.tex, xkvview.sty, +%% xkvltxp.sty, xkvutils.tex, pst-xkey.tex, pst-xkey.sty, xkveca.cls, +%% xkvecb.cls, xkvesa.sty, xkvesb.sty, xkvesc.sty, xkvex1.tex, +%% xkvex2.tex, xkvex3.tex and xkvex4.tex. +%% +%% The following files constitute the xkeyval bundle and must be +%% distributed as a whole: readme, xkeyval.pdf, keyval.tex, +%% pst-xkey.sty, pst-xkey.tex, xkeyval.sty, xkeyval.tex, xkvview.sty, +%% xkvltxp.sty, xkvtxhdr.tex, xkvutils.tex, pst-xkey.dtx and xkeyval.dtx. +%% +\ProvidesClass{xkvecb} +%% pass any unknown option to article +\DeclareOptionX{keyviii}{\def\keyviii{#1}} +\DeclareOptionX*{\PassOptionsToClass{\CurrentOption}{article}} +\ProcessOptionsX* +%% load article +\LoadClass{article} +\endinput +%% +%% End of file `xkvecb.cls'. diff --git a/Master/texmf-dist/doc/latex/xkeyval/xkvesa.sty b/Master/texmf-dist/doc/latex/xkeyval/xkvesa.sty new file mode 100644 index 00000000000..3cfe1cd07dd --- /dev/null +++ b/Master/texmf-dist/doc/latex/xkeyval/xkvesa.sty @@ -0,0 +1,54 @@ +%% +%% This is file `xkvesa.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% xkeyval.dtx (with options: `xkvesa') +%% +%% --------------------------------------- +%% Copyright (C) 2004-2020 Hendri Adriaens +%% --------------------------------------- +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2003/12/01 or later. +%% +%% This work has the LPPL maintenance status "maintained". +%% +%% This Current Maintainer of this work is Hendri Adriaens. +%% +%% This work consists of the file xkeyval.dtx and derived files +%% keyval.tex, xkvtxhdr.tex, xkeyval.sty, xkeyval.tex, xkvview.sty, +%% xkvltxp.sty, xkvutils.tex, pst-xkey.tex, pst-xkey.sty, xkveca.cls, +%% xkvecb.cls, xkvesa.sty, xkvesb.sty, xkvesc.sty, xkvex1.tex, +%% xkvex2.tex, xkvex3.tex and xkvex4.tex. +%% +%% The following files constitute the xkeyval bundle and must be +%% distributed as a whole: readme, xkeyval.pdf, keyval.tex, +%% pst-xkey.sty, pst-xkey.tex, xkeyval.sty, xkeyval.tex, xkvview.sty, +%% xkvltxp.sty, xkvtxhdr.tex, xkvutils.tex, pst-xkey.dtx and xkeyval.dtx. +%% +\ProvidesPackage{xkvesa} +\let\keyia\@empty +\let\keyii\@empty +%% keyi has been used in \documentclass +%% this key uses that information to set another macro +%% to do this, \ProcessOptionsX* is necessary. +%% the value from the \documentclass is copied. +\DeclareOptionX{keyi}{\def\keyia{#1}} +\DeclareOptionX{keyii}{\def\keyii{#1}} +%% pass any unknown keys to xkvesb.sty +\DeclareOptionX*{\PassOptionsToPackage{\CurrentOption}{xkvesb}} +%% pass a specific key=value to xkvesb.sty +\PassOptionsToPackage{keyiii={test 3}}{xkvesb} +%% process options. use the * to pick up options from \documentclass +\ProcessOptionsX* +\RequirePackage{xkvesb} +\endinput +%% +%% End of file `xkvesa.sty'. diff --git a/Master/texmf-dist/doc/latex/xkeyval/xkvesb.sty b/Master/texmf-dist/doc/latex/xkeyval/xkvesb.sty new file mode 100644 index 00000000000..19d7b18723a --- /dev/null +++ b/Master/texmf-dist/doc/latex/xkeyval/xkvesb.sty @@ -0,0 +1,52 @@ +%% +%% This is file `xkvesb.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% xkeyval.dtx (with options: `xkvesb') +%% +%% --------------------------------------- +%% Copyright (C) 2004-2020 Hendri Adriaens +%% --------------------------------------- +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2003/12/01 or later. +%% +%% This work has the LPPL maintenance status "maintained". +%% +%% This Current Maintainer of this work is Hendri Adriaens. +%% +%% This work consists of the file xkeyval.dtx and derived files +%% keyval.tex, xkvtxhdr.tex, xkeyval.sty, xkeyval.tex, xkvview.sty, +%% xkvltxp.sty, xkvutils.tex, pst-xkey.tex, pst-xkey.sty, xkveca.cls, +%% xkvecb.cls, xkvesa.sty, xkvesb.sty, xkvesc.sty, xkvex1.tex, +%% xkvex2.tex, xkvex3.tex and xkvex4.tex. +%% +%% The following files constitute the xkeyval bundle and must be +%% distributed as a whole: readme, xkeyval.pdf, keyval.tex, +%% pst-xkey.sty, pst-xkey.tex, xkeyval.sty, xkeyval.tex, xkvview.sty, +%% xkvltxp.sty, xkvtxhdr.tex, xkvutils.tex, pst-xkey.dtx and xkeyval.dtx. +%% +\ProvidesPackage{xkvesb} +\let\keyiii\@empty +\let\keyiv\@empty +\let\keyv\@empty +%% use multiple families to define options +\DeclareOptionX[xkvesb]<famiii>{keyiii}{\def\keyiii{#1}} +\DeclareOptionX[xkvesb]<famiv>{keyiv}{\def\keyiv{#1}} +%% define \keyv as \CurrentOption +\DeclareOptionX*{\let\keyv\CurrentOption} +%% execute options in multiple families +\ExecuteOptionsX[xkvesb]<famiii>{keyiii={test 3}} +%% process options in multiple families +%% do not set keyiii +\ProcessOptionsX[xkvesb]<famiii,famiv>[keyiii] +\endinput +%% +%% End of file `xkvesb.sty'. diff --git a/Master/texmf-dist/doc/latex/xkeyval/xkvesc.sty b/Master/texmf-dist/doc/latex/xkeyval/xkvesc.sty new file mode 100644 index 00000000000..bd92c839714 --- /dev/null +++ b/Master/texmf-dist/doc/latex/xkeyval/xkvesc.sty @@ -0,0 +1,47 @@ +%% +%% This is file `xkvesc.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% xkeyval.dtx (with options: `xkvesc') +%% +%% --------------------------------------- +%% Copyright (C) 2004-2020 Hendri Adriaens +%% --------------------------------------- +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2003/12/01 or later. +%% +%% This work has the LPPL maintenance status "maintained". +%% +%% This Current Maintainer of this work is Hendri Adriaens. +%% +%% This work consists of the file xkeyval.dtx and derived files +%% keyval.tex, xkvtxhdr.tex, xkeyval.sty, xkeyval.tex, xkvview.sty, +%% xkvltxp.sty, xkvutils.tex, pst-xkey.tex, pst-xkey.sty, xkveca.cls, +%% xkvecb.cls, xkvesa.sty, xkvesb.sty, xkvesc.sty, xkvex1.tex, +%% xkvex2.tex, xkvex3.tex and xkvex4.tex. +%% +%% The following files constitute the xkeyval bundle and must be +%% distributed as a whole: readme, xkeyval.pdf, keyval.tex, +%% pst-xkey.sty, pst-xkey.tex, xkeyval.sty, xkeyval.tex, xkvview.sty, +%% xkvltxp.sty, xkvtxhdr.tex, xkvutils.tex, pst-xkey.dtx and xkeyval.dtx. +%% +\ProvidesPackage{xkvesc} +%% redefine \keyvi when keyvi option is specified in \documentclass +\DeclareOption{keyvi}{\def\keyvi{test 6a}} +%% keyvii is a package specific key +\DeclareOption{keyvii}{\def\keyvii{test 7}} +%% note that this package uses original LaTeX macros for options. +%% this is possible since xkeyval filters key=value pairs from +%% the \documentclass options list. +\ProcessOptions +\endinput +%% +%% End of file `xkvesc.sty'. diff --git a/Master/texmf-dist/doc/latex/xkeyval/xkvex1.tex b/Master/texmf-dist/doc/latex/xkeyval/xkvex1.tex new file mode 100644 index 00000000000..47f88091a91 --- /dev/null +++ b/Master/texmf-dist/doc/latex/xkeyval/xkvex1.tex @@ -0,0 +1,153 @@ +%% +%% This is file `xkvex1.tex', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% xkeyval.dtx (with options: `xkvex1') +%% +%% --------------------------------------- +%% Copyright (C) 2004-2020 Hendri Adriaens +%% --------------------------------------- +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2003/12/01 or later. +%% +%% This work has the LPPL maintenance status "maintained". +%% +%% This Current Maintainer of this work is Hendri Adriaens. +%% +%% This work consists of the file xkeyval.dtx and derived files +%% keyval.tex, xkvtxhdr.tex, xkeyval.sty, xkeyval.tex, xkvview.sty, +%% xkvltxp.sty, xkvutils.tex, pst-xkey.tex, pst-xkey.sty, xkveca.cls, +%% xkvecb.cls, xkvesa.sty, xkvesb.sty, xkvesc.sty, xkvex1.tex, +%% xkvex2.tex, xkvex3.tex and xkvex4.tex. +%% +%% The following files constitute the xkeyval bundle and must be +%% distributed as a whole: readme, xkeyval.pdf, keyval.tex, +%% pst-xkey.sty, pst-xkey.tex, xkeyval.sty, xkeyval.tex, xkvview.sty, +%% xkvltxp.sty, xkvtxhdr.tex, xkvutils.tex, pst-xkey.dtx and xkeyval.dtx. +%% +\input xkeyval + +\catcode`\@=11 + +%% xkeyval package: TeX example +%% Hendri Adriaens + +\noindent Example 1. This example demonstrates the use of the new +macros for setting keys of the `xkeyval' package. Have a look at the +source for information about this example and to understand the output. + +%% Define keys. +\define@key{fami}{keyi}{key 1: #1 } +\define@key{famii}{keyii}{key 2: #1 } +\define@key{famiii}{keyiii}[test 2]{key 3: #1 } +\define@key{famiv}{keyi}{key 4: #1 } + +%% Set keys from multiple families. +\setkeys{fami,famii,famiii}{keyi=test 1,keyiii} + +%% Multiplely defined keys will be taken from the first family on the +%% list that defines the key. When + is used, all families +%% defining the key will set it. +\setkeys{fami,famiv}{keyi=test 3}\par +\setkeys{famiv,fami}{keyi=test 4}\par +\setkeys+{fami,famiv}{keyi=test 5}\par + +%% Starred form sets keys that it can find in the families specified. +%% Keys that cannot be located will be put onto a list for later use +%% by \setrmkeys. +\setkeys*{famiv}{keyi=test 9,keyii=http://www.test10.com, + keyiii=test 11}\par + +%% Try to set the remaining keys from the previous step. The starred +%% version defines a new list in case there are still keys that cannot +%% be located in the given families. The command below does not do +%% anything since the `keyi' key has already been taken from family +%% `famiv' above. +\setrmkeys*{fami}\par + +%% The normal version will complain (as \setkeys) when it cannot locate +%% a key which was previously submitted to \xsetkeys and hasn't been +%% set yet by previous commands. `xkeyval' commands can also be used to +%% set `keyval' options. +\setrmkeys{famii,famiii}\par + +%% Set keys, excluding some keys. +\setkeys{fami,famii,famiii}[keyi,keyiii]{keyi=test 6,keyii=test +7,keyiii=test 8}\par + +%% Test whether a key is defined in a family from the list. +\key@ifundefined{fami,famii}{keyiii} +{keyiii is not defined in family `fami' or `famii'} +{keyiii is defined in family `fami' or `famii'} + +%% Define some keys and macros. +\define@cmdkey[my]{fama}[my@]{keya}[none]{} +\define@choicekey[my]{fama}{keyb}{a,b,c}[b]{correct input: #1} +\define@boolkey[my]{famb}{keyc}[true]{} +\def\testa{\setkeys[my]{fama}} +\def\testb{\setkeys[my]{famb}} +\def\testset{\setkeys[my]{fama,famb}} + +%% Now \testa can only set keya, \testb can only +%% set keyb and \testset can set both. +\testa{keya} + \my@keya\ +\testa{keyb} +\testb{keyc} + \ifmy@famb@keyc true \else false \fi +\testset{keya=test 11,keyb=c,keyc=false} + \my@keya\space + \ifmy@famb@keyc true \else false \fi + +%% Pointer system + +%% First we (re)define some keys. +\define@key{fam}{keyi}{key 1: #1 } +\define@key{fam}{keyii}{key 2: #1 } +\define@key{fam}{keyiii}[test 2]{key 3: #1 } + +%% Pointers can be used to copy the value of other keys in the same +%% family. This can be done in two ways. The first example shows `on +%% the spot' value saving. +\setkeys{fam}{\savevalue{keyi}=test 12,\savevalue{keyii}=\usevalue{keyi}} +\setkeys{fam}{keyiii=\usevalue{keyii}} + +%% However, you can also predefine the keys to be saved for the entire +%% document with a single command. +\savekeys{fam}{keyi,keyii} +\setkeys{fam}{keyi=test 13,keyii=\usevalue{keyi}} +\setkeys{fam}{keyiii=\usevalue{keyii}} + +%% Pointers can be used in default values as well. Remember that the +%% previous example used \savekeys for keyi and keyii. +\define@key{fam}{keyi}{keyi: #1 } +\define@key{fam}{keyii}[\usevalue{keyi}]{keyii: #1 } +\define@key{fam}{keyiii}[\usevalue{keyii}]{keyiii: #1 } +\setkeys{fam}{keyi=test 14} +\setkeys{fam}{keyii} +\setkeys{fam}{keyiii} + +%% Presetting keys + +%% Simple example of the preset system. +\define@key{fam}{keyi}{keyi: #1 } +\define@key{fam}{keyii}{keyii: #1 } +\presetkeys{fam}{keyi=blue}{keyii=\usevalue{keyi}} +\setkeys{fam}{}\par +\setkeys{fam}{keyi=red}\par +\setkeys{fam}{keyii=red} +\presetkeys{fam}{keyi=red}{}\par +\setkeys{fam}{keyii=\usevalue{keyi}} + +\bye +\endinput +%% +%% End of file `xkvex1.tex'. diff --git a/Master/texmf-dist/doc/latex/xkeyval/xkvex2.tex b/Master/texmf-dist/doc/latex/xkeyval/xkvex2.tex new file mode 100644 index 00000000000..4e6b1c364c8 --- /dev/null +++ b/Master/texmf-dist/doc/latex/xkeyval/xkvex2.tex @@ -0,0 +1,356 @@ +%% +%% This is file `xkvex2.tex', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% xkeyval.dtx (with options: `xkvex2') +%% +%% --------------------------------------- +%% Copyright (C) 2004-2020 Hendri Adriaens +%% --------------------------------------- +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2003/12/01 or later. +%% +%% This work has the LPPL maintenance status "maintained". +%% +%% This Current Maintainer of this work is Hendri Adriaens. +%% +%% This work consists of the file xkeyval.dtx and derived files +%% keyval.tex, xkvtxhdr.tex, xkeyval.sty, xkeyval.tex, xkvview.sty, +%% xkvltxp.sty, xkvutils.tex, pst-xkey.tex, pst-xkey.sty, xkveca.cls, +%% xkvecb.cls, xkvesa.sty, xkvesb.sty, xkvesc.sty, xkvex1.tex, +%% xkvex2.tex, xkvex3.tex and xkvex4.tex. +%% +%% The following files constitute the xkeyval bundle and must be +%% distributed as a whole: readme, xkeyval.pdf, keyval.tex, +%% pst-xkey.sty, pst-xkey.tex, xkeyval.sty, xkeyval.tex, xkvview.sty, +%% xkvltxp.sty, xkvtxhdr.tex, xkvutils.tex, pst-xkey.dtx and xkeyval.dtx. +%% +\documentclass{article} +\usepackage{xkeyval} +\usepackage{xcolor,calc} + +%% Example of setting keyval options using xkeyval +\usepackage{hyperref} +\usepackage{helvet} +\setkeys{Hyp,Hel}{colorlinks,urlcolor=green,scaled=.85} + +\title{\textsf{xkeyval} package\\\normalsize\emph{Example 2}} +\author{Hendri Adriaens} +\setlength{\parindent}{0cm} + +\makeatletter + +\begin{document} +\maketitle + +This example demonstrates the use of the new macros for setting +keys of the \textsf{xkeyval} package. Below each piece of verbatim +code, you can find its output. + +\section{Simple operations} + +Define keys. +\begin{verbatim} +\define@key{fami}{keyi}{key 1: #1\space} +\define@key{famii}{keyii}{key 2: #1\space} +\define@key{famiii}{keyiii}[test 2]{key 3: #1\space} +\define@key{famiv}{keyi}{key 4: #1\space} +\end{verbatim} +\define@key{fami}{keyi}{key 1: #1\space} +\define@key{famii}{keyii}{key 2: #1\space} +\define@key{famiii}{keyiii}[test 2]{key 3: #1\space} +\define@key{famiv}{keyi}{key 4: #1\space} + +Set keys from multiple families. +\begin{verbatim} +\setkeys{fami,famii,famiii}{keyi=test 1,keyiii} +\end{verbatim} +\begin{itemize} +\item[$\Rightarrow$] +\setkeys{fami,famii,famiii}{keyi=test 1,keyiii} +\end{itemize} + +Multiplely defined keys will be taken from the first family on the +list that defines the key. When \verb|+| is used, all families +defining the key will set it. +\begin{verbatim} +\setkeys{fami,famiv}{keyi=test 3} +\setkeys{famiv,fami}{keyi=test 4} +\setkeys+{fami,famiv}{keyi=test 5} +\end{verbatim} +\begin{itemize} +\item[$\Rightarrow$] +\setkeys{fami,famiv}{keyi=test 3}\par +\setkeys{famiv,fami}{keyi=test 4}\par +\setkeys+{fami,famiv}{keyi=test 5} +\end{itemize} + +Starred form sets keys that it can find in the families specified. +Keys that cannot be located will be put onto a list for later use +by \verb+\setrmkeys+. +\begin{verbatim} +\setkeys*{famiv}{keyi=test 9,keyii=\url{http://www.test10.com}, + keyiii=this key has been set on page \thepage} +\end{verbatim} +\begin{itemize} +\item[$\Rightarrow$] +\setkeys*{famiv}{keyi=test 9,keyii=\url{http://www.test10.com}, + keyiii=this key has been set on page \thepage} +\end{itemize} + +Try to set the remaining keys from the previous step. The starred +version defines a new list in case there are still keys that +cannot be located in the given families. The command below does +not do anything since the \verb+keyi+ key has already been taken +from family \verb+famiv+ above. +\begin{verbatim} +\setrmkeys*{fami} +\end{verbatim} +\setrmkeys*{fami}\par + +The normal version will complain (as \verb+\setkeys+) when it +cannot locate a key which was previously submitted to +\verb+\setkeys+ and hasn't been set yet by previous commands. +\textsf{xkeyval} commands can also be used to set \textsf{keyval} +options as is done to the color of the url created with the +\textsf{hyperref} package and the scaling of the font used for +`\textsf{xkeyval}' with the \textsf{helvet} package. (See the +preamble of the example for the code). +\begin{verbatim} +\setrmkeys{famii,famiii} +\end{verbatim} +\begin{itemize} +\item[$\Rightarrow$] +\setrmkeys{famii,famiii} +\end{itemize} + +Set keys, excluding some keys. +\begin{verbatim} +\setkeys{fami,famii,famiii}[keyi,keyiii]{keyi=test 6,keyii=test 7,keyiii=test 8} +\end{verbatim} +\begin{itemize} +\item[$\Rightarrow$] +\setkeys{fami,famii,famiii}[keyi,keyiii]{keyi=test 6,keyii=test 7,keyiii=test 8} +\end{itemize} + +Test whether a key is defined in a family from the list. +\begin{verbatim} +\key@ifundefined{fami,famii}{keyiii} +{keyiii is not defined in family `fami' or `famii'} +{keyiii is defined in family `fami' or `famii'} +\end{verbatim} +\begin{itemize} +\item[$\Rightarrow$] +\key@ifundefined{fami,famii}{keyiii} +{keyiii is not defined in family `fami' or `famii'} +{keyiii is defined in family `fami' or `famii'} +\end{itemize} + +Define some keys and macros. +\begin{verbatim} +\define@cmdkey[my]{fama}[my@]{keya}[none]{} +\define@choicekey[my]{fama}{keyb}{a,b,c}[b]{correct input: #1} +\define@boolkey[my]{famb}{keyc}[true]{} +\def\testa{\setkeys[my]{fama}} +\def\testb{\setkeys[my]{famb}} +\def\testset{\setkeys[my]{fama,famb}} +\end{verbatim} +\define@cmdkey[my]{fama}[my@]{keya}[none]{} +\define@choicekey[my]{fama}{keyb}{a,b,c}[b]{correct input: #1} +\define@boolkey[my]{famb}{keyc}[true]{} +\def\testa{\setkeys[my]{fama}} +\def\testb{\setkeys[my]{famb}} +\def\testset{\setkeys[my]{fama,famb}} +Now \verb+\testa+ can only set \verb+keya+, \verb+\testb+ can only +set \verb+keyb+ and \verb+\testset+ can set both. +\begin{verbatim} +\testa{keya} + \my@keya\ +\testa{keyb} +\testb{keyc} + \ifmy@famb@keyc true \else false \fi +\testset{keya=test 11,keyb=c,keyc=false} + \my@keya\space + \ifmy@famb@keyc true \else false \fi +\end{verbatim} +\begin{itemize} +\item[$\Rightarrow$] +\testa{keya} + \my@keya\ +\testa{keyb} +\testb{keyc} + \ifmy@famb@keyc true \else false \fi +\testset{keya=test 11,keyb=c,keyc=false} + \my@keya\space + \ifmy@famb@keyc true \else false \fi +\end{itemize} + +\section{Pointers and values} + +First we (re)define some keys. +\begin{verbatim} +\define@key{fam}{keyi}{key 1: #1 } +\define@key{fam}{keyii}{key 2: #1 } +\define@key{fam}{keyiii}[test 2]{key 3: #1 } +\end{verbatim} +\define@key{fam}{keyi}{key 1: #1 } +\define@key{fam}{keyii}{key 2: #1 } +\define@key{fam}{keyiii}[test 2]{key 3: #1 } + +Pointers can be used to copy the value of other keys in the same +family. This can be done in two ways. The first example shows `on +the spot' value saving. +\begin{verbatim} +\setkeys{fam}{\savevalue{keyi}=test 12,\savevalue{keyii}=\usevalue{keyi}} +\setkeys{fam}{keyiii=\usevalue{keyii}} +\end{verbatim} +\begin{itemize} +\item[$\Rightarrow$] +\setkeys{fam}{\savevalue{keyi}=test 12,\savevalue{keyii}=\usevalue{keyi}} +\setkeys{fam}{keyiii=\usevalue{keyii}} +\end{itemize} + +However, you can also predefine the keys to be saved for the entire +document with a single command. Note that we force keys to be saved +globally. This is necessary here since the commands in the source of +this document appear in an environment. +\begin{verbatim} +\savekeys{fam}{\global{keyi},\global{keyii}} +\setkeys{fam}{keyi=test 13,keyii=\usevalue{keyi}} +\setkeys{fam}{keyiii=\usevalue{keyii}} +\end{verbatim} +\begin{itemize} +\item[$\Rightarrow$] +\savekeys{fam}{\global{keyi},\global{keyii}} +\setkeys{fam}{keyi=test 13,keyii=\usevalue{keyi}} +\setkeys{fam}{keyiii=\usevalue{keyii}} +\end{itemize} + +Pointers can be used in default values as well. Remember that the +previous example used \verb+\savekeys+ for \verb+keyi+ and \verb+keyii+. +\begin{verbatim} +\define@key{fam}{keyi}{keyi: #1 } +\define@key{fam}{keyii}[\usevalue{keyi}]{keyii: #1 } +\define@key{fam}{keyiii}[\usevalue{keyii}]{keyiii: #1 } +\setkeys{fam}{keyi=test 14} +\setkeys{fam}{keyii} +\setkeys{fam}{keyiii} +\end{verbatim} +\begin{itemize} +\item[$\Rightarrow$] +\define@key{fam}{keyi}{keyi: #1 } +\define@key{fam}{keyii}[\usevalue{keyi}]{keyii: #1 } +\define@key{fam}{keyiii}[\usevalue{keyii}]{keyiii: #1 } +\setkeys{fam}{keyi=test 14} +\setkeys{fam}{keyii} +\setkeys{fam}{keyiii} +\end{itemize} + +\section{Presetting keys} + +Simple example of the preset system. +\begin{verbatim} +\define@key{fam}{keyi}{keyi: #1 } +\define@key{fam}{keyii}{keyii: #1 } +\presetkeys{fam}{keyi=blue}{keyii=\usevalue{keyi}} +\setkeys{fam}{}\par +\setkeys{fam}{keyi=red}\par +\setkeys{fam}{keyii=red} +\presetkeys{fam}{keyi=red}{} +\setkeys{fam}{keyii=\usevalue{keyi}} +\end{verbatim} +\begin{itemize} +\item[$\Rightarrow$] +\define@key{fam}{keyi}{keyi: #1 } +\define@key{fam}{keyii}{keyii: #1 } +\presetkeys{fam}{keyi=blue}{keyii=\usevalue{keyi}} +\setkeys{fam}{}\par +\setkeys{fam}{keyi=red}\par +\setkeys{fam}{keyii=red} +\presetkeys{fam}{keyi=red}{}\par +\setkeys{fam}{keyii=\usevalue{keyi}} +\end{itemize} + +\section{Application of pointers, values and presets} + +\setkeys{Hyp}{urlcolor=black} +More complicated example of the preset +system and pointer system. See for more information about this +example the +\textsf{xkeyval} article on\par +\url{http://www.tug.org/TUGboat/tb25-2/tb81adriaens.pdf}. +\begin{verbatim} +\newdimen\shadowsize +\define@boolkey{Fbox}{frame}[true]{} +\define@boolkey{Fbox}{shadow}[true]{} +\define@key{Fbox}{framecolor}{\def\Fboxframecolor{#1}} +\define@key{Fbox}{shadowcolor}{\def\Fboxshadowcolor{#1}} +\define@key{Fbox}{framesize}{\setlength\fboxrule{#1}} +\define@key{Fbox}{shadowsize}{\setlength\shadowsize{#1}} +\presetkeys{Fbox}{frame,framecolor=red,framesize=0.5pt}% + {shadow=\usevalue{frame},shadowcolor=\usevalue{framecolor}!40,% + shadowsize=\usevalue{framesize}*4} +\savekeys{Fbox}{frame,framecolor,framesize} +\newcommand*\Fbox[2][]{% + \setkeys{Fbox}{#1}% + {\ifKV@Fbox@frame\else\fboxrule0pt\fi + \ifKV@Fbox@shadow\else\shadowsize0pt\fi + \sbox0{\fcolorbox{\Fboxframecolor}{white}{#2}}% + \hskip\shadowsize + \color{\Fboxshadowcolor}% + \rule[-\dp0]{\wd0}{\ht0+\dp0}% + \llap{\raisebox{\shadowsize}% + {\box0\hskip\shadowsize}}}% +} +\Fbox{demo1} +\Fbox[framecolor=blue]{demo2} +\Fbox[shadow=false]{demo3} +\Fbox[framesize=1pt]{demo4} +\Fbox[frame=false,shadow]{demo5} +\end{verbatim} +\newdimen\shadowsize +\define@boolkey{Fbox}{frame}[true]{} +\define@boolkey{Fbox}{shadow}[true]{} +\define@key{Fbox}{framecolor}% + {\def\Fboxframecolor{#1}} +\define@key{Fbox}{shadowcolor}% + {\def\Fboxshadowcolor{#1}} +\define@key{Fbox}{framesize}% + {\setlength\fboxrule{#1}} +\define@key{Fbox}{shadowsize}% + {\setlength\shadowsize{#1}} +\presetkeys{Fbox}% + {frame,framecolor=red,framesize=0.5pt}% + {shadow=\usevalue{frame}, + shadowcolor=\usevalue{framecolor}!40, + shadowsize=\usevalue{framesize}*4} +\savekeys{Fbox}{frame,framecolor,framesize} +\newcommand*\Fbox[2][]{% + \setkeys{Fbox}{#1}% + {\ifKV@Fbox@frame\else\fboxrule0pt\fi + \ifKV@Fbox@shadow\else\shadowsize0pt\fi + \sbox0{\fcolorbox{\Fboxframecolor}{white}{#2}}% + \hskip\shadowsize + \color{\Fboxshadowcolor}% + \rule[-\dp0]{\wd0}{\ht0+\dp0}% + \llap{\raisebox{\shadowsize}% + {\box0\hskip\shadowsize}}}% +} +\Fbox{demo1} +\Fbox[framecolor=blue]{demo2} +\Fbox[shadow=false]{demo3} +\Fbox[framesize=1pt]{demo4} +\Fbox[frame=false,shadow]{demo5} + +\end{document} +\endinput +%% +%% End of file `xkvex2.tex'. diff --git a/Master/texmf-dist/doc/latex/xkeyval/xkvex3.tex b/Master/texmf-dist/doc/latex/xkeyval/xkvex3.tex new file mode 100644 index 00000000000..0a3dc879dc7 --- /dev/null +++ b/Master/texmf-dist/doc/latex/xkeyval/xkvex3.tex @@ -0,0 +1,93 @@ +%% +%% This is file `xkvex3.tex', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% xkeyval.dtx (with options: `xkvex3') +%% +%% --------------------------------------- +%% Copyright (C) 2004-2020 Hendri Adriaens +%% --------------------------------------- +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2003/12/01 or later. +%% +%% This work has the LPPL maintenance status "maintained". +%% +%% This Current Maintainer of this work is Hendri Adriaens. +%% +%% This work consists of the file xkeyval.dtx and derived files +%% keyval.tex, xkvtxhdr.tex, xkeyval.sty, xkeyval.tex, xkvview.sty, +%% xkvltxp.sty, xkvutils.tex, pst-xkey.tex, pst-xkey.sty, xkveca.cls, +%% xkvecb.cls, xkvesa.sty, xkvesb.sty, xkvesc.sty, xkvex1.tex, +%% xkvex2.tex, xkvex3.tex and xkvex4.tex. +%% +%% The following files constitute the xkeyval bundle and must be +%% distributed as a whole: readme, xkeyval.pdf, keyval.tex, +%% pst-xkey.sty, pst-xkey.tex, xkeyval.sty, xkeyval.tex, xkvview.sty, +%% xkvltxp.sty, xkvtxhdr.tex, xkvutils.tex, pst-xkey.dtx and xkeyval.dtx. +%% +%% keyi will set \keyi in xkveca.cls +%% keyvi will set \keyvi in xkveca.cls and xkvesc.sty will pick +%% it up from \documentclass and redefine it +%% IgnoredGlobal and another=key will be considered as global +%% options to be passed on to packages. Not used anymore. +\documentclass[keyi=test1,keyvi,another=key,IgnoredGlobal,10pt]{xkveca} + +%% keyii will set \keyii in xkvesa.sty +%% keyiv will be passed to xkvesb.sty as unknown option +%% the other input will be passed on to xkvesb as well. +\usepackage[keyii=test2,keyiv=test4,test5]{xkvesa} + +%% keyvii will set \keyvii in xkvesc.sty +\usepackage[keyvii]{xkvesc} + +\title{\textsf{xkeyval} package\\\normalsize\emph{Example 3}} +\author{Hendri Adriaens} +\setlength{\parindent}{0cm} + +\makeatletter +\let\@tempa\@classoptionslist +\let\@tempb\@unusedoptionlist + +\begin{document} +\maketitle + +This example demonstrates the use of the new macros for declaring +class and package options of the \textsf{xkeyval} package. Please +study the files \verb+xkvex2.tex+, \verb+xkveca.cls+, +\verb+xkvecb.cls+, \verb+xkvesa.sty+, \verb+xkvesb.sty+ and +\verb+xkvesc.sty+ carefully to understand the output below.\\ + +Set by \verb+xkveca.cls+: \keyi\par +Set by \verb+xkvesa.sty+, copied from \verb+\documentclass+: \keyia\par +Set by \verb+xkvesa.sty+: \keyii\par +Set by \verb+xkvesb.sty+, passed on from \verb+xkvesa.sty+: \keyiii\par +Set by \verb+xkvesb.sty+, passed on as unknown key from \verb+xkvesa.sty+: \keyiv\par +Set by \verb+xkvesb.sty+, passed on as unknown from \verb+xkvesa.sty+: \keyv\par +Set by the class, copied by \verb+xkvesc.sty+: \keyvi\par +Set by \verb+xkvesc.sty+: \keyvii\par +Set by \verb+xkvecb.cls+, passed on from \verb+xkveca.cls+: \keyviii\\ + +The document class is: \XKV@documentclass\par +Unused global options: \@tempb\\ + +Notice the content of the following macros.\par +\verb+\@classoptionslist+: \@tempa\par +\verb+\XKV@classoptionslist+: \XKV@classoptionslist\\ + +This shows that \verb+key=value+ pairs have been deleted from the +class options list so that subsequent packages which are not using +\textsf{xkeyval} and are scanning this list will not run into +problems.\\ + +\end{document} +\endinput +%% +%% End of file `xkvex3.tex'. diff --git a/Master/texmf-dist/doc/latex/xkeyval/xkvex4.tex b/Master/texmf-dist/doc/latex/xkeyval/xkvex4.tex new file mode 100644 index 00000000000..7402799294c --- /dev/null +++ b/Master/texmf-dist/doc/latex/xkeyval/xkvex4.tex @@ -0,0 +1,106 @@ +%% +%% This is file `xkvex4.tex', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% xkeyval.dtx (with options: `xkvex4') +%% +%% --------------------------------------- +%% Copyright (C) 2004-2020 Hendri Adriaens +%% --------------------------------------- +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2003/12/01 or later. +%% +%% This work has the LPPL maintenance status "maintained". +%% +%% This Current Maintainer of this work is Hendri Adriaens. +%% +%% This work consists of the file xkeyval.dtx and derived files +%% keyval.tex, xkvtxhdr.tex, xkeyval.sty, xkeyval.tex, xkvview.sty, +%% xkvltxp.sty, xkvutils.tex, pst-xkey.tex, pst-xkey.sty, xkveca.cls, +%% xkvecb.cls, xkvesa.sty, xkvesb.sty, xkvesc.sty, xkvex1.tex, +%% xkvex2.tex, xkvex3.tex and xkvex4.tex. +%% +%% The following files constitute the xkeyval bundle and must be +%% distributed as a whole: readme, xkeyval.pdf, keyval.tex, +%% pst-xkey.sty, pst-xkey.tex, xkeyval.sty, xkeyval.tex, xkvview.sty, +%% xkvltxp.sty, xkvtxhdr.tex, xkvutils.tex, pst-xkey.dtx and xkeyval.dtx. +%% +%% Load LaTeX kernel macros patch +\RequirePackage{xkvltxp} + +%% keyi will set \keyi in xkveca.cls +%% keyvi will set \keyvi in xkveca.cls and xkvesc.sty will pick +%% it up from \documentclass and redefine it +%% IgnoredGlobal and another=key will be considered as global +%% options to be passed on to packages. Not used anymore. +\documentclass[keyi=test1 on page \thepage,keyvi,another=key,IgnoredGlobal,10pt]{xkveca} + +%% keyii will set \keyii in xkvesa.sty +%% keyiv will be passed to xkvesb.sty as unknown option +%% the other input will be passed on to xkvesb as well. +\usepackage[keyii=test2 on page \thepage,keyiv=test4 on page \thepage,test5]{xkvesa} + +%% keyvii will set \keyvii in xkvesc.sty +\usepackage[keyvii]{xkvesc} + +\title{\textsf{xkeyval} package\\\normalsize\emph{Example 4}} +\author{Hendri Adriaens} +\setlength{\parindent}{0cm} + +\makeatletter +\let\@tempa\@classoptionslist +\let\@tempb\@unusedoptionlist +\let\@tempc\XKV@classoptionslist +\@onelevel@sanitize\@tempc + +\begin{document} +\maketitle + +This example demonstrates the use of the new macros for declaring +class and package options of the \textsf{xkeyval} package. Please +study the files \verb+xkvex2.tex+, \verb+xkveca.cls+, +\verb+xkvecb.cls+, \verb+xkvesa.sty+, \verb+xkvesb.sty+ and +\verb+xkvesc.sty+ carefully to understand the output below.\\ + +Set by \verb+xkveca.cls+: \keyi\par +Set by \verb+xkvesa.sty+, copied from \verb+\documentclass+: \keyia\par +Set by \verb+xkvesa.sty+: \keyii\par +Set by \verb+xkvesb.sty+, passed on from \verb+xkvesa.sty+: \keyiii\par +Set by \verb+xkvesb.sty+, passed on as unknown from \verb+xkvesa.sty+: \keyiv\par +Set by \verb+xkvesb.sty+, passed on as unknown from \verb+xkvesa.sty+: \keyv\par +Set by the class, copied by \verb+xkvesc.sty+: \keyvi\par +Set by \verb+xkvesc.sty+: \keyvii\par +Set by \verb+xkvecb.cls+, passed on from \verb+xkveca.cls+: \keyviii\\ + +The document class is: \XKV@documentclass\par +Unused global options: \texttt{\@tempb}\\ + +Notice the content of the following macros.\par +\verb+\@classoptionslist+: \texttt{\@tempa}\par +\verb+\XKV@classoptionslist+:\par\texttt{\@tempc}\\ + +This shows that \verb+key=value+ pairs have been deleted from the +class options list so that subsequent packages which are not using +\textsf{xkeyval} and are scanning this list will not run into +problems.\\ + +\newpage +This page shows that key values are only expanded when they are +actually used. They are not expanded during option processing.\\ + +\keyi\par +\keyii\par +\keyiv + +\end{document} +\endinput +%% +%% End of file `xkvex4.tex'. |