0

I have this matrix, where the red cells are the column and row names, respectively

enter image description here

as you can see the first row are just parameters, but then I use Identity matrices (I), zero vectors and matrices (0).

How can I put the signs (a huge I, or a huge 0, with their dimensions) in a matrix? Note that column and row names are not needed.

I tried the \usepackage{nicematrix} but couldn't make it.

Thanks in advance!

1 Answer 1

3

The nicematrix command you need is \Block. The usage is

\Block{r-c}<optional styles>{content}

r and c are the number of rows and columns in the block. <Large> is used in the code below as optional style. You could change to LARGE, Huge, etc.

Notes:

  • You must compile twice.
  • You must have empty cells to accommodate the space taken by \Block.
  • Since your matrix has more than 10 columns, you need \setcounter{MaxMatrixCols}{12}.

enter image description here

\documentclass{article}

\usepackage{nicematrix}
\setcounter{MaxMatrixCols}{12}

\begin{document}

\[
\begin{NiceMatrix}[hvlines,rules/color=gray!50]
\phi_1 & \phi_2 & \phi_3 & \cdots & \phi_{p-1} & \phi_p & \theta_1 & \theta_1 & \theta_1 & \cdots & \theta_{q-1} & \theta_q\\
\Block{5-5}<\Large>{I_{(p-1)\times(p-1)}} & & & & & \Block{5-1}<\Large>{0_{(p-1)\times 1}} & \Block{5-5}<\Large>{0_{(p-1)\times(q-1)}} & & & & & \Block{5-1}<\Large>{0_{(p-1)\times 1}}\\
 & \\
 & \\
 & \\
 & \\
\Block{1-12}<\Large>{0_{1\times(p+q)}}\\
\Block{4-5}<\Large>{0_{q\times(p-1)}} & & & & & \Block{4-1}<\Large>{0_{q\times 1}} & \Block{4-5}<\Large>{I_{q\times(q-1)}} & & & & & \Block{4-1}<\Large>{0_{q\times 1}}\\
 & \\
 & \\
 & 
\end{NiceMatrix}
\]

\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .