2

Two matrices with additional info marked on them

Do you have any suggestion how to make such formula? Or maybe I need to draw them somehow?

Big thanks for any hints!

1 Answers1

5

I suggest using nicematrix.

enter image description here

\documentclass{article}

\usepackage{nicematrix, tikz}

\begin{document}

[ \begin{pNiceArray}{rrrrr}[first-row] \downarrow && \downarrow && \downarrow\ 1 & 3 & 3 & 2 & 1\ 2 & 6 & 9 & 5 & 2\ -1 & -3 & 3 & 0 & 1\ 3 & 9 & 6 & 5 & 2 \end{pNiceArray} \sim \begin{pNiceArray}{rrrrr}[first-row] \downarrow && \downarrow && \downarrow\ 1 & 3 & 3 & 2 & 1\ 0 & 0 & 3 & 1 & 0\ 0 & 0 & 0 & 0 & 2\ 0 & 0 & 0 & 0 & 0 \CodeAfter \tikz \draw (2-|1)--(2-|3)--(3-|3)--(3-|5)--(4-|5)--(4-|6); \end{pNiceArray} ]

\end{document}

If you want to tighten up the spacing in the first matrix, you can change the first line to \begin{pNiceArray}{@{\,}r@{\;}rrrr}[first-row]

enter image description here

Sandy G
  • 42,558