# The differences between TeX engines

I am confused about what TeX and its offspring (LaTeX, pdfTeX/pdfLaTeX, e-TeX, ConTeXt, LuaTeX, etc.) are.

Some, like LaTeX, seem like add ons to TeX (maybe a change to the eyes and mouth, but not stomach). Others, like pdfTeX, seem like changes to the underlying system (i.e., a change to the stomach).

Is there a good reference that explains the differences and the evolution?

-
See for example tex.stackexchange.com/questions/36 and tex.stackexchange.com/questions/6776, both of which cover a lot of this. –  Joseph Wright Mar 16 '11 at 9:24

## TeX engines

There are currently five engines (binaries) which can process TeX input, although not all are used to the same extent.

• Knuth's TeX, as described in The TeXbook. This is of course the definitive TeX, but is only used as the standard engine in modern TeX distributions if you are using the plain format only (i.e. for `tex <somefile>` but nothing else). (Knuth added new primitives to TeX in 1990 for version 3, so most code today requires the 'TeX90' primitives. The previous TeX, version 2, may also be called 'TeX82'. TeX90 uses 8-bit input, TeX82 was 7-bit.)

• e-TeX, released in the late 1990s. This adds a number of additional primitives to TeX, for example `\unexpanded`, and bidirectional typesetting extension called `TeX--XeT`. The e-TeX extensions are incorporated into all of the newer engines, and so e-TeX itself is not widely used: people use one of the newer engines, in the main. See the UK FAQ entry on e-TeX for another view. (Note: LuaTeX does not use TeX--XeT approach for bidirection typesetting, so includes all of the e-TeX primitives except those related to TeX--XeT.)

• pdfTeX, which incorporates e-TeX and then adds a number of (mainly) PDF-related primitives. pdfTeX can produce both DVI and PDF output (something people often miss due to the engine name). pdfTeX is used as the default engine for modern TeX systems, so when you do for example `latex` or `pdflatex` it is actually pdfTeX that is the binary doing the work. Once again, there is a UK FAQ on pdfTeX.

• XeTeX, which incorporates e-TeX, works with native UTF-8 input and can access system fonts. XeTeX includes some of the pdfTeX primitives, but not currently all of them (sometimes the names also vary!). XeTeX uses system-dependent libraries to access system fonts, which does make this very easy to do.

• LuaTeX, which was originally aimed to be v2 of pdfTeX, but is now a somewhat separate approach. LuaTeX once again incorporates the e-TeX extensions, uses native UTF-8 input and also includes the Lua scripting engine. It has some of the pdfTeX primitives, but others have been dropped in favour of using Lua scripting. LuaTeX can access system fonts using Lua, rather than by building libraries into the binary. LuaTeX also incorporates some ideas from Omega and Aleph like multidirectional typesetting. (Omega and Aleph were earlier attempts to extend TeX for non-Latin script work and multidirectional typesetting.)

As you can see, both XeTeX and LuaTeX are native UTF-8 engines, with XeTeX having been around longer and being probably the more widely-used for bidirectional work at present. Both make it easy to use UTF-8 input and system fonts. See Differences between LuaTeX, ConTeXt and XeTeX for more on this.

-
This is great! While it is similar to what is available at link your answer is much clearer to me. The fact that the commands "latex" and "pdflatex" are both calling the pdfTeX engine is very helpful. I would love to see the answer expanded to include formats and how the formats and engines "interact". –  user4263 Mar 16 '11 at 10:49
@Joseph: Brilliantly written answer. –  Yossi Gil Mar 17 '11 at 13:23
@Jasper: As I understand it, Than originally extended from `tex.web` for direct PDF output, then later added the e-TeX extensions. The two are not really distinct, as pdfTeX has had the e-TeX for a long time. –  Joseph Wright Apr 25 '11 at 9:56
Joseph, I wonder if Knuth's TeX ('TeX-82') and "the base Tex engine" are the same concept? If not, is Knuth's TeX ('TeX-82') an engine for plain Tex? (If I am correct, Tex and plain Tex are different concepts, the latter is a superset of the former?) –  Tim Jul 19 '12 at 18:38
@Tim The engine and format are separate concepts. Knuth's TeX (TeX82 or as I've now pointed out more likely TeX90) is an engine, and can be used to create plain TeX as a superset as you say. Some people use 'plain TeX' to refer to the plain format built only with Knuth's TeX (and use for example 'plain XeTeX' to mean the plain format using the XeTeX engine), while others use 'plain TeX' to mean the plain format without being engine-specific. –  Joseph Wright Jul 19 '12 at 18:53