diff options
author | Karl Berry <karl@freefriends.org> | 2009-09-06 23:20:42 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2009-09-06 23:20:42 +0000 |
commit | bfb16a7c8d3c77987590435854c647b54bc6450b (patch) | |
tree | cf65fafece2986d781a52ad28aaeb06fe48eed69 /Master/texmf-dist/tex/latex/xpackages/xtras | |
parent | 2b8eb47b09b2d853b8243d0fb61b408edb3d04a7 (diff) |
xpackages (5sep09)
git-svn-id: svn://tug.org/texlive/trunk@15164 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/xpackages/xtras')
-rw-r--r-- | Master/texmf-dist/tex/latex/xpackages/xtras/l3keys2e.sty | 117 |
1 files changed, 117 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/xpackages/xtras/l3keys2e.sty b/Master/texmf-dist/tex/latex/xpackages/xtras/l3keys2e.sty new file mode 100644 index 00000000000..67e67fe285a --- /dev/null +++ b/Master/texmf-dist/tex/latex/xpackages/xtras/l3keys2e.sty @@ -0,0 +1,117 @@ +%% +%% This is file `l3keys2e.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% l3keys2e.dtx (with options: `package') +%% ---------------------------------------------------------------- +%% l3keys2e --- Parsing LaTeX3 keyvals as LaTeX2e package options +%% Copyright 2009 The LaTeX3 Project +%% Released under the LaTeX Project Public License v1.3c or later +%% See http://www.latex-project.org/lppl.txt +%% ---------------------------------------------------------------- +%% File: l3keys2e.dtx (C) Copyright 2009 LaTeX3 Project +%% +%% It may be distributed and/or modified under the conditions of the +%% LaTeX Project Public License (LPPL), either version 1.3c of this +%% license or (at your option) any later version. The latest version +%% of this license is in the file +%% +%% http://www.latex-project.org/lppl.txt +%% +%% This file is part of the ``l3keys2e'' (The Work in LPPL) +%% and all files in that bundle must be distributed together. +%% +%% The released version of this bundle is available from CTAN. +%% +%% ----------------------------------------------------------------------- +%% +%% The development version of the bundle can be found at +%% +%% http://www.latex-project.org/svnroot/experimental/trunk/ +%% +%% for those people who are interested. +%% +%%%%%%%%%%% +%% NOTE: %% +%%%%%%%%%%% +%% +%% Snapshots taken from the repository represent work in progress and may +%% not work or may contain conflicting material! We therefore ask +%% people _not_ to put them into distributions, archives, etc. without +%% prior consultation with the LaTeX Project Team. +%% +%% ----------------------------------------------------------------------- +%% +\RequirePackage{l3names} +\GetIdInfo$Id: l3keys2e.dtx 1494 2009-08-24 11:05:44Z joseph $ + {Parsing LaTeX3 keyvals as LaTeX2e package options} +\ProvidesExplPackage + {\filename}{\filedate}{\fileversion}{\filedescription} +\RequirePackage{xparse} +\clist_new:N \keys_latexe_options_clist +\cs_new:Nn \keys_latexe_options:n { + \clist_clear:N \keys_latexe_options_clist + \keys_latexe_options_global:n {#1} + \keys_latexe_options_local: + \keys_if_exist:nnF {#1} { unknown } { + \keys_define:nn {#1} { + unknown .code:n = { + \msg_warning:nnxx { Option~Processing } { unknown-option } + { \l_keys_key_tl } { \@currname } + } + } + } + \keys_set:nV {#1} \keys_latexe_options_clist + \AtEndOfPackage { \cs_set_eq:NN \@unprocessedoptions \scan_stop: } +} +\msg_new:nnn { Option~Processing } { unknown-option } {% + Unknown~option~`#1'\\% + for~module~#2.% +} +\cs_new:Nn \keys_latexe_options_global:n { + \cs_if_eq:NNF \@classoptionslist \scan_stop: { + \cs_if_eq:NNTF \@currext \@clsextension { + \keys_latexe_options_class:n {#1} + }{ + \keys_latexe_options_package:n {#1} + } + } +} +\cs_new:Nn \keys_latexe_options_class:n { + \clist_map_inline:Nn \@classoptionslist { + \keys_if_exist:nnTF {#1} { \keys_latexe_remove_equals:n {##1} } { + \clist_put_right:Nn \keys_latexe_options_clist {##1} + }{ + \clist_put_right:Nn \@unusedoptionlist {##1} + } + } +} +\cs_new:Nn \keys_latexe_options_package:n { + \clist_map_inline:Nn \@classoptionslist { + \keys_if_exist:nnT {#1} { \keys_latexe_remove_equals:n {##1} } { + \clist_put_right:Nn \keys_latexe_options_clist {##1} + \clist_remove_element:Nn \@unusedoptionlist {##1} + } + } +} +\cs_new_nopar:Nn \keys_latexe_options_local: { + \cs_if_eq:NNF \@currext \@clsextension { + \cs_if_exist:cT { opt@ \@currname . \@currext } { + \exp_args:NNc \clist_put_right:NV \keys_latexe_options_clist + { opt@ \@currname . \@currext } + } + } +} +\cs_new:Nn \keys_latexe_remove_equals:n { + \keys_latexe_remove_equals:w #1 = \q_stop +} +\cs_new:Npn \keys_latexe_remove_equals:w #1 = #2 \q_stop {#1} +\NewDocumentCommand \ProcessKeysOptions { m } { + \keys_latexe_options:n {#1} +} +\@onlypreamble \ProcessKeysOptions +\endinput +%% +%% End of file `l3keys2e.sty'. |