tags:

views:

161

answers:

4

My equation is very long, how do I get it to continue on the next line rather than go off the page?

+1  A: 

Without configuring your math environment to clip, you could force a new line with two backslashes in a sequence like this:

Bla Bla \\ Bla Bla in another line

The problem with this is that you will need to determine where a line is likely to end and force to always have a line break there. With equations, rather than text, I prefer this manual way.

You could also use \\* to prevent a new page from being started.

Uri
A: 

There are a couple ways you can deal with this. First, and perhaps best, is to rework your equation so that it is not so long; it is likely unreadable if it is that long.

If it must be so, check out the AMS Short Math Guide for some ways to handle it. (on the second page)

Personally, I'd use an align environment, so that the breaking and alignment can be precisely controlled. e.g.

\begin{align*}
   x&+y+\dots+\dots+x_100000000\\
   &+x_100000001+\dots+\dots
\end{align*}

which would line up the first plus signs of each line... but obviously, you can set the alignments wherever you like.

TJ Ellis
A: 

I think I usually used eqnarray or something. It lets you say

\begin{eqnarray*}
    x &=& blah blah blah \\ 
      & & more blah blah blah \\
      & & even more blah blah
\end{eqnarray*}

and it will be aligned by the & &... As pkaeding mentioned, it's hard to read, but when you've got an equation thats that long, it's gonna be hard to read no matter what... (The * makes it not have an equation number, IIRC)

Brian Postow
f.y.i. the AMS recommends not using eqnarray environments because they "produce inconsistent spacing of the equal signs and make no attempt to prevent overprinting of the equation body and equation number." -- not really applicable here, but good to know; a good ol' align environment can take care of most such circumstances.
TJ Ellis
+2  A: 

If your equation does not fit on a single line, then the multiline environment probably is what you need:

\begin{multiline}
first part of the equation \\
= second part of the equation
\end{multiline}

If you also need some alignment respect to the first part, you can use split:

\begin{equation}
\begin{split}
first part &= second part #1 \\
           &= second part #2
\end{split}
\end{equation}

Both environments require the amsmath package.

Alessandro C.