[Tex/LaTex] Fractions with large elements

best practicesmath-mode

What is best practice for typesetting fractions with large objects in the numerator and denominator?

For example, fractions with limits, integrals, summations, etc… cause the expressions to look contracted and somewhat odd.

I understand that it is probably best to leave this as is when writing mathematics inline, but as a stand-alone fraction I feel it would be much less distracting if the symbols were typeset at normal size and the fraction was given more height in which to place itself.

Are there standards (for pure mathematics) regarding this problem? And what are the options – if it's generally permitted – for expanding the fraction size to incorporate large objects?


Example

\frac{\sum_{i=0}^{n} i^2}{\iint_{D}\frac{\partial (x,y)}{\partial (u,v)}\,\mathrm{d}u\,\mathrm{d}v}

Both the summation and the integral look somewhat cramped.

Best Answer

When TeX is in display-style math mode and the amsmath package is loaded, \frac and \dfrac are equivalent, and the material in the numerator and denominator portions of \frac will be typeset in "text-style math" mode by default. This entails, among other things, that summation and integral symbols will be typeset in text style, as will any fractional expressions. The resulting tight, or "cramped", look is probably what you're looking to avoid.

To override the default setting, i.e., to force TeX to render the material in both the numerator and denominator terms in display-style math mode, one needs to insert an explicit \displaystyle instruction at the start of both the numerator and denominator material. For more on this subject, see the posting Show inline math as if it were display math.

If you have a lot of these expressions, it's worthwhile to create a macro called, say, \ddfrac (short for "double displaystyle frac", I suppose):

\newcommand\ddfrac[2]{\frac{\displaystyle #1}{\displaystyle #2}}

enter image description here

\documentclass[12pt]{article}
\usepackage{amsmath}
\newcommand\ddfrac[2]{\frac{\displaystyle #1}{\displaystyle #2}}
\begin{document}
\begin{align*}
\frac{\sum_{i=1}^\infty \frac{1}{i^2}}{ \int_{-\infty}^\infty 
   \frac{1}{\sqrt{2\pi\sigma^2}} \exp\bigl(-\frac{(x-\mu)^2}{2\sigma^2}\bigr)
   \,\mathrm{d}x} &= \frac{\pi^2}{6}
\qquad\text{too cramped?}\\[2ex]
\ddfrac{\sum_{i=1}^\infty \frac{1}{i^2}}{\int_{-\infty}^\infty 
   \frac{1}{\sqrt{2\pi\sigma^2}} \exp\biggl(-\frac{(x-\mu)^2}{2\sigma^2}\biggr)
   \,\mathrm{d}x} &= \frac{\pi^2}{6}
\qquad\text{about right?}
\end{align*}
\end{document}