Possible Duplicate:
How to undo a \def (i.e., Need a \undef capability)
In my template I test for chapter defined to prevent that code section only valid for a chapter class are executed. However if I load titlesec chapter is always defined regardless of the class in use.
So how can I make \chapter undefined after the execution of titlesec?
So far I tried this which did not work:
\ifcsdef{chapter}{%
\usepackage{titlesec}%
% make chapter undefined again
\let\chapter\relax%
}{
\usepackage{titlesec}%
}
\let\chapter\UnDeFiNEDinstead of\relax? – Marco Oct 15 '12 at 20:02\undef\chapterseems to work withetoolboxpackage. Test case:Chapter is \ifcsdef{chapter}{defined}{undefined}.And @Marco's suggestion also works. – Peter Grill Oct 15 '12 at 20:05