6 Jun
2006
6 Jun
'06
9:54 a.m.
Aditya Mahajan wrote:
Hi, I am confused why the following definition does not work as expected.
\def\PM{\dosingleempty\doPM} \def\doPM[#1]{\iffirstargument P_{M_{#1}} \else P_{M_t}\fi}
\starttext Why is $\widetilde \PM[T]$ not the same as $\widetilde P_{M_T}$ \stoptext
The argument to \widetilde cannot be a macro that requires arguments, that just won't work. If you want the accent on top of a single character, you have to give it a single argument. It is possbile to do so, like this: \def\PM{P\dosingleempty\doPM} \def\doPM[#1]{\iffirstargument _{M_{#1}}\else _{M_t}\fi} \let\normalwidetilde\widetilde \def\widetilde{\expandafter\normalwidetilde} But it is better to create a new set of macros \widetildePM. Cheers, Taco