# LaTeX Error: Environment table undefined

When I try to compile a latex file, I get the following error:

LaTeX Error: Environment table undefined.


I think the line that is causing the problem is: \begin{table}

Does anybody know how I can fix this?

-

## migrated from stackoverflow.comMar 27 '13 at 6:19

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

Welcome to TeX.SE. For future reference you should compose a fully compilable MWE including \documentclass and the appropriate packages that reproduces the problem. Otherwise those trying to help can only guess at what the exact problem is. – Peter Grill Mar 27 '13 at 6:27
It could be that you're using a document class that doesn't define tables (for example, the letter class). – Nicola Talbot Mar 27 '13 at 10:33

You are most likely missing the document class declaration. Remember that the content of your document must be surrounded by

\documentclass{article}
\begin{document}
<content here>
\end{document}


You are of course free to use a different document class, but you need one such declaration.

-
Wow, that is amazing mind reading ability. :-) However, when I remove the \documentclass, the error I get is The font size command \normalsize is not defined, not Environment table undefined. – Peter Grill Mar 27 '13 at 6:26
See here. – Lars Kotthoff Mar 27 '13 at 8:34
Yeah that is what I am saying. I get a different error than Environment table undefined which is what your solution seems to be addressing. – Peter Grill Mar 27 '13 at 8:47
These errors should both be fixed by adding the document class command. – Lars Kotthoff Mar 27 '13 at 8:55
@LarsKotthoff ITYM "... adding the correct document class command. (not all classes define the table environment.) – wasteofspace Mar 27 '13 at 10:32