2x2 행렬을 5x5 행렬에 삽입

2x2 행렬을 5x5 행렬에 삽입

5x5 행렬의 4번째와 5번째 행, 4번째와 5번째 열에 2x2 행렬을 균등하게 삽입해야 합니다. 내 코드를 조정해야 합니다.

\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*}

답변1

아니면 nicematrix. 추가 패키지가 필요합니다. (이 패키지는 다른 항목, 특히 Ti를 로드합니다.케이Z) 그러나 열 사이의 간격은 수정되지 않으며 모양의 모든 측면을 완전히 제어할 수 있습니다.

\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}

여기에 이미지 설명을 입력하세요

답변2

bmatrix2x2 행렬 대신에 matrix. 하지만 이는 개인 취향일 뿐이므로 문제 없이 교환할 수 있습니다.

\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}

결과 matrix:

행렬

결과 bmatrix:

b매트릭스

답변3

다음을 갖춘 솔루션 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} 

여기에 이미지 설명을 입력하세요

관련 정보