3

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?

4
  • 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
    Commented May 10, 2014 at 12:50
  • Why don't you just write J&0\\0&J?
    – percusse
    Commented May 10, 2014 at 12:50
  • I want to insert the full 0-matrices to make clear, that J is 2x2
    – Hagadol
    Commented May 10, 2014 at 12:52
  • You can say so via J_{2\times 2}
    – percusse
    Commented May 10, 2014 at 13:07

1 Answer 1

5

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.

\documentclass{article}
\usepackage{mathtools}
\begin{document}
\[
\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}
\]
\end{document}

matrix

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .