\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?
\\is seen, TeX will look whether*follows, gobbling spaces. Then it will look whether[follows, still gobbling spaces. An endline is converted to a space, but with%it’s not even seen. Worse, inamsmathenvironments, the space gobbling fearure is disabled, so\\<newline>[works, but ``\%\relaxdid not work for me. Even without square brackets. Making curly braces, as described in the other answer, worked. – John Sep 28 '23 at 09:36\relaxafter the newline before a\midrule, it crashes maybe in the same way as when you do not have a newline before a\midrule. However, the\relaxis not necessary at this location for the square bracket. For the other locations the crashes might have been caused by another person, who edited something else simultaneously (on overleaf). Sorry for the noise. – John Sep 28 '23 at 11:24