TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'd like to be able to do the following kind of thing:


without LaTeX complaining about undefined environment. Is it possible without breaking existing environments?

share|improve this question
Of course, I can patch the definition of \begin to remove the \@latex@error (p.204 of source2e.pdf). As a \csname is invoked it should not be a problem if the control sequence is not defined. But I'd like to hear it is safe from gurus :). – cjorssen Jan 10 '13 at 22:53
Why do you want to use undefined environments? Just curious... – marczellm Jan 10 '13 at 22:56
@marczellm Coding environments is a lot more fun than writing a whole lecture about the phase plane. So every time I need a new environment, I spend time coding it rather than doing the right thing :). – cjorssen Jan 10 '13 at 22:59
@cjorssen: Hmmm, I think you are missing the whole point of procrastinating.. :-) – Peter Grill Jan 10 '13 at 23:02
up vote 8 down vote accepted

Yes, you can:


\let\xbegin\begin % store original \begin
\let\xifundefined\@ifundefined % store original \@ifundefined
  % "inactivate" \@ifundefined, but only once, hence reverting
  % it to original definition immediately




share|improve this answer
Interesting, thanks. – cjorssen Jan 10 '13 at 23:09

Your Answer


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.