4

I am currently having issues with the display of this equation below.

The code I have inserted is using align but I have also tried using eqnarray, (which has right-alignment but is deprecated), and am now at the point of considering using a table.

The alignment here doesn't appear to do as the documentation says, and when I add extra &'s I can get the format slightly better but not exactly as I want. To be clear, it is the right-alignment of the second column that is giving me most trouble.

Code:

\begin{align*}
&\frac{2^{1+k/2}}{k!} &< 1\\
\Leftrightarrow &2^{1+k/2} &< k!\\
\Leftrightarrow& (\sqrt{2})^k\cdot 2 &< \left(\frac{k}{e}\right)^k \sqrt{2 \pi k}
\end{align*}

What it looks like now:

enter image description here

What I want it to look like:

enter image description here

1 Answers1

5

Following is the appropriate way to have multiple alignments within an align:

enter image description here

\documentclass{article}
\usepackage{amsmath}% http://ctan.org/pkg/amsmath
\begin{document}
% Original
\begin{align*}
 & \frac{2^{1+k/2}}{k!} & < 1\\
\Leftrightarrow & 2^{1+k/2} & < k!\\
\Leftrightarrow & (\sqrt{2})^k\cdot 2 & < \left(\frac{k}{e}\right)^k \sqrt{2 \pi k}
\end{align*}
% Correct
\begin{align*}
 && \frac{2^{1+k/2}}{k!} & < 1\\
\Leftrightarrow && 2^{1+k/2} & < k!\\
\Leftrightarrow && (\sqrt{2})^k\cdot 2 & < \left(\frac{k}{e}\right)^k \sqrt{2 \pi k}
\end{align*}
\end{document}

As reference for multiple points within align, see the amsmath user guide (section 3.6 Equation groups with mutual alignment, p 6-7). There's also other align-related environments that would yield this output, including alignat.

Regarding your venture to other environments, perhaps \eqnarray vs \align is of interest.

Werner
  • 603,163
  • Great info, thanks very much for this as well as editing my original post –  Feb 04 '13 at 19:26