3

Does anyone know how I could write this block matrix with a LaTeX code ? For now, this is a figure I did on photoshop... And I would like it to be an equation to have a better resolution.

enter image description here

2

2 Answers 2

4
\documentclass{article}
\usepackage{amsmath}
\usepackage{tikz}

\newcommand{\mymatrix}{
    \left(\begin{gathered}
    \tikzpicture[every node/.style={anchor=south west}]
        \node[minimum width=2cm,minimum height=.6cm] at (0,0) {$C_2$};
        \node[minimum width=2cm,minimum height=.6cm] at (0,.6) {$B_2$};
        \node[minimum width=4cm,minimum height=1.2cm] at (2,0) {$M_{3,7}^{[1,2]}$};
        \node[minimum width=1.5cm,minimum height=1.2cm] at (0,1.2) {$A_4$};
        \node[minimum width=4.5cm,minimum height=1.2cm] at (1.5,1.2) {$M_{3,7}^{[1]}$};
        \draw[dashed] (0,1.2) -- (6,1.2);
        \draw[dashed] (0,0.6) -- (2,0.6);
        \draw[dashed] (2,0) -- (2,1.2);
        \draw[dashed] (1.5,1.2) -- (1.5,2.4);
    \endtikzpicture
    \end{gathered}\right)
}

\begin{document}
    \[ M_{3,9} = \mymatrix \]
\end{document}

enter image description here

0
1

Here is a solution with {pNiceArray} of nicematrix.

\documentclass{article}
\usepackage{nicematrix}
\usepackage{tikz}

\begin{document}

\NiceMatrixOptions
  {
    custom-line = 
     {
       letter = : , 
       command = hdashedline , 
       tikz = dashed , 
     }
  }

\renewcommand{\arraystretch}{1.3}

$M_{3,9} = \begin{pNiceArray}{ccc:c:ccccc}[columns-width = 3mm]
\Block{3-3}{A_4} & & & \Block{3-5}{M_{3,7}^{[1]}} & & & & \\
\\
\\
\hdashedline
\Block{1-4}{B_2} & & & & \Block{2-4}{M_{3,7}^{[1,2]}} \\
\hdashedline
\Block{1-4}{C_2} \\
\end{pNiceArray}$

\end{document}

You need several compilations (because nicematrix uses PGF/Tikz nodes under the hood).

Output of the above code

You must log in to answer this question.

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