12.14.4 \ClassError and \PackageError and other messages

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}
\ClassNote{class name}{note-text}
\ClassNoteNoLine{class name}{note-text}
\ClassInfo{class name}{log-text}

and the same for packages:

\PackageError{package name}{error-text}{help-text}
\PackageWarning{package name}{warning-text}
\PackageWarningNoLine{package name}{warning-text}
\PackageNote{package name}{note-text}
\PackageNoteNoLine{package name}{note-text}
\PackageInfo{package name}{log-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 help-text.

The four Warning commands write warning-text on the terminal and log file (with no error prompt), prefixed by the text ‘Warning:’.

The four Note commands also write the note-text to the terminal and log file, without the ‘Warning:’ prefix.

The NoLine versions omit the number of the input line generating the message, while the other versions do show that number.

The two Info commands write log-text only in the transcript file and not to the terminal.

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 where a space character is ignored, most commonly after a command.

LaTeX appends a period to the messages.


Unofficial LaTeX2e reference manual