How to fix this block matrix so that it can have same spacing between its columns

\begin{document}

$\left( \begin{array}{ccccccccc} & & & & -1 & -1 & \dots & \dots & -1 \\ &&& & 0 & 0 & \dots & \dots & 0 \\ & \text{\huge{\Gamma(\mathbb{Z}_n)+nI}} &&& \ldots&\ldots & \dotso & \dotso &\dots \\ &&& & \ldots&\ldots & \dotso & \dotso &\dots \\ & & & & 0 & 0 & \dots & \dots & 0 \\ -1&0 \dotso & \dots & 0& & & & \\ -1 &0 \dots & \dots & 0& & & & \\ \dotso &\dotso & \dotso & \dotso & & &\text{\huge{I}} \\ \dotso &\dotso & \dotso & \dotso & & \\ -1 &0 & \dotso & 0& & & & \end{array} \right)$

\end{document}


The output I am getting is

There is a lot of gap coming between the 1st and the 2nd column in the left block. There is a lot of gap between $-1$ and $0$ in the lower end of the left side of the matrix.

It can be seen that the matrix is not formatted properly. Is there any way I can fix this?

I will be grateful if someone can fix this for me.

Use nicematrix.

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

$\begin{pNiceArray}{w{c}{1em}w{c}{1em}w{c}{1em}w{c}{1em}w{c}{1em}w{c}{1em}w{c}{1em}w{c}{1em}w{c}{1em}} \Block{5-4}<\Large>{~\Gamma(\mathbb{Z}_n)+nI}& & & & -1 & -1 & \Cdots & \Cdots & -1 \\ &&& & 0 & 0 & \Cdots & \Cdots & 0 \\ & &&& \Vdots&\Vdots & \Ddots & & \Vdots\\ & &&& \Vdots&\Vdots & &\Ddots & \Vdots\\ & & & & 0 & 0 & \Cdots & \Cdots & 0 \\ -1&0 & \Cdots & \Cdots & 0& \Block{5-4}<\Large>{I}& & \\ -1 &0 & \Cdots & \Cdots & 0& & & \\ \Vdots&\Vdots & \Ddots & & \Vdots& & \\ \Vdots&\Vdots & & \Ddots & \Vdots & \\ -1 &0 & \Cdots & \Cdots&0 & & & \end{pNiceArray}$

\end{document}


ADDENDUM: Per request no package beyond amsfonts which you seem to be loading.

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

$\left( \begin{array}{cccccccccc} & & && & -1 & -1 & \dots & \dots & -1 \\ &&& && 0 & 0 & \dots & \dots & 0 \\ & & \text{\makebox[0pt]{\large{\Gamma(\mathbb{Z}_n)+nI}}} &&& \ldots&\ldots & \dotso & \dotso &\dots \\ &&& & & \ldots&\ldots & \dotso & \dotso &\dots \\ & & & && 0 & 0 & \dots & \dots & 0 \\ -1&0 & \dotso & \dots & 0& & & & \\ -1 &0 & \dots & \dots & 0& & & & \\ \dotso &\dotso & \dotso & \dotso & & & & \text{\makebox[0pt]{\large\huge{I}}} \\ \dotso &\dotso & \dotso & \dotso & & \\ -1 &0 & \dotso & 0& 0 & & & \end{array} \right)$
\end{document}


Or

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

$\left( \begin{array}{ccc@{}ccccc@{}cc} & & && & -1 & -1 & \cdots & \cdots & -1 \\ &&& && 0 & 0 & \cdots & \cdots & 0 \\ & & \text{\makebox[0pt]{\large{\Gamma(\mathbb{Z}_n)+nI}}} &&& \vdots&\vdots & \ddots\,\, & &\vdots \\[-1ex] &&& & & \vdots&\vdots & & \,\,\ddots &\vdots \\ & & & && 0 & 0 & \cdots & \cdots & 0 \\ -1&0 & \dotso & \dots & 0& & & & \\ -1 &0 & \cdots & \cdots & 0& & & & \\ \vdots &\vdots & \ddots\,\, & & \vdots & & & \text{\makebox[0pt]{\large\huge{I}}} \\[-1ex] \vdots &\vdots & & \,\,\ddots & \vdots & & \\ -1 &0 & \cdots & \cdots& 0 & & & \end{array} \right)$
\end{document}


• Thanks a lot but do you know how to do these things without any package such as 'nicematrix" , – Math_Freak Apr 12 at 6:59
• @Math_Freak If you post an MWE which indicates which packages you are using, and specify which you do not like, one can do that. Otherwise it is hard. I do not know if "package such as nicematrix" also includes amsmath, obviously you are loading amsfonts but how would one know which packages you do not use if you do not post a complete example? – user194703 Apr 12 at 7:03
• I understand your point. thanks a lot Sir, one more question , can you just specify what I was doing wrong in my question and what did you do specifically to fix that – Math_Freak Apr 12 at 7:14
• What is the use of \mbox ? I was just trying to understand the use of each command in Latex and thats why asking you, I hope I am not disturbing , I am just learning LaTeX , so I am not so efficient , sorry for asking questions – Math_Freak Apr 12 at 7:15
• @Math_Freak \mbox is mostly obsolete, use \text. You should write a code in the question which starts with \documentclass and loads all necessary packages, and should be compilable. And if you decide for yourself that you only want to use very basic packages, that's perfectly fine, but please add this information to the question. – user194703 Apr 12 at 7:22

Use 1) \hidewidth large text\hidewidth, 2) \quad after \left(, 3) \phantom+ before some zeros:

$$\left(\quad \def\+{\phantom+} \begin{array}{ccccccccc} & & & & -1 & -1 & \dots & \dots & -1 \\ &&& & \+0 & \+0 & \dots & \dots & \+0 \\ & \hidewidth\text{\huge{\Gamma(\mathbb{Z}_n)+nI}}\hidewidth &&& \ldots&\ldots & \dotso & \dotso &\dots \\ &&& & \ldots&\ldots & \dotso & \dotso &\dots \\ & & & & \+0 & \+0 & \dots & \dots & \+0 \\ -1&0 \dotso & \dots & 0& & & & \\ -1 &0 \dots & \dots & 0& & & & \\ \dotso &\dotso & \dotso & \dotso & & &\text{\huge{I}} \\ \dotso &\dotso & \dotso & \dotso & & \\ -1 &0 & \dotso & 0& & & & \end{array} \right)$$

• Thanks a lot Sir.Can you please explain what you did which fixed the work? I just wanted to know how to fix these things on my own so that I dont have to post such questions here again? – Math_Freak Apr 12 at 6:58
• I explained it. Se my answer 1), 2), 3). The 1) is main idea of solving this problem: \hidewidth is negative space which allows to protrude the text over the column boundaries. – wipet Apr 12 at 7:03
• Yes , but I dont understand the use of \phantom, \quad – Math_Freak Apr 12 at 7:11
• I am new to LaTeX, so sorry for asking questions, hope you dont mind – Math_Freak Apr 12 at 7:17
• \quad inserts a space equal to font size. You can try to remove it and you can see what happens: the \hidewidth causes that the text laps to the left bracket. And \phantom creates a space equal to the size of the text. You can remove the \+ and you can see what happens: -1 above 0 are centered, but it does not look so pretty. – wipet Apr 12 at 7:38