# Is the document an example of an environment?

Is the document in which you write your code an example of an environment? It seems like it might be, because it requires \begin and \end statements, but I have never seen a source which defines whether or not it is an environment. If it is not an environment, what is it?

• Yes, it is. However, it's a special one since no code put after \end{document} is executed.
– yo'
Jun 27 '16 at 14:57
• If you define an environment as something starting with \begin{<string>} and ending with \end{<string>}, then document is an environment. Jun 27 '16 at 14:58

## 1 Answer

It is an environment by definition (as that's what the official latex manual calls it) however it does have one more or less unique property in that unlike any normal environment the content is not in a TeX group, this is for efficiency reasons and makes little observable difference as there can be no code after the environment that is executed.