Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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}
share|improve this question

1 Answer 1

up vote 6 down vote accepted

enter image description here

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.

enter image description here

share|improve this answer
1  
The last row may be also \multicolumn{4}{c}{X} & e –  egreg Mar 14 '12 at 21:21
2  
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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.