[Tex/LaTex] The differences between TeX engines

tex-core

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?

Best Answer

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.

Related Question