2

Block diagonal matrix

The code:

$$[T]_{\beta}=\begin{bmatrix}
c_{1}&&\\
        &\ddots& \\
          &&c_{1}
\end{bmatrix}
$$

I am trying with this code but ended up having a normal diagonal matrix. I want a block diagonal matrix that is drawn in the picture. A block diagonal matrix is a matrix whose diagonal entries consist of small n-order matrix. This is actually what the matrix should look like this but I have no idea how to do it. I attached the code here and I will attach my file screenshot.

enter image description here

There is no error in my code but the problem is I have no idea to make this type of matrix. I saw many examples online and in tex exchange but they are not useful for me.

Stephen
  • 3,826
RIPAN DAS
  • 85
  • 5
  • Welcome to TEX.SE! Please show us the complete compilable TeX code you have tried so far ... – Mensch May 29 '23 at 18:08
  • Actually I am writing in miktex and I mentioned above what I able to write so far. – RIPAN DAS May 29 '23 at 18:13
  • Maybe you could get some ideas here: https://tex.stackexchange.com/q/585487 – barbara beeton May 29 '23 at 18:48
  • And I don't know what is the problem with stack exchange that it closes all my problems by saying it need for clarity. I put enough details in my question. Please someone clarify this also. I saw many questions in SE that doesn't have much details. What is the problem with me. – RIPAN DAS May 30 '23 at 13:54
  • Here's a clarity check for you: 1) Copy your posted code into a new .tex file. 2) Compile it. 3) Add missing parts, until it compiles. 4) Make sure, it still shows your problem. 5) Post that one instead. Comparing with your current code should make the "clarity" request self-evident. – MS-SPO May 30 '23 at 15:24
  • No I already done it few times. I am not getting what i want – RIPAN DAS May 31 '23 at 06:16
  • @RIPANDAS, please do yourself a favor: a) isolate the relevant part of your code about the diagonal matrix, b) save it as a new .tex file, c) add what's missing to compile, d) make sure it still shows your attempt and struggle, e) post it. This will most likely lift the closed-status. // Also I suggest to make use of this sites search capabilities: a) RELATED Links (to the right), b) search field (top), c) tags (left) – MS-SPO Jul 26 '23 at 08:18
  • Thanks for updating. Kindly consider my comments 2 comments up: https://tex.stackexchange.com/questions/687117/latex-command-for-block-diagonal-matrix#comment1705042_687117 . // It doesn't compile, so the question remains closed to me. – MS-SPO Jul 26 '23 at 08:42
  • Off-topic: You should not use $$…$$ in LaTeX. Use either \[…\] or another math environment for displayed math, e.g., using package amsmath. – cabohah Jul 26 '23 at 09:45

2 Answers2

2

With {bNiceMatrix} of nicematrix.

\documentclass{article}
\usepackage{nicematrix}

\setcounter{MaxMatrixCols}{20}

\begin{document}

\setlength{\arraycolsep}{4pt}

$\begin{bNiceMatrix}[margin] \Block[borders={bottom,right}]{4-4}{} c_1\ &c_1\ & &\Ddots\ & & &c_1&\Block[l]{1-4}{\scriptstyle d_1\times d_1}\ & & & &\Block[draw]{4-4}{} c_2\ & & & & &c_2\ & & & & & &\Ddots\ & & & & & & &c_2&\Block[l]{1-4}{\scriptstyle d_2\times d_2}\\ & & & & & & & &\ddots\ & & & & & & & & &\Block[draw]{4-4}{} c_n\ & & & & & & & & & &c_n\ & & & & & & & & & & &\Ddots\ & & & & & & & & & & & &c_n&\scriptstyle d_n\times d_n \ \end{bNiceMatrix}$

\end{document}

Output of the above code

F. Pantigny
  • 40,250
0

Something like this?

enter image description here

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\[
\begin{pmatrix}
c_{11} \\
& \ddots \\
& & c_{nn}
\end{pmatrix}
\]
\end{document}
Mico
  • 506,678