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!

2

1 Answer 1

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

1
  • Thank you! <3 Will upvote once I have 15 reputation points. Dec 16, 2022 at 9:33

You must log in to answer this question.

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