I have the following problem. I have defined a macro, \func
as follows
\newcommand{\func}[1]{% do something with #1
X #1 Y
}
I now want to define another macro
\newcommand{\MyFunc}[1]{
% parse #1 and if it contains "\func{....}", ignore all except this part
% otherwise ignore #1
}
Can someone tell me how to implement \MyFunc
?
Here is what should happen:
\MyFunc{123abcdefg} % should print nothing
\MyFunc{123\func{abcd}efg} % should print X abcd Y
I can only change the code of \MyFunc
. \func
should remain as it is.