Thanks, Huseyin. My codes in context is reasonable, so I want to know why this is wrong.
Catcodes can¡¯t be changed in footnotes which is necessary to make \ a normal character for the \type command. For TeX command you can use \tex{mycommand} which adds a \ at the begin of the argument.