# problem with multline

I have a problem with multline command when I would like to handle long equation here is the code:

\begin{multline}
\gamma(w_{i-1}, ..., w_{i-n+1}) = \frac{D_{1} N_{1}(w_{i-1}^{w_{i-n+1}} w') +   D_{2} N_{2}(w_{i-1}, ..., w_{i-n+1} w')
\\ +  D_{3_{+}} N_{3_{+}}(w_{i-1}, ..., w_{i-n+1} w')                 }{\sum_{w_{i}}N(w_{i} ...w_{i-n+1}^{i})}
\end{multline}


the error is: extra "}"

But I dont find the mistake

Thank you

• Welcome to TeX.SE! As far as I can see, you have fraction over two line. This is not allowed. And please, instead of code fragment provide complete, minimal (non)working example (MWE) which start with \documentclass{...} and end with \end{document}. With this you will help to people who like to help you ... Jun 12, 2016 at 7:46
• Possibly related: tex.stackexchange.com/questions/186959/… Jun 12, 2016 at 7:49

Following up on egreg's answer here, the issue seems to be that you can't split lines in the middle of the numerator. (Though I'm making some assumptions on documentclass here...) Here's one possible fix, since the denominator is relatively short:

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\begin{multline}
\gamma(w_{i-1}, ..., w_{i-n+1}) =
\frac{1}{{\sum_{w_{i}}N(w_{i} ...w_{i-n+1}^{i})}} \Bigl(
D_{1} N_{1}(w_{i-1}^{w_{i-n+1}} w') + \\
D_{2} N_{2}(w_{i-1}, ..., w_{i-n+1} w') +
D_{3_{+}} N_{3_{+}}(w_{i-1}, ..., w_{i-n+1} w')\Bigr)
\end{multline}

\end{document}


I guess that you looking for something like this:

For this is used macro \splitfrac{...}{...} from package mathtools:

\documentclass{article}
\usepackage{mathtools}
\usepackage{geometry}

\begin{document}
$$\gamma(w_{i-1},\dots,w_{i-n+1}) = \dfrac{\splitfrac{D_{1} N_{1}(w_{i-1}^{w_{i-n+1}} w') + D_{2} N_{2}(w_{i-1},\dots,w_{i-n+1} w')} { + D_{3_{+}} N_{3_{+}}(w_{i-1},\dots,w_{i-n+1} w')} }{\sum_{w_{i}}N(w_{i},\dots,w_{i-n+1}^{i})}$$
\end{document}