[Tex/LaTex] Align two inequalities

equationshorizontal alignmentmath-mode

I am trying to align two inequlities vertically. The \le signs should have the same horizontal positions and the term in the should be centered. My first attempt:

\sum a &\le \sum b &\le \sum c \\
\log \sum a &\le \log \sum b &\le \log \sum c

Doesn't work. My second attempt:

\sum a &\le& \sum b &\le& \sum c \\
\log \sum a &\le& \log \sum b &\le& \log \sum c

The alignment is good, but the sum signs are smaller than in the align environment.

What is the "best" way to do this LaTeX?

Best Answer

alignat is your friend:

\sum a &\le &\sum b &\le \sum c \\
\log \sum a &\le{} &\log \sum b &\le \log \sum c


alt text

I needed to add two extra alignment characters between the columns, and a {} to make the \le a binary operator. The number of &'s should be 2n-1 where n is the argument given (2 in the case above).

Although now that I read the question again I realize I didn't answer it. It seems that you want the \sum term to be centered...

The only way I can think of doing it is a bit ugly:

\settowidth{\yuckkyhack}{$\displaystyle\log \sum b$}
\sum a &{}\le{} &\makebox[\yuckkyhack]{$\displaystyle\sum b$} {}&\le \sum c \\
\log \sum a &\le{} &\log \sum b &\le \log \sum c

which gives the desired result (I think):

alt text

but requires manual selection of the largest bit of text, and use of a length...any ideas for improvement?

Related Question