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, 2016 at 14:57
  • 1
    If you define an environment as something starting with \begin{<string>} and ending with \end{<string>}, then document is an environment.
    – egreg
    Jun 27, 2016 at 14:58

1 Answer 1


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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .