[Tex/LaTex] \documentclass: undefined control sequence


There's probably a ton of questions about this already but I've been spending all day feeling overwhelmed with the TeX learning curve.

I'm trying to learn LuaTeX (by the way, if you know of a good tutorial I'd love to know about it). I have downloaded TeX Live 2011 for Windows yesterday. I have a LaTeX document with working syntax which renders properly. When I switch the typeset setting to ConTeXt (LuaTeX), I get Undefined control sequence for the first line, \documentclass{report}. What am I doing wrong?

Best Answer

I hope this answer can clarify a few basic concepts for you.

TeX TeX is a (macro) programming language invented by Knuth. It is a Turing complete language. That is, theoretically you can do almost anything you can do with other languages, though not necessarily easily.

TeX Engine A program that can interpret the TeX language. It is like the perl program for the Perl language. The first TeX engine was written by Knuth. Nowadays, popular engines include pdftex, xetex, luatex. pdftex is much faster than the other two though the other two provide extra functionality, especially for using opentype fonts. luatex provides much more than fonts.

LaTeX and ConTeXt These are formats. A format is just a set of TeX macros (well, not exactly so simple). They define a lot of macros for you to use. For example, LaTeX defines the \documentclass and \begin{document} macros while ConTeXt defines \starttext. It will take a much longer paragraph to answer what there really is in a format. For now, you may just think the program lualatex is a shortcut for starting the luatex engine, inputting the LaTeX macro packages (i.e., the format), and then processing your input. (I know this is not the exact explanation, but I believe it helps a beginner to understand).

LuaLaTeX, XeLaTeX, pdfLaTeX, ... these are all just shortcuts for using the LaTeX format with a TeX engine.

In the question, you seems to think ConTeXt and LuaTeX are the same. This is not true. ConTeXt Mark IV requires LuaTeX as an engine to process this format. Just like many LaTeX packages and the forthcoming LaTeX3 format requires an engine with e-TeX features.

Please correct me if there's anything wrong with this answer.