114

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.

3
  • 10
    At least in the case of luatex, it is the microtype package whose support for luatex is incomplete. Commented Sep 15, 2010 at 7:17
  • 2
    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
    Commented Dec 16, 2012 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.
    – d-cmst
    Commented Nov 8, 2013 at 11:26

9 Answers 9

55

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}
6
  • 1
    Is it possible to use Tracking/Letterspacing with luaLaTeX?
    – lockstep
    Commented Sep 19, 2010 at 21:20
  • 5
    \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). Commented Sep 20, 2010 at 8:49
  • 7
    Can anyone confirm if this is still valid in 2013? Commented Jul 7, 2013 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
    Commented Mar 24, 2015 at 16:49
  • 1
    @IgorKotelnikov: Yes you are right, this has changed. Also the claim that polyglossia can not be used with lualatex is no longer always true. But 5 years old question can get outdated ... Commented Dec 9, 2015 at 8:15
32

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.

2
  • 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
    Commented Sep 26, 2011 at 19:52
  • 18
    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? Commented Sep 26, 2011 at 20:17
31

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.

3
  • 1
    Micro-typography for OTF fonts isn't really stable yet - For what engine? Are you talking about the trouble with the microtype package? Commented Sep 15, 2010 at 12:19
  • Thank you for the XeTeX 64bit info. I was wondering why it always segfaults on my math documents.
    – Caramdir
    Commented Sep 15, 2010 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
    Commented Sep 15, 2010 at 18:34
18

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.

4
  • 1
    I'm sure that it is not a strict superset. microtype works in pdfTeX but not in LuaTeX. Commented Sep 15, 2010 at 4:41
  • 4
    microtype does work with LuaTeX.
    – Philipp
    Commented Sep 15, 2010 at 9:29
  • So the trouble is only with opentype fonts? And it is in fact a strict superset? Commented Sep 15, 2010 at 22:24
  • 10
    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
    Commented Sep 16, 2010 at 2:42
6

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

1
  • 6
    This got fixed a while ago by doing clipping at the PDF level using some specials :-)
    – Joseph Wright
    Commented Feb 22, 2015 at 16:25
2

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}.

4
  • 12
    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. Commented Sep 15, 2010 at 5:07
  • 1
    Thank you; I tried it and it solved all my issues. I'm moving back to XeLaTex for all my documents now. Commented Sep 15, 2010 at 5:25
  • 1
    @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? Commented Oct 15, 2011 at 3:58
  • 2
    @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). Commented Oct 15, 2011 at 5:35
2

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.

1
  • Can you see what part is slower? The font loading or the typesetting? Anything else?
    – topskip
    Commented Oct 15, 2011 at 6:51
2

As it turned out in An equivalent of psfrag and polyglossia together?, you cannot use psfrag with XeLaTeX. For me it was a serious problem.

1

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

3
  • 4
    Why are you comparing it with latex-dvips-ps2pdf instead of pdflatex? And also how slow is very very slow? Commented Jun 15, 2011 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 :-) Commented Jun 15, 2011 at 3:54
  • 7
    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. Commented Jun 15, 2011 at 4:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .