The xparse
documentation says,
But that's not what I get when I test s
.
\documentclass{article}
\usepackage{xparse}
\NewDocumentCommand{\myfunc}{s}{#1}
\begin{document}
\myfunc % should return \BooleanFalse; actually returns \Gamma
\myfunc* % should return \BooleanTrue; actually returns \Delta
\end{document}
Edit: Also, \IfValueTF
doesn't return 0 when *
is absent.
\documentclass{article}
\usepackage{xparse}
\NewDocumentCommand{\myfuncB}{s}{
\IfValueTF{#1}{1}{0}
}
\begin{document}
\myfuncB % should return 0; actually returns 1
\myfuncB* % should return 1; actually returns 1
\end{document}
\BooleanTrue
and\BooleanFalse
cannot be typeset: they are boolean variables and don't make sense outside of a\IfBooleanTF{#1}
test. Try\IfBooleanTF{#1}{True}{False}
\char"00
and Delta is\char"01
?expl3
booleans are\char"0
and\char"1
, and that's why OP gets that output. Regardless it doesn't make much sense to use them for typesetting\IfBooleanTF
, not\IfValueTF
. The latter tests for the special marker-NoValue-