Elementos da margem direita NiceMatrix

Elementos da margem direita NiceMatrix

Tenho lutado para descobrir o que há de errado com meu código. Atualmente tenho uma matriz com algumas cores e na margem gostaria de setas. No momento estou com isso

\documentclass{article}
\usepackage{graphicx}
\usepackage{amsmath,amsfonts,amssymb,amsthm}
\usepackage{xcolor}
\usepackage{mathtools}
\usepackage{nicematrix}
\usepackage{array}
\usepackage{tikz}
\usetikzlibrary{arrows,matrix,positioning,fit, decorations.pathreplacing}
\setcounter{MaxMatrixCols}{20}
\usepackage[left=1in,top=1in,right=1in,bottom=1in,nohead,paperwidth=8.5in, paperheight=11in]{geometry}

\begin{document}

\begin{figure}
    \centering
\[
\NiceMatrixOptions{xdots={horizontal-labels,line-style = <->}}
\setlength\arraycolsep{6pt}
\begin{pNiceMatrix}%
[   margin,
    last-col,
  ]
\Block[fill=red!15,rounded-corners]{2-12}{} a_{1,1} & a_{1,2} & a_{1,3} & a_{1,4} & a_{1,4} & a_{1,4} & a_{1,4} & a_{1,4} & a_{1,9} & a_{1,10} & a_{1,11} & a_{1,12} & \\
 a_{2,1} & a_{1,4} & a_{1,4} & a_{1,4} & a_{1,4} & a_{1,4} & a_{1,4} & a_{1,4} & a_{1,4} & a_{1,10} & a_{1,11} & a_{1,12} & \\
 a_{2,1} & a_{1,4} & a_{1,4} & a_{1,4} & a_{1,4} & a_{1,4} & a_{1,4} & a_{1,4} & a_{1,4} & a_{1,10} & a_{1,11} & a_{1,12} & \\
\Block[fill=blue!15,rounded-corners]{2-12}{} a_{1,1} & a_{1,2} & a_{1,3} & a_{1,4} & a_{1,4} & a_{1,4} & a_{1,4} & a_{1,4} & a_{1,9} & a_{1,10} & a_{1,11} & a_{1,12} & \\
 a_{2,1} & a_{1,4} & a_{1,4} & a_{1,4} & a_{1,4} & a_{1,4} & a_{1,4} & a_{1,4} & a_{1,4} & a_{1,10} & a_{1,11} & a_{1,12} & \\
 a_{2,1} & a_{1,4} & a_{1,4} & a_{1,4} & a_{1,4} & a_{1,4} & a_{1,4} & a_{1,4} & a_{1,4} & a_{1,10} & a_{1,11} & a_{1,12} & \\
\Block[fill=green!15,rounded-corners]{2-12}{} a_{1,1} & a_{1,2} & a_{1,3} & a_{1,4} & a_{1,4} & a_{1,4} & a_{1,4} & a_{1,4} & a_{1,9} & a_{1,10} & a_{1,11} & a_{1,12} & \\
 a_{2,1} & a_{1,4} & a_{1,4} & a_{1,4} & a_{1,4} & a_{1,4} & a_{1,4} & a_{1,4} & a_{1,4} & a_{1,10} & a_{1,11} & a_{1,12} & \\
 a_{2,1} & a_{1,4} & a_{1,4} & a_{1,4} & a_{1,4} & a_{1,4} & a_{1,4} & a_{1,4} & a_{1,4} & a_{1,10} & a_{1,11} & a_{1,12} & \\
\Block[fill=brown!15,rounded-corners]{2-12}{} a_{1,1} & a_{1,2} & a_{1,3} & a_{1,4} & a_{1,4} & a_{1,4} & a_{1,4} & a_{1,4} & a_{1,9} & a_{1,10} & a_{1,11} & a_{1,12} & \\
 a_{2,1} & a_{1,4} & a_{1,4} & a_{1,4} & a_{1,4} & a_{1,4} & a_{1,4} & a_{1,4} & a_{1,4} & a_{1,10} & a_{1,11} & a_{1,12} & \\
 a_{2,1} & a_{1,4} & a_{1,4} & a_{1,4} & a_{1,4} & a_{1,4} & a_{1,4} & a_{1,4} & a_{1,4} & a_{1,10} & a_{1,11} & a_{1,12} & \\
\end{pNiceMatrix}\]
\end{figure}

\begin{figure}
\[
\NiceMatrixOptions{xdots={horizontal-labels,line-style = <->}}
\setlength\arraycolsep{6pt}
\begin{pNiceMatrix}%
[   margin,
    last-col,
  ]
\Block[fill=red!15,rounded-corners]{1-12}{} a_{11} & a_{1,3} & a_{1,3} & a_{1,3} & a_{1,3} & a_{1,3} & a_{1,3} & a_{1,3} & a_{19} & a_{1,3} & a_{1,3} & a_{1,3} & \Vdotsfor{3}^{\text{State 1}}\\
\Block[fill=blue!15,rounded-corners]{1-12}{} a_{21} & a_{1,3} & a_{1,3} & a_{1,3} & a_{1,3} & a_{1,3} & a_{1,3} & a_{1,3} & a_{1,3} & a_{1,3} & a_{1,3} & a_{1,3} & \\ 
\Block[fill=green!15,rounded-corners]{1-12}{} a_{21} & a_{1,3} & a_{1,3} & a_{1,3} & a_{1,3} & a_{1,3} & a_{1,3} & a_{1,3} & a_{1,3} & a_{1,3} & a_{1,3} & a_{1,3} & \\
a_{2,1} & a_{1,4} & a_{1,4} & a_{1,4} & a_{1,4} & a_{1,4} & a_{1,4} & a_{1,4} & a_{1,4} & a_{1,10} & a_{1,11} & a_{1,12} & \Vdotsfor{3}^{\text{State 2}}\\
a_{2,1} & a_{1,4} & a_{1,4} & a_{1,4} & a_{1,4} & a_{1,4} & a_{1,4} & a_{1,4} & a_{1,4} & a_{1,10} & a_{1,11} & a_{1,12} & \\
a_{2,1} & a_{1,4} & a_{1,4} & a_{1,4} & a_{1,4} & a_{1,4} & a_{1,4} & a_{1,4} & a_{1,4} & a_{1,10} & a_{1,11} & a_{1,12} & \\
\Block[fill=red!15,rounded-corners]{1-12}{} a_{71} & a_{1,3} & a_{1,3} & a_{1,3} & a_{1,3} & a_{1,3} & a_{1,3} & a_{1,3} & a_{1,3} & a_{1,3} & a_{1,3} & a_{1,3} & \Vdotsfor{3}^{\text{State 3}}\\
\Block[fill=blue!15,rounded-corners]{1-12}{} a_{71} & a_{1,3} & a_{1,3} & a_{1,3} & a_{1,3} & a_{1,3} & a_{1,3} & a_{1,3} & a_{1,3} & a_{1,3} & a_{1,3} & a_{1,3} & \\
\Block[fill=green!15,rounded-corners]{1-12}{} a_{71} & a_{1,3} & a_{1,3} & a_{1,3} & a_{1,3} & a_{1,3} & a_{1,3} & a_{1,3} & a_{1,3} & a_{1,3} & a_{1,3} & a_{1,3} & \\
\Block[fill=red!15,rounded-corners]{1-12}{} a_{71} & a_{1,3} & a_{1,3} & a_{1,3} & a_{1,3} & a_{1,3} & a_{1,3} & a_{1,3} & a_{1,3} & a_{1,3} & a_{1,3} & a_{1,3} & \Vdotsfor{3}^{\text{State 3}}\\
\Block[fill=blue!15,rounded-corners]{1-12}{} a_{71} & a_{1,3} & a_{1,3} & a_{1,3} & a_{1,3} & a_{1,3} & a_{1,3} & a_{1,3} & a_{1,3} & a_{1,3} & a_{1,3} & a_{1,3} & \\
\Block[fill=green!15,rounded-corners]{1-12}{} a_{71} & a_{1,3} & a_{1,3} & a_{1,3} & a_{1,3} & a_{1,3} & a_{1,3} & a_{1,3} & a_{1,3} & a_{1,3} & a_{1,3} & a_{1,3} & \\
\end{pNiceMatrix}\]
\end{figure}
\end{document}

O primeiro número atualmente sangra na margem. Além disso, a segunda figura é quase uma réplica exata da primeira, mas quando quero adicionar setas verticais, obtenho um erro "Missing = inseriu for \ifnum." e "Número faltante, tratado como zero." Além disso, a última coluna é mesclada com a margem. Há algo que possa ser feito para corrigir isso?

Responder1

Então, de fato, há um problema com o Overleaf em que o nicematrixpacote não é atualizado para a versão mais recente. Carregar o arquivo nicematrix.stypara meu projeto Overleaf corrigiu o problema. O arquivo pode ser encontrado no servidor SVN do TeXLive:www.tug.org/svn/texlive/trunk/Master/texmf-dist/tex/latex/nicematrix/nicematrix.sty

informação relacionada