# Compilation Error when I try to resize box

Firstly, I know that here was some similar problems, but I really can't get any problem solved.
Well, here is my problem: I have table that is so wide and gets outside slide. I tried to use \resizebox{\textwidth}{!} in the first line above table and I got message:

missing \endcsname...


What should I do?

• Welcome to TeX.SX! Please make your code compilable (if possible), or at least complete it with \documentclass{...}, the required \usepackage's, \begin{document}, and \end{document}. That may seem tedious to you, but think of the extra work it represents for TeX.SX users willing to give you a hand. Help them help you: remove that one hurdle between you and a solution to your problem. Since you mention sldes, I assume your MWE would be in the form of a single beamer frame with a resized table in it. – Mike Renfro Nov 27 '16 at 18:48
• It is impossible to debug that without more information, but also are you sure you want to resize a table (which is very much only something to do as a last resort, it produces inconsistent font sizes, and there are usually far less destructive ways to fit a table to a page) – David Carlisle Nov 27 '16 at 18:50

You haven't given many clues but I would guess you just added \resizebox{\textwidth}{!} without putting the entire table in the third {.....} argument.

If you really must scale the table (and really, it's almost never a good plan)

\resizebox{\textwidth}{!}{%
\begin{tabular}{cc}
a&b\\
\end{tabular}%
}


with the entire tabular in the argument to \resizebox.

If you do

\resizebox{\textwidth}{!}
\begin{tabular}{cc}
a&b\\
\end{tabular}


then that is the same as

\resizebox{\textwidth}{!}{\begin}
{tabular}{cc}
a&b\\
\end{tabular}


so the argument of \resizebox is just \begin so at some point it will execute \begin divorced from the environment name tabular which is quite likely to generate multiple errors including missing csname.