I'm trying to write a macro that returns different things depending on it if is used in a displayed equation or if it is used in an inline equation. Something like this, I assume:
\newcommand{\foo}{%
\ifdisplaystyle
This equation is displayed!
\else
This equation is inline!
\fi}
I assume there's a way to do this, as $\sum$
and $$\sum$$
look different. How is it done?
\mathchoice
?\mathchoice
works and then use it).