I am making a command called seal
that needs a boolean key=value
option. Since I don't know how to do this, I am using key=yes
and key=no
for defining my pgfkeys
as follows.
\pgfkeys{
/seal/.is family, /seal,
% "seal" options
invert/.estore in = \sealInvert,
other/.estore in = \sealOther,}
An then, I define \seal
roughly as follows:
\newcommand{\seal}[2][]{%
\pgfkeys{/seal,invert=no,other=value,#1}%
%
% IF invert=no
\ifthenelse{\equal{\storeInvert}{no}}{%
Code...}{%
% ELSEIF invert=yes
\ifthenelse{\equal{\storeInvert}{yes}}{%
Code...}{%
% ELSE
\PackageWarning{seal}{Unknown option invert=\storeInvert.}}}%
}
I'd like to know how to redefine this in order to have a code like this:
\newcommand{\seal}[2][]{%
\pgfkeys{/seal,invert=false,other=value,#1}%
%
% IF invert=false
\ifthenelse{\NOT\storeInvert}{%
Code...}{%
% ELSE (invert=true)
Code...}%
}
In case other value is passed (e.g. invert=blah
), I'd like \seal
to return a message like:
Unknown option `invert=blah`: `blah` is not boolean.
This last may not be necessary, though. It would depend on what is printed when a non boolean value is passed into a boolean key.
Thanks in advance for any help.
PS: The packages I am using/requiring are graphicx
, tikz
pgfkeys
, and ifthen
.