7

I would like to temporarily undefine a command. The reason for this is that I need to use a specific class file which defines the equation* using \@namedef and I would also really like to use the amsmath package as it in particular defines the align environment, but it also defines the equation* environment, so this leads to an error at compilation.

I have found how to temporarily disable a command without a star, i.e. by doing

\makeatletter
\let\oldequation\equation
\let\equation\@undefined
\makeatother

and then loading the amsmath package.

This doesn't work for equation* for reasons I don't quite understand, but apparently * at the end starts a new lexeme.

So how would I achieve a similar result for equation*? The class and style files are not under my control.

13

Just as \makeatletter locally makes @ a letter you can locally make * a letter.

\catcode`\*=11
\makeatletter
\let\oldequation*\equation*
\let\equation*\@undefined
\let\oldendequation*\endequation*
\let\endequation*\@undefined
\makeatother
\catcode`\*=12

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.