# Can I redefine an environment to generate an error?

I know how to use \renewenvironment to redefine an environment, but instead of changing formatting, I'd like to have any use of the environment generate an error (log and abort). Is there a way to do this?

-
\renewenvironment{tabular}{\ABORT}{}, assuming of course that the environment  is already defined (hence the renew, otherwise use new), and the macro \ABORT does not exit or aborts as you desire. – Peter Grill Mar 16 '12 at 22:12

\documentclass{article}
\newenvironment{die}
{\GenericError{}{Mortal environment found}
{I'm very unhappy, exiting}
{What you did is highly disapproved}\endgroup\csname @@end\endcsname}
{}

\begin{document}
\begin{die}
\end{die}
\end{document}

-

This is as simple as possible:

\def\yourenv{\GenericError{}{This is my error}{}{}}

-
This does not really define the environment (since you did not define \endyourenv, btu does generate an error as desired. – Peter Grill Mar 16 '12 at 22:15
the question is about re-defining, so \endyourenv should have been already defined before you do this modification. – yo' Mar 16 '12 at 22:16
Duh!!! Good point. I don't have even a good excuse like too much wine!! – Peter Grill Mar 16 '12 at 23:21