# 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
I suggest we convert the question to Community Wiki, such that we can create a brief overview together regarding all the TeX engines, with links to related questions on the site and in the FAQ. –  Stefan Kottwitz Mar 16 '11 at 9:28
@Stefan: With a bit of tidying of the question, sounds good to me. Do we want one answer covering everything? –  Joseph Wright Mar 16 '11 at 9:30
@Joseph: Yes, if it's ok for @Dan the question could be tidied (and these comments) and one wiki answer with summary information and links would be great. If there would really be a need to explain further, we could add engine-specific answers and link to them from the summary post. –  Stefan Kottwitz Mar 16 '11 at 9:36

## 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
I edited the notes about bidirectional typesetting. XeTeX does RTL based on e-TeX extension, LuaTeX is the one incorporating Omega. –  Khaled Hosny Mar 16 '11 at 11:38
@Khaled: I've not kept up with all of the low-level detail on this - thanks. –  Joseph Wright Mar 16 '11 at 11:41
@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