Using & in align

This is better realized with an array:

\documentclass{article}
\usepackage{array}

\begin{document}

\[
\setlength{\arraycolsep}{0pt}
\renewcommand{\arraystretch}{1.5}
\begin{array}{c *{3}{ >{{}}c<{{}} c } }
A &> & B &> & C &> & D \\
A &> & \multicolumn{3}{c}{E} &> & D
\end{array}
\]

\end{document}

enter image description here

Seven points of alignment, the even numbered column for the relation symbol, so surrounded by empty subformula in order to produce the correct space. Intercolumn padding is set (locally) to zero.


A variant with alignat and eqmakebox, mimicking the construction of the \vdotswithin command from mathtools: \documentclass{article}

\usepackage{amsmath}
\usepackage{eqparbox}
\begin{document}

\begin{alignat}{3}
 A & > B & & \eqmakebox[A]{$ {}>{} $} C &&> D \\
 A & > & & \eqmakebox[A]{$ E $}& & >D
\end{alignat}

\end{document} 

enter image description here

An explanation on the ampersands usage

The only difference between align and alignat is that the spacing between the columns of aligned equations is chosen by the user in the case of the alignat environment.

For n columns, you have to use 2n – 1 &: from the 2nd one, each & marks the beginning of a new column, the following & marks the alignment point in its column.

Here, I set 3 columns, whence 5&, with no spacing between the columns.


You can use alignat instead of align and then some low level commands to get the centering or you can use the eqnarray package.

alignat

Sample output

\documentclass{article}

\usepackage{amsmath}

\makeatletter
\newcommand{\ccol}[1]{\omit\column@plus\hfill$\m@th\displaystyle #1$\hfill\span}
\makeatother

\begin{document}

\begin{alignat}{2}
 A >{}& B > C &&> D \\
 A >{}&\ccol{E}&>D
\end{alignat}

\end{document}

equationarray

Second sample

\documentclass{article}

\usepackage{eqnarray}

\begin{document}

\arraycolsep 0pt
\begin{equationarray}{rcl}
 A >{}& B > C &{}> D \\
 A >{}&E&{}>D
\end{equationarray}

\end{document}

Tags:

Align