diff options
author | Norbert Preining <preining@logic.at> | 2006-11-03 15:23:50 +0000 |
---|---|---|
committer | Norbert Preining <preining@logic.at> | 2006-11-03 15:23:50 +0000 |
commit | 99a1032a78cd9a51b5864d9b963df30117b09d70 (patch) | |
tree | 56c73b47043a136063cc686f6941684f9dedab46 /Master/texmf-dist/source/latex/oberdiek | |
parent | 85f63670376866bd28df82c4e04302d87217b241 (diff) |
oberdiek update
git-svn-id: svn://tug.org/texlive/trunk@2387 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/oberdiek')
-rw-r--r-- | Master/texmf-dist/source/latex/oberdiek/kvsetkeys.dtx | 115 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/oberdiek/oberdiek.ins | 2 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/oberdiek/oberdiek.tex | 6 |
3 files changed, 106 insertions, 17 deletions
diff --git a/Master/texmf-dist/source/latex/oberdiek/kvsetkeys.dtx b/Master/texmf-dist/source/latex/oberdiek/kvsetkeys.dtx index e3827ac5674..b64a8c8cdae 100644 --- a/Master/texmf-dist/source/latex/oberdiek/kvsetkeys.dtx +++ b/Master/texmf-dist/source/latex/oberdiek/kvsetkeys.dtx @@ -16,7 +16,8 @@ % % This work consists of the main source file kvsetkeys.dtx % and the derived files -% kvsetkeys.sty, kvsetkeys.pdf, kvsetkeys.ins, kvsetkeys.drv. +% kvsetkeys.sty, kvsetkeys.pdf, kvsetkeys.ins, kvsetkeys.drv, +% kvsetkeys-example.tex. % % Distribution: % CTAN:macros/latex/contrib/oberdiek/kvsetkeys.dtx @@ -51,6 +52,7 @@ % Installation: % TDS:tex/generic/oberdiek/kvsetkeys.sty % TDS:doc/latex/oberdiek/kvsetkeys.pdf +% TDS:doc/latex/oberdiek/kvsetkeys-example.tex % TDS:source/latex/oberdiek/kvsetkeys.dtx % %<*ignore> @@ -66,7 +68,7 @@ \input docstrip.tex \Msg{************************************************************************} \Msg{* Installation} -\Msg{* Package: kvsetkeys 2006/03/06 v1.0 Key value parser with default handler support (HO)} +\Msg{* Package: kvsetkeys 2006/10/19 v1.1 Key value parser with default handler support (HO)} \Msg{************************************************************************} \keepsilent @@ -92,7 +94,8 @@ This Current Maintainer of this work is Heiko Oberdiek. This work consists of the main source file kvsetkeys.dtx and the derived files - kvsetkeys.sty, kvsetkeys.pdf, kvsetkeys.ins, kvsetkeys.drv. + kvsetkeys.sty, kvsetkeys.pdf, kvsetkeys.ins, kvsetkeys.drv, + kvsetkeys-example.tex. \endpreamble @@ -101,6 +104,8 @@ and the derived files \file{kvsetkeys.drv}{\from{kvsetkeys.dtx}{driver}}% \usedir{tex/generic/oberdiek}% \file{kvsetkeys.sty}{\from{kvsetkeys.dtx}{package}}% + \usedir{doc/latex/oberdiek}% + \file{kvsetkeys-example.tex}{\from{kvsetkeys.dtx}{example}}% } \obeyspaces @@ -126,7 +131,7 @@ and the derived files %<*driver> \NeedsTeXFormat{LaTeX2e} \ProvidesFile{kvsetkeys.drv}% - [2006/03/06 v1.0 Key value parser with default handler support (HO)] + [2006/10/19 v1.1 Key value parser with default handler support (HO)] \documentclass{ltxdoc} \usepackage{holtxdoc} \begin{document} @@ -135,7 +140,7 @@ and the derived files %</driver> % \fi % -% \CheckSum{580} +% \CheckSum{585} % % \CharacterTable % {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z @@ -156,7 +161,7 @@ and the derived files % \GetFileInfo{kvsetkeys.drv} % % \title{The \xpackage{kvsetkeys} package} -% \date{2006/03/06 v1.0} +% \date{2006/10/19 v1.1} % \author{Heiko Oberdiek\\\xemail{oberdiek@uni-freiburg.de}} % % \maketitle @@ -166,7 +171,7 @@ and the derived files % of package \xpackage{keyval}'s \cs{setkeys}. It allows to specify % a handler that deals with unknown options. Active commas and equal % signs may be used (e.g. see \xpackage{babel}'s shorthands) and -% only one level of curly braces are removed from the values. +% only one level of curly braces is removed from the values. % \end{abstract} % % \tableofcontents @@ -275,10 +280,20 @@ and the derived files % fi % \end{quote} % -% \begin{declcs}{kv@set@family@handler}\,\M{family}\,\M{handler} +% \subsection{Default family handler} +% +% \cs{kv@processor@default} calls \meta{handler}, the default +% handler for the family, if the key does not exist in the family. +% The handler is called with two arguments, the key and the value. +% It can be defined with \cs{kv@set@family@hander}: +% +% \begin{declcs}{kv@set@family@handler}\,\M{family}\,\M{handler definition} % \end{declcs} -% This sets the handler \meta{handler} for the keyval family -% \meta{family}. +% This sets the default family handler for the keyval family +% \meta{family}. Inside \meta{handler definition} |#1| stands for +% the key and |#2| is the value. Also \cs{kv@key} and \cs{kv@value} +% can be used for the key and the value. If the value is not given, +% \cs{kv@value} has the meaning \cs{relax}. % % \subsection{Do it all} % @@ -291,6 +306,70 @@ and the derived files % \texttt{\{}\cs{kv@processor@default}\,\M{family}\texttt{\}} % \end{quote} % +% Thus you can replace \cs{setkeys} of package \xpackage{keyval} +% by the key value parser of this package: +% \begin{quote} +% |\renewcommand*{\setkeys}{\kvsetkeys}|\\ +% or\\ +% |\let\setkeys\kvsetkeys| +% \end{quote} +% +% \section{Example} +% +% The following example prints a short piece of HTML code using +% the tabbing environment for indenting purpose and a key value +% syntax for specifying the attributes of an HTML tag. +% The example illustrates the use of a default family handler. +% \begin{macrocode} +%<*example> +\documentclass{article} +\usepackage[T1]{fontenc} +\usepackage{kvsetkeys} +\usepackage{keyval} + +\makeatletter +\newcommand*{\tag}[2][]{% + % #1: attributes + % #2: tag name + \begingroup + \toks@={}% + \let\@endslash\@empty + \kvsetkeys{tag}{#1}% + \texttt{% + \textless #2\the\toks@\@endslash\textgreater + }% + \endgroup +} +\kv@set@family@handler{tag}{% + % #1: key + % #2: value + \toks@\expandafter{% + \the\toks@ + \space + #1=\string"#2\string"% + }% +} +\define@key{tag}{/}[]{% + \def\@endslash{/}% +} +\makeatother + +\begin{document} +\begin{tabbing} + \mbox{}\qquad\=\qquad\=\kill + \tag{html}\\ + \>\dots\\ + \>\tag[border=1]{table}\\ + \>\>\tag[width=200, span=3, /]{colgroup}\\ + \>\>\dots\\ + \>\tag{/table}\\ + \>\dots\\ + \tag{/html}\\ +\end{tabbing} +\end{document} +%</example> +% \end{macrocode} +% % \StopEventually{ % } % @@ -345,7 +424,7 @@ and the derived files \fi \expandafter\x\csname ver@kvsetkeys.sty\endcsname \ProvidesPackage{kvsetkeys}% - [2006/03/06 v1.0 Key value parser with default handler support (HO)] + [2006/10/19 v1.1 Key value parser with default handler support (HO)] % \end{macrocode} % % \begin{macrocode} @@ -651,8 +730,11 @@ and the derived files % % \begin{macro}{\kv@set@family@handler} % \begin{macrocode} -\def\kv@set@family@handler#1#{% - \expandafter\def\csname KVS@#1@handler\endcsname +\def\kv@set@family@handler#1{% + \KVS@set@family@handler{#1}\@nil +} +\def\KVS@set@family@handler#1\@nil#{% + \expandafter\def\csname KVS@#1@handler\endcsname##1##2% } % \end{macrocode} % \end{macro} @@ -748,6 +830,7 @@ and the derived files % \begin{tabular}{@{}>{\ttfamily}l@{$\quad\rightarrow\quad$}>{\ttfamily}l@{}} % kvsetkeys.sty & tex/generic/oberdiek/kvsetkeys.sty\\ % kvsetkeys.pdf & doc/latex/oberdiek/kvsetkeys.pdf\\ +% kvsetkeys-example.tex & doc/latex/oberdiek/kvsetkeys-example.tex\\ % kvsetkeys.dtx & source/latex/oberdiek/kvsetkeys.dtx\\ % \end{tabular}^^A % }% @@ -830,6 +913,12 @@ and the derived files % \item % First version. % \end{Version} +% \begin{Version}{2006/10/19 v1.1} +% \item +% Fix of \cs{kv@set@family@handler}. +% \item +% Example added. +% \end{Version} % \end{History} % % \PrintIndex diff --git a/Master/texmf-dist/source/latex/oberdiek/oberdiek.ins b/Master/texmf-dist/source/latex/oberdiek/oberdiek.ins index b3d80cc9e68..4a10914c6e3 100644 --- a/Master/texmf-dist/source/latex/oberdiek/oberdiek.ins +++ b/Master/texmf-dist/source/latex/oberdiek/oberdiek.ins @@ -1,5 +1,5 @@ % oberdiek.ins -% 2006/09/29 +% 2006/10/19 % % Copyright (C) 1999, 2001, 2006 by % Heiko Oberdiek <oberdiek@uni-freiburg.de> diff --git a/Master/texmf-dist/source/latex/oberdiek/oberdiek.tex b/Master/texmf-dist/source/latex/oberdiek/oberdiek.tex index e4dae70813d..bfa12e78fd2 100644 --- a/Master/texmf-dist/source/latex/oberdiek/oberdiek.tex +++ b/Master/texmf-dist/source/latex/oberdiek/oberdiek.tex @@ -6,7 +6,7 @@ \newcommand*{\Subject}{CTAN:\CTANdir} \newcommand*{\Author}{Heiko Oberdiek} \newcommand*{\Email}{oberdiek@uni-freiburg.de} -\newcommand*{\Date}{2006/09/29} +\newcommand*{\Date}{2006/10/19} % Copyright (C) 2006 by % Heiko Oberdiek <oberdiek@uni-freiburg.de> @@ -200,7 +200,7 @@ [\entrysep] \entry{kvoptions}{2006/08/22}{2.4}{Connects package keyval with \LaTeX{} options}% [\entrysep] -\entry{kvsetkeys}{2006/03/06}{1.0}{Key value parser with default handler support}% +\entry{kvsetkeys}{2006/10/19}{1.1}{Key value parser with default handler support}% [\entrysep] \entry{makerobust}{2006/03/18}{1.0}{Making a macro robust}% [\entrysep] @@ -487,7 +487,7 @@ Package \xpackage{kvsetkeys} provides \cs{kvsetkeys}, a variant of package \xpackage{keyval}'s \cs{setkeys}. It allows to specify a handler that deals with unknown options. Active commas and equal signs may be used (e.g. see \xpackage{babel}'s shorthands) and -only one level of curly braces are removed from the values. +only one level of curly braces is removed from the values. \end{abstract} \tocinclude{kvsetkeys} |