I have a command defined with xparse that looks like this:
\NewDocumentCommand{\ME}{sogd<>}{\added[id=ME,remark={#1}]{#2}}
(for the full code see Passing complicated argument patterns to a new command)
Now, I want this to be defined through another command, something like
\newcommand{\definerevision}[1]{
\NewDocumentCommand{\#1}{gg}{\added[id=#1,remark={??#1}]{??#2}}
}
(?? means "what to put here?")
That is \definerevision{INITIAL} expands to define the command \NewDocumentCommand{\INITIAL}{gg}{\added[id=INITIAL,remark={#1}]{#2}} (e.g. in the header)
There are two potential problems, the first is to expand \#1 and the second is that the argument #1 has to be distinguished between the top level command or the nested command (how to distinguish).
Is there a way to define a command through another command using \newcommand or \xparse?
remark=##2, since##1is the starred optional argument. – Jun 01 '15 at 00:38...{gg}{ ... #1 ... #2}. Also I put??to know what to put there. – alfC Jun 01 '15 at 00:41{gg}macro – Jun 01 '15 at 00:46