How can one delete or undefine macros in Context? Is there a difference if i've used \def or \define to create a macro?


Why do you want to do 'undefine' a macro? Depending on what you want, try:




It does not matter whether you used \def or \define

  • 2
    Note that the first is canonical Tex from Knuth (except that he uses the equals sign: \let\macro=\undefined) and is the preferred way to do it. – Charles Stewart Mar 1 '11 at 10:32
  • 2
    The second (\donothing is just a more descriptive synonym of \relax) is better if you do not want code that uses \macro to fail. I am guessing that the OP wants to ignore some ConTeXt environments, \startsomething ... \stopsomething. In that case, it is better to set them to \donothing rather than \undefined. – Aditya Mar 1 '11 at 15:19
  • @CharlesStewart, @Aditya Doesn’t that rely on the fact that \undefined is indeed undefined itself? – And isn’t \@undefined used for that at so many other places? – Robert Siemer Dec 1 '13 at 3:08
  • @RobertSiemer: \@undefined is used in LaTeX. ConTeXt only uses \undefined. In fact, \undefined is used about 120 times in the ConTeXt MkIV source files. – Aditya Dec 1 '13 at 7:37
  • @RobertSiemer - It does rely on \undefined having the usual meaning of being undefined. It also depends on \let having the usual meaning of the Tex primitive, and the relevant catcodes being what you expect. Tex doesn't offer much in the way of safety precautions. – Charles Stewart Dec 2 '13 at 13:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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