# Centering item along several nodes in bmatrix

How can I position X exactly in the middle of space between a and d column?

\documentclass{article}
\usepackage{amsmath}
\begin{document}
$\begin{bmatrix} a & b & c & d & e \\ a & b & c & d & e \\ & & X & & e \end{bmatrix}$
\end{document}

-

bmatrix uses a normal array internally so:

\documentclass{article}
\usepackage{amsmath}
\begin{document}
$\begin{bmatrix} a & b & c & d & e \\ a & b & c & d & e \\ &\multicolumn{2}{c}{X} & & e \end{bmatrix}$
\end{document}


As noted in the comments \multicolumn{4}{c}{X} & e is another possibility, depending on where exactly you want to centre. This image shows the two versions with a modified matrix making the columns widths of a and d more distinct.

-
The last row may be also \multicolumn{4}{c}{X} & e – egreg Mar 14 '12 at 21:21
Yes it's hard to see the difference in this example, but if a and d columns are different widths, my version centers on the inner edges, whereas @egreg's centers on the outer edges, so taking the widths of the a and d column into account. Take your pick:-) – David Carlisle Mar 14 '12 at 21:24