While I’m no expert in either XeLaTeX or LuaLaTeX, I’ve used both a bit, so I’ll try to write up some things that I’ve noticed in the “front-end” superficial user level.
fontspec
... is the standard way of using fonts with both engines. I haven’t noticed remarkable differences in the outcome or font selection, but according to the comments to this question, there seem to be some.
This means, of course, that neither inputenc
nor fontenc
should be used. Do make sure to save your .tex file in UTF-8.
microtype
Version 2.5 from 2013-03-13 seems to have improved XeLaTeX support a lot. For LuaLaTeX (and pdfLaTeX), protrusion and expansion are supported; for XeLaTeX it’s only protrusion. Since microtype
typically works great without further configuration, you can simply load it for any of the engines.
babel
/polyglossia
polyglossia
only works with XeLaTeX. A minimal setup of babel
works with both engines (I think a recent update also included some improvements for XeLaTeX, is that right?), but the package description on CTAN still says: “Users of XeTeX are advised to use polyglossia
rather than babel
.” Hence, I’d follow that advice and use babel
with LuaLaTeX (and pdfLaTeX), but polyglossia
with XeLaTeX. That’s certainly the way it used to be.
xunicode
On up-to-date systems, this package should not be necessary at all – that seems to be the verdict here on tex.sx. If anywhere, it should only be used with XeLaTeX; in fact, it produces an error message in LuaLaTeX (unless it’s loaded after fontspec
).
LuaLaTeX-only packages
While there probably are some packages specifically tailored for XeLaTeX, I would assume there are (and will be) many more for LuaLaTeX, making use of the scripting language Lua being tightly tied into the engine. Two that I have used so far are Patrick’s lua-check-hyphen
, enabling you to easily check all hyphenations that occur in your document, and Mico’s selnolig
(announcement on meta), which automatically suppresses typographically undesirable ligatures for English and German, based on an extensive pattern list. (Check it out.)
Best Answer
luatex is an implementation of the TeX engine that has the lua programming language embedded in it. Lua functions can be written to do some of the heavy programmatic lifting that the TeX engine is not terribly good at. ConTeXt MkIV is powered by luatex.
XeTeX is an extension to the TeX engine that allows the use of open type fonts installed to the operating system. the fontspec package in conjunction with xetex provides access to system fonts.