0

Although there are some ways to breaking an equation even at TexStack but they could not help me. I have an equation which is written below:

\begin{eqnarray}
 \langle ABCD\rangle&=&\frac{1}{400} \left[ 20 \cos \left(\frac{x}{2}\right)\Nonumber\\
&+&35 \cos \left(\frac{3 x}{2}\right)\right]\nonumber\\
 \label{eq:what}
\end{eqnarray} 

It yields me a shape of equation which is not my desired. I upload the shape on which I bring out my desired case by a pen of paint. Desired cases are:

  1. Replacement of 3 numbers of equation I should have just one appropriate number in the second line.
  2. Two Cos functions should be put under each other.
  3. The symbol of "+" should move to the upper line.
  4. The symbol "]" must be put in the end of equation.

enter image description here

3 Answers 3

1

Here is how to do it with align. Not only is eqnarray deprecated but its spacing around alignment point is often not good.

Alternatively, as mentioned by Barbara Beeton, one can use the split environnment, within equation:

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\begin{align}
  \langle ABCD\rangle=\frac{1}{400}\Bigl[ & 20\cos\Bigl(\frac{x}{2}\Bigr)+ \notag \\
                                          & 35\cos\Bigl(\frac{3 x}{2}\Bigr)\Bigr]
  \label{eq:what}
\end{align}


\begin{equation}\begin{split}
  \langle ABCD\rangle=\frac{1}{400}\Bigl[ &20\cos\Bigl(\frac{x}{2}\Bigr)+ \\
                                          & 35\cos\Bigl(\frac{3 x}{2}\Bigr)\Bigr]
\end{split}
  \label{eq:what}
\end{equation}

 \end{document} 

enter image description here

2
  • equation and split would also do it. Nov 29, 2015 at 18:40
  • It is so nice and amazing........ Nov 29, 2015 at 19:26
2

Another possibilities by using mathtools and multilined environment:

\documentclass[twocolumn]{article}
    \usepackage{mathtools}

    \begin{document}
\begin{equation}\label{eq:what}
    \begin{multlined}[5cm]
\langle ABCD\rangle =
    \frac{1}{400}\left[20\cos\left(\frac{x}{2}\right)\right. + \\[1ex]
                        \left.35\cos\left(\frac{3 x}{2}\right)\right]  
    \end{multlined}
\end{equation}
    \end{document} 

In this case you still can proper use \left[... and ...\right] with paired\right.andleft.` respectively.

enter image description here

1
  • Wonderful and excellent.... Nov 29, 2015 at 19:27
0

This should be the code you're looking for. If I remember right, \left[ \right] does not work over multiple lines. Thus, you have to adjust the size of [ and ] in the lines with \big or \Big etc.

Furthermore, the undesired equation numbers come from \ at your last line. You don't need another line, do you? So you can omit the \, which lead to an enumeration of an empty line.

    \begin{eqnarray}
 \langle ABCD\rangle=\frac{1}{400}&\Big[{20}\cos\left(\frac{x}{2}\right)+ \notag\\
&\phantom{\Big[}{35}\cos\left(\frac{3 x}{2}\right)\Big]
 \label{eq:what}
\end{eqnarray} 
5
  • Thanks to you. But if we have for example cos(2x)+ cos(3x/2) +cos(x)+ a constant such 100, if we wan to to have two terms in the first line and the two other terms in the second line, the second line will not begin at the place of starting point of the first line!! Nov 29, 2015 at 10:47
  • 1
    eqnarray is quite outdated!
    – user31729
    Nov 29, 2015 at 10:49
  • The use of & regulates the positioning.
    – Stats_L
    Nov 29, 2015 at 10:52
  • I would be so glad if you tell me what can be replaced to eqnarray? Nov 29, 2015 at 10:53
  • You should use align in my opinion. If you want to omit the equation numbers in general, you can use align*
    – Stats_L
    Nov 29, 2015 at 10:53

You must log in to answer this question.

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