Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.
\begin{table}[ht]
\makebox[\textwidth][c]{
    \begin{tabular}{ccccc}
        \hline
        \hline
        [] & [] & [] & [] & []\\
        [] & [] & [] & [] & []\\
        \hline
        \hline
    \end{tabular}
}
\caption{test}
\end{table}

I cannot run the above code, latex returned an error about missing number, but I can't see anything I am missing.

And the weirdest thing is that

\begin{table}[ht]
\makebox[\textwidth][c]{
    \begin{tabular}{ccccc}
        \hline
        \hline
        [] & [] & [] & [] & []\\
        \hline
        \hline
    \end{tabular}
}
\caption{test}
\end{table}

This code works.

Anyone have any idea?

share|improve this question

1 Answer 1

up vote 11 down vote accepted

Since \\ allows an optional argument, the [ in the following line is mistaken for it.

......         \\\relax
[whatever] ... \\
share|improve this answer
    
Thanks!! I was fighting against this error for half an hour. –  Benjamin Nov 11 '11 at 10:48

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.