This question has two parts. First, is there a way to define a macro only for math mode?
Second, how do I specifically get the following definition to work correctly?
\def\fi{f^{-1}}
One additional point is that I'm trying to create this definition within a local scope rather than global scope, but I'm not sure that's relevant.
\fi, even in a local context, is likely to be a bad idea as it's a TeX primitive used in conditionals. – Joseph Wright♦ Jan 17 at 20:04\fisince it declares the end of anifstatement. – azetina Jan 17 at 20:04\newcommandwould be preferred over\def... this applies to all the answers below! – Ari Brodsky Jan 18 at 8:53