0

I am struggling to create the matrix in the picture attached using Latex. I have tried using commands like \hline but the matrix ends up looking messy as the line goes all the way across.

Edit: To clarify, I am looking for each block to have a square outline.

A matrix with 2x2 blocks in its diagonal up to a certain point where, there after, there is only zeros. All the blank space in the matrix is just zeroes.

  • Welcome. Please add a minimal working example (MWE) and see the TeX.SX starter guide when asking a question. So that people have a starting point. – BambOo Apr 15 '18 at 15:33
  • Use TikZ's \matrix: each entry is itself a node, so it is possible to draw (A-1-1.north west)rectangle(A-2-2.south eaast). – Symbol 1 Apr 15 '18 at 16:01
3

Is this like you want?

\documentclass{article}
\usepackage{amsmath, bigstrut}

\begin{document}

\[ \setlength{\fboxsep}{0pt}%\setlength{\arraycolsep}{0pt}
\left(\begin{array}{@{}c@{}c@{}c@{\mkern-5mu}c@{\,}cc*{2}{@{\;}c}@{}}%
\noalign{\vskip 1.5ex}
  \fbox{\,$\begin{matrix}
  0 & 1 \\
-1 & 0
  \end{matrix}$\,}
 \\[-0.4pt]
  & \hskip-0.4pt\fbox{\,$\begin{matrix}
  0 & 1 \\
 -1 & 0
  \end{matrix}$\,}\\[-0.5ex]
   & & \;\ddots \\[-2.2ex]
   & & & \;\ddots \\[-0.5ex]
   & & & & \fbox{\,$\begin{matrix}
  0 & 1 \\
 -1 & 0
  \end{matrix}$\,}\\
 & & & & &0 \\[-1.5ex]
 & & & & & & \ddots \\[-1ex]
 & & & & & & & 0 \bigstrut[b]
\end{array}\right)
\]

\end{document} 

enter image description here

Edit: or even this variant:

\[ \setlength{\fboxsep}{0pt}%\setlength{\arraycolsep}{0pt}
\left(\begin{array}{@{}c@{}l@{}c@{\mkern-5mu}c@{\,}rc*{2}{@{\;}c}@{}}%
\noalign{\vskip 1.5ex}
  \fbox{\,$\begin{matrix}
  0 & 1 \\
-1 & 0
  \end{matrix}$\,}
 \\[-0.4pt]
  & \hskip-0.4pt\fbox{\,$\begin{matrix}
  0 & 1 \\
 -1 & 0 
  \end{matrix}$\,} & & & \text{\LARGE 0} \\[-0.5ex]
   & & \;\ddots \\[-2.2ex]
   & & & \;\ddots \\[-0.5ex]
   &\text{\LARGE 0} & & & \fbox{\,$\begin{matrix}
  0 & 1 \\
 -1 & 0
  \end{matrix}$\,}\\
 && & & &0 \\[-1.5ex]
 & & & & & & \ddots \\[-1ex]
 & & & & & & & 0 \bigstrut[b]
\end{array}\right)
\]

enter image description here

0

Do you need something like this only, or do you also want the box around the blocks ?

\documentclass{article}
\usepackage{amsmath}
\begin{document}

\begin{equation}
\begin{bmatrix}
0  & 1  & &  & & & & &\\
-1 & 0 & &  & & & & &\\
   &   & 0  & 1 & &  & & & \\
   &   & -1 & 0 & &  & & &  \\
   &   &  &  & \ddots &  & &   \\
   &   &  &  &   & 0  & 1 & & &   \\
   &  & &  &   & -1 & 0 & & & \\
   &  & &  &   &  &  & 0 & & \\
   &  & &  &   &  &  & & \ddots & \\
   &  & &  &   &  &  & & & 0\\
\end{bmatrix}
\end{equation}

\end{document}

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.