%%
%% This is file `metakeys.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% metakeys.dtx  (with options: `package')
%% 
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
\ProvidesPackage{metakeys}[2010/09/02 v0.9 Framework for Metadata Keys]
\newif\ifmetakeys@showmeta\metakeys@showmetafalse
\DeclareOption{showmeta}{\metakeys@showmetatrue}
\ProcessOptions
\RequirePackage{keyval}[1997/11/10]
\newcommand\addmetakey{\@ifstar\addmetakey@star\addmetakey@nostar}
\newcommand\addmetakey@star[3][]{\metakeys@ext@clear@keys{#2}{#3}{#1}%
\metakeys@initialize@showkeys{#2}%
\define@key{#2}{#3}[#1]{\expandafter\gdef\csname #2@#3\endcsname{##1}}}
\newcommand\addmetakey@nostar[3][]{\metakeys@ext@showkeys{#2}{#3}\addmetakey@star[#1]{#2}{#3}}
\newcommand\metasetkeys[2]{\@nameuse{clear@#1@keys}\setkeys{#1}{#2}%
\ifmetakeys@showmeta%
\edef\@@keys{\@nameuse{#1@showkeys}}%
\metakeys@show@keys{#1}{\@for\@I:=\@@keys\do{\metakeys@show@keyval{#1}{\@I}}}%
\fi}
\newcommand\metakeys@ext@clear@keys[3]{\@metakeys@ext@clear@keys{#1}{#1@#2}{#3}}
\newcommand\@metakeys@ext@clear@keys[3]{\@ifundefined{clear@#1@keys}%
{\expandafter\def\csname clear@#1@keys\endcsname%
{\expandafter\gdef\csname #2\endcsname{#3}}}%
{\expandafter\g@addto@macro\csname clear@#1@keys\endcsname%
{\expandafter\gdef\csname #2\endcsname{#3}}}}
\newcommand\metakeys@initialize@showkeys[1]%
{\@ifundefined{#1@showkeys}{\expandafter\def\csname #1@showkeys\endcsname{}}{}}%
\newcommand\metakeys@ext@showkeys[2]{\@ifundefined{#1@showkeys}%
{\expandafter\def\csname #1@showkeys\endcsname{#2}}%
{\expandafter\edef\csname #1@showkeys\endcsname{\csname #1@showkeys\endcsname,#2}}}
\newcommand\@metakeys@show@key[2]{\metakeys@show@key{#2}{#1}}
\newcommand\metakeys@show@key[2]{\edef\@test{#2}\ifx\@test\@empty\else #1:#2\quad\fi}
\newcommand\metakeys@show@keys[2]{\marginpar{{\scriptsize #2}}}
\newcommand\metakeys@show@keyval[2]{\expandafter\@metakeys@show@key\csname #1@#2\endcsname{#2}}
\newcommand\showmetakeys{\metakeys@showmetatrue}
\newcommand\hidemetakeys{\metakeys@showmetafalse}
\newcommand\addmetakeynew[3][]{\metakeys@ext@clear@keys{#2}{#3}{#1}%
\define@key{#2}{#3}{\expandafter\gdef\csname #2@#3\endcsname{##1}}}
\newcommand\metakeys@unspecified{an metakeys-defined key left unspecified}
\newcommand\metakeysifus[4]{\message{testing #1@#2=\csname#1@#2\endcsname}%
\expandafter\ifx\csname #1@#2\endcsname\metakeys@unspecified{#3}\else{#4}\fi}
\endinput
%%
%% End of file `metakeys.sty'.
