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##1
is the starred optional argument. – user31729 Jun 1 '15 at 0:38...{gg}{ ... #1 ... #2}
. Also I put??
to know what to put there. – alfC Jun 1 '15 at 0:41{gg}
macro – user31729 Jun 1 '15 at 0:46