nested align split

456 views
Skip to first unread message

f33l

unread,
Jan 11, 2008, 9:47:33 AM1/11/08
to LaTeX Users Group
Hi all,


I am trying to use align and split (amsmath) in a nested manner.

More precisely, I'm trying somethink like:

\begin{align}
&
\begin{split}
= &E1_part 0 \\
&+ E1_part 1 \\
&- E1_part 2\\
\end{split} \nonumber
\\
&
\begin{split}
= &E2_part 0 \\
&+ E2_part 1 \\
\end{split} \nonumber
\\
\end{align}

The problem is, that the resulting formula looks similar to this,

= E1_part0
+ E1_part1
- E1_part2
= E2_part0
+ E2_part1

rather than how I'd like it to look

= E1_part0
+ E1_part1
- E1_part2
= E2_part0
+ E2_part1

Any ideas?

Werner Grundlingh

unread,
Jan 11, 2008, 12:23:05 PM1/11/08
to LaTeX Users Group
I get exactly the required output you want, and not the first
suggested output. Moreover, if the alignment in the equation is as in
your last suggestion, then the following is a little simpler:

\[
\begin{split}
= {}&E1_part 0 \\
&+ E1_part 1 \\
&- E1_part 2\\
= {}&E2_part 0 \\
&+ E2_part 1 \\
\end{split}
\]

It yields the correct spacing between operators, equations and is
fairly straight forward.

Hope this helps,
Werner

f33l

unread,
Jan 12, 2008, 6:57:29 AM1/12/08
to LaTeX Users Group
Dear Werner,


You're right, with the code from my last post, the unwanted behavior
did not show. This is because the "equations" were of the same length.
The behavior shows if you consider the following:

\begin{align}
&
\begin{split}
= &E1_part 0 \\
&+ E1_part 1 \\
&- E1_part 2\\
\end{split} \nonumber
\\
&
\begin{split}
= &E2_part xxxxxxxxxxxxxxx 0 \\
&+ E2_part 1 \\
\end{split} \nonumber
\\
\end{align}


One possible solution (thanks to Werner) would be the following:

\begin{align}
= &E1_part 0 \nonumber \\
&+ E1_part 1 \nonumber \\
&- E1_part 2 \nonumber \\
= &E2_part xxxxxxxxxxxxxxx 0 \nonumber \\
&+ E2_part 1 \nonumber \\ \nonumber
\end{align}

I was hoping there was a way to keep each multi-line equation as a
separate entity, which again can be aligned, but this works, as well.

Thanks!

- Chris
Reply all
Reply to author
Forward
0 new messages