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

## TeX engines

There are currently seven engines (binaries) in common use 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.)

• pTeX and upTeX These are variants of TeX written for (primarily) Japanese typesetting. pTeX adds a number of primitives to support vertical typesetting using 'traditional' Japanese encodings, with upTeX taking Unicode input (though with a number of provisos: it is not a 'simple' Unicode engine). upTeX also adds some additional primitives. As these two engines are closely related, they are often referred to as (u)pTeX. Both pTeX and upTeX are available with the e-TeX extensions: e-pTeX and e-upTeX. For 'routine' work the e-TeX enabled versions are recommended: they also include cross-compatibility primitives from pdfTeX. (This allows e-(u)pTeX to work with `expl3`, for example.)

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, 2011 at 10:49
• @Joseph: Brilliantly written answer. Mar 17, 2011 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. Apr 25, 2011 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, 2012 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. Jul 19, 2012 at 18:53

fwiw, i long ago wrote a web page briefly outlining these things: http://tug.org/levels.html.

• Good overview, but the part on Context is a vague. Jul 21, 2016 at 16:31