Do you have any suggestion how to make such formula? Or maybe I need to draw them somehow?
Big thanks for any hints!
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It only takes a minute to sign up.
Sign up to join this communityDo you have any suggestion how to make such formula? Or maybe I need to draw them somehow?
Big thanks for any hints!
I suggest using nicematrix
.
\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]