Elementos del margen derecho de NiceMatrix

Elementos del margen derecho de NiceMatrix

He estado luchando por descubrir qué está mal en mi código. Actualmente tengo una matriz con algunos colores y en el margen quisiera flechas. Por el momento tengo esto

\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}

La primera cifra actualmente se pierde en el margen. Además, la segunda figura es casi una réplica exacta de la primera, pero cuando quiero agregar flechas verticales, aparece el error "Falta = insertado para \ifnum". y "Número faltante, tratado como cero". Además, la última columna se fusiona con el margen. ¿Hay algo que se pueda hacer para solucionar este problema?

Respuesta1

De hecho, hay un problema con Overleaf donde el nicematrixpaquete no se actualiza a la última versión. Cargar el archivo nicematrix.styen mi proyecto Overleaf solucionó el problema. El archivo se puede encontrar en el servidor SVN de TeXLive:www.tug.org/svn/texlive/trunk/Master/texmf-dist/tex/latex/nicematrix/nicematrix.sty

información relacionada