Fractions with large elements
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}}
\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}
I'm also having trouble with this and I'm not quite aware why fractions "crunch" limits, integrals, summations and so on in pure math environments. With amsmath
or mathtools
you can write dfrac
instead of frac
, but since dfrac
is used for inline fractions, it won't change anything for you in math environments.
My workaround is using \displaystyle
in the fractions, like Mico mentioned, where I have summations or such elements. Although I would also be glad to have a global option for those things in amsmath
or mathtools
. I've looked around the internet but couldn't find anything useful.
I have written my "own" fraction command for using summations, integrals and so on in equations. The command just writes \displaystyle
at the first position of the numerator and denominator. Instead of ffrac
you can of course name it whatever you want (and isn't used by LaTeX or any other usepackages you use):
\documentclass{scrartcl}
\usepackage{mathtools}
\usepackage{amssymb}
\newcommand{\ffrac}[2]{\ensuremath{\frac{\displaystyle #1}{\displaystyle #2}}}
\begin{document}
\begin{align}
U^{2} &= \frac{\sum_{t=0}^{T}u^{2}\cdot \Delta t}{T}\\
U^{2} &= \ffrac{\sum_{t=0}^{T}u^{2}\cdot \Delta t}{T}
\end{align}
\end{document}