2

I am wrting this equation with

\begin{eqnarray}
u_k^{n+1}=\argmin_{u_k \epsilon X} 
 \left\lbrace \alpha \left|\left|\partial_t\left[\left(\delta(t)+\frac{j}{\pi t}\right)*u_k(t)\right]e^{-j\omega_kt}\right|\right|_2^2
\\ +\left|\left| f(t)-\sum_i u_i(t) + \frac{\lambda(t)}{2} \right|\right|_2^2  \right\rbrace
\end{eqnarray}

but getting error

 ! Extra }, or forgotten \right.][1]
  • You cannot use the \left ... \right syntax across multiple lines of an array. See: http://tex.stackexchange.com/questions/49890/linebreak-between-left-and-right, http://tex.stackexchange.com/questions/21290/how-to-make-left-right-pairs-of-delimiter-work-over-multiple-lines, http://tex.stackexchange.com/questions/73964/left-and-right-in-equation-across-multiple-lines – Steven B. Segletes Feb 04 '15 at 11:18
  • Search the site for \big, \bigg, \Big and \Bigg as alternatives. – Steven B. Segletes Feb 04 '15 at 11:24
  • Welcome to TeX.SX!. When asking questions it is better to provide a full minimal working example (MWE) both in order to demonstrate what you are trying to do and to help others help you. The MWE should look like \documentclass...\begin{document}...\end{document}, it should compile and contain close to the minimal amount of code needed to explain/demonstrate what you are asking. This saves everyone time:) –  Feb 04 '15 at 12:07

1 Answers1

5

You have not balanced \left and \rights across line break. Further, better not use eqnarray but use amsmath facilities like align etc.

\documentclass{article}
\usepackage{mathtools}
\DeclareMathOperator*{\argmin}{arg\,min}
\begin{document}
  \begin{equation}
  \begin{multlined}
u_k^{n+1}=\argmin_{u_k \epsilon X}
 \left\lbrace \alpha \left|\left|\partial_t\left[\left(\delta(t)+\frac{j}{\pi t}\right)*u_k(t)\right]e^{-j\omega_kt}\right|\right|_2^2 \right.\\ 
\left.+\left|\left| f(t)-\sum_i u_i(t) + \frac{\lambda(t)}{2} \right|\right|_2^2  \right\rbrace
\end{multlined}
\end{equation}
\end{document}

I have used multlined from mathtools (which also loads amsmath).

enter image description here

Improved version:

Instead of using \left and \right pair (which gives more space as noted by Mico and needs to be balanced across lines), you can use Biggl and Biggr from amsmath. Here is a screen shot from amsldoc page 15, (texdoc amsldoc):

enter image description here

And for double bar use a \DeclarePairedDelimiter like

 \DeclarePairedDelimiter{\norm}{\lVert}{\rVert}

and use it like \norm[\bigg]{<content>} (Thanks to Mico)

\documentclass{article}
\usepackage{mathtools}
\DeclareMathOperator*{\argmin}{arg\,min}
\DeclarePairedDelimiter{\norm}{\lVert}{\rVert}
\begin{document}
  \begin{equation}
  \begin{multlined}
    u_k^{n+1}=\argmin_{u_k \epsilon X}
        \Biggl\lbrace \alpha \norm[\bigg]{\partial_t\left[\left(\delta(t)+\frac{j}
            {\pi t}\right)*u_k(t)\right]e^{-j\omega_kt}}_2^2 \\
        +\norm[\bigg]{f(t)-\sum_i u_i(t) + \frac{\lambda(t)}{2}}_2^2  \Biggr\rbrace
\end{multlined}
\end{equation}
\end{document}

enter image description here

One could, as suggested by @MaxNoe, get automatic sizing of the double vertical bars by using the "starred" version of the command, viz., \norm*{<content>}. However, in the example at hand, doing so would generate delimiters that are too large -- hence the use of the explicit sizing directive, \norm[\bigg]{<content>}, in the code above.

Mico
  • 506,678
  • The \left|\left| and \right|\right| instructions leave too much whitespace between the vertical bars. Since the bars presumably denote a "norm", it would be better to write either \left\lVert and \right\rVert or, better still, set up a norm "operator" via \DeclarePairedDelimiter{\norm}{\lVert}{\rVert} in the preamble and then write \norm[\bigg]{...} in the equation. – Mico Feb 04 '15 at 11:57
  • \left|\left| schould be \left\Vert, possibly with a \DeclarePairedDelimiter – MaxNoe Feb 04 '15 at 11:57
  • haha, same time – MaxNoe Feb 04 '15 at 11:57
  • @Mico I was in a hurry to go home. Thanks, now answer updated. –  Feb 04 '15 at 12:26
  • you can use the starred version of \norm to get the size automatically, \norm*{\frac{1}{2}} – MaxNoe Feb 04 '15 at 12:29
  • @MaxNoe Thanks, I added it. I am on and off now so many things are pending and work comes in discrete amounts :-) –  Feb 04 '15 at 12:52
  • @MaxNoe - Using \norm* will give you an incorrect size for the second norm expression. Automatic sizing is not foolproof... Better to use \norm{\bigg]{...}. – Mico Feb 04 '15 at 13:24
  • I know, I just wanted to mention it for completeness regarding DeclarePairedDelimiter – MaxNoe Feb 04 '15 at 13:26
  • don't think anyone has mentioned it yet ... in the first example, the braces aren't the same size; the left brace is a tad smaller. – barbara beeton Feb 04 '15 at 17:03
  • @barbarabeeton - You point out another good reason for not using \left and \right -- at least not without paying close attention to the fence sizes (in this case, the sizes of the curly braces). – Mico Feb 04 '15 at 20:14