0

How to format lines automatically in latex?

I wrote:

\begin{equation}
\begin{split}
\Lambda^{'}(pq-2)=4p^4q^4 - 4p^4q^3 - 4p^3q^4 - 2p^3q^3 + 4p^3q^2 + 4p^2q^3 -\\4(6pq - p - q - 5)(pq - 2)^3 + 5(pq - 2)^4 - 12p^2q^2 +3(13p^2q^2 - 5p^2q - 5pq^2 - 18pq + p + q + 10)(pq - 2)^2 +\\
10p^2q + 10pq^2 - 2(12p^3q^3 - 8p^3q^2 - 8p^2q^3 - 17p^2q^2
\\+ 5p^2q + 5pq^2 + 12pq + 6p + 6q - 8)(pq - 2) + 4pq - 4p -4q - 8
\end{split}
\end{equation}

I tried experimenting by putting \\ to get a newline. But the equation is not fitting in my page. Its going outside of page.

Does there exist any command so that texmaker can automatically put the equation within the page?

  • Off topic: don't use \Lambda^{'} but simply \Lambda'. – Sigur Jan 20 at 15:20
  • 1
    I'm almost sure that automatic is not possible. You have to adjust by hand, inserting another new line, for example, at \\ 12p^2q^2. – Sigur Jan 20 at 15:22
  • @Sigur; thanks a lot – Math_Freak Jan 21 at 2:20
2

For automatic breaking of long output from computer algebra and similar systems it often helps to use inline math. As you want an equation number I wrapped that in a \parbox and equation here.

enter image description here

\documentclass{article}

\begin{document}

\begin{equation}
\Lambda'(pq-2)=\parbox[t]{.75\textwidth}{$\displaystyle
4p^4q^4 - 4p^4q^3 - 4p^3q^4 - 2p^3q^3 + 4p^3q^2 + 4p^2q^3 -
4(6pq - p - q - 5)(pq - 2)^3 + 5(pq - 2)^4 - 12p^2q^2 +3(13p^2q^2 -
5p^2q - 5pq^2 - 18pq + p + q + 10)(pq - 2)^2 +
10p^2q + 10pq^2 - 2(12p^3q^3 - 8p^3q^2 - 8p^2q^3 - 17p^2q^2
+ 5p^2q + 5pq^2 + 12pq + 6p + 6q - 8)(pq - 2) + 4pq - 4p -4q - 8
$}
\end{equation}
\end{document}
  • You are superb!!, thanks a lot – Math_Freak Jan 21 at 2:32
  • One question sir, How can i go to a new line in this environment – Math_Freak Jan 21 at 2:59
  • Suppose I want to write $\implies $ in the new line, how can i go to a new line – Math_Freak Jan 21 at 3:00

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.