Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

How can I undefine an environment?

This is how to undefine a command:

\newcommand\foo
\makeatletter
\let\foo\@undefined
\makeatother

I need to undefine the spacing environment from the setspace package. This does not seem to work:

\usepackage{setspace}
\makeatletter
\let\beginspacing\@undefined
\let\endspacing\@undefined    
\makeatother
share|improve this question
add comment

1 Answer

up vote 13 down vote accepted

The macro \newenvironment{foo} defines the two macros

\foo
\endfoo

not \beginfoo.

Rather than undefine spacing, you could simply make it a noop:

\renewenvironment{spacing}{}{}

This is preferable because it will keep track of nested environments.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.