How does one include a command name, including its backslash, in the message issued by a \typeout command?

For example, I want to issue the message >>> Using \cmd to the log. How must the following be modified to do it?

\typeout{>>> Using \cmd.}
  • 2
    \string\cmd or \protect\cmd depending on space Jul 14, 2019 at 15:11
  • That did it, thanks.
    – murray
    Jul 14, 2019 at 15:49

1 Answer 1


\string\cmd or \protect\cmd depending on space requirements.

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.