Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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.

share|improve this question
5  
I am aware of the fact that lualatex uses dynamic memory management. As author of a memory-intensive package, I believe that this is quite interesting and simplifies things considerably. I suppose the xelatex has the typical cumbersome memory limit restrictions. –  Christian Feuersänger Jul 31 '13 at 15:10
add comment

4 Answers

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.
share|improve this answer
1  
Ad point 3: Does Xe(La)TeX? –  Sverre Jul 31 '13 at 14:57
    
@Sverre Yes AFAIK –  Xavier Jul 31 '13 at 14:58
1  
Official successor? What about LaTeX 3; different discussion? –  Raphael Jul 31 '13 at 15:13
4  
@Raphael I believe you are mistaking engines for formats –  cgnieder Jul 31 '13 at 15:15
6  
XeTeX relies on system specefic libraries for system specific features (like locating system fonts, which is always system specific, if you want to do it reliably), so it is hardly an issue in practice. –  Khaled Hosny Jul 31 '13 at 16:08
show 1 more comment

LuaTeX including METAPOST as mplib is a huge advantage --- looking forward to LuaTeX maturing past the difficulties noted in the question (you did report those as bugs to the appropriate people, right?)

share|improve this answer
    
No I didn't ... :-/ I'll search and see if there's a place for LuaTeX bug reports. –  Sverre Sep 6 '13 at 13:54
add comment

I agree with Xavier on the first two points.

Another advantage of LuaTeX over XeTeX is that LuaTeX uses the PDF engine of pdfTeX, while XeTeX uses its own one. One consequence of this is, that all features of the PGF graphics package (on which TikZ builds) should be available also under LuaTeX, while some features are definitely not available under XeTeX.

share|improve this answer
add comment

One good reason to switch to LuaTeX is the fact that XeTeX can't use the glyph names for glyphs in the Private Use Area of fonts. As a result, any glyph from the PUA will end up as garbled text if you try to copy it from the pdf output. This issue has been raised in Small-caps, old-style numbers, and some ligatures produce odd symbols in PDF copy text? and \pdfglyphtounicode with XeTeX. I don't know if this is likely to be resolved, since the XeTeX maintainers apparently insist that fonts shouldn't use the PUA at all. But as long as there are many characters that haven't been included in Unicode yet, fonts need to add those extra characters in the PUA.

LuaTeX doesn't have this problem, it seems. LuaTeX does not, however, as seen in the OP's question, deal very well with many other aspects of font outputs ...

share|improve this answer
    
Using PUA for glyphs that should be accessed with font features is not the same as using PUA for unencoded characters, the later works as intended; PUA in → PUA out. –  Khaled Hosny Sep 6 '13 at 14:33
    
@KhaledHosny I don't know much about this, but if a font has e.g. both lining and old style numbers, is there any other place to put the old style numbers than in the PUA? They can't both occupy the Unicode slots for numbers. Similarly, if a font has ligatures that haven't been assigned to Unicode yet - can they go anywhere but the PUA? –  Sverre Sep 6 '13 at 16:24
2  
The recommended way is to not give the alternate glyphs any Unicode points at all, that is what all the new fonts does. And if the font designer does this and give them proper glyph names, everything works as expected. –  Khaled Hosny Sep 6 '13 at 16:45
2  
I don’t know BabelMap, so I don’t understand its terminology. Junicode used to use PUA for its ligatures and alternate glyphs, but last version(s) does not do that any more. The PUA glyphs are still left for backward compatibility e.g. for people who were typing the PUA codes directly (which is one if the reason why PUA should not be used for this; it encourages bad practices). Libertine is still using PUA, though I discussed this with its author and hopefully it will be fixed in later releases. –  Khaled Hosny Sep 7 '13 at 0:38
1  
Yes, unless you are using a font viewer (or glyph palette, in applications that has such a thing). –  Khaled Hosny Sep 7 '13 at 13:00
show 6 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.