NiceMatrix 오른쪽 여백 요소

NiceMatrix 오른쪽 여백 요소

나는 내 코드에 무엇이 문제인지 알아내려고 애썼다. 현재 몇 가지 색상이 있는 행렬이 있고 여백에 화살표가 필요합니다. 현재 나는 이것을 가지고 있습니다.

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

첫 번째 수치는 현재 여백으로 번지고 있습니다. 게다가 두 번째 그림은 첫 번째 그림과 거의 똑같지만 수직 화살표를 추가하려고 하면 "Missing = insert for \ifnum" 오류가 발생합니다. 및 "누락된 숫자, 0으로 처리됨" 또한 마지막 열은 여백과 병합됩니다. 이 문제를 해결하기 위해 할 수 있는 일이 있나요?

답변1

nicematrix따라서 실제로 Overleaf에는 패키지가 최신 버전으로 업데이트되지 않는 문제가 있습니다 . 내 Overleaf 프로젝트에 파일을 업로드하면 nicematrix.sty문제가 해결되었습니다. 파일은 TeXLive의 SVN 서버에서 찾을 수 있습니다:www.tug.org/svn/texlive/trunk/Master/texmf-dist/tex/latex/nicematrix/nicematrix.sty

관련 정보