# 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.

-
Which TeX distribution do you have on your system? It's a bit puzzling, to say the least, that a file you describe as being "very plain" (i.e., plain TeX, right?) would compile when run under pdflatex but won't compile at all under pdftex. – Mico Jan 13 '12 at 21:22
@Mico: I use Tex Live – Ayman Elmasry Jan 13 '12 at 21:45
@Mico: I meant plain as in not fancy, but I suppose it doesn't use any of the extra macros provided by Latex over plain Tex. – Ayman Elmasry Jan 13 '12 at 21:50
"A whole lot of errors" - you expect us to guess them. Sorry, but my crystal ball is out for repair. Please read how to ask smart questions and how to report bugs. You will also find some background about TeX helpful. – Martin Schröder Jan 13 '12 at 22:38

If a .tex file starts with \documentclass (or, possibly, the 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 are, loosely speaking, big chunks of precompiled macros. There are many TeX formats; nowadays, the best known TeX formats (other than the original "Plain TeX" format, of course) are (pdf)latex, xe(la)tex, lua(la)tex, and ConTeXt.

The LaTeX format is, to a first approximation, a large superset of the "Plain TeX" format. (Well, it's not a strict superset 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 "Plain TeX" format is loaded instead of the "LaTeX" format.

Note that the \documentclass instruction is itself a "LaTeX" 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.

-
Are {pdf,lua,xe}latex really formats? I thought LaTeX and ConTeXt were the only widely used formats nowadays, while XeTeX et. al. are different compilers. – You Jan 14 '12 at 0:36
@You: I thought ConTeXt was an editor. And I believe what Mico means by format is language or dialect (in the computer languages sense). – Ben Voigt Jan 14 '12 at 0:39