summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2011-12-24 23:51:38 +0000
committerKarl Berry <karl@freefriends.org>2011-12-24 23:51:38 +0000
commit211b7130dc1fe594fb4f775af6249864a789f7b0 (patch)
tree53eb87d27ce92f97c816a9977d9ee4d12425be01
parent7af65506fa2152224f81b051fd958eb3dca5c1c2 (diff)
keyreader 0.4a (24dec11)
git-svn-id: svn://tug.org/texlive/trunk@24936 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Master/texmf-dist/doc/latex/keyreader/README2
-rw-r--r--Master/texmf-dist/doc/latex/keyreader/keyreader-guide.pdfbin240486 -> 241488 bytes
-rw-r--r--Master/texmf-dist/doc/latex/keyreader/keyreader-guide.tex19
-rw-r--r--Master/texmf-dist/tex/latex/keyreader/keyreader-guide.cfg38
-rw-r--r--Master/texmf-dist/tex/latex/keyreader/keyreader.sty25
5 files changed, 28 insertions, 56 deletions
diff --git a/Master/texmf-dist/doc/latex/keyreader/README b/Master/texmf-dist/doc/latex/keyreader/README
index a0626c718e1..fc0c781397e 100644
--- a/Master/texmf-dist/doc/latex/keyreader/README
+++ b/Master/texmf-dist/doc/latex/keyreader/README
@@ -6,7 +6,7 @@ Ahmed Musa
VERSION
-Version 0.4, December 2011
+Version 0.4a, December 2011
SUMMARY
diff --git a/Master/texmf-dist/doc/latex/keyreader/keyreader-guide.pdf b/Master/texmf-dist/doc/latex/keyreader/keyreader-guide.pdf
index 23c6662cab0..656583c7d3d 100644
--- a/Master/texmf-dist/doc/latex/keyreader/keyreader-guide.pdf
+++ b/Master/texmf-dist/doc/latex/keyreader/keyreader-guide.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/keyreader/keyreader-guide.tex b/Master/texmf-dist/doc/latex/keyreader/keyreader-guide.tex
index 86a969ec46e..41c1ca88398 100644
--- a/Master/texmf-dist/doc/latex/keyreader/keyreader-guide.tex
+++ b/Master/texmf-dist/doc/latex/keyreader/keyreader-guide.tex
@@ -29,7 +29,7 @@
\title{The \texttt{\color{blue}keyreader} Package\titleref{t1,t2}}
\titlenotes[t1,t2]{%
The package is available at \url{\titleurltext}.\sep
- This user manual corresponds to version~0.4 of the package.
+ This user manual corresponds to version~0.4a of the package.
}
\subtitle{A robust interface to \pkg'{xkeyval}}
\titleurl{http://mirror.ctan.org/macros/latex/contrib/keyreader/}
@@ -40,7 +40,7 @@
\def\abstractname{\textsf{Summary}}
\begin{abstract}
\small
- The \pkg'{keyreader} provides robustness and some extensions to the \pkg'{xkeyval}. It preserves braces in key values and saves estate when defining keys. Also, keys are initialized as soon as they are defined, and, unlike in the \pkg'{xkeyval}, admissible alternate values of choice keys can have individual callbacks. This user manual assumes that the reader is familiar with some of the functions and user interfaces of the \pkg'{xkeyval}.
+ The \pkg'{keyreader} provides robustness and some extensions to the \pkg'{xkeyval}. It preserves braces in key values and saves estate when defining keys. Also, when the command \fx{\krddefinekeys} is used, keys are initialized as soon as they are defined, and, unlike in the \pkg'{xkeyval}, admissible alternate values of choice keys can have individual callbacks. This user manual assumes that the reader is familiar with some of the functions and user interfaces of the \pkg'{xkeyval}.
\end{abstract}
\let\licensename\relax
@@ -68,10 +68,10 @@
\newpage
\docsection(sec:motivation){Motivation}
-The \pkg'{keyreader} predated the \pkg'{ltxkeys} and was developed to make key parsing by the \pkg'{xkeyval} robust (in the sense of preserving outer braces in key values throughout parsing), as well as reduce the amount of typing that is required for defining several keys. To achieve robustness in key parsing, the \fx{\setkeys} command of the \pkg'{xkeyval} has been patched. The \pkg'{keyreader} provides commands for compactly defining and setting all types of key (ordinary, command, boolean, and choice). Also, the \pkg'{keyreader} introduces the concept of callbacks for the alternate/admissible values of choice keys. Moreover, 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 \hx{false} irrespective of their default values.
+The \pkg'{keyreader} predated the \pkg'{ltxkeys} and was developed to make key parsing by the \pkg'{xkeyval} robust (in the sense of preserving outer braces in key values throughout parsing), as well as reduce the amount of typing that is required for defining several keys. To achieve robustness in key parsing, the \fx{\setkeys} command of the \pkg'{xkeyval} has been patched and renamed \fx{\krdsetkeys}. The \pkg'{keyreader} provides commands for compactly defining and setting all types of key (ordinary, command, boolean, and choice). Also, the \pkg'{keyreader} introduces the concept of callbacks for the alternate/admissible values of choice keys defined via the command \fx{\krddefinekeys}. Moreover, when \fx{\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 \hx{false} irrespective of their default values.
The \pkg'{keyreader} has been used as a development platform for the \pkg'{ltxkeys} because the \pkg'{xkeyval}, on which the \pkg'{keyreader} is based, has been quite stable for some years, its inherent
-shortcomings not withstanding. Because the \pkg'{keyreader} is based on the \pkg'{xkeyval}, it inherits some of the limitations of the \pkg'{xkeyval}. Has the user ever tried to pass to \pkg'{xkeyval}'s \fx{\setkeys} an unbalanced conditional (\eg, \hhx{\iftrue,\iffalse,\ifx}, or \hx{\fi}) as the value of a key? He/she will quickly be hit by the error message \quoted{! Incomplete \hx{\ifx}; all text was ignored after line \ldots}, or something similar. The same limitation applies to the \pkg'{keyreader}.
+shortcomings not withstanding. Because the \pkg'{keyreader} is based on the \pkg'{xkeyval}, it inherits some of the limitations of the \pkg'{xkeyval}. Has the user ever tried to pass to \pkg'{xkeyval}'s \fx{\setkeys} an unbalanced conditional (invloving \hhx{\iftrue,\iffalse,\ifx}, or \hx{\fi}) as the value of a key? He/she will quickly be hit by the error message \quoted{! Incomplete \hx{\ifx}; all text was ignored after line \ldots}, or something similar. The same limitation applies to the \pkg'{keyreader}. In this respect, the \pkg'{ltxkeys} is more robust.
\docsection(sec:user-commands)<user commands>{User commands}
@@ -119,17 +119,17 @@ The list parser in this case is invariably \qcomma.
The star (\redstar*) is an optional prefix. If it is present, then only definable (\ie, non-existent) keys will be defined. The existence of a key depends on \ang{kprefix} and \ang{kfamily}, since keys are name-spaced.
-The command \fx{\setkeys} of the \pkg'{xkeyval} is made more robust, in the sense that it now preserves all outer braces in the values of keys. The patched command \fx{\setkeys} has the same syntax as the original \fx{\setkeys} of the \pkg'{xkeyval}, namely
+The command \fx{\krdsetkeys} is a more robust counterpart of the \pkg'{xkeyval}'s \fx{\setkeys}, in the sense that it preserves all outer braces in the values of keys. The new command \fx{\krdsetkeys} has the same syntax as the original \fx{\setkeys} of the \pkg'{xkeyval}, namely
\start{macro}[\setkeys]
-\setkeys|*|+[|A(kprefix)]{|A(families)}[|A(na)]{|A(|verbkeyval pairs)}
+\krdsetkeys|*|+[|A(kprefix)]{|A(families)}[|A(na)]{|A(|verbkeyval pairs)}
\finish{macro}
As usual, the star (\redstar) and plus sign (\redplus) are optional prefixes. The \stform will save all undeclared keys in the list \fx{\XKV@rm}, possibly for setting later with the command \fx{\setrmkeys}, and will not report any unknown key as undeclared. The \plform will set the given keys in all the given families, instead of in just one family. The combination \redstar\redplus* will set the listed keys in all the given families and append unknown keys to the container \fx{\XKV@rm}. \ang{na} is the list of keys that shouldn't be set in the current run.
-Actually, it isn't \fx{\setkeys} that is patched directly by the \pkg'{keyreader}, but some of the macros that it calls. Since a package might redefine \fx{\setkeys}, we also saved the patched \fx{\setkeys} in \fx{\krdsetkeys}. Indeed, \fx{\krdsetkeys} isn't exactly \fx{\setkeys}, since the former avoids the selective sanitization of \keyval list that is done by \fx{\setkeys}. Instead \fx{\krdsetkeys} \quoted{normalizes} the \keyval or comma-separated list. Therefore, users of the \pkg'{keyreader} should always call the command \fx{\krdsetkeys} instead of \fx{\setkeys}. Both have the same user interface.
+Since a package might redefine \fx{\setkeys}, we also saved the patched \fx{\setkeys} in \fx{\krdsetkeys}. Indeed, \fx{\krdsetkeys} isn't exactly \fx{\setkeys}, since the former avoids the selective sanitization of \keyval list that is done by \fx{\setkeys}. Instead \fx{\krdsetkeys} \quoted{normalizes} the \keyval or comma-separated list. Therefore, users of the \pkg'{keyreader} should always call the command \fx{\krdsetkeys} instead of \fx{\setkeys}. Both have the same user interface.
-The \pkg'{xkeyval}'s command \fxi{\setrmkeys}, which sets \quoted{remaining keys}, has been modified to \fxi{\krdsetrmkeys}. Users of the \pkg'{keyreader} should use \fx{\krdsetrmkeys} in place of \fx{\setrmkeys}.
+The \pkg'{xkeyval}'s command \fxi{\setrmkeys}, which sets \quoted{remaining keys}, has been modified to \fxi{\krdsetrmkeys}, while keeping \fx{\setrmkeys} unchanged. Users of the \pkg'{keyreader} should use \fx{\krdsetrmkeys} in place of \fx{\setrmkeys}.
\docsection(sec:examples)<examples>{Examples}
@@ -188,6 +188,9 @@ The commands \ffxi'{\krdDeclareOption, \krdExecuteOptions, \krdProcessOptions} a
The following change history highlights significant changes that affect user utilities and interfaces; changes of technical nature are not documented in this section.
\begin{versionhist}
+ \begin{version}{0.4a}{2011/12/23}
+ \item Bug fix: the key list in \fx{\krddefinekeys} shouldn't have been normalized with respect to forward slash (/).
+ \end{version}
\begin{version}{0.4}{2011/12/20}
\item Several of the former functions of the package have been transferred to the \pkg'{ltxkeys} with even more robustness. The package now provides mainly a compact and robust interface to the features of the \pkg'{xkeyval}.
\end{version}
diff --git a/Master/texmf-dist/tex/latex/keyreader/keyreader-guide.cfg b/Master/texmf-dist/tex/latex/keyreader/keyreader-guide.cfg
deleted file mode 100644
index a43780b1f25..00000000000
--- a/Master/texmf-dist/tex/latex/keyreader/keyreader-guide.cfg
+++ /dev/null
@@ -1,38 +0,0 @@
-\ProvidesFile{keyreader-guide.cfg}%
- [2011/12/20 v0.0.3 Configuration file for keyreader-guide (AM)]
-
-\amltxoptions{%
- geometryoptions = {left=3cm,right=3cm,top=2.5cm,%
- bottom=2.5cm,includeheadfoot},
- reviewdocument = false,
- parindent = false,
- toc = false,
- frontpagestyle = empty,
- pretitleskip = 0ex,
- posttitleskip = 1ex,
- presuptitleskip = 15ex,
- postsuptitleskip = 0ex,
- presubtitleskip = 0ex,
- postsubtitleskip = 0ex,
- natbiboptions = {numbers,sort&compress},
- cmdcolor = xmagenta1,
- stylecolor = xgreen1,
- speccolor = teal,
- sectionheadcolor = blue
-}
-\fancypagenos[%
- textalign = center,
- show-on-page-one = false,
- show-page-numbers = true,
- show-headrule = true,
- show-footrule = false,
- y-position = -.44\paperheight,
- x-position = 0,
- scale = 1,
- angle = 0,
- style = \textsc{Page~\thepage~of~\pageref{xwmlastpage}},
- left-header = The \textcolor{macrocolor}{keyreader} package,
- right-header = \ttcl{black}{\today}
-]
-
-\endinput
diff --git a/Master/texmf-dist/tex/latex/keyreader/keyreader.sty b/Master/texmf-dist/tex/latex/keyreader/keyreader.sty
index 3cefcf964ab..a64ec1e7908 100644
--- a/Master/texmf-dist/tex/latex/keyreader/keyreader.sty
+++ b/Master/texmf-dist/tex/latex/keyreader/keyreader.sty
@@ -1,6 +1,6 @@
%++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++%
% %
-% This is file 'keyreader.sty', version 0.4, December 2011. %
+% This is file 'keyreader.sty', version 0.4a, December 2011. %
% %
% This package and accompanying files may be distributed and/or %
% modified under the conditions of the LaTeX Project Public License, %
@@ -21,7 +21,7 @@
%++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++%
\ProvidesPackage{keyreader}
- [2011/12/20 v0.4 Robust xkeyval package interface (AM)]
+ [2011/12/23 v0.4a Robust xkeyval package interface (AM)]
\ifcase
\ifx\eTeXversion\@undefined\z@\else
\ifnum\eTeXversion<\tw@\z@\else\@ne\fi\fi
@@ -197,6 +197,15 @@
}
\endgroup
+% Eg,
+% \newcount\nr\nr=\tw@
+% \def\do#1{%
+% \let\noexpand#1%
+% \expandafter\noexpand\csname\expandafter\@gobble\string#1@%
+% \romannumeral\nr\endcsname
+% }
+% \edef\x{\krdfor{\cmda,\cmdb}}
+% \show\x -> \let\cmda\cmda@ii \let\cmdb\cmdb@ii
\def\krdfor#1{\krd@for@a#1,\krd@nnil,\krd@nil}
\def\krd@for@a#1,#2\krd@nil{%
\krdifblank{#1}{%
@@ -417,17 +426,17 @@
}%
\ifnum\XKV@depth=\z@\let\XKV@rm\@empty\fi
\expandafter\XKV@usepresetkeys\expandafter{\krd@na}{preseth}%
- \krdexpandsecond\XKV@s@tkeys
+ \krdexpandsecond\krd@s@tkeys
{{\krdexpandonce\XKV@resb}{\krdexpandonce\krd@na}}%
\expandafter\XKV@usepresetkeys\expandafter{\krd@na}{presett}%
\let\CurrentOption\@empty
}
-\protected\def\XKV@s@tkeys#1#2{%
+\protected\def\krd@s@tkeys#1#2{%
\edef\key@list{\unexpanded{#1}}%
\krdkvnormalize\key@list
\edef\XKV@na{\unexpanded{#2}}%
\krdifx\XKV@na\@empty{}{\krdcsvnormalize\XKV@na}%
- \def\XKV@s@tkeys@a##1={%
+ \def\krd@s@tkeys@a##1={%
\def\reserved@a####1=####2\@nil{%
\edef\reserved@a{\expandafter\krdtrimspace\expandafter{\@gobble####1}}%
\krdifx\reserved@a\@empty{%
@@ -446,7 +455,7 @@
\reserved@a.%
}%
\XKV@for@o\key@list\CurrentOption{%
- \expandafter\XKV@s@tkeys@a\CurrentOption==\@nil
+ \expandafter\krd@s@tkeys@a\CurrentOption==\@nil
}%
}
\protected\def\krdsetrmkeys{\XKV@testopta{\XKV@testoptc\krd@setrmkeys}}
@@ -559,8 +568,7 @@
\krdifx\key@default\krd@rej{}{%
[\expandafter\krdifbraced\expandafter{\key@default}%
{{{\krdexpandonce\key@default}}}{\krdexpandonce\key@default}]%
- }%
- {%
+ }{%
\ifnum\key@typenr=\thr@@
\krdifx\krd@resb\krd@rej{}{\unexpanded{##5}}%
\krd@executealt{########1}{\krdexpandonce\krd@altlistb}%
@@ -573,7 +581,6 @@
}%
}%
\edef\key@list{\unexpanded{#4}}%
- \krdcsvnormalize[/]\key@list
\krdlistloop*[;]\key@list\ifx\end\@undefined\fi{}{}{%
\krd@splita##1/^?^/^?^/^?^/^?^/\krd@nil
}%