[Tex/LaTex] Why choose LuaLaTeX over XeLaTeX

luatexxetex

There are questions on TeX.sX already about what the differences between LuaLaTeX and XeLaTeX are (Differences between LuaTeX, ConTeXt and XeTeX), what one should be keep in mind when going from XeLaTeX to LuaLaTeX (Considerations when migrating from XeTeX to LuaTeX?), and how they typically differ in their preambles (Frequently loaded packages: Differences between XeLaTeX and LuaLaTeX).

From the perspective of an end user, however, I've yet to see any reason for why one should switch from XeLaTeX to LuaLaTeX. That is, I have read facts like LuaLaTeX using the Lua scripting engine, but that is not relevant to an end user like me who has no idea what that entails.

Yet I've noticed that most of the cool kids here on TeX.sX seem to prefer LuaLaTeX over XeLaTex, and I'm curious what those reasons are, and more specifically, if they apply to "normal" end users like myself.

To give LuaLaTeX a try, I recompiled an old short handout of mine in LuaLaTex, and they mostly looked exactly the same. Where they differed, however, XeLaTeX clearly gave the better results. Below are some examples I found in my handout:

XeLaTeX:

enter image description here

LuaLaTeX:

enter image description here

\documentclass{article}
\usepackage{fontspec}
\setmainfont
    [
        Path = C:/Windows/Fonts/,
        Extension = .otf,
        UprightFont = LinLibertine_R,
        BoldFont = LinLibertine_RZ,
        ItalicFont = LinLibertine_RI,
        BoldItalicFont = LinLibertine_RZI
    ]{libertine}

\begin{document}
mak\textbf{\underline{a}}t
\textit{wund\textbf{\underline{V\char"0306}}de}
\textit{*wund\textbf{\underline{\char"014D}}d\char"0113}
\end{document}

In the second and third word, LuaLaTeX adds more white space before the underlined italicized boldfaced characters. In my view, it adds too much. Notice, however, that it does not add any extra white space in the first word, where the character is not italicized.

In the second word, XeLaTeX handles the placement of the combining breve character well, but LuaLaTeX does not. This is potentially a worry, since I normally use a lot of combining characters in my documents (this being the only example in my handout).

If anything, I only see reasons to stick to XeLaTeX for the moment, but I am still curious if there are advantages to LuaLaTeX over XeLaTeX that could potentially override the disadvantages I've identified above.

Best Answer

In my personal opinion (i.e. from anecdotal situations I've encountered), lua(la)tex looks indeed a little less stable than xe(la)tex, in particular when it comes to some advanced font features (fontspec was after all developed for xe(la)tex first). It's somehow to be expected: xe(la)tex itself is older than lua(la)tex and can therefore expected to be a more mature in terms of bugs, etc.

The advantages I see of lua(la)tex though are:

  • lua(la)tex has been choosen as the official successor of pdf(la)tex, so you can expect more development effort to go towards it now and in the future. For example, microtype supports much more features under lua(la)tex than it does under xe(la)tex,
  • lua(la)tex opens up the internals of TeX to the Lua programming language. This might sound like some irrelevant technicality to the end user, but in reality it is not when you consider that this might enable advanced packages / features that are just not possible to implement otherwise, such as rivers detection and most other features of impnattypo.
  • lua(la)tex doesn't rely on system-specific libraries, so in theory you're less prone to encounter platform-specific issues or differences in output.