5

I used

\begin{matrix}
\ldots & 1 & 0 & 0 & 2 & 1 & | & 2 & 0 & 0 & 1 & \ldots \\
\ldots &   &   &   &   & 0 & | & 1  &   &   &   &
\end{matrix}

But Latex says:

Extra alignment tab has been changed to \cr.
<recently read> \endtemplate 

Where is my mistake?

math12
  • 283

1 Answers1

3

See How to use more than 10 tab stops in \bmatrix?, but probably you want something else:

\[
\begin{array}{@{} *{6}{c} | *{5}{c} @{}}
\dots & 1 & 0 & 0 & 2 & 1 & 2 & 0 & 0 & 1 & \dots \\
\dots &   &   &   &   & 0 & 1  &   &   &   &
\end{array}
\]

enter image description here

Compare with the output of

\documentclass{article}
\usepackage{amsmath}
\setcounter{MaxMatrixCols}{12}
\begin{document}
\[
\begin{matrix}
\dots & 1 & 0 & 0 & 2 & 1 & | & 2 & 0 & 0 & 1 & \dots \\
\dots &   &   &   &   & 0 & | & 1  &   &   &   &
\end{matrix}
\]
\end{document}

enter image description here

egreg
  • 1,121,712
  • 1
    IMHO, this is very curious "feature" of LaTeX's matrix: the limit to max 10 columns. The matrix can be declared using \halign primitive with unlimited number of columns. – wipet May 01 '15 at 13:43
  • @wipet The problem is removing the padding at either side, while keeping all the features of array that's not simply \halign. – egreg May 01 '15 at 13:45
  • This is not simply \halign but it is implemented by \halign and it can be implemented more general. But I understand that this is for somebody problem. – wipet May 01 '15 at 14:20
  • 3
    @wipet The main author of amsmath was a very skilled TeX programmer and he chose this approach. I'd be wary of offending his memory. If you think you can do better, why don't you offer your services to AMS or at least propose a different implementation that behaves the same? – egreg May 01 '15 at 14:25