You can add \displaystyle
to the columns you like in your array
:
% arara: pdflatex
\documentclass[a4paper]{book}
\usepackage{mathtools}
\usepackage{lipsum}
\usepackage{array}
\begin{document}
\lipsum[1]
\begin{equation}
\begin{aligned}
&\left.\begin{array}{r@{\;}>{{}\displaystyle}l}
U =& \sum_{\mathclap{\text{bonds},\,i}} K_{b,i} ( b_i - b_{0,i})^2 \\
&+ \sum_{\mathclap{\text{angles},\, i}} K_{\theta,i} ( \theta_i - \theta_{0,i} )^2 \\
&+ \sum_{\mathclap{\text{dihedrals},\, i}} K_{\phi,i} \bigl( 1 - \cos( n\phi_i - \phi_{0,i} ) \bigr) \\
&+ \mathrlap{\sum_{\mathclap{\substack{\text{improper},\, i\\ \text{dihedrals}}}} K_{\omega,i} ( \omega_i - \omega_{0,i} )^2 }
\hphantom{\sum_{\mathclap{\text{atoms},\,i,j}}\epsilon_{ij}\Biggl[\biggl(\frac{r^{\min}_{ij}}{r_{ij}}\biggr)^{12}-2\biggl(\frac{r^{\min}_{ij}}{r_{ij}}\biggr)^6\Biggr]}
\end{array}\right\}\text{bonded}\\
&\left.\begin{array}{r@{\;}>{{}\displaystyle}l}
\hphantom{U =}
&+\sum_{\mathclap{\text{atoms},\,i,j}}\epsilon_{ij}\Biggl[\biggl(\frac{r^{\min}_{ij}}{r_{ij}}\biggr)^{12}-2\biggl(\frac{r^{\min}_{ij}}{r_{ij}}\biggr)^6\Biggr] \\
&+\sum_{\mathclap{\text{atoms},\, i,j}}(4\pi\epsilon_0\epsilon_r)^{-1}\frac{q_i q_j}{ r_{ij}}
\end{array}\right\}\text{non-bonded}
\end{aligned}
\end{equation}
\lipsum[2-3]
\end{document}
If you were just concerned about the limits of your sum-symbols, you could add the command \limits
to each of them. Safes you some space.
\begin{equation}
\begin{aligned}
&\left.\begin{array}{r@{\;}>{{}}l}
U =&\sum\limits_{\mathclap{\text{bonds},\,i}} K_{b,i} ( b_i - b_{0,i})^2 \\
&+ \sum\limits_{\mathclap{\text{angles},\, i}} K_{\theta,i} ( \theta_i - \theta_{0,i} )^2 \\
&+ \sum\limits_{\mathclap{\text{dihedrals},\, i}} K_{\phi,i}\bigl( 1 - \cos( n\phi_i - \phi_{0,i} ) \bigr) \\
&+ \mathrlap{\sum\limits_{\mathclap{\substack{\text{improper},\, i\\ \text{dihedrals}}}} K_{\omega,i} ( \omega_i - \omega_{0,i} )^2 }
\hphantom{\sum\limits_{\mathclap{\text{atoms},\,i,j}}\epsilon_{ij}\biggl[\Bigl(\frac{r^{\min}_{ij}}{r_{ij}}\Bigr)^{12}-2\Bigl(\frac{r^{\min}_{ij}}{r_{ij}}\Bigr)^6\biggr]}
\end{array}\right\}\text{bonded}\\
&\left.\begin{array}{r@{\;}>{{}}l}
\hphantom{U =}
&+\sum\limits_{\mathclap{\text{atoms},\,i,j}}\epsilon_{ij}\biggl[\Bigl(\frac{r^{\min}_{ij}}{r_{ij}}\Bigr)^{12}-2\Bigl(\frac{r^{\min}_{ij}}{r_{ij}}\Bigr)^6\biggr] \\
&+\sum\limits_{\mathclap{\text{atoms},\, i,j}}(4\pi\epsilon_0\epsilon_r)^{-1}\frac{q_i q_j}{ r_{ij}}
\end{array}\right\}\text{non-bonded}
\end{aligned}
\end{equation}
This would look like
However, personally I would not set such things as an array
, as those are meant for matrices and alike. You could just nest two aligned
which will result in display style as well.
\begin{equation}
\begin{aligned}
&\left.\begin{aligned}
U ={}& \sum_{\mathclap{\text{bonds},\,i}} K_{b,i} ( b_i - b_{0,i})^2 \\
&+ \sum_{\mathclap{\text{angles},\, i}} K_{\theta,i} ( \theta_i - \theta_{0,i} )^2 \\
&+ \sum_{\mathclap{\text{dihedrals},\, i}} K_{\phi,i} \bigl( 1 - \cos( n\phi_i - \phi_{0,i} ) \bigr) \\
&+ \mathrlap{\sum_{\mathclap{\substack{\text{improper},\, i\\ \text{dihedrals}}}} K_{\omega,i} ( \omega_i - \omega_{0,i} )^2 }
\hphantom{\sum_{\mathclap{\text{atoms},\,i,j}}\epsilon_{ij}\Biggl[\biggl(\frac{r^{\min}_{ij}}{r_{ij}}\biggr)^{12}-2\biggl(\frac{r^{\min}_{ij}}{r_{ij}}\biggr)^6\Biggr]}
\end{aligned}\right\}\text{bonded}\\
&\left.\begin{aligned}
\hphantom{U ={}}
&+\sum_{\mathclap{\text{atoms},\,i,j}}\epsilon_{ij}\Biggl[\biggl(\frac{r^{\min}_{ij}}{r_{ij}}\biggr)^{12}-2\biggl(\frac{r^{\min}_{ij}}{r_{ij}}\biggr)^6\Biggr] \\
&+\sum_{\mathclap{\text{atoms},\, i,j}}(4\pi\epsilon_0\epsilon_r)^{-1}\frac{q_i q_j}{ r_{ij}}
\end{aligned}\right\}\text{non-bonded}
\end{aligned}
\end{equation}
You can see that the vertical spacing is much more pleasant (but you could treat that manually for all cases, of course):
Best Answer
Loading
amsmath
naturally switches\frac
to\tfrac
when in "inline math" (or text style) and\dfrac
under "display math" (or display style). This provides a better layout:However, you can update
\frac
to condition based on the style using\mathchoice
:Given that (say)
\frac{x+y}{x-y}
will be set asx+y/x-y
when in text style, and technically have an incorrect mathematical representation, one could venture one step further. That is, measure the numerator and denominator width, and set it inside brackets if necessary: