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

I am building a big matrix within the which I have block matrices, which I want to indicate by boxes. My current state looks like this:

 $$\begin{matrix} \framebox[3.\width]{J}& \begin{matrix} 0&0&\\0&0&\end{matrix}&\\
    \begin{matrix} 0&0&\\0&0&\end{matrix}& \framebox[3.\width]{J}&\end{matrix}$$

but this makes the frameboxes aligned to the right. I want them centered in their matrix-cell.

How can I solve this?

share|improve this question
Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format. It would be very helpful if you could provide a complete minimum working example beginning with \documentclass and ending with \end{document} – darthbith May 10 '14 at 12:50
Why don't you just write J&0\\0&J? – percusse May 10 '14 at 12:50
I want to insert the full 0-matrices to make clear, that J is 2x2 – Hagadol May 10 '14 at 12:52
You can say so via J_{2\times 2} – percusse May 10 '14 at 13:07
up vote 5 down vote accepted

The columns are centred, but each of your 'inner' matrices has an empty column, generated by a spurious & at the end of the row. Delete these, and the problem goes away.

\framebox[3.\width]{J} &
0 & 0  \\
0 & 0
& \\
0 & 0 \\
0 & 0
& \framebox[3.\width]{J} &


share|improve this answer

Your Answer


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.