Imagine I have written several fractions of the form $\frac{V+W}{U}$
and decide later that I want them to be displayed as a slashed fraction instead. In the group where I want this to happen, I can always do \renewcommand\frac[2]{#1/#2}
. However, I would like to add parenthesis to the numerator (or the denominator) only if it contains a mathop
. At least, this seems to me a suitable first heuristic for deciding whether the numerator (denominator) is to be parenthesised or not.
Does anyone know how to achieve this?