Consider the following short .sty
package:
%% This is file `mypackage.sty'
\NeedsTeXFormat{LaTeX2e}[1997/06/01]
\ProvidesPackage{mypackage}
\DeclareOption{myoptionone}{Do something}
\DeclareOption{myoptiontwo}{Do some other things}
\DeclareOption{myoptionthree}{Do something awesome}
\ExecuteOptions{myoptionone,myoptiontwo}
\ProcessOptions\relax
\endinput
When loaded using \usepackage{mypackage}
, the options myoptionone
and myoptiontwo
are executed as default.
Now, I want to add a key value option foo=<value>
to mypackage.sty
using the kvoptions
package, with the following default settings: foo=bar
and maintaining the original myoptionone
and myoptiontwo
.
So far, I got
%% This is file `mypackage.sty'
\NeedsTeXFormat{LaTeX2e}[1997/06/01]
\ProvidesPackage{mypackage}
\RequirePackage{kvoptions}
\SetupKeyvalOptions{
family=hmm,
prefix=hmm@
}
\DeclareVoidOption{myoptionone}{Do something}
\DeclareVoidOption{myoptiontwo}{Do some other things}
\DeclareVoidOption{myoptionthree}{Do something awesome}
\DeclareStringOption[bar]{foo}[bar]
%\ExecuteOptions{myoptionone,myoptiontwo}% This doesn't work.
\ProcessKeyvalOptions*
\endinput
What’s the equivalence of \ExecuteOptions
when kvoptions
is used? I don’t think I understand this discussion on Google Groups.