I am trying to adapt the code from this post to allow for matlab style syntax for matrices in latex. In the MWE example, the alignment of the \vdots is incorrect (should be centered)...
My MWE is...
\documentclass{article}
\usepackage{mathtools}
\makeatletter
\renewcommand\env@matrix[1][r]{\hskip -\arraycolsep%
\let@ifnextchar\new@ifnextchar
\array{\c@MaxMatrixCols #1}}
\makeatother
\usepackage{nicematrix}
\renewcommand\matrix[1]{%
\begin{bNiceMatrix}[r][light-syntax]
#1
\end{bNiceMatrix}%
}
\begin{document}
\begin{equation}
\matrix{\vec{x}^{(1)};\vec{x}^{(2)};\vdots;\vec{x}^{(m)}}^{T}
\end{equation}
\end{document}
How can I fix this?
UPDATE
I tried the solution from @F. Pantigny. It worked for \vdots, but for \cdots and \ldots it causes there to be extra dots between the different elements of the matrix, ie...
\documentclass{article}
\usepackage{mathtools}
\usepackage{nicematrix}
\renewcommand\matrix[1]{%
\begin{bNiceMatrix}[r,light-syntax,renew-dots,xdots/shorten=6pt]
#1
\end{bNiceMatrix}%
}
\begin{document}
\begin{equation*}
\matrix{\vec{x}^{(1)};\vec{x}^{(2)};\vdots;\vec{x}^{(m)}}^{T} = \matrix{\vec{x}^{(1)} \vec{x}^{(2)}\cdots \vec{x}^{(n)}}
\end{equation*}
\end{document}
gives...



renew-dotsbut with, in the matrix,\Vdots(provided bynicematrix) instead of\vdots. – F. Pantigny Sep 24 '23 at 18:16