Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I have an equation which I want to split into two, but it always gives error when I use standard equation breaking techniques, like \split, \gather etc. The quation is given as

\vec{B}^{tra}(\textbf{r})  = \sum^{+\infty}_{n=-\infty}{j^{-n+1}\left[ \frac{k_{+2}c_{n}}{\omega}(\textbf{M}^{1}_{n}(k_{+2}r) +\textbf{N}^{1}_{n}(k_{+2}r))Cos(\theta) 
 -\frac{k_{-2}d_{n}}{\omega}(\textbf{M}^{1}_{n}(k_{-2}r)-\textbf{N}^{1}_{n}(k_{-2}r))sin(\theta)\right]}.

I want to write the sine term on second line.

any help will highly appreciated.

FA

share|improve this question
1  
Welcome to TeX.SE! Real quick: By indenting lines of LaTeX code by four spaces -- which may be done smoothly by highlighting the lines in question and clicking on the {} "button" in the line above the editing window -- the site will pretty-print the code. –  Mico Dec 8 '13 at 13:17
add comment

2 Answers

I suggest you make the following changes to your code

  • To typeset curly braces in TeX/LaTeX, it's necessary to enter them as \{ and \} rather than as { and }. I've replaced your { and } terms with curly braces below since you feature them in your example. However, they're not really needed and could thus be omitted entirely.

  • Since the curly braces and square brackets will enclose material that's broken across two lines, one can't use \left and \right to make them "large". I suggest you use the explicit sizing instructions \biggl and \biggr.

  • Don't write cos and sin but \cos and \sin to have TeX typeset the materials in an upright roman font rather than in math italics.

enter image description here

\documentclass{article}
\usepackage{amsmath} % provides the "align*" environment
\begin{document}
\begin{align*}
\vec{B}^{tra}(\textbf{r}) 
=  \sum^{+\infty}_{n=-\infty}\biggl\{ j^{-n+1}
&\biggl[ \frac{k_{+2}c_{n}}{\omega}
\bigl(\textbf{M}^{1}_{n}(k_{+2}r) +\textbf{N}^{1}_{n}(k_{+2}r)\bigr) \cos(\theta) \\
&\quad {}-\frac{k_{-2}d_{n}}{\omega}
\bigl(\textbf{M}^{1}_{n}(k_{-2}r)-\textbf{N}^{1}_{n}(k_{-2}r)\bigr) \sin(\theta)
\biggr]\biggr\}.
\end{align*}
\end{document}

Without the unnecesssary curly braces and with the superscript term "tra" typeset in an upright-roman font, the equation looks like this:

enter image description here

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{align*}
\vec{B}^{\textup{tra}}(\textbf{r}) 
=  \sum^{+\infty}_{n=-\infty} j^{-n+1}
&\biggl[ \frac{k_{+2}c_{n}}{\omega}
\bigl(\textbf{M}^{1}_{n}(k_{+2}r) +\textbf{N}^{1}_{n}(k_{+2}r)\bigr) \cos(\theta) \\
&\quad {}-\frac{k_{-2}d_{n}}{\omega}
\bigl(\textbf{M}^{1}_{n}(k_{-2}r)-\textbf{N}^{1}_{n}(k_{-2}r)\bigr) \sin(\theta) \biggr].
\end{align*}
\end{document}
share|improve this answer
3  
I'd remove the braces that serve no purpose. –  egreg Dec 8 '13 at 13:36
    
@egreg - I've added a second form, without the curly braces. I did think it was important to mention the need to type \{ and \} rather than just { and } if curly braces are to be typeset. –  Mico Dec 8 '13 at 13:47
add comment

One possible approach is to use the split environment from »amsmath« (here loaded by »mathtools«). This makes it necessary to use a manual scale for delimiters by e.g. \bigg.

\documentclass[11pt]{article}
\usepackage[T1]{fontenc}
\usepackage{mathtools}  % loads »amsmath«

\begin{document}
  \begin{equation}
    \begin{split}
      \vec{B}^\text{tra}(\textbf{r}) = \sum_{n=-\infty}^{+\infty} j^{-n+1}\bigg[ \frac{k_{+2}c_n}{\omega}(\textbf{M}^1_n(k_{+2}r) +\textbf{N}^1_n(k_{+2}r))\cos(\theta) \\
      {}-\frac{k_{-2}d_n}{\omega}(\textbf{M}^1_n(k_{-2}r)-\textbf{N}^1_n(k_{-2}r))\sin(\theta)\bigg]
    \end{split}
  \end{equation}
\end{document}

enter image description here

share|improve this answer
    
The "+2" in the numerator of the fraction on the first line seems to have lost its subscript status. –  Mico Dec 8 '13 at 13:41
    
@Mico: Thanks for that hint. This was not the only place where the underscore for subscripts got lost. Actually I just copied the code from the OP. –  Thorsten Donig Dec 8 '13 at 14:01
2  
you want to put an empty group {} before the minus sign starting the second line to get the correct spacing (binary, not unary). –  barbara beeton Dec 8 '13 at 15:02
    
@barbarabeeton: Thanks for the hint. Small detail fixed. –  Thorsten Donig Dec 11 '13 at 20:54
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.