Is it possible to have a hook in every display math mode, before and after the formula?
For example: if I would like to make every display formula 50% smaller, I would ask the hook on entering the $$ formula to be \scalebox{.5}\bgroup\ensuremath\bgroup and the one on leaving the formula would be \egroup\egroup.
It should work both with $$...$$, \[...\] and with \begin{equation}...\end{equation}.
In other words, writing
\def\beginDisplayMathHook{\scalebox{.5}\bgroup\ensuremath\bgroup}
\def\endDisplayMathHook{\egroup\egroup}
$$ x^2+y^2=1 $$
should be equivalent to
$$\scalebox{.5}{\ensuremath{x^2+y^2=1}}$$
Is this possible?


\DeclareMathSizesrather than use scaling – David Carlisle Oct 12 '16 at 21:57\resizebox{\textwidth}{!}{...}whenever the formula is larger than\textwidth… – yannis Oct 12 '16 at 22:02