[Tex/LaTex] Differences between LuaTeX, ConTeXt and XeTeX

contextluatexxetex

I’m interested in the differences and commonalities between the “new” (La)TeX processors:

Personally, I’ve only used XeTeX so far and without having the time to try out all three systems, I’m having a surprisingly hard time setting them off from one each other.

As I understand it, these systems are actually very different in some regards. So I’m explicitly asking for strengths and weaknesses in every-day use (whatever that is), rather than very special scenarios.

(I’ve already asked a similar question on Super User some time ago.)

Best Answer

Both LuaTeX and XeTeX are UTF-8 engines for processing TeX documents. This means that the input (.tex files) can contain characters that with pdfTeX are difficult to use directly. Both can also use system fonts, again in contrast to pdfTeX. However, the two are very different in approach.

XeTeX uses system-specific libraries to work. This means that it is very easy to use 'out of the box' for loading system fonts and other UTF-8 tasks. Indeed, it was written for this purpose: supporting languages, etc., that traditional TeX struggles with. This makes for an easy to use engine for end users, particularly if you use the fontspec package on LaTeX. However, because things are 'farmed out' to the OS, there is a trade-off in flexibility terms.

In contrast, LuaTeX has bigger aims. The idea is to add a scripting language (Lua) to TeX, and to open up the internals of TeX to this language. The result is that a lot is possible, but it has to be programmed in. There is growing LaTeX support for LuaTeX: fontspec v2 supports it, and new packages are being written to use more of the new features.

At the moment, I'd use XeTeX for UTF-8 and font support, unless I was after particular effects that only LuaTeX does well (Arabic typography is a particular challenge). The choice btween XeTeX and LuaTeX is 'tight': both have advantages depending on your exact requirements. (I'm on the LaTeX kernel team, so as a programmer I'm very keen on exploiting LuaTeX.)

ConTeXt is not an engine, and so is in a slightly different place here. ConTeXt is a format for TeX, like LaTeX, but is newer and much larger. ConTeXt Mark IV is a LuaTeX-only implementation. The people behind ConTeXt are very active in developing LuaTeX, and are using the new features to extend TeX and what ConTeXt can do. I've already pointed out that I'm working on LaTeX, so of course I'd like to see new features in LaTeX do the same. This is something I and the other members of the LaTeX project are working on.

Related Question