[Tex/LaTex] How to use more than 10 tab stops in bmatrix or other amsmath matrix environments

amsmathmath-modematrices

I'm using bmatrix environment from the amsmath package, and I'm trying to do something like this:

\documentclass{article}
\usepackage{amsmath}

 \begin{document}
     \begin{equation}
         \begin{bmatrix}
             1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11\\
         \end{bmatrix}
    \end{equation}
 \end{document}

However, pdfLaTeX returns an error: "Extra alignment tab has been changed to \cr", and in the output the extra element is moved to the next row. (If I remove one element, then it works perfectly fine). I guess this means that I've hit some hard limit on the number of tab stops in a matrix. Is there a way to change this?

The elements in the matrix are short and could fit perfectly on a single row.

Best Answer

Googling "10 columns" together with "tex" and "halign" lead me to this document, where it is explained that, e.g.,

\setcounter{MaxMatrixCols}{20}

enables you to use 20 columns.

Related Question