I thought the way to undo a \def
was to define it to \relax
, but that does not appear to work. Also, am not sure why this produces no output if I try to use \def
instead of \let
in my attempt to do an undef.
\documentclass{article}
\begin{document}
\def\CaseA{}%
\ifdefined\CaseA%
\def\ProcessCaseA{}%
% Do stuff that uses \ProcessCaseA
%\def\ProcessCaseA\relax% no output if use this, and comment next line
\let\ProcessCaseA\relax% no output if comment this, and use above line
\fi
% Now do stuff that requires \ProcessCaseA NOT be defined
\ifdefined\ProcessCaseA
ERROR: \textbackslash ProcessCaseA is still defined
\else
SUCCESS: \textbackslash ProcessCaseA is not defined
\fi
\end{document}