Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Please see my questions in the codes:

\documentclass{article}

\usepackage{amsmath,amsthm,mathtools}

\begin{document}

I am not sure align at the equal sign is a good idea, it looks weird to me.
\begin{align}
y & = \Sigma aaa \\  \nonumber 
& = bbb + ccc \\ \nonumber 
& + ddd + eee \\ \nonumber 
& + fff + ggg
\end{align}

So I am trying some other options, like this [Effect-1],
\begin{align}
y= & \Sigma aaa \\  \nonumber 
= &bbb + ccc \\ \nonumber 
&  {\rm{~~~~}} + ddd + eee \\ \nonumber 
&  {\rm{~~~~}} + fff + ggg
\end{align}
That is the first line and second line, align at equal sign, and the second and the rest, align at plus sign.

Or this [Effect-2],
\begin{align}
y= & \Sigma aaa \\  \nonumber 
= & {\rm{~~~}} bbb + ccc \\ \nonumber 
& + ddd + eee \\ \nonumber 
& + fff + ggg
\end{align}
That is the first line and second line, align at equal sign, and the second and the rest, align at characters sign, and in the meantime, keep plus sign not aligned with equal sign.

Some sentences. Some sentences. Some sentences. Some sentences. Some sentences. Some sentences.

Some sentences. Some sentences. Some sentences. Some sentences. Some sentences. Some sentences. Some sentences.

\begin{align}
y= & \Sigma aaa \\  \nonumber 
= & \rm{~~~} bbb - ccc - ddd - eee \\ \nonumber 
& - fff - ggg
\end{align}
I want this new equation aligned with the above equations without using intertext.

Questions: 

1) Using \emph{rm spaces} looks stupid and not always correct, any better solution for multi alignments?

2) How to align across different paragraphs, if I do not want to use "inter text"?

\end{document}  

enter image description here

share|improve this question
add comment

2 Answers

up vote 1 down vote accepted

Here are a couple of methods you can employ:

enter image description here

\documentclass{article}
\usepackage{mathtools}% http://ctan.org/pkg/{mathtools}
\begin{document}

One way
\begin{align}
  y & = \Sigma aaa \\
  & = bbb + ccc \nonumber \\
  & \mathrel{\phantom{=}}{} + ddd + eee \nonumber \\
  & \mathrel{\phantom{=}}{} + fff + ggg \nonumber 
\end{align}

Another way,
\begin{align}
  y &= \Sigma aaa \\
    &= bbb + ccc \nonumber \\ 
    &\mathrel{\phantom{=}}\phantom{bbb} + ddd + eee \nonumber \\
    &\mathrel{\phantom{=}}\phantom{bbb} + fff + ggg \nonumber
\end{align}
That is the first line and second line, align at equal sign, and the second and the rest, 
align at plus sign.

Yet another way
\begin{align}
  y &= \Sigma aaa \\
    &= {}\mathbin{\phantom{+}} bbb + ccc \nonumber \\ 
    &\mathrel{\phantom{=}}{} + ddd + eee \nonumber \\
    &\mathrel{\phantom{=}}{} + fff + ggg \nonumber
\end{align}
That is the first line and second line, align at equal sign, and the second and the rest, 
align at characters sign, and in the meantime, keep plus sign not aligned with equal sign.
\begin{align}
  y &= \Sigma aaa \\
    &= bbb - ccc - ddd - eee \nonumber \\
    & - fff - ggg \nonumber
\end{align}
I want this new equation aligned with the equations below without using intertext.
\begin{align}
  y &\mathrlap{{}= \Sigma aaa}\phantom{{}= bbb - ccc - ddd - eee} \\
    &= {}\mathbin{\phantom{+}} bbb + ccc \nonumber \\ 
    &\mathrel{\phantom{=}}{} + ddd + eee \nonumber \\
    &\mathrel{\phantom{=}}{} + fff + ggg \nonumber
\end{align}

\end{document}

Some considerations:

  • Never leave empty lines around align (to avoid excessive vertical spacing);
  • Use \phantom{..} to obtain the correct spacing of stuff without actually typesetting it;
  • Using \phantom might remove the spacing associated with an operator/relation. Fix this by adding an empty group {} on the "lost side".
  • When avoiding \intertext, you need to be able to capture (manually) the largest (horizontally) elements on either side of the alignment and transfer it verbatim, using \phantom. The actual setting of other components should use an overlapping technique (\mathrlap or \mathllap, as in my example).
share|improve this answer
add comment

Or rather this:

\begin{align}
y & = \Sigma aaa \\  \nonumber 
& = bbb + ccc \\ \nonumber 
& \quad{}+ ddd + eee \\ \nonumber 
& \quad{}+ fff + ggg
\end{align}

{} is for proper spacing around + sign and \quad and \qquad are standard lengths in math mode.

share|improve this answer
    
How about my effect-1? Please see my edit. Thanks, that is the 2nd line and the rest aligned at plus sign. –  Daniel Jun 7 '13 at 18:14
    
@Daniel In Effect-1 there is improper spacing around = signs and aligning on + signs seems to be incidental. –  Przemysław Scherwentke Jun 7 '13 at 18:21
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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