TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a command that generates the error or warning of my choice? I'm planning to put it in an \ifthenelse, so it can't be a syntax error.

share|improve this question
up vote 28 down vote accepted

There are commands \GenericInfo, \GenericWarning and \GenericError. For class and package writers there are also \Class… and \Package… equivalents, described in the clsguide.

An example:


\GenericWarning{}{A simple warning}

  {This is a\MessageBreak
    multi-line error\MessageBreak
  {Describe here where to go for more information}
  {This is the error help (type H to see me)}

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.