# [texhax] aliasing document environment

Fri Feb 25 04:35:46 CET 2011

Hi There,

When I try to latex the following:

\documentclass{article}
\newenvironment{foo}{\begin{document}}{\end{document}}
\begin{foo}
\end{foo}

I get:

LaTeX Error: \begin{foo} on input line 3 ended by \end{document}.

Why is that? Is there a way to do this without errors?

Thanks,
Moshe