Previous: , Up: Command line   [Contents][Index]

### 28.3 Recovering from errors

If LaTeX finds an error in your document then it gives you an error message and prompts you with a question mark, ?. For instance, running LaTeX on this file

\newcommand{\NP}{\ensuremath{\textbf{NP}}}
The \PN{} problem is a million dollar one.

causes it show this, and wait for input.

! Undefined control sequence.
l.5 The \PN
{} problem is a million dollar one.
?

The simplest thing is to enter ‘x’ and <return> and fix the typo. You could instead enter ‘?’ and <return> to see other options.

There are two other error scenarios. The first is that you forgot to include the \end{document} or misspelled it. In this case LaTeX gives you a ‘*’ prompt. You can get back to the command line by typing \stop and <return>.

The last scenario is that you mistyped the file name. For instance, instead of pdflatex test you might type pdflatex tste.

! I can't find file `tste'.
<*> tste

(Press Enter to retry, or Control-D to exit)
Please type another input file name:

The simplest thing is to enter <Control> and ‘d’ (holding them down at the same time), and then retype the correct command line.