3

I would like to make something that looks like this:

enter image description here

I don't know how to get the brackets inside the matrix to line up in the right spots. I don't need them to be red; I just added that to emphasize what I want.

Here is what I used to make this (sans red brackets):

\begin{bmatrix} I_p \\ & \ddots \\ && I_p \\ & I_p \\ && \ddots \\ &&& I_p \\ &&& \vdots & \ddots \\ &&& \ddots & \vdots \\ &&&& I_p \\ &&&&& \ddots \\ &&&&&& I_p \end{bmatrix} 

EDIT: See this followup question for the solution I went with.

2 Answers 2

4

Use blkarray

\documentclass{article} \usepackage{blkarray} \begin{document} \[ \left[ \begin{blockarray}{ccccccc} \begin{block}{[ccc]cccc} I_p \\ & \ddots \\ & & I_p \\ \end{block} \begin{block}{c[ccc]ccc} & I_p \\ & & \ddots \\ & & & I_p \\ \end{block} & & & \vdots & \ddots \\ & & & \ddots & \vdots \\ \begin{block}{cccc[ccc]} & & & & I_p \\ & & & & & \ddots \\ & & & & & & I_p \\ \end{block} \end{blockarray} \right] \] \end{document} 

enter image description here

2
  • Pretty good! Do you know how to adjust it so that the spacing at the top and the bottom is more even? That is the only thing I don't like about this solution as it is. Commented Feb 22, 2019 at 18:12
  • I fixed it. See this post. Commented Feb 22, 2019 at 21:22
2

With {NiceArray} of nicematrix.

\documentclass{article} \usepackage{nicematrix} \begin{document} \[ \begin{NiceArray}{ccccccc}[margin] I_p \\ & \ddots \\ & & I_p \\ & I_p \\ & & \ddots \\ & & & I_p \\ & & & \vdots & \ddots \\ & & & \ddots & \vdots \\ & & & & I_p \\ & & & & & \ddots \\ & & & & & & I_p \\ \CodeAfter \SubMatrix[{1-1}{3-3}] \SubMatrix[{4-2}{6-4}] \SubMatrix[{9-5}{11-7}] \SubMatrix[{1-1}{11-7}][extra-height=1mm,xshift=1mm] \end{NiceArray} \] \end{document} 

Output of the above code

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.