0

I have a very long equation that begins and ends with a curly brace. I would like it to extend over multiple lines. I tried the following

\documentclass[]{article}
\usepackage{amssymb}
\usepackage{amsmath}

\begin{document}
    
\begin{eqnarray}  \label{eq:cohensDCSs3}
    \hat{\mathcal{A}}_c^{\pm}= \left \{\bf{s}: \\ \nonumber
    \pm \frac{k}{\sqrt{N}}\right\}
\end{eqnarray}


\end{document}

and get the following error message

! Extra }, or forgotten \right.
<template> }
            $\@eqnsel \endtemplate 
l.9 ...l{A}}_c^{\pm}= \left \{\bf{s}: \\ \nonumber
                                              
? 

I do not get this error message if I leave out the "\\ \nonumber" part.

Edit. Thank you for the replies. But I wanted a large brace at the beginning of the first line and a large brace at the end of the last line. The following is what I want. enter image description here

The following code does what I want. The braces expand with the equation which begins and ends with a brace. I don't want any braces to span all of the lines.

\documentclass[]{article}
\usepackage{amssymb}
\usepackage{amsmath}

\begin{document}
    
    \begin{eqnarray}
    \hat{\mathcal{A}}_c^{\pm}=  \left\{\bf{s}: \right. \\     \nonumber
    \left. \pm \frac{k}{\sqrt{N}}\right\}
    \end{eqnarray}


\end{document}
3
  • 1
    Source of your problems solved here: How to make \left, \right pairs of delimiter work over multiple lines?
    – Werner
    Sep 21, 2021 at 16:34
  • What you want is not at all clear. The snippet you've given has a much smaller { placed to the right of where the second line starts, so I don't think that's what you really want. Bernard has a nice answer. Is that what you want? If not, why not? You can also use sizing commands like \biggl and \biggr to adjust the \{ and \}.
    – Teepeemm
    Sep 21, 2021 at 20:56
  • @Werner. Yes it does. I had not seen that question. Sep 22, 2021 at 0:05

2 Answers 2

3

Does it work for you or I misunderstand You?

\documentclass[]{article}
\usepackage{amssymb}
\usepackage{amsmath}

\begin{document}
    
\begin{eqnarray}  \label{eq:cohensDCSs3}
    \hat{\mathcal{A}}_c^{\pm}=  \lbrace\bf{s}: \\ \nonumber
    \pm \frac{k}{\sqrt{N}}\rbrace
\end{eqnarray}


\end{document}

Just replace \left{ to the "\lbrace" and same "\rbrace"

1
  • This is equivalent to deleting \left and \right. Presumably OP has them for a reason.
    – Teepeemm
    Sep 21, 2021 at 20:51
1

You shouldn't use eqnarray – the spacing at the alignment point is not good. I propose this simple solution with left-aligned Bmatrix:

\documentclass[]{article}
\usepackage{amssymb}
\usepackage{mathtools}

\begin{document}

\begin{equation}\label{eq:cohensDCSs3}
      \hat{\mathcal{A}}_c^{\pm}= \begin{Bmatrix*}[l]\bf{s}: \\
    \pm \frac{k}{\sqrt{N}}\end{Bmatrix*}
\end{equation}

\end{document} 

enter image description here

Not the answer you're looking for? Browse other questions tagged .