The following code produces a negative phantom (from the comment in this answer):
However, when used inside an equation like
I get an error. The solution is to do
Is it possible to define
negphantom in such a way that it respects being inside an equation or not? (the latter solution is not perfect, since the
\inf is not in displaystyle).