TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using the ACM SIG template and trying to create a table of 4 columns.

I get the error mentioned in the title of the question. I know the standard reasons why this error can occur.

But my question is: Is it possible that the template or .cls file is controlling the maximum number of columns in a table ? If it were, would I get a different error than this?

share|improve this question

migrated from stackoverflow.com Dec 4 '11 at 18:46

This question came from our site for professional and enthusiast programmers.

up vote 17 down vote accepted

The error can be reproduced by

\documentclass{article}

\begin{document}

\begin{tabular}{c|c}
one & two & three \\
\hline
one & two 
\end{tabular}
\end{document}

The problem is caused by the extra column you try to insert. The tabular environment expects two columns but three is inserted.

share|improve this answer
1  
that's precisely what was happening. in TexShop on mac, the characters for | and l look exactly same. – euphoria83 Oct 18 '10 at 19:46

Hi,I had the same question and googled to this page. At last, I solved this problem by add one more c, the correct case should like below:

\documentclass{article}

\begin{document}

\begin{tabular}{c|c|c}
one & two & three \\
\hline
one & two 
\end{tabular}
\end{document}
share|improve this answer

Not all extra alignment tab has been changed to \cr errors are found via Google or Bing. Something as simple as defining a macro with arguments and forgetting the argument before the first \\ will reproduce the error.

Same thing with \newcommand.

e.g.,

\def\test#1#2{$\hbox to 4cm{#1}}$}
\begin{tabular}{cccc}
Oh & \test{tested}{} & Oh & \test{Oh} \\
   & \test{testing}{} &   & \test{Ohh}{} \\
\end{tabular} 
share|improve this answer
    
That is the very same error as in the other cases, because you are trying to typeset 8 columns, but only four are expected. – Johannes_B May 15 at 10:12
    
@Johannes_B You've been around with TeX for a while now. Could you point me to a relevant piece of information either through tug or any other book or material where the newcommand and this error have been co related with one another? .... The error so far, to my understanding points to a very broad concept I wasn't able to find it but just trough trial and error. – doed May 15 at 10:21
    
Your definition wants two arguments, in the first row, the last \test doesn't have a second and uses what comes next. That means the double backslash gets (partly) eaten up and LaTeX doesn't have the information that the line should be broken. Hence it complains that two many columns are used. – Johannes_B May 15 at 10:25
    
Try \test{Wombat}\\ Wombat or even use \def\test#1#2{#1\typeout{This is shown in the terminal: #2}} to see that the double backslash is eaten up completely. – Johannes_B May 15 at 10:29
    
But @Johannes_B ok, it complains that two many columns are used.... vague to say the least. And if the information out there is vague then it just defeats the purpose. Who wrote or came up with the idea to have the error extra alignment tab has been changed to \cr then? – doed May 15 at 11:20

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.