0

I tried the other posts here on the following problem, but they don't work for this equation. I have the following:

\begin{equation}
     \psi(x)=\frac{1}{2\pi i}\int_{\partial\gamma_r}\left\{\frac{1}{\mu}\int_{-\infty}^{\infty}R(x,t;\mu)[\psi^{\prime\prime}(t)+q(t)\psi(t)]dt\\
     -\int_{-\infty}^{\infty}R(x,t;\mu)\psi(t)dt \right\}d\mu
\end{equation}

however, as you can see the tall curly brackets only work without array, but the formula is too long. I then try with array, but it fails to work:

     \begin{equation}
\begin{array}{cc}
     \psi(x)=\frac{1}{2\pi i}\int_{\partial\gamma_r}\left\{\frac{1}{\mu}\int_{-\infty}^{\infty}R(x,t;\mu)[\psi^{\prime\prime}(t)+q(t)\psi(t)]dt\\
     -\int_{-\infty}^{\infty}R(x,t;\mu)\psi(t)dt \right\}d\mu
\end{array}
\end{equation}

How can this be made so it looks correct?

Thanks

MadyYuvi
  • 13,693

5 Answers5

2

Just an addition to @MadyYuvi's answer, here's how I'd do this particular one

\documentclass{book}
\usepackage{mathtools}
\begin{document}

\begin{equation}
\begin{aligned}
  \psi(x)=\frac{1}{2\pi
    i}\int_{\partial\gamma_r}
  \biggl\{&\frac{1}{\mu}\int_{-\infty}^{\infty}R(x,t;\mu)[\psi^{\prime\prime}(t)+q(t)\psi(t)]dt
  \\
  & -\int_{-\infty}^{\infty}R(x,t;\mu)\psi(t)dt \biggr\}d\mu
\end{aligned}
\end{equation}

\end{document}

enter image description here

By request here is an image of the result of using \begin{aligned}[b] in the MWE above. It will (in this case) move the equation number to the last line. My own personal preference is in the middle as in the image above.

enter image description here

daleif
  • 54,450
1

Hope the below may meet your requirement:

\documentclass{book}
\usepackage{mathtools}
\begin{document}

\begin{equation}
\begin{split}
     \psi(x)&=\frac{1}{2\pi i} \int_{\partial\gamma_r}\biggl\{
              \frac{1}{\mu}\int_{-\infty}^{\infty}R(x,t;\mu)
              [\psi^{\prime\prime}(t)+q(t)\psi(t)]dt \\
            &\quad -\int_{-\infty}^{\infty}R(x,t;\mu)\psi(t)dt \biggr\}d\mu
\end{split}
\end{equation}

\end{document}

OUTPUT enter image description here

Mico
  • 506,678
MadyYuvi
  • 13,693
1

If you're willing to place the limits of integration above and below the integral symbols and to reduce the spacing around the integral symbols, you can actually place the entire equation in one line.

enter image description here

\documentclass{article}
\begin{document}
\begin{equation}
\psi(x)=\frac{1}{2\pi i} {\int\limits_{\partial\gamma_r}}
\biggl\{ \frac{1}{\mu}
{\int\limits_{-\infty}^{\infty}}
R(x,t;\mu) [\psi''(t)+q(t)\psi(t)]dt - \!
{\int\limits_{-\infty}^{\infty}}
R(x,t;\mu)\psi(t)\,dt \biggr\} d\mu
\end{equation}
\end{document} 
Mico
  • 506,678
0

You can use the Bmatrix environment, or, better \Bmatrix* from mathtools, which can take an optional argument for the alignment. You also can split your equation in a different layout. Here are the two possibilities:

\documentclass{article}
\usepackage{mathtools}

\begin{document}

 \begin{equation}
 \psi(x)=\frac{1}{2\pi i} \int_{\partial\gamma_r} \begin{Bmatrix*}[r]\frac{1}{\mu}\int_{-\infty}^{\infty}R(x,t;\mu)[\psi''(t)+q(t)\psi(t)]dt\\
 -\int_{-\infty}^{\infty}R(x,t;\mu)\psi(t)dt \end{Bmatrix*}d\mu
\end{equation}
\bigskip

\begin{equation}
\begin{aligned}
      & \psi(x) =\frac{1}{2\pi i}\times {}\\
      &\int_{\partial\gamma_r} \left\{\frac{1}{\mu}\int_{-\infty}^{\infty}R(x,t;\mu)[\psi''(t)+q(t)\psi(t)]dt
     -\int_{-\infty}^{\infty}R(x,t;\mu)\psi(t)dt \right\}d\mu
\end{aligned}
\end{equation}

\end{document} 

enter image description here

Other than that, if you load geometry to have more decent margins (unless you you marginal notes, of course), the equation will fit on a single line.

Bernard
  • 271,350
0

Delimiters are required to be placed in the same line of the formula [i.e. no \\ are allowed between a pair \left\{ \right\}]. So

\begin{equation}
\begin{array}{cc}
     \psi(x)=\frac{1}{2\pi i}\int_{\partial\gamma_r}\left\{\frac{1}{\mu}\int_{-\infty}^{\infty}R(x,t;\mu)[\psi^{\prime\prime}(t)+q(t)\psi(t)]dt\\
     -\int_{-\infty}^{\infty}R(x,t;\mu)\psi(t)dt \right\}d\mu
\end{array}
\end{equation}

could not work.

In LaTeX we have an environment to deal with long, long, long formulas: split. In short, the equation placed in split environment could be break down into a few more lines by \\ so that the formula would not exceed the center area of "papers".

Additionally, \left and \right should be paired in the same line, but the delimiters could be mismatched. Particularly \left. and \right. are "empty delimiters", which allow us to print single-sided curly braces.

Thus the following would work [I displayed each modification in single lines respectively]:

\begin{equation}
\begin{split}
     \psi(x) &=
\frac{1}{2\pi i}\int_{\partial\gamma_r}\left\{\frac{1}{\mu}\int_{-\infty}^{\infty}R(x,t;\mu)[\psi^{\prime\prime}(t)+q(t)\psi(t)]dt 
\right.
\\
& \left. 
-\int_{-\infty}^{\infty}R(x,t;\mu)\psi(t)dt \right\}d\mu
\end{split}
\end{equation}

which yields something like [ignore the color]

Output

Of course, as the comments pointed out, generally we shall choose the size of the paired delimiters, such as \Biggl\{ and \Biggr\}. I tried to minimize the modification.

xbh
  • 113
  • 1
    The use of \left\{ \right. in the first line and \left. \right\} in the second one works here because of a happy coincidence. In general you'll end with different-sized delimiters. – campa Mar 04 '20 at 12:01
  • @campa Thanks, you are right. – xbh Mar 04 '20 at 12:05