1

I get the

"Missing } inserted \end{multline}"

when I run the equation below, please someone help me please.

\begin{multline}
{G_1} = \frac{{{2^{m - 1}}(m - 1)!}}{{{{\left( {\frac{m}{{\overline \gamma}}} \right)}^m}}}\frac{{\overline \gamma  }}{{m + \overline \gamma}}{e^{ - \frac{\lambda }{2}\frac{m}{{m + \overline \gamma  }}}}\left[ {\left( {1 + \frac{m}{{\overline \gamma  }}} \right){{\left( {\frac{m}{{m + \overline \gamma}}} \right)}^{m - 1}}\\ \times {L_{m - 1}}\left( { - \frac{\lambda }{2}\frac{{\overline \gamma  }}{{m + \overline \gamma  }}} \right) + {{\sum\limits_{n = 0}^{m - 2} {\left( {\frac{m}{{m + \overline \gamma  }}} \right)} }^n}{L_n}\left( { - \frac{\lambda }{2}\frac{{\overline \gamma  }}{{m + \overline \gamma  }}} \right)} \right]
\end{multline}here
Rico
  • 6,097

3 Answers3

6

You're overusing braces and this makes very difficult to balance them. There is no need to type {G_1}, because G_1 will give exactly the same result.

However, the error is due to starting \left on one line and trying to end it in the next one.

When complicated formulas are involved, it's better to split lines more generously; this helps in keeping things balanced. I've also removed all the unnecessary braces.

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{multline}
G_1 = 
\frac{2^{m - 1}(m - 1)!}{\left( \frac{m}{\overline\gamma} \right)^m}
\frac{\overline\gamma}{m+\overline\gamma}
e^{-\frac{\lambda}{2}\frac{m}{m + \overline\gamma}}
\biggl[ % NOT \left
\left( 1 + \frac{m}{\overline\gamma} \right)
\left(\frac{m}{m + \overline \gamma} \right)^{m-1}
\\
\times
L_{m-1}
\left(
  -\frac{\lambda}{2}
  \frac{\overline\gamma}{m + \overline\gamma}
\right) +
\sum_{n = 0}^{m - 2}
\left(\frac{m}{m + \overline\gamma}\right)^n L_n
\left(
  -\frac{\lambda}{2}\frac{\overline\gamma}{m + \overline\gamma}
\right)
\biggr] % BALANCE THE \biggl
\end{multline}
\end{document}

enter image description here

David Carlisle
  • 757,742
egreg
  • 1,121,712
2

This is fairly thorny. Some basic recommendations before I present the unpicked solution:

  • Don't write something this complicated in a single line. Break it into smaller components (say, a line per fraction).
  • In a code with this many curly braces, you can drop them where you don't need them. It'll make the code easier to debug. Unless you want to display the curly braces, in which case you want \{ and \}.
  • If something is wrapped in \left( and \right), then you don't also need to wrap it in curly brackets to get a power in the right place.
  • Consider defining macros for terms which you use a lot. For example, I use \ogamma for \overline\gamma, which makes the code shorter and easier to read. And the terms g/(m+g) and m/(m+g) occur sufficiently often that you might just want to give special symbols for these, to make the typeset equation easier to read.
  • The problem in your code is the \\. You have a left square bracket \left[ on the first line, and this needs to be closed on the same line with a \right of something. Thus, I added \right. \\ \left. around the linebreak, so the \left[ is closed by the phantom \right. This caused an error when I was trying to compile this.

I believe this code gives you what you want:

\documentclass{article}

\usepackage{amsmath}

\newcommand{\ogamma}{\overline\gamma}

\begin{multline}
G_1 =
\frac{2^{m-1} (m-1)!}{\left( \frac{m}{\ogamma} \right)^m}
\frac{\ogamma}{m+\ogamma}
e^{-\frac{\lambda}{2}\frac{m}{m+\ogamma}}
\left[
  \left( 1+\frac{m}{\ogamma} \right)
  \left( \frac{m}{m+\ogamma} \right)^{m-1}
  \right. \\ \left.
    \times L_{m-1}
  \left( -\frac{\lambda}{2} \frac{\ogamma}{m+\ogamma}\right)
+ \left( \sum\limits_{n=0}^{m-2} a
    \left( \frac{m}{m + \ogamma} \right)
  \right)^n L_n
  \left( -\frac{\lambda}{2} \frac{\ogamma}{m+\ogamma} \right)
\right]
\end{multline}

\end{document}

Caveat that everybody's style is different. Breaking it up into these particular chunks is just what happens to work for me. Although you now have (at least) three different ways of writing it, you might want to consider trying this yourself, and seeing where putting a new line makes sense to you.

It typesets as follows:

enter image description here

(I added brackets around the sum so that the term affected by the \n was clear visually; I hope this was correct.)

You might also want to consider using a LaTeX editor that highlights where braces begin and end. For example, TeXShop marks the text between a pair of braces in a yellow highlight:

enter image description here

I found this quite useful when rewriting the above.

alexwlchan
  • 5,417
  • 3
    A (potential) problem with using \left[ ... \right. \\ \left. ... \right] is that the brackets won't necessarily be of the same size. If the contents of the second line wasn't as high as that of the first line, you would get a closing bracket that was smaller than the opening bracket. – Torbjørn T. Jun 13 '13 at 14:30
0
\documentclass{article}
\usepackage{amsmath}
\begin{document}

\begin{multline}
{G_1} = 
\frac{{{2^{m - 1}}(m - 1)!}}
{{{{\left( {\frac{m}{{\overline \gamma}}} \right)}^m}}}
\frac{{\overline \gamma  }}{{m + \overline \gamma}}{e^{ - \frac{\lambda }{2}
\frac{m}{{m + \overline \gamma  }}}}
\left[ {\left( {1 + \frac{m}{{\overline \gamma  }}} \right)
{{\left( {\frac{m}{{m + \overline \gamma}}} \right)}^{m - 1}}}\right.\\  % }\right. added
\left.\times {L_{m - 1}}\left( % \left. added
 { - \frac{\lambda }{2}\frac{{\overline \gamma  }}{{m + \overline \gamma  }}}
 \right) 
+ {{\sum\limits_{n = 0}^{m - 2} {\left( {\frac{m}{{m + \overline \gamma  }}} \right)} }^n}
{L_n}\left( { - \frac{\lambda }{2}\frac{{\overline \gamma  }}{{m + \overline \gamma  }}} \right) % } removed
 \right]
\\
\end{multline}here

\end{document}

with the following result

enter image description here

David Carlisle
  • 757,742