# Drawbacks of XeTeX/LuaTeX

Currently I use pdflatex to process my documents, but I want to be with the cool kids and switch to XeTeX or LuaTeX. My documents are moderately multilingual (main text in portuguese or english, quotations and references in english, german, french, russian and greek), but nothing that pdflatex can't handle with some effort. I just want to get rid of the cruft and be able to use OpenType fonts.

So, is there any drawback of XeTeX/LuaTeX that should stop me from switching right now?

My main concern is math typesetting, as there's usually more math than text in my documents =)

The only issue I am aware is that their support for microtype is incomplete.

-
At least in the case of luatex, it is the microtype package whose support for luatex is incomplete. –  Taco Hoekwater Sep 15 '10 at 7:17
The microtype 0.25 (in beta-07 since 2011/08/18) supports much more in both luatex and xelatex than the 0.24 release version in TL2012 –  GTK Dec 16 '12 at 0:36
I think it may be worth mentioning that lualatex 0.76 (distributed with TL 2013) might be significantly slower than pdflatex for some use cases. See also tex.stackexchange.com/questions/75118/… for more info. –  dcmst Nov 8 '13 at 11:26

## 8 Answers

Math isn't the problem if you are happy with the "normal" math fonts used already by pdftex. This will work fine with xelatex + lualatex too. You can also try unicode-math but I don't know if it works in all cases.

The multilanguage support is more problematic: As you are using different scripts (greek, russian) you can't use babel (at least for this languages), as it will break the unicode font support. So you need polyglossia and this doesn't work with lualatex yet as it use (at least for some languages) xetex specific commands like \XeTeXinterclass. Also the support files of some of the languages (e.g. french) are much more sophisticated in the babel version. It is possible to mix babel + polyglossia but it depends a lot on the actual language combination if and how good it works.

Regarding the microtype support: The newest version of xetex can do protrusion (I haven't tried it yet), lualatex can protrusion + expansion. The author of microtype has just announced on c.t.t. that a preliminary version of microtype exists which supports both engines.
But at least for lualatex it isn't needed, one can activate both without problems manually:

 \documentclass[fontsize=12pt]{scrartcl}
\pdfprotrudechars1
\pdfadjustspacing1

\usepackage{lipsum}
\usepackage{fontspec}
\newfontfeature{Microtype}{protrusion=default;expansion=default;}
\setmainfont[Microtype,Ligatures=TeX]{Linux Libertine O}
\begin{document}
\lipsum
\end{document}

-
Is it possible to use Tracking/Letterspacing with luaLaTeX? –  lockstep Sep 19 '10 at 21:20
\letterspacefont has been added recently. So this should work: \documentclass{article} %\usepackage{fontspec} \begin{document} ABCDEF \letterspacefont\lspfont=\font 1000 {\lspfont ABCDEF} ABCDEF \end{document} (It works without fontspec with pdflatex too. I saw a message that suggests that Robert is working on adding the necessary user code to microtype). –  Ulrike Fischer Sep 20 '10 at 8:49
Can anyone confirm if this is still valid in 2013? –  Oxinabox Jul 7 '13 at 15:36
I'm pretty sure based on my own recent experiences that most of this is no longer relevant in answering the same question today. –  Caleb Mar 24 at 16:49

Depends on your needs:

• Micro-typography for OTF fonts isn't really stable yet
• Support for micro-typography and OpenType math seems to be much better in ConTeXt than in LaTeX, so you might consider switching to ConTeXt
• If you don't need micro-typography or OpenType math and want to continue with LaTeX, both XeLaTeX and LuaLaTeX are fine
• Normally you want matching text and math fonts. There are very few such combinations: Latin Modern, Cambria, Asana, XITS, mathptmx, mathpazo, mathdesign. Personally I like Latin Modern and Cambria most. Cambria is the only "professional" font in this list, and would be my first choice if OTF math support were stable enough. For the moment, I keep using Latin Modern with pdftex.

PdfTeX + microtype + Latin Modern has the advantage of being absolutely stable and giving coherent output. I'd say you should try both ways and then decide whether the advantages of OTF/Unicode outweigh the remaining issues.

-
Micro-typography for OTF fonts isn't really stable yet - For what engine? Are you talking about the trouble with the microtype package? –  Charles Stewart Sep 15 '10 at 12:19
Thank you for the XeTeX 64bit info. I was wondering why it always segfaults on my math documents. –  Caramdir Sep 15 '10 at 15:34
@Charles Stewart: With "stable" I mean something like the current pdfTeX situation–load microtype and be happy. Regarding XeTeX and LuaTeX: there are still too many issues related to micro-typography, many of which have only been fixed in unreleased versions. –  Philipp Sep 15 '10 at 18:34

If you are a scientist, there is a pretty serious drawback: there's no support for XeTeX/LuaTeX in arXiv, nor in any of the journals I looked.

Of course, that's not a technical drawback, but is the reason why I haven't switched to the new engines for the majority of my documents.

-
Could you expand what you mean by this? I'm working in chemistry, and the American Chemical Society has a package out that does page sizes, bibliographic styles and such for you. Would this not work with luaTeX/XeTeX? –  Canageek Sep 26 '11 at 19:52
The other way around. Probably ACS' packages will work with LuaTeX/XeTeX, but their journals won't be able to compile a document you create that requires LuaTeX/XeTeX to be compiled. So to work with them you'd need to work within the restricted subset of LuaTeX that works with pdflatex; and if you're doing this what's the advantage of using LuaTeX? –  Mateus Araújo Sep 26 '11 at 20:17

I have been extensively using LuaTeX (with ConTeXt) for about three years now, and like you my documents are mostly math. Although I use ConTeXt, I assume that most of this will also be true for LaTeX.

LuaTeX is a superset of pdfTeX, so everything that works in pdfTeX also works in LuaTeX. The only real issue is that the engine and the associated macros are still evolving, and on rare occasions bugs creep into the latest version. I normally keep a backup of two previous versions of the engine and the macro package, and have rollback back on two or three occasions (usually when close to a deadline, when I have no time to see why something fails). Rolling back is relatively simple if your package manager or TeX installation supports it. Most Linux distributions allow you to rollback and I believe that the latest TeX Live also supports rollback of packages. Other than that, I have not faced any issues with luatex. I do not use XeTeX, so cannot comment on that.

-
I'm sure that it is not a strict superset. microtype works in pdfTeX but not in LuaTeX. –  Mateus Araújo Sep 15 '10 at 4:41
microtype does work with LuaTeX. –  Philipp Sep 15 '10 at 9:29
So the trouble is only with opentype fonts? And it is in fact a strict superset? –  Mateus Araújo Sep 15 '10 at 22:24
In luatex protrusion works for both opentype (and true type) and type1 (the traditional TeX) fonts. In terms of features, luatex is a superset of pdftex; but it is not completely backwards compatible. So, in some cases, the macro package needs to adapt to luatex. Depending on the package, this can be slow. Hence, all this confusion about microtype. –  Aditya Sep 16 '10 at 2:42

In addition to the other answers, there is also a minor problem with XeTeX: cropping is not available for included graphics.

-
This got fixed a while ago by doing clipping at the PDF level using some specials :-) –  Joseph Wright Feb 22 at 16:25

I tried switching to XeTeX as my standard compilation path recently, and ran into issues with non-english characters in unicode source files: while pdfTeX will happily produce the ö glyph when faced with the word Gröbner and with \usepackage[utf8]{inputenc} in the preamble, XeTeX simply left out the glyph, forcing me to switch back to pdfTeX or use \"o instead.

There may well be an easy fix for this behaviour, but I didn't find it, and didn't particularly (at that time) need the benefits of using XeTeX.

Edited to add: araujoms pointed out in comments to this answer that all my issues with XeTeX are solved completely by the inclusion of \usepackage{fontspec}.

-
Perhaps you had a font issue? If you run xetex without any package in the preamble it won't produce any non-ascii glyphs. Just load fontspec that it will load the Latin Modern font for you, that AFAIK covers all glyphs used in european languages. –  Mateus Araújo Sep 15 '10 at 5:07
Thank you; I tried it and it solved all my issues. I'm moving back to XeLaTex for all my documents now. –  Mikael Vejdemo-Johansson Sep 15 '10 at 5:25
@MateusAraújo: Latin Modern has no cyrillic script. Saying that Latin Modern covers all european glyphs don't you imply that 1/3 of Europe residents are not europeans? –  Igor Kotelnikov Oct 15 '11 at 3:58
@Igor: I think you're too touchy. I added AFAIK precisely because I don't know much about Latin Modern, just that it has been able to display any glyph I try (obviously I have never tried to display a cyrillic glyph). –  Mateus Araújo Oct 15 '11 at 5:35

XeTeX still has troubles with importing movies. See Why \movieref does not work under XeLaTeX. This was my main motivation for moving to LuaTeX not XeTeX from PDFLaTeX. Unfortunately, LuaLaTeX is visibly slower that XeLaTeX, at least for my very specific document.

-
Can you see what part is slower? The font loading or the typesetting? Anything else? –  topskip Oct 15 '11 at 6:51

XeTeX runs 3 times slower than latex-dvips-ps2pdf as explained in Why does xelatex execute much much slower than latex-dvips-ps2pdf?

-
Why are you comparing it with latex-dvips-ps2pdf instead of pdflatex? And also how slow is very very slow? –  Mateus Araújo Jun 15 '11 at 3:48
@Mateus: Because I don't use pdflatex for my work that make use of PSTricks. Please see the link, 3 times slower :-) –  xport Jun 15 '11 at 3:54
Okay, but if xelatex is the same speed as pdflatex, then it is hardly a drawback of XeTeX per se, which was my original question. I'd be interested to see a speed comparison between xelatex, pdflatex and lualatex, if you're so inclined. Also consider editing your answer to include the "3 times slower". Is more informative and less subjective. –  Mateus Araújo Jun 15 '11 at 4:04