Time for action – interpreting and fixing an error
Let's create a tiny test document. For sure you know those "Hello world!" printing programs—we shall write one in LaTeX. Though we are used to the uncommon capitalization used in the words TeX and LaTeX, we will now try if \Latex
works as well.
Create a new document containing these lines:
\documentclass{article} \begin{document} \Latex\ says: Hello world! \end{document}
Typeset. LaTeX will stop and print out the following message:
! Undefined control sequence.
l.3 \Latex
\ says: Hello world!
Click on the cancel icon in the upper-left corner of TeXworks to stop typesetting. Go to line 3, correct
\Latex
into\LaTeX
and Typeset again. Now LaTeX produces output without an error:
What just happened?
LaTeX commands are case-sensitive. Because we did not respect that, LaTeX had to deal with a macro called \Latex
, which is just unknown. As a command is also called a control sequence
, we got the error Undefined control sequence.
If TeX encounters an error...