I have defined a command using xparse
as
\DeclareDocumentCommand\mymacro{o o o}
and I want to call it with various numbers of arguments (up to 3)
\mymacro, \mymacro[test][two], \mymacro[][][test]
etc...
The issue is that []
doesn't seem to return a \NoValue
but an empty token as the tests I use \IfNoValueTF
never return false on it.
Is there a way to make an "empty" argument like \mymacro[]
set #1
to \NoValue
when it is an empty string?
Essentially I need "empty" arguments to be set to \NoValue
for my code to work.
I could always do
\mymacro[\NoValue][test][\NoValue]
but of course that defeats the purpose of making it simple.
In my code I use \IfNoValueTF{#n}
a lot but for it to work on empty arguments I would need something like \IfNoValueOrEmptyTF
.