I am trying to stress xparse
and find something I tried which is not documented anywhere. This code snippet is not compiling and I do not get why.
\documentclass{article}
\usepackage{xparse}
\DeclareDocumentCommand\mycom{gm}{%
Optional: \IfNoValueTF{#1}{Empty}{#1}\par
Mandatory: #2}
\begin{document}
\mycom{MAN}
\mycom{OPT}{MAN}
\end{document}
For what I read in the documentation this should produce something like
Optional: Empty
Mandatory: MAN
Optional: OPT
Mandatory: MAN
Did I read the documentation wrongly?