diff options
author | Karl Berry <karl@freefriends.org> | 2016-04-07 20:49:10 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2016-04-07 20:49:10 +0000 |
commit | ddfe3a4eaf95167482e923d4da3de2917a7dbfbb (patch) | |
tree | 0acc1bb60b37392451f5e79e00c33c487c19abcf /Master/texmf-dist/tex/latex/stex/metakeys | |
parent | a04ae5a947a6b06bc717719f6ad63e6de5cb5af6 (diff) |
stex (7apr16)
git-svn-id: svn://tug.org/texlive/trunk@40320 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/stex/metakeys')
-rw-r--r-- | Master/texmf-dist/tex/latex/stex/metakeys/metakeys.sty | 143 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/stex/metakeys/metakeys.sty.ltxml | 3 |
2 files changed, 96 insertions, 50 deletions
diff --git a/Master/texmf-dist/tex/latex/stex/metakeys/metakeys.sty b/Master/texmf-dist/tex/latex/stex/metakeys/metakeys.sty index b499384e139..6e5f99abb5c 100644 --- a/Master/texmf-dist/tex/latex/stex/metakeys/metakeys.sty +++ b/Master/texmf-dist/tex/latex/stex/metakeys/metakeys.sty @@ -7,57 +7,106 @@ %% metakeys.dtx (with options: `package') %% \NeedsTeXFormat{LaTeX2e}[1999/12/01] -\ProvidesPackage{metakeys}[2012/01/28 v0.9 Framework for Metadata Keys] +\ProvidesPackage{metakeys}[2016/04/06 v0.9 Framework for Metadata Keys] \newif\ifmetakeys@showmeta\metakeys@showmetafalse \DeclareOption{showmeta}{\metakeys@showmetatrue} +\DeclareOption*{} \ProcessOptions \RequirePackage{keyval}[1997/11/10] -\newcommand\addmetakey{\@ifstar\addmetakey@star\addmetakey@nostar} -\newcommand\addmetakey@star[3][]% -{\@ifnextchar[{\addmetakey@star@aux[#1]{#2}{#3}}{\addmetakey@star@aux[#1]{#2}{#3}[]}} -\def\addmetakey@star@aux[#1]#2#3[#4]{\metakeys@ext@clear@keys{#2}{#3}{#1}% -\metakeys@initialize@showkeys{#2}% -\define@key{#2}{#3}[#4]{\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\gdef\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\addmetalistkey{\@ifstar\addmetalistkey@star\addmetalistkey@nostar} -\newcommand\addmetalistkey@star[3][]{\metakeys@ext@clear@keys{#2}{#3}{#1}% -\metakeys@initialize@showkeys{#2}% -\expandafter\gdef\csname #2@#3s\endcsname{} -\define@key{#2}{#3}[#1]{% -\expandafter\ifx\csname #2@#3s\endcsname\@empty\expandafter\gdef\csname #2@#3s\endcsname{##1}% -\else\expandafter\xdef\csname #2@#3s\endcsname{\csname #2@#3s\endcsname,##1}% -\fi}} -\newcommand\addmetalistkey@nostar[3][]% -{\metakeys@ext@showkeys{#2}{#3}\addmetalistkey@star[#1]{#2}{#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} +\RequirePackage{etoolbox} +\newcommand\addmetakey{\@ifstar\addmetakey@star\addmetakey@nostar}% +\newcommand\addmetakey@star[3][]{% + \@ifnextchar[{% + \addmetakey@star@aux[#1]{#2}{#3}% + }{% + \addmetakey@star@aux[#1]{#2}{#3}[]% + }% +}% +\def\addmetakey@star@aux[#1]#2#3[#4]{% + \metakeys@ext@clear@keys{#2}{#3}{#1}% + \metakeys@initialize@showkeys{#2}% + \define@key{#2}{#3}[#4]{% + \csxdef{#2@#3}{##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% +}% +\newrobustcmd\metakeys@ext@clear@keys[3]{% + \@metakeys@ext@clear@keys{#1}{#1@#2}{#3}% +}% +\newrobustcmd\@metakeys@ext@clear@keys[3]{% + \@ifundefined{clear@#1@keys}{% +\csgdef{clear@#1@keys}{\csgdef{#2}{#3}}% + }% + {\expandafter\gappto\csname clear@#1@keys\endcsname{\csgdef{#2}{#3}}}% +}% +\newrobustcmd\addmetalistkey{% + \@ifstar\addmetalistkey@star\addmetalistkey@nostar% +}% +\newrobustcmd\addmetalistkey@star[3][]{% + \metakeys@ext@clear@keys{#2}{#3}{#1}% + \metakeys@initialize@showkeys{#2}% + \csgdef{#2@#3s}{}% + \define@key{#2}{#3}[#1]{% + \ifcsempty{#2@#3s}{% + \csgdef{#2@#3s}{##1}% + }{% + \csxdef{#2@#3s}{\csuse{#2@#3s},##1}% + }% + }% +}% +\newrobustcmd\addmetalistkey@nostar[3][]{% + \metakeys@ext@showkeys{#2}{#3}% + \addmetalistkey@star[#1]{#2}{#3}% +}% +\newrobustcmd\metakeys@initialize@showkeys[1]{% + \@ifundefined{#1@showkeys}{% + \csdef{#1@showkeys}{}% + }{}% +}% +\newrobustcmd\metakeys@ext@showkeys[2]{% + \@ifundefined{#1@showkeys}{% + \csdef{#1@showkeys}{#2}% + }{% + \csedef{#1@showkeys}{\csuse{#1@showkeys},#2}% + }% +}% +\newrobustcmd\@metakeys@show@key[2]{\metakeys@show@key{#2}{#1}}% +\newrobustcmd\metakeys@show@key[2]{% + \edef\@test{#2}% + \ifx\@test\@empty\else #1:#2\quad\fi% +}% +\newrobustcmd\metakeys@show@keys[2]{\marginpar{{\scriptsize #2}}}% +\newrobustcmd\metakeys@show@keyval[2]{% + \expandafter\@metakeys@show@key\csname #1@#2\endcsname{#2}% +}% +\newrobustcmd\showmetakeys{\metakeys@showmetatrue}% +\newrobustcmd\hidemetakeys{\metakeys@showmetafalse}% +\newrobustcmd\addmetakeynew[3][]{% + \metakeys@ext@clear@keys{#2}{#3}{#1}% + \define@key{#2}{#3}{% + \csgdef{#2@#3}{##1}% + }% +}% +\newrobustcmd\metakeys@unspecified{an metakeys-defined key left unspecified}% +\newrobustcmd\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'. diff --git a/Master/texmf-dist/tex/latex/stex/metakeys/metakeys.sty.ltxml b/Master/texmf-dist/tex/latex/stex/metakeys/metakeys.sty.ltxml deleted file mode 100644 index b07f809f8e9..00000000000 --- a/Master/texmf-dist/tex/latex/stex/metakeys/metakeys.sty.ltxml +++ /dev/null @@ -1,3 +0,0 @@ -DefConstructor('\showmetakeys',''); -DefConstructor('\hidemetakeys',''); -1; |