
Preciso inserir uma matriz 2x2 uniformemente na 4ª e 5ª linhas e nas 4ª e 5ª colunas de uma matriz 5x5. Meu código precisa de ajustes.
\begin{equation*}
a_1=
\begin{bmatrix}
1 & 0 & 0 & 0 & 0\\
0 & 0 & 0 & 0 & 0\\
0 & 0 & 0 & 0 & 0\\
0 & 0 & 0 & & {\begin{bmatrix} & b & \end{bmatrix}}\\
0 & 0 & 0 &
\end{bmatrix}
\end{equation*}
Responder1
Ou talvez com nicematrix
. Requer um pacote extra (que por sua vez carrega outras coisas, principalmente TikZ), mas o espaçamento entre as colunas não é modificado e você tem controle total sobre todos os aspectos da aparência.
\documentclass{article}
\usepackage{amsmath}
\usepackage{nicematrix}
\begin{document}
\begin{equation*}
a_1=\begin{bNiceMatrix}[name=mymatrix]
1 & 0 & 0 & 0 & 0\\
0 & 0 & 0 & 0 & 0\\
0 & 0 & 0 & 0 & 0\\
0 & 0 & 0 & \phantom{0} & \phantom{0}\\
0 & 0 & 0 & \phantom{0} & \phantom{0}
\end{bNiceMatrix}
\begin{tikzpicture}[remember picture,overlay]
\node[fit=(mymatrix-4-4)(mymatrix-5-5),inner sep=-0.2ex,text height=1.2em] (f){$b$};
\draw[thick] ([xshift=0.5ex]f.south west)-| (f.north west) -- ++ (0.5ex,0)
([xshift=-0.5ex]f.south east)-| (f.north east) -- ++ (-0.5ex,0);
\end{tikzpicture}
\end{equation*}
\end{document}
Responder2
Em vez bmatrix
da matriz 2x2 que usei matrix
. Mas é apenas uma preferência pessoal e pode ser trocada sem problemas.
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{equation*}
a_1=
\begin{bmatrix}
\begin{matrix}
1 & 0 & 0\\
0 & 0 & 0 \\
0 & 0 & 0
\end{matrix} &
\begin{matrix}
0 & 0\\
0 & 0 \\
0 & 0
\end{matrix}\\
\begin{matrix}
0 & 0 & 0\\
0 & 0 & 0
\end{matrix} &
\begin{matrix} & b & \end{matrix}\\
\end{bmatrix}
\end{equation*}
\end{document}
Resultado com matrix
:
Resultado com bmatrix
:
Responder3
Uma solução com blkarray
:
\documentclass{article}
\usepackage{multirow}
\usepackage{blkarray, bigstrut}
\usepackage{amsmath}
\begin{document}
\begin{equation*}
a_1=
\left[
\begin{blockarray}{@{\,}ccccc@{\:}}
\bigstrut[t]
1 & 0 & 0 & 0 & 0 & \\
0 & 0 & 0 & 0 & 0 & \\
0 & 0 & 0 & 0 & 0 & \\
\begin{block}{@{\,}ccc[\BAmulticolumn{2}{!{}c!{}}@{\:}]}
0 & 0 & 0 & \multirow{2}{*}{b}\\
0 & 0 & 0 & \\
\end{block}
\BAnoalign{\vskip -7ex}
\end{blockarray}\right]
\end{equation*}
\end{document}