3

I have written the following equation:

\begin{document}
\documentclass[12pt]{article}
\begin{align}
    \begin{split}
    \bigg \{2\rho-\bigg (2l+n-2-\sqrt{n^2-4l^2+4ln-4n+4}\bigg )\bigg\}
    \bigg \{2\rho-\bigg (2l+n-2+\sqrt{n^2-4l^2+4ln-4n+4}\bigg )\bigg\}\geq 0
    \end{split}
    \end{align}
\end{document}

The lines of the equation are getting out of the margin. I did use split and \\ but when I use it the rest of the part of the document starts behaving abruptly . I start getting spaces in between the sections. Can someone please tell me how to fix it? Do I need to use any package??

5

Here are a few options.1

\documentclass[12pt]{article}
\usepackage{amsmath}
\begin{document}
The options include \texttt{align}
\begin{align}
    \bigl\{2\rho-\bigl(2\ell+n-2-\sqrt{n^2-4\ell^2+4\ell n-4n+4}\bigr)\bigr\}&\notag\\
    \cdot\bigl\{2\rho-\bigl(2\ell+n-2+\sqrt{n^2-4\ell^2+4\ell n-4n+4}\bigr)\bigr\}&\geq 0
\end{align}
and \texttt{multline}
\begin{multline}
    \bigl\{2\rho-\bigl(2\ell+n-2-\sqrt{n^2-4\ell^2+4\ell n-4n+4}\bigr)\bigr\}\\
    \cdot\bigl\{2\rho-\bigl(2\ell+n-2+\sqrt{n^2-4\ell^2+4\ell n-4n+4}\bigr)\bigr\}\geq 0
\end{multline}
and \texttt{aligned}
\begin{equation}
\begin{aligned}
    \bigl\{2\rho-\bigl(2\ell+n-2-\sqrt{n^2-4\ell^2+4\ell n-4n+4}\bigr)\bigr\}&\\
    \cdot\bigl\{2\rho-\bigl(2\ell+n-2+\sqrt{n^2-4\ell^2+4\ell n-4n+4}\bigr)\bigr\}&\geq 0
\end{aligned}
\end{equation}
and \texttt{split}
\begin{equation}
\begin{split}
    \bigl\{2\rho-\bigl(2\ell+n-2-\sqrt{n^2-4\ell^2+4\ell n-4n+4}\bigr)\bigr\}\\
    \cdot\bigl\{2\rho-\bigl(2\ell+n-2+\sqrt{n^2-4\ell^2+4\ell n-4n+4}\bigr)\bigr\}\geq 0
\end{split}
\end{equation}
\end{document}

enter image description here

In the future, please consider posting compilable examples. \documentclass needs to go before \begin{document} and you forgot to load amsmath.

1I personally do not like options (3) or (4), but this is just an opinion. When you have the first time a page break in an equation you may understand why.

| improve this answer | |
  • Thank you very much Sir. One question what are the alternatives for aligned? – Math_Freak Jun 5 at 4:08
  • 1
    @Math_Freak I added more options. (I am pretty sure there will be other answers adding a slight tilt and tell you how great this tilt is. This is what happens always these days.) – user194703 Jun 5 at 4:15
  • +1 But I think you forgot to introduce another one with multlined. – Too Fat Man No Neck Jun 5 at 4:41
  • 2
    @MoneyOrientedProgrammer Thanks! Yes, the list is by far not exhaustive. My favorite is also missing: \documentclass[12pt,fleqn]{article} \begin{document} \begin{equation} f_+(\ell,n)\,f_-(\ell,n)\ge0\;, \end{equation} where \begin{equation} f_\pm(\ell,n)=2\rho-\bigl(2\ell+n-2\pm\sqrt{n^2-4\ell^2+4\ell n-4n+4}\bigr)\;. \end{equation} \end{document}. – user194703 Jun 5 at 4:45
  • Yes. It is easier to read. – Too Fat Man No Neck Jun 5 at 5:25
3

I suggest a different way to cope with such a long formula: use an abbreviation for the expression under the square root.

\documentclass[12pt]{article}
\usepackage{amsmath}

\begin{document}

\begin{equation}
  \begin{aligned}[t]
  &\bigl( 2\rho-(2l+n-2-\sqrt{\Delta}\,) \bigr)
   \bigl( 2\rho-(2l+n-2+\sqrt{\Delta}\,) \bigr)\geq 0
  \\[0.5ex]
  &\Delta=n^2-4l^2+4ln-4n+4
  \end{aligned}
\end{equation}

\end{document}

There is no need to go \bigg: just remember to use \, when the square root is followed by a parenthesis.

enter image description here

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.