what should be preferred: $x_1,\, x_2,\ldots,\, x_n$
or $x_1$, $x_2$, ..., $x_n$
I'm hesitating for the \ldots
versus ...
[Tex/LaTex] inline math with \ldots
inline()math-mode
Related Solutions
Try to imagine, how the text would look like, if TeX had decided to put the inline math in the next line … the interword spacing in the first line would be too high. Since TeX is a perfectionist, it rather ignores the right margin, than allows this to happen and also notifies the user by inserting a warning overfull hbox
in the log.
You now have a few possibilities to solve this:
- Rewrite the text. In this case you probably want it to be longer in front of the formula. This is the best solution in my opinion, because you don't have to compromise typographically.
- Add
\\
in front of the formula. This breaks justification of course. - Allow TeX to be more sloppy maybe by using
\begin{sloppypar}…
. Our TeX-Gurus might help you here… I'm not really familiar with the internals of TeX and how to adjust them, sorry ;-)
Apart from those general solutions, how about changing the the formula? An index that long does not look good … especially in conjunction with other formulas. $R_{\mathrm{uni}}$
for example fits really well … typographically at least.
(By using find&replace it's also quite easy to change this throughout the whole document)
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
is OK.
This is how Knuth use in TeXbook.
For me, I would replace the tildes with spaces.
I don't think one should use
...
instead of\dots
or\ldots
.