TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
up vote 7 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
2  
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.