I want to pass an argument string to \NewDocumentCommand that allows me to apply different code expressions based on the specified option.
For instance, consider a command named product with an argument called type , where the latter can be either "direct" (in such case printing $#2 \times #3$) or "tensor" (in such printing $#2 \otimes #3$).

type'. Do you just want\NewDocumentCommand {mmm}and then test if#1isdirectortensor? – cfr Oct 17 '23 at 01:31