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?

  • 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
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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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