I have the following code in my document:
$$ \frac{\displaystyle \sum_i \min(A_i,B_i)}
{\displaystyle \sum_i \max(A_i,B_i)} $$
resulting in:
I prefer "display style" here, but the size of the contents in the numerator and denominator are a bit too large for my liking in the context where they appear, so I decided to scale down.
$$ \frac{\scalebox{0.75}{\text{$\displaystyle \sum_i \min(A_i,B_i)$}}}
{\scalebox{0.75}{\text{$\displaystyle \sum_i \max(A_i,B_i)$}}} $$
but for some reason, this causes an unwanted shift:
so I'm forced to go back to standard "text style" mode in the meantime…
I can't spot why this might be happening based on the code above; I've also tried resizebox
but it has the same issue … has anyone got any idea why it's happening or how I could fix it?
(EDIT: I solved my particular problem by scaling down the fraction as a whole rather than its constituent parts; but the question remains. Is this a latex bug? Thanks.)
Best Answer
In my opinion you don't really want
\displaystyle
, but neither you want\scalebox
.The size of
\min
and the other letters is right, it's just the summation symbol that grow too large:If you really want to go the
\scalebox
way, enclose them in\mbox
:The issue is apparently due to how TeX typesets fractions, putting aside the numerator until it decides the size; the assignments performed by
\scalebox
get wrong without this further level of boxing.Or, maybe better, use
\mfrac
from thenccmath
package: