Following an earlier question I switched to xparse
. Now I am sitting in a compatibility trap and try to allow old and new stuff at the same time. The point of origin is the infamous macro with two optional arguments. My minimal example is:
\documentclass{minimal}
\usepackage{xparse}
\NewDocumentCommand \sidenotetext { o o m } {%
(#1), (#2), #3
}%
\begin{document}
\sidenotetext{arg} % case (1)
\sidenotetext[1]{arg} % \sidenotetext[mark=1]{arg}; case 2
\sidenotetext[][]{arg} % case 3
\sidenotetext[][2]{arg} %\sidenotetext[offset=2]{arg}; case 4
\sidenotetext[3][]{arg} %\sidenotetext[mark=3]{arg}; case 5
\sidenotetext[4][5]{arg} %\sidenotetext[mark=4,offset=5]{arg}; case 6
\end{document}
Is it possible to make the left and the right macros (commented out) work at the same time? If not, Is it possible at all to make case 2 work, i.e. no key always means mark and the rest is key value? I assume, l3keys is the right choice to play nice with xparse?