# Using arrays to align parallel equations: Why isn't $|z|$ centered?

There was an earlier question about aligning different parts of two parallel equations in a multiple line environment, and I'm trying to adapt Werner's answer that used an array for my own use. Probably the problem is that I don't fully understand the code I should put directly after \begin{array}. Here are my code and the output:

$\begin{array}{c*{2}{@{{}\mathrel{<}{}}l}} 1 & |z| & |k|\inv \\[\jot] |k| & |\phi(z)| & \hphantom{|} 1 \end{array}$ Why isn't the |z| in the top of the array centered? How should I fix that? (I also welcome comments about other aspects of the code, if applicable.)

I think you wanted to write

*{2}{c@{{}\mathrel{<}{}}}l


c*{2}{@{{}\mathrel{<}{}}l}


which means having the last two columns left-aligned.

In fact, the syntax for multiple columns with same alignment is

*{<number of columns>}{<column alignment>}


Also, since the < symbol is defined as \mathrel by default, you can eliminate it:

*{2}{c@{{}<{}}}l


MWE:

\documentclass{article}

\newcommand{\inv}{^{-1}}

\begin{document}

$\begin{array}{*{2}{c@{{}<{}}}l} 1 & |z| & |k|\inv \\[\jot] |k| & |\phi(z)| & \hphantom{|} 1 \end{array}$

\end{document} Moreover note that (citing egreg's comment) "adding a new column without intercolumn space for the exponent and changing the third one to be centered, avoids guessing that the width of k is the same as the width of 1".

That is, the same result can be obtained with the following code:

\documentclass{article}

\newcommand{\inv}{^{-1}}

\begin{document}

$\begin{array}{*{2}{c@{{}<{}}}c@{}l} 1 & |z| & |k| & \inv \\[\jot] |k| & |\phi(z)| & 1 & \end{array}$

\end{document}

• Adding a new column without intercolumn space for the exponent and changing the third one to be centered avoids guessing that the width of k is the same as the width of 1. Jul 27, 2015 at 22:27

May be you are looking for

\documentclass{article}
\def\inv{^{-1}}
\begin{document}
$\begin{array}{c*{2}{@{{}\mathrel{<}{}}c}} 1 & |z| & |k|\inv \\[\jot] |k| & |\phi(z)| & \hphantom{|} 1 \end{array}$
\end{document}


in your original code c*{2}{@{{}\mathrel{<}{}}l} means first column is center and the two last column are left 