First, bear in mind that what we are talking about is LaTeX3 syntax on top of LaTeX2e. That means that LaTeX2e conventions apply to some extent. In particular, LaTeX2e expands options and removes spaces. So you have to be a little wary in what you set up as load-time package options.
Now, as LaTeX2e is still actually doing the processing, the main macros remain: \DeclareOption
and \ProcessOptions
. However, if you want to create key-value options you are best off loading the support package l3keys2e
. This enables you you process LaTeX2e package or class options using the key-value system provided by expl3
. What you then need to do is a two-step process:
- Declare keys for your package using
\keys_define:nn
- Process the package options using
\ProcessKeysOptions
You might therefore have something like
\RequirePackage{l3keys2e}
\ProvidesExplPackage{mypkg}{2011/04/14}{0.0}{A demo}
\keys_define:nn { mypkg }
{
option-1 .code:n = some-code-here ,
option-2 .code:n = some-other-code-here
}
\ProcessKeysOptions { mypkg }
...
Any key which is declared before \ProcessKeysOptions
is treated as a potential package option (this is true for other key-value approaches to package options).
\DeclareOption
and\ProcessOptions
are not allowed inexpl3
-style packages?\@ptionlist{\@currname.\@currext}
. Is there some public macro available which I don't know yet?