I don't really have much insight on how \displaystyle actually works, i just see the difference between in-line equation like $\frac{1}{2}$ which displays a small fraction and $\displaystyle \frac{1}{2}$ which produce a bigger fraction.
My question: is it possibile to build a single macros such that (on input a,b), in line equations produces $a/b$ and in display-style equation produces $\frac{a}{b}$?
\mathchoicemacro, see https://tex.stackexchange.com/q/148740/15925 – Andrew Swann Jan 07 '19 at 14:32\mathchoice{\frac{a}{b}}{a/b}{a/b}{a/b}. The second and third repetition ofa/bis for script and scriptscript style, should you need that. – Martin Scharrer Jan 07 '19 at 14:36