블록 매트릭스용 중괄호

블록 매트릭스용 중괄호

나는 차원의 블록 행렬 S를 가지고 있습니다(Lm+n)\times (L+n)m

행렬

그러나 나는 그것이 독자를 위해 명확한 방식으로 쓰여지지 않았다고 생각합니다. 제안사항이 있나요?

이것은 내가 지금까지 작성한 코드입니다(여기 tex.stackexchange에 있는 몇 가지 답변 덕분에).

\documentclass{article}
\usepackage{amsmath}
     \usepackage{xcolor}
     %%overbrace matrix
     \newcommand\overmat[2]{%
      \makebox[0pt][l]{$\smash{\color{white}\overbrace{\phantom{%
                \begin{matrix}#2\end{matrix}}}^{\text{\color{black}#1}}}$}#2}
        \newcommand\bovermat[2]{%
         \makebox[0pt][l]{$\smash{\overbrace{\phantom{%
                \begin{matrix}#2\end{matrix}}}^{\text{#1}}}$}#2}
          \newcommand\partialphantom{\vphantom{\frac{\partial e_{P,M}} 
          {\partial w_{1,1}}}}

\begin{document}

 \begin{equation}
  S=\left[\phantom{\begin{matrix}a_0\\ b_0\\ \ddots\\b_0 \end{matrix}}
\right.\hspace{-1.5em}
   \begin{matrix}
    \bovermat{$mn$}{M_n & ... & M_1 \ } & \bovermat{$Lm$}{0_{n\times m} & 
       ...& 0_{n\times m}}\\
        a_nI_m & ... & a_1I_m & a_0I_m & ... & 0\\
        \vdots & \ddots & & & \ddots & \vdots \\
        0 & & a_nI_m & ... & ... & a_0I_m
    \end{matrix}
       \hspace{-1.5em}
        \left.\phantom{\begin{matrix}a_0\\ a_0\\ \ddots\\b_0 
           \end{matrix}}\right]\hspace{-1em}
       \begin{tabular}{l}
       $\left.\lefteqn{\phantom{\begin{matrix} a_0 \end{matrix}}}\right\}n$\\
       $\left.\lefteqn{\phantom{\begin{matrix} b_0\\ \ddots\\ b_0\ 
        \end{matrix}}} \right\}Lm$
     \end{tabular}
     \end{equation}
  \end{document}

답변1

개인적으로 나는 이러한 중괄호에 중복된 정보가 포함되어 있으므로 추가하지 않을 것입니다. $0_{n\times m}$ 표기법으로 표시된 것처럼 단일 블록이 고정된 차원을 가지고 있다는 것을 알고 있는 경우 행렬의 차원을 지정하는 것 외에 알아야 할 것은 블록의 개수입니다. 이는 예를 들어 Ti를 사용하여 수행할 수 있습니다.케이Z는 다음과 같습니다:

\documentclass{article}
\usepackage{amsmath}
\usepackage{tikz}
\usetikzlibrary{matrix}
\begin{document}

\begin{equation}
  S=\vcenter{\hbox{% really dotted from https://tex.stackexchange.com/a/52856/121799
  \begin{tikzpicture}[really dotted/.style={dash pattern=on 0.01pt off 4.5pt,
                                         line cap=round},inner xsep=0pt]
  \matrix[matrix of math nodes,left delimiter={[}
  ,right delimiter={]},column 2/.append style={column sep=3em},
  column 5/.append style={column sep=3em}] (mat)
   {
    M_n & & M_1 & 0_{n\times m} &        & 0_{n\times m}\\
        a_nI_m &  & a_1I_m & a_0I_m &  & 0\\
        ~ &  & & &  &  \\[1ex]
        0 & & a_nI_m & 0 &  & a_0I_m\\
    };
    \draw[really dotted,line width=1pt,shorten >=2pt] (mat-1-1) -- (mat-1-3)
    node[midway,above,font=\tiny]{$m$ times}
     (mat-1-4) -- (mat-1-6) node[midway,above,font=\tiny]{$m$ times}
     (mat-2-1) -- (mat-2-3) (mat-2-4) -- (mat-2-6)
     (mat-4-1) -- (mat-4-3) (mat-4-4) -- (mat-4-6);
    \draw[really dotted,line width=1pt,shorten >=2pt] 
    (mat-2-1) -- (mat-4-3) (mat-2-1) -- (mat-4-1)
    (mat-2-3) -- (mat-4-3) (mat-2-4) -- (mat-4-6) (mat-2-4) -- (mat-4-4)
    (mat-2-6) -- (mat-4-6);
    \end{tikzpicture}}}
     \end{equation}
\end{document}

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

답변2

또 다른 대체 옵션은 다음을 사용하는 것입니다.nicematrix패키지. 당신은 항상 매우 훌륭한 사용자 @marmot와 동일한 이미지를 얻지만 여기에는 짧은 코드가 있습니다. 점은 행렬의 요소에서 약간 떨어져 있습니다. 두 이미지를 확대/축소하면 두 이미지의 차이를 확인할 수 있습니다.

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

\documentclass{article}
\usepackage{nicematrix}
\begin{document}
\[S=\left[\begin{NiceArray}{CCCCCC}
M_n & \overset{\scriptstyle m \text{ times}}{\Cdots} & M_1&\!\!\!  0_{n\times m}&\overset{\scriptstyle m \text{ times}}{\Cdots} &0_{n\times m}\\
a_nI_m & \Cdots & a_1I_m&\!\!\!  a_0I_m&\Cdots &  0\\
\Vdots & \Ddots &  \Vdots &\!\!\!     \Vdots        &    \Ddots     & \Vdots\\
0 & \Cdots & a_nI_m        & 0&\Cdots &a_0I_m\\
\end{NiceArray}\right]
\]
\end{document}

답변3

@Sebastiano의 답변 (+1)에 대한 보충 자료로 ... 대신 사용하고 bNiceMatrix다음 을 NiceArray추가 $m$ times합니다 tikzpicture.

\documentclass[margin=3mm, preview]{standalone}
\usepackage{nicematrix}
\usetikzlibrary{quotes} % for labels "m times"

\begin{document}
\[
S = \begin{bNiceMatrix}[columns-width=2em, name=m]
M_n     & \Cdots & M_1     & 0_{n\times m} & \Cdots & 0_{n\times m} \\
a_nI_m  & \Cdots & a_1I_m  & a_0I_m        & \Cdots & a_1I_m        \\
\Vdots  & \Ddots & \Vdots  & \Vdots        & \Ddots & \Vdots        \\
0       & \Cdots & a_nI_m  & 0             & \Cdots & a_0I_m        \\
\end{bNiceMatrix}
\]
\tikz[remember picture,overlay,font=\tiny]
\path   (m-1-1) to ["$m$ times"] (m-1-3)
        (m-1-4) to ["$m$ times"] (m-1-6);
\end{document}

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

메모: 최종 결과를 얻으려면 위에서 컴파일해야 합니다.적어도 두 번.

답변4

최신 버전 nicematrix(3.15, 20/04/06)을 사용하면 Zarko 답변의 더 짧은 버전을 제공할 수 있습니다. 실제로 이 버전에서는 ^및 를 사용하여 점선에 라벨을 붙이는 것이 가능합니다 _.

\documentclass[margin=3mm, preview]{standalone}
\usepackage{nicematrix}

\begin{document}
\[
S = \begin{bNiceMatrix}[columns-width=2em]
M_n     & \Cdots^{m \text{ times}} & M_1     & 0_{n\times m} & \Cdots^{m \text{ times}} & 0_{n\times m} \\
a_nI_m  & \Cdots & a_1I_m  & a_0I_m        & \Cdots & a_1I_m        \\
\Vdots  & \Ddots & \Vdots  & \Vdots        & \Ddots & \Vdots        \\
0       & \Cdots & a_nI_m  & 0             & \Cdots & a_0I_m        \\
\end{bNiceMatrix}
\]
\end{document}

위 코드의 결과

관련 정보