[Tex/LaTex] What’s the difference between pdfTeX and pdfLaTeX


I've been working on a project and compiled it using pdfLaTeX, then tried to compile using pdftex and got a whole lot of errors. I'd like to know why that would happen since it's a very plain file and I did not put a pdflatex option in documentclass or anything like that, and what's the real difference between them.

Best Answer

If a .tex file starts with \documentclass -- or, possibly, the now-obsolete \documentstyle command -- it's a file that needs to be compiled by a TeX engine that loads the LaTeX format file rather than the Plain TeX format file. Format files (or, shorter, "formats") are, loosely speaking, large collections of macros. There are many TeX formats; nowadays, the best known formats -- other than the original PlainTeX format -- are LaTeX (LaTeX2e, to be a bit more precise) and ConTeXt.

The LaTeX(2e) format is, to a first approximation, a large superset of the Plain-TeX format. It's not a strict superset, though, because there are some "Plain TeX" macros that aren't implemented in LaTeX. Hence, .tex files that contain LaTeX commands cannot be compiled if the PlainTeX format is loaded instead of the LaTeX format.

Note that the \documentclass instruction is itself a "LaTeX"-specific macro, i.e., it is not recognized by "Plain TeX". Therefore, pdftex (which loads the "plain TeX" format) cannot proceed properly once it encounters the \documentclass instruction on line 1 of the input file.

Addendum: For more information on TeX formats see, for instance, the webpage TeX formats and engines as well as the TeX.SE page List of TeX formats.