# Latex align error?

Why does the following code give me this error?:

"Extra } or forgotten \right)"


I have been through it and cannot work out why.

\begin{align}
C(t,xxx,\tau,N,X)&=N\Phi\sum_{i=1}^{n}\left[-(1+X_{\tau_{i}})P(t,T_{i})\left(\frac{\ln\frac{P(t,T_{i-1})}{(1+X_{\tau_{i}}P(t,T_{i})}}{\Sigma(t,T_{i-1},T_{i})}-\frac{1}{2}\Sigma(t,T_{i-1},T_{i})\right)\\
&+P(t,T_{i-1})[\left(\frac{\ln\frac{P(t,T_{i-1})}{(1+X_{\tau_{i}})P(t,T_{i})}}{\Sigma(t,T_{i-1},T_{i})}-\frac{1}{2}\Sigma(t,T_{i-1},T_{i})\right)\right]
\end{align}

-
Welcome to TeX.sx! Your question was migrated here from Stack Overflow. Please register on this site, too, and make sure that both accounts are associated with each other (by using the same OpenID), otherwise you won't be able to comment on or accept answers or edit your question. –  Werner Jul 26 '12 at 17:25

## migrated from stackoverflow.comJul 26 '12 at 16:50

This question came from our site for professional and enthusiast programmers.

First of all, you're missing a matching \right delimiter to one of your \left delimiters.

Also, you cannot break \left and \right across lines inside align (or any math environment for that matter). You need to do this manually by using a fake opposing delimiter and introducing the necessary false heights to obtain equivalent delimiters. However, an easier alternative would be to use non-matching "big" operators:

\documentclass{article}
\usepackage{amsmath}% http://ctan.org/pkg/amsmath
\begin{document}
\begin{align}
\rlap{$C(t,xxx,\tau,N,X)$}\hspace{2em} & \nonumber \\
&= N\Phi\sum_{i=1}^{n}
\Bigg[-(1+X_{\tau_{i}})P(t,T_{i})
\Bigg(\frac{\ln\frac{P(t,T_{i-1})}{(1+X_{\tau_{i}}P(t,T_{i})}}{\Sigma(t,T_{i-1},T_{i})}-\frac{1}{2}\Sigma(t,T_{i-1},T_{i})\Bigg)\\
&\phantom{{}={}} {}+P(t,T_{i-1})\Bigg[
\Bigg(\frac{\ln\frac{P(t,T_{i-1})}{(1+X_{\tau_{i}})P(t,T_{i})}}{\Sigma(t,T_{i-1},T_{i})}-\frac{1}{2}\Sigma(t,T_{i-1},T_{i})\Bigg)\Bigg]\Bigg]
\end{align}
\end{document}​


The use of \hspace in the first line is to make the equation fit within the text block width. Also note the use of \phantom{{}={}} to obtain the correct spacing for the second numbered equation.

-
I see! that is very useful to know. Thank you very much! –  Mary Jul 25 '12 at 17:34