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.

Rendered Picture

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):

enter image description here

\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):

enter image description here

\documentclass{article}

\begin{document}

\[
  \left(\frac{a}{b}\right)
  \quad
  \left(\frac{b}{a}\right)
  \quad
  \left(\frac{\vphantom{a}\smash{b}}{a}\right)
\]

\end{document}

I doubt that's what you want, but still.

Related Question