summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/oberdiek/kvoptions.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/source/latex/oberdiek/kvoptions.dtx')
-rw-r--r--Master/texmf-dist/source/latex/oberdiek/kvoptions.dtx174
1 files changed, 137 insertions, 37 deletions
diff --git a/Master/texmf-dist/source/latex/oberdiek/kvoptions.dtx b/Master/texmf-dist/source/latex/oberdiek/kvoptions.dtx
index b320732c69f..0b98b24d021 100644
--- a/Master/texmf-dist/source/latex/oberdiek/kvoptions.dtx
+++ b/Master/texmf-dist/source/latex/oberdiek/kvoptions.dtx
@@ -1,11 +1,12 @@
% \iffalse meta-comment
-%
+%
% File: kvoptions.dtx
-% Version: 2010/12/23 v3.10
-%
-% Copyright (C) 2004, 2006, 2007, 2009, 2010 by
+% Version: 2011/06/30 v3.11
+% Info: Key value format for package options
+%
+% Copyright (C) 2004, 2006, 2007, 2009-2011 by
% Heiko Oberdiek <heiko.oberdiek at googlemail.com>
-%
+%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either
% version 1.3c of this license or (at your option) any later
@@ -15,11 +16,11 @@
% http://www.latex-project.org/lppl.txt
% and version 1.3 or later is part of all distributions of
% LaTeX version 2005/12/01 or later.
-%
+%
% This work has the LPPL maintenance status "maintained".
-%
+%
% This Current Maintainer of this work is Heiko Oberdiek.
-%
+%
% This work consists of the main source file kvoptions.dtx
% and the derived files
% kvoptions.sty, kvoptions.pdf, kvoptions.ins, kvoptions.drv,
@@ -27,11 +28,11 @@
% kvoptions-test1.tex, kvoptions-test2.tex,
% kvoptions-test3.tex, kvoptions-test4.tex,
% kvoptions-test4.sty.
-%
+%
% Distribution:
% CTAN:macros/latex/contrib/oberdiek/kvoptions.dtx
% CTAN:macros/latex/contrib/oberdiek/kvoptions.pdf
-%
+%
% Unpacking:
% (a) If kvoptions.ins is present:
% tex kvoptions.ins
@@ -40,7 +41,7 @@
% (c) If you insist on using LaTeX
% latex \let\install=y\input{kvoptions.dtx}
% (quote the arguments according to the demands of your shell)
-%
+%
% Documentation:
% (a) If kvoptions.drv is present:
% latex kvoptions.drv
@@ -50,14 +51,14 @@
% if available. Here you can specify further options, e.g.
% use A4 as paper format:
% \PassOptionsToClass{a4paper}{article}
-%
+%
% Programm calls to get the documentation (example):
% pdflatex kvoptions.dtx
% makeindex -s gind.ist kvoptions.idx
% pdflatex kvoptions.dtx
% makeindex -s gind.ist kvoptions.idx
% pdflatex kvoptions.dtx
-%
+%
% Installation:
% TDS:tex/latex/oberdiek/kvoptions.sty
% TDS:tex/latex/oberdiek/kvoptions-patch.sty
@@ -85,7 +86,7 @@
\input docstrip.tex
\Msg{************************************************************************}
\Msg{* Installation}
-\Msg{* Package: kvoptions 2010/12/23 v3.10 Keyval support for LaTeX options (HO)}
+\Msg{* Package: kvoptions 2011/06/30 v3.11 Key value format for package options (HO)}
\Msg{************************************************************************}
\keepsilent
@@ -97,9 +98,9 @@
This is a generated file.
Project: kvoptions
-Version: 2010/12/23 v3.10
+Version: 2011/06/30 v3.11
-Copyright (C) 2004, 2006, 2007, 2009, 2010 by
+Copyright (C) 2004, 2006, 2007, 2009-2011 by
Heiko Oberdiek <heiko.oberdiek at googlemail.com>
This work may be distributed and/or modified under the
@@ -141,6 +142,10 @@ and the derived files
\file{kvoptions-test3.tex}{\from{kvoptions.dtx}{test3}}%
\file{kvoptions-test4.tex}{\from{kvoptions.dtx}{test4}}%
\file{kvoptions-test4.sty}{\from{kvoptions.dtx}{test4pkg}}%
+ \nopreamble
+ \nopostamble
+ \usedir{source/latex/oberdiek/catalogue}%
+ \file{kvoptions.xml}{\from{kvoptions.dtx}{catalogue}}%
}
\catcode32=13\relax% active space
@@ -167,16 +172,16 @@ and the derived files
%<*driver>
\NeedsTeXFormat{LaTeX2e}
\ProvidesFile{kvoptions.drv}%
- [2010/12/23 v3.10 Keyval support for LaTeX options (HO)]%
+ [2011/06/30 v3.11 Key value format for package options (HO)]%
\documentclass{ltxdoc}
-\usepackage{holtxdoc}[2011/02/04]
+\usepackage{holtxdoc}[2011/11/22]
\begin{document}
\DocInput{kvoptions.dtx}%
\end{document}
%</driver>
% \fi
%
-% \CheckSum{2361}
+% \CheckSum{2398}
%
% \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
@@ -197,7 +202,7 @@ and the derived files
% \GetFileInfo{kvoptions.drv}
%
% \title{The \xpackage{kvoptions} package}
-% \date{2010/12/23 v3.10}
+% \date{2011/06/30 v3.11}
% \author{Heiko Oberdiek\\\xemail{heiko.oberdiek at googlemail.com}}
%
% \maketitle
@@ -485,7 +490,7 @@ and the derived files
% Sometimes contrasting names are used to characterize the
% two states of a boolean switch, for example \xoption{draft}
% vs.\@ \xoption{final}. Both options behave like boolean
-% options but they do not need to different switches, they
+% options but they do not need two different switches, they
% should share one. \cs{DeclareComplementaryOption} allows this.
% The option \meta{key} shares the switch of option \meta{parent}.
% Example:
@@ -763,7 +768,7 @@ and the derived files
% Package identification
% -----------------------
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{example-mycolorsetup}[2010/12/23 Managing my colors]
+\ProvidesPackage{example-mycolorsetup}[2011/06/30 Managing my colors]
\RequirePackage{ifpdf}
\RequirePackage{kvoptions}
@@ -944,7 +949,7 @@ and the derived files
% Some remarks:
% \begin{itemize}
% \item The patch requires \eTeX, its \cs{unexpanded} feature
-% is much to nice. It is possible to work around using token
+% is much too nice. It is possible to work around using token
% registers. But the code becomes longer, slower, more difficult
% to read and maintain. The package without option \xoption{patch}
% works and will work without \eTeX.
@@ -1146,7 +1151,7 @@ and the derived files
\fi
\expandafter\x\csname ver@kvoptions.sty\endcsname
\ProvidesPackage{kvoptions}%
- [2010/12/23 v3.10 Keyval support for LaTeX options (HO)]%
+ [2011/06/30 v3.11 Key value format for package options (HO)]%
% \end{macrocode}
%
% \paragraph{Catcodes}
@@ -1251,7 +1256,7 @@ and the derived files
% \begin{macrocode}
\DeclareOption{patch}{%
\AtEndOfPackage{%
- \RequirePackage{kvoptions-patch}[2010/12/23]%
+ \RequirePackage{kvoptions-patch}[2011/06/30]%
}%
}
% \end{macrocode}
@@ -1858,6 +1863,59 @@ and the derived files
%
% \subsection{Process options}
%
+% \subsubsection{Get global options}
+%
+% Package \xpackage{xkeyval} removes options with equal signs from
+% the global options (\cs{@classoptionslist}). The effect is that
+% other packages and classes will not see these global options anymore.
+% A bug-report was answered that this behaviour is ``by design''.
+% Thus I call it a design bug. Now getting the global options require
+% an algorithm instead of a simple macro call.
+% \begin{macrocode}
+%</package>
+%<*package|patch>
+% \end{macrocode}
+% \begin{macro}{\KVO@IfDefThen}
+% Call |#2| if command |#1| is defined and not \cs{relax}.
+% (Package \xpackage{kvoptions-patch} does not load
+% package \xpackage{ltxcmds}.)
+% \begin{macrocode}
+\def\KVO@IfDefThen#1#2{%
+ \ifx#1\ltx@undefined
+ \else
+ \ifx#1\relax
+ \else
+ #2%
+ \fi
+ \fi
+}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\KVO@GetClassOptionsList}
+% \begin{macrocode}
+\def\KVO@GetClassOptionsList{%
+ \let\KVO@classoptionslist\@classoptionslist
+ \KVO@IfDefThen\@classoptionslist{%
+ \KVO@IfDefThen\XKV@documentclass{%
+ \ifx\XKV@documentclass\ltx@empty
+ \else
+ \KVO@IfDefThen\XKV@classoptionslist{%
+ \ifx\XKV@classoptionslist\ltx@empty
+ \else
+ \let\KVO@classoptionslist\XKV@classoptionslist
+ \fi
+ }%
+ \fi
+ }%
+ }%
+}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+%</package|patch>
+%<*package>
+% \end{macrocode}
+%
% \subsubsection{\cs{ProcessKeyvalOptions}}
%
% \begin{macro}{\ProcessKeyvalOptions}
@@ -1888,9 +1946,10 @@ and the derived files
% \begin{macrocode}
\ifx\@currext\@clsextension
\else
- \ifx\@classoptionslist\relax
+ \KVO@GetClassOptionsList
+ \ifx\KVO@classoptionslist\relax
\else
- \@for\KVO@CurrentOption:=\@classoptionslist\do{%
+ \@for\KVO@CurrentOption:=\KVO@classoptionslist\do{%
\@ifundefined{KV@#1@\expandafter\KVO@getkey
\KVO@CurrentOption=\@nil}{%
}{%
@@ -2226,7 +2285,7 @@ and the derived files
\TMP@EnsureCode{124}{12}% |
\edef\KVO@AtEnd{\KVO@AtEnd\noexpand\endinput}
\ProvidesPackage{kvoptions-patch}%
- [2010/12/23 v3.10 LaTeX patch for keyval options (HO)]%
+ [2011/06/30 v3.11 LaTeX patch for keyval options (HO)]%
% \end{macrocode}
%
% Check for \eTeX.
@@ -2326,7 +2385,8 @@ and the derived files
\ifx\@currext\@clsextension
\toks@{}%
\else
- \toks@\expandafter{\@classoptionslist,}%
+ \KVO@GetClassOptionsList
+ \toks@\expandafter{\KVO@classoptionslist,}%
\fi
\toks\tw@\expandafter{\@curroptions}%
\edef\x{\endgroup
@@ -2347,7 +2407,8 @@ and the derived files
\def\KVO@xprocess@ptions{%
\ifx\@currext\@clsextension
\else
- \@for\CurrentOption:=\@classoptionslist\do{%
+ \KVO@GetClassOptionsList
+ \@for\CurrentOption:=\KVO@classoptionslist\do{%
\ifx\CurrentOption\@empty
\else
\KVO@in@\CurrentOption\@declaredoptions
@@ -2896,7 +2957,7 @@ and the derived files
%<*test3>
\NeedsTeXFormat{LaTeX2e}
\makeatletter
-\RequirePackage{kvoptions}[2010/12/23]
+\RequirePackage{kvoptions}[2011/06/30]
\def\msg#{\immediate\write16}
\define@key{testfamily}{testkey}{%
\msg{[testfamily/testkey/#1]}%
@@ -2936,8 +2997,8 @@ and the derived files
% \begin{macrocode}
%<*test4pkg>
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{kvoptions-test4}[2010/12/23 package for testing]
-\RequirePackage{kvoptions}[2010/12/23]
+\ProvidesPackage{kvoptions-test4}[2011/06/30 package for testing]
+\RequirePackage{kvoptions}[2011/06/30]
\SetupKeyvalOptions{%
family=FOO,%
prefix=foo,%
@@ -2956,10 +3017,10 @@ and the derived files
% \begin{macrocode}
%<*test4>
\NeedsTeXFormat{LaTeX2e}
-\ProvidesFile{kvoptions-test4.tex}[2010/12/23 test file]
+\ProvidesFile{kvoptions-test4.tex}[2011/06/30 test file]
\RequirePackage[%
str=A,set=B,str=C,%
-]{kvoptions-test4}[2010/12/23]
+]{kvoptions-test4}[2011/06/30]
\def\TestExpected{C}
\ifx\foostr\TestExpected
\typeout{* Test ok.}%
@@ -3160,12 +3221,46 @@ and the derived files
%\end{verbatim}
% \end{quote}
%
+% \section{Catalogue}
+%
+% The following XML file can be used as source for the
+% \href{http://mirror.ctan.org/help/Catalogue/catalogue.html}{\TeX\ Catalogue}.
+% The elements \texttt{caption} and \texttt{description} are imported
+% from the original XML file from the Catalogue.
+% The name of the XML file in the Catalogue is \xfile{kvoptions.xml}.
+% \begin{macrocode}
+%<*catalogue>
+<?xml version='1.0' encoding='us-ascii'?>
+<!DOCTYPE entry SYSTEM 'catalogue.dtd'>
+<entry datestamp='$Date$' modifier='$Author$' id='kvoptions'>
+ <name>kvoptions</name>
+ <caption>Key value format for package options.</caption>
+ <authorref id='auth:oberdiek'/>
+ <copyright owner='Heiko Oberdiek' year='2004,2006,2007,2009-2011'/>
+ <license type='lppl1.3'/>
+ <version number='3.11'/>
+ <description>
+ This package offers support for package authors who want to
+ use options in key-value format for their package options.
+ <p/>
+ The package is part of the <xref refid='oberdiek'>oberdiek</xref> bundle.
+ </description>
+ <documentation details='Package documentation'
+ href='ctan:/macros/latex/contrib/oberdiek/kvoptions.pdf'/>
+ <ctan file='true' path='/macros/latex/contrib/oberdiek/kvoptions.dtx'/>
+ <miktex location='oberdiek'/>
+ <texlive location='oberdiek'/>
+ <install path='/macros/latex/contrib/oberdiek/oberdiek.tds.zip'/>
+</entry>
+%</catalogue>
+% \end{macrocode}
+%
% \newcommand*{\bibpackage}[4]{^^A
% \bibitem{#1}
% Package \xpackage{#1}, #2, #3.^^A
% \ifx\\#4\\\else\space#4\fi\par
% }
-%
+%
% \begin{thebibliography}{99}
% \bibitem{tb94wright}
% A guide to key-value methods, Joseph Wright, second draft for
@@ -3191,7 +3286,7 @@ and the derived files
% The \LaTeX3 Project, \textit{\LaTeXe\ for class and package writers},
% 2003/12/09.
% \CTAN{macros/latex/doc/clsguide.pdf}
-%
+%
% \end{thebibliography}
%
% \begin{History}
@@ -3324,6 +3419,11 @@ and the derived files
% \hologo{TeX} argument to improve compatibility with
% \cs{DeclareOption}.
% \end{Version}
+% \begin{Version}{2011/06/30 v3.11}
+% \item
+% Fix because of design bug in package \xpackage{xkeyval} that
+% removes global options with equal signs.
+% \end{Version}
% \end{History}
%
% \PrintIndex