我知道如何使用\renewenvironment
来重新定义环境,但我不想更改格式,而是想让环境的任何使用都产生错误(记录并中止)。有办法吗?
答案1
\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}
答案2
这尽可能简单:
\def\yourenv{\GenericError{}{This is my error}{}{}}