\DeclareDocumentCommand\test{o}{\IfNoValueOrEmptyTF{#1}{No value or empty!}{-#1-}}
works, but when we try to use a split list the NoValueOrEmpty test fails:
\DeclareDocumentCommand\test{ > { \SplitList { , } }o}{\IfNoValueOrEmptyTF{#1}{No value or empty!}{-#1-}}
It seems an empty splitlist is not the same as empty?
\makeatletter
\newcommand{\IfNoValueOrEmptyTF}[3]
{
\IfNoValueTF{#1}{#2}
{
\def\@tempa{#1}
\ifx\@tempa\@empty#2\else#3\fi
}
}
\makeatother
{}
, so just using\IfNoValueTF #1
(without the braces) should work.\IfNoValueTF{#1}
and\IfNoValueTF #1
seem to work just fine for me. And even using\IfNoValueOrEmptyTF
, so perhaps I did not properly set up the test case. Can you post a complete MWE.\IfNoValueTF #1
with\test{a,b,c}
, it will fail, since\SplitList
causes#1
to be{a}{b}{c}
.NoValue
) arguments are not the same. Trying to test as you are suggests that your input syntax is not well-behaved.