3

I am trying to align multiple equations left in a two column environment. The equal signs are aligned properly, but are more centered in the column, rahter than aligned on the left side of the column. Could one help me out with proper alignment? Please excuse me for the messy third line equation, but since I am using a two column environment I had to break this equation line as well.

\documentclass[twoside,twocolumn,9pt]{article}
\usepackage{IEEEtrantools}


\begin{document}

    \begin{IEEEeqnarray}{ll}
    P  &= \sum_{i,j; i<j} \left\{ 4\varepsilon_{ij} \left[ \left( \frac{\epsilon_{ij}}{r_{ij}} \right)^{12} - \left(\frac{\epsilon_{ij}}{r_{ij}} \right)^{6} \right] + \frac{q_{i}q_{j}e^{2}}{r_{ij}} \right\} \nonumber\\
       &+ \sum_{i} k_{b,i} (r_{i} - r_{0,i})^{2} + \sum_{i} k_{\theta,i} (\theta_{i} - \theta_{0,i})^{2}  \nonumber\\
       &+ \sum_{i} \frac{1}{2} \left[ k_{\varsigma_{1},i}(1+cos \varsigma) + k_{\varphi_{2},i}(1+cos \varsigma) + \ldots \right. \nonumber\\
    \left. \quad k_{\varsigma_{3},i}(1+cos \varphi) + k_{\varphi_{4},i}(1+cos \varphi)  \right] 
    \end{IEEEeqnarray}

\end{document}

Thanks for the help.

John.

1
  • 1
    Insert an & before the 4th line.
    – Imran
    Commented Jul 27, 2022 at 10:27

1 Answer 1

4

I'd use rCl for the specification.

\documentclass[twoside,twocolumn]{article}
\usepackage{amsmath}
\usepackage{IEEEtrantools}


\begin{document}

\begin{IEEEeqnarray}{rCl}
P &=& \sum_{\substack{i,j \\ i<j}}
      \biggl\{
        4\varepsilon_{ij} \biggl[
          \left( \frac{\epsilon_{ij}}{r_{ij}} \right)^{\!12} -
          \left(\frac{\epsilon_{ij}}{r_{ij}} \right)^{\!6}
        \biggr]
        + \frac{q_{i}q_{j}e^{2}}{r_{ij}}
      \biggr\}
\nonumber\\
  &+& \sum_{i} k_{b,i} (r_{i} - r_{0,i})^{2} +
      \sum_{i} k_{\theta,i} (\theta_{i} - \theta_{0,i})^{2}
\nonumber\\
  &+& \sum_{i} \frac{1}{2}
      \bigl[ k_{\varsigma_{1},i}(1+\cos \varsigma) +
        k_{\varphi_{2},i}(1+\cos \varsigma)
\nonumber\\
  & &\hphantom{\sum} + k_{\varsigma_{3},i}(1+\cos \varphi) + k_{\varphi_{4},i}(1+\cos \varphi)
     \bigr]
\end{IEEEeqnarray}

\end{document}

enter image description here

Points to note:

  1. \substack under the first summation to save horizontal space and get alignment in the subsequent lines

  2. sparing use of \left and \right, that make oversized fences

  3. \! in the exponents to the large parentheses

  4. \cos and not cos

  5. a phantom in the last line to achieve better spacing

With align:

\documentclass[twoside,twocolumn]{article}
\usepackage{amsmath}

\begin{document}

\begin{align}
P &= \sum_{\substack{i,j \\ i<j}}
     \biggl\{
       4\varepsilon_{ij} \biggl[
         \left( \frac{\epsilon_{ij}}{r_{ij}} \right)^{\!12} -
         \left(\frac{\epsilon_{ij}}{r_{ij}} \right)^{\!6}
       \biggr]
       + \frac{q_{i}q_{j}e^{2}}{r_{ij}}
     \biggr\}
\nonumber\\
  &+ \sum_{i} k_{b,i} (r_{i} - r_{0,i})^{2} +
     \sum_{i} k_{\theta,i} (\theta_{i} - \theta_{0,i})^{2}
\nonumber\\
  &+ \sum_{i} \frac{1}{2}
     \bigl[ k_{\varsigma_{1},i}(1+\cos \varsigma) +
        k_{\varphi_{2},i}(1+\cos \varsigma)
\nonumber\\
  & \qquad\quad + k_{\varsigma_{3},i}(1+\cos \varphi) + k_{\varphi_{4},i}(1+\cos \varphi)
     \bigr]
\end{align}

\end{document}

enter image description here

4
  • Hello @egreg. Which one is standard? Aligning the + signs with = or the first summation symbol?
    – Imran
    Commented Jul 27, 2022 at 10:44
  • 2
    @Imran Since the typesetting is two-column, space has to be used sparingly. In a one-column document I'd probably push to the right the + signs.
    – egreg
    Commented Jul 27, 2022 at 10:46
  • 1
    @Imran But in a two-column document the line breaks would be very different
    – egreg
    Commented Jul 27, 2022 at 10:56
  • Thank you. While aligning I face a dilemma in choosing between these two.
    – Imran
    Commented Jul 27, 2022 at 12:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .