3

I am facing problem to split this equation in three lines. Where is the problem because whenever I run latex. It stopped and write missing }. The equation is

\begin{equation}\begin{split}
& A_{t}(r,\theta)=[\frac{\alpha^{0}(\frac{r}{2M}) + \beta^{0}}{r}]p_{0} + \frac{\alpha^{1}(\frac{r}{2M} (-\frac{r}{2M} + 1)) \\
&\qquad + \beta^{1}(\frac{r}{2M}(1-\frac{r}{2M}) (2\ln(\frac{r}{r-2M} - \frac{2M}{r} - \frac{1}{\frac{r}{2M} - 1})))}{r} p_{1}(cos\theta)\\ + ...\Bigr,
\end{split}
\label{eq1}
\end{equation}
  • You are trying to break a \frac across multiple lines without showing how this should be handled. Also, you can't break structures across & without some help... Can you provide a visual of what the output is supposed to look like? It'll give a better understanding of how solutions should handle a fraction broken across a line-break. – Werner Mar 22 '18 at 17:30

2 Answers2

1

In principle, split from amsmath packet does the job. Here, your code spinet doesn't compile because you have a frac (the one starting with \frac{\alpha^{1} which is split between the two lines. Without the split, one get the following equation:enter image description here which IMO is terribly ugly.

Eliminating this faulty fraction, abetter coding would be :

\begin{equation}\label{eq1}
\begin{split}
A_{t}(r,\theta)&=\bigg(\frac{\alpha^{0}(\frac{r}{2M}) + \beta^{0}}{r}\bigg) P_{0} \\
&\qquad+ \frac{1}{r}\;\bigg(\alpha^{1}\Big(\frac{r}{2M} \big(-\frac{r}{2M} + 1\big)\Big) %\times\\ 
%& \qquad\qquad
 \beta^{1}\Big(\frac{r}{2M}\big(1-\frac{r}{2M}\big)\big(2\ln(\frac{r}{r-2M} - \frac{2M}{r} - \frac{1}{\frac{r}{2M} - 1})\big)\Big)\bigg) P_{1}(\cos\theta) +\cdots,
\end{split}
\end{equation}

resulting in: enter image description here which is still to large...

As the \bigg parenthesis of the second term seems to be a product, and because the structure \Bigg( ... \Bigg)\\ can be split among lines (oppositely to\fracor\left(...\right)`` ) you could split it again:

\begin{equation}\label{eq1}
\begin{split}
A_{t}(r,\theta)&=\bigg(\frac{\alpha^{0}(\frac{r}{2M}) + \beta^{0}}{r}\bigg) P_{0} \\
&\qquad+ \frac{1}{r}\;\bigg(\alpha^{1}\Big(\frac{r}{2M} \big(-\frac{r}{2M} + 1\big)\Big) \; \times\cdots\\ 
& \qquad\qquad\qquad\qquad
 \beta^{1}\Big(\frac{r}{2M}\big(1-\frac{r}{2M}\big)\big(2\ln(\frac{r}{r-2M} - \frac{2M}{r} - \frac{1}{\frac{r}{2M} - 1})\big)\Big)\bigg) P_{1}(\cos\theta) \\
&\qquad+\cdots,
\end{split}
\end{equation}

resulting in: enter image description here

Of course if \beta^1 is a variable and not a function of the following parenthesis, instead to the proposed break, a break just before the \big(2\ln( (with suitable change of parenthesis size) could be preferred.

Jhor
  • 4,179
1

You may want to do the readers a big favor by simplifying the equation structure. For instance, since every term in the sum appears to be divided by r, it would be helpful to place \frac{1}{r} ahead of the remainder of the math material. It would probably also help to replace the recurring expression \frac{r}{2M} with something simpler, say, r'. (Feel free to come up with a better abbreviation than r'...)

enter image description here

\documentclass{article}
\usepackage{amsmath} % for 'split' environment
\newcommand\rM{r'}   % orginally: {\frac{r}{2M}}
\begin{document}
Put $r'=r/(2M)$. Then
\begin{equation}
\begin{split}
A_{t}(r,\theta)
&=\frac{1}{r} \Bigl\{ (\alpha^0\rM + \beta^0)p_0 
  + \alpha^1\rM (-\rM + 1) p_{1} \cos\theta\\
&\quad+\beta^1\Bigl[\rM(1-\rM) \Bigl( 2\ln\Bigl( \frac{r}{r-2M} - \frac{1}{r'} 
  - \frac{1}{\rM - 1}\Bigr) \Bigr)\Bigr]p_{1} \cos\theta\\ 
&\quad + \dotsb \Bigr\}
\end{split}
\label{eq1}
\end{equation}
\end{document}
Mico
  • 506,678