12.14.4 \ClassError and \PackageError and others

Produce error, warning, and informational messages for classes:

\ClassError{class name}{error-text}{help-text}
\ClassWarning{class name}{warning-text}
\ClassWarningNoLine{class name}{warning-text}
\ClassInfo{class name}{info-text}
\ClassInfoNoLine{class name}{info-text}

and the same for packages:

\PackageError{package name}{error-text}{help-text}
\PackageWarning{package name}{warning-text}
\PackageWarningNoLine{package name}{warning-text}
\PackageInfo{package name}{info-text}
\PackageInfoNoLine{package name}{info-text}

For \ClassError and \PackageError the message is error-text, followed by TeX’s ‘?’ error prompt. If the user then asks for help by typing h, they see the help text.

The four Warning commands are similar except that they write warning-text on the screen with no error prompt. The four Info commands write info-text only in the transcript file. The NoLine versions omit the number of the line generating the message, while the other versions do show that number.

To format the messages, including the help-text: use \protect to stop a command from expanding, get a line break with \MessageBreak, and get a space with \space when a space character is ignore, most commonly after a command.

LaTeX appends a period to the messages.


Unofficial LaTeX2e reference manual