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.

Consider the following result with 2 methods. Don't hesitate to propose better ones if any.

enter image description here

The question is: What is the correct way to properly align a split equation in which binary operator appears at the beginning of the continued parts?

\documentclass[preview,border=12pt]{standalone}
\usepackage{mathtools}
\begin{document}
\section*{quad}
\[
\begin{split}
\text{LHS} 
&= c + d\\
&\quad +e +f +g
\end{split}
\]

\section*{phantom}
\[
\begin{split}
\text{LHS} 
&= c + d\\
&\hphantom{{}=} +e +f +g
\end{split}
\]
\end{document}
share|improve this question
1  
The first thing I would think is: is there a proper alignment? (Not talking about how to align, but rather the point of alignment.) I don't think so. Unlike manye equations where you can easily think that aligning at the = is right, here you can align at many different (and no so defined) points. –  Manuel Jun 19 at 22:02
1  
The only rule I know says that you shouldn't align with the left side of the equal sign (tex.stackexchange.com/a/172110). So Manuel is right. There could be many points. I also use your style (vert. aligned right side of the =) and therefore would tend to the second version. This version yields a perfect alignment. Can't imagine that \quad always will. –  LaRiFaRi Jun 19 at 22:33
1  
agreed that there's no definitive rule for such alignment. knuth uses \qquad after the alignment point for a continued formula (texbook, page 195). mathematics into type shows several possibilities, including those already mentioned (pages 46ff.). –  barbara beeton Jun 20 at 13:50

1 Answer 1

up vote 2 down vote accepted

I prefer one of these 3 variants, that use the amsmath environments (the second one, not very convincing here, might be of interest for longer formulae):

\documentclass[preview,border=12pt]{standalone}
\usepackage{mathtools}

\begin{document}

\section*{variant 1:}
\begin{align*}
\text{LHS} &= \begin{aligned}[t]
c & + d\\
& +e + f +g
\end{aligned}
\end{align*}

\section*{variant 2:}
\begin{align*}
\text{LHS} & = \begin{multlined}[t]
c + d\\
+e +f +g
\end{multlined}
\end{align*}

\section*{variant 3:}
\begin{alignat*}{2}
 & \text{LHS} & {} = c & + d \\
  & & &+ e + f +g
\end{alignat*}

\end{document} 

enter image description here

share|improve this answer
    
In the third one you ar missing a {}. And in the two others I would add \! before the …ed environment. –  Manuel Jun 19 at 22:03
    
Thanks, Manuel! You're right, I didn't check enough. Modified the answer. The funny point is that in another (not totally satisfactory) variant, I did have to add a {} in front of a binary operator… –  Bernard Jun 19 at 22:13
    
The code is not synced with the output image, I think. –  stalking is prohibited Jun 19 at 22:49
    
You're right. I thought I had loaded the new output image, but I didn't for some reason (probably forgot to validate my upload°). Now it's sync'ed. –  Bernard Jun 19 at 22:54
    
Right, thanks. I think now it's OK. –  Bernard Jun 19 at 23:21

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.