B. Common Errors
- If you're running LaTeX from a terminal and the only message that gets displayed is:
latex: Command not found.
orBad command or file name
then you have either mistyped the command name, or you don't have LaTeX installed on your computer, or your path hasn't been set up correctly. First check that you have typed the command correctly, then check to see if you have TeX installed. Failing that, contact your system administrator for help or try one of the resources listed in Appendix C. Need More Help?. - If you're running LaTeX from a terminal and you get the message (or something similar):
This is TeX, Version 3.14159 (Web2C 7.3.1) ! I can't find file `sample'. <*> sample Please type another input file name:
then you have either misspelt the filename or you are in the wrong directory. If you have misspelt the filename, simply type in the correct name at the prompt. If you are in the wrong directory or you want to quit, type X followed by the return character . To check you are in the right directory, on a Unix-like system you can type:ls
This will list the contents of the directory. If you are certain that you have spelt the filename correctly and that you are in the right directory, there may be something wrong with your path, in which case contact your system administrator. - Error messages will usually look something like:
! Undefined control sequence. l.1 \docmentclass [12pt]{scrartcl} ?
The first line is the error message. In this example I have misspelt the command\documentclass
. The next line begins with l. followed by a number. This is the line number in the source code where the error occurred. In this case the error occurred on line 1. Following the line number is the input line LaTeX has processed so far, and staggered on the next line is the remainder of the input line.Here's another example. Suppose line 8 of my source code looks like:
The date today is: \toady, which is nice to know.
The error in this case is the misspelling of the command\today
. The error message will appear as follows:At the LaTeX prompt, you can either type h for a help message, or type x to exit LaTeX and go back to your source code and fix the problem.
There follows below a list of common error messages. If your problem isn't listed there, try the UK FAQ.
This book is also available as A4 PDF or 12.8cm x 9.6cm PDF or paperback (ISBN 978-1-909440-00-5).