I want to show a matrix in Rmarkdown pdf file. Using basic LaTeX I created my desired matrix representation:
$$X_{123} = \begin{bmatrix}
a_{1} & a_{1} & a_{1} & \dots & a_{1} & a_{1} & a_{1} & a_{1} & a_{1} & a_{1} & a_{1}\\
\ \vdots &\ \vdots &\ \vdots &\ \vdots &\ \vdots &\ \vdots &\ \vdots &\ \vdots &\ \vdots &\ \vdots &\ \vdots\\
a_{n} & a_{n} & a_{n} & \dots & a_{n} & a_{n} & a_{n} & a_{n} & a_{n} & a_{n} & a_{n}\\
\end{bmatrix}$$
When I type this matrix in Rmarkdown file, the preview window shows my desired matrix:
However, when I knit the Rmd file to pdf I get this error:
! Extra alignment tab has been changed to \cr.
<recently read> \endtemplate
When I delete all the \vdots and \dots which create the 3 dot symbols the rendering works fine. What am I missing here?
