Let's say that you have an equation like this:
And want to align it in a pretty way, say:
or:
as opposite to the sloppy:
Then, you can use the environment
split
within the package
amsmath
, just as in the example in the box below. By the way, the sloppy way is the last bit of code in the example.
\documentclass{article} \usepackage{amsmath} \begin{document} \begin{equation} \begin{split} x = a + b + c \end{split} \end{equation}
\begin{equation} \begin{split} x = {} & a \\ + & b \\ + & c \\ \end{split} \end{equation}
\begin{equation} \begin{split} x = {} & a + b \\ + & c \\ \end{split} \end{equation}
\begin{equation} \begin{array}{l} x = a+ b \\ + c \\ \end{array} \end{equation} \end{document}

It's just a matter of personal preference or personal style, but I would probably use this code:
ReplyDelete\begin{eqnarray}
x &=& a + b \\ \nonumber
& & + c
\end{eqnarray}
or:
\begin{eqnarray*}
x &=& a + b \\
& & + c
\end{eqnarray*}
You may then find useful the article about eqnarray in the Practex journal:
ReplyDeletehttp://www.tug.org/pracjourn/20064/madsen/
My question then Nelson is the following... things are not really ligned up nicely in your version. Is this something that is fixable? for example, the spacing is not the same on the first line and the next lines.
ReplyDeleteI have no idea. Gustav may know.
ReplyDeleteHere is something I found if you want to make it look nice. (Courtesy of: ftp://ftp.ams.org/pub/tex/doc/amsmath/shortmathguide.pdf)
ReplyDelete\begin{equation}\label{xx}
\begin{split}
a& =b+cd\\
& \quad +ef\\
& =g+h\\
& =i
\end{split}
\end{equation}