Why do \left( \frac{a}{b} \right) and \left( \frac{b}{a} \right) have different sizes
bracketsfractions
Interestingly enough, I found that \left( \frac{a}{b} \right) and \left( \frac{b}{a} \right) have different sizes in Display Mode.
What caused them to have a different size?
Best Answer
To see why this is the case, consider looking at the bounding box associated with the resulting \frac (or the numerator/denominator):
\documentclass{article}
\begin{document}
\setlength{\fboxsep}{-\fboxrule}% Just for this example
\[
% Bounding boxes of numerator/denominator
\left(\frac{\fbox{$a$}}{\fbox{$b$}}\right)
\quad
\left(\frac{\fbox{$b$}}{\fbox{$a$}}\right)
\quad
% Bounding box of complete fraction
\left(\fbox{$\displaystyle\frac{a}{b}$}\right)
\quad
\left(\fbox{$\displaystyle\frac{b}{a}$}\right)
\]
\end{document}
The ascender of b pushes higher than a (without an ascender) and, since the delimiters extend equidistant around the vertical math axis (denoted by the horizontal rule of the fraction), it's extended more to accommodate for the "larger" numerator.
If you wanted the delimiters to extend the same height you'd have to remove the additional height added by b's ascender. This can be achieved via \smash, supplemented with an appropriate \vphantom (of a or some other character without an ascender):
I assume your document is in inline math mode when the fraction occurs.
While in inline math mode, the numerator and denominator of \frac are set in \scriptstyle by default. Script-size letters and symbols are about 30% (linearly) smaller than in text size.
To force TeX to typeset the numerator and denominator terms in \textstyle, either prefix the \displaystyle directive to \frac or -- if the amsmath package is loaded -- write \dfrac.
If you want to typeset the numerator and denominator terms in \displaystyle (which may be necessary if you have "large" math symbols such as \sum and \prod), it's best to set up a dedicated macro called, say, \ddfrac to perform the job.
Best Answer
To see why this is the case, consider looking at the bounding box associated with the resulting
\frac
(or the numerator/denominator):The ascender of
b
pushes higher thana
(without an ascender) and, since the delimiters extend equidistant around the vertical math axis (denoted by the horizontal rule of the fraction), it's extended more to accommodate for the "larger" numerator.If you wanted the delimiters to extend the same height you'd have to remove the additional height added by
b
's ascender. This can be achieved via\smash
, supplemented with an appropriate\vphantom
(ofa
or some other character without an ascender):I doubt that's what you want, but still.