Is it possible to declare some command inside a package as obsolete? I work on a package and want to inform users that in the next version of the package this commands will be deleted. What kind of messages will be seen by user in this case?

  • 3
    You could \typeout a warning to the log file whenever the command is used. Also, you could mention in the documentation that the command is deprecated. My approach in these situations is to leave the outmoded command in the package for several backward compatibility, but to use the documentation to warn against its use, citing lack of technical support moving forward. May 13, 2019 at 11:10

2 Answers 2


Add a warning to the definition :


\PackageWarning{eqexpl}{command foo is obsolete, please use bar instead}%




If it's just a drop-in replacement, then something like below should be good.


\makeatletter % let's emulate a package

\newcommand{\newversion}{This is the command that should be used}

     The command \noexpand\oldversion is obsolete and might get\MessageBreak
     removed in future versions of the package.\MessageBreak
     Please use \noexpand\newversion instead%



I use \oldversion.

Again I use \oldversion.

Also \newversion.


This way, users will get a single warning and the old command will be redefined to mean the new one.

However, a precise way to do this might depend on the nature of the command: if you use it in an expansion context, the user will get a lot of weird errors.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .