# Considerations when migrating from XeTeX to LuaTeX?

What are the things to know when moving from XeTeX to LuaTeX, particularly when it comes to TTF/OTF support and OpenType features?

The only difference is for Linux: OpenType or TrueType fonts from the TeX directory structure, e.g. the texgyre fonts, have to be assigned by its filename for `XeTeX`, e.g. `\fontspec{texgyre-pagella.otf}`. LuaTeX itself also searches the TeX font directories, the reason why LuaTeX finds such font defined by its family name, e.g. `\fontspec{TexGyre-Pagella}`. For MiKTeX it should make no difference, fonts should be found.

The package `mathspec` works only for `XeTeX`. And `polyglossia` doesn't work with LuaLaTeX yet.

• In XeTeX on Linux, I currently use the font name, not the font filename. For example, I do `\fontspec{Linux Libertine O}` and it works. Does `fontspec` work with LuaLaTeX? I get an error when I run `lualatex` on a tex file using `fontspec` (using TL2009)... – raphink Jul 20 '11 at 14:47
• Are you sure that font names don't work on TeXLive? The font database is generated by lualatex/luaotfload/mkluatexfontsdb and if a font is found at all why shouldn't the font name be in the database too? There is certainly no problem on miktex, lualatex accepts even a lot of name variants like `\setmainfont{TeXGyrePagella}`. – Ulrike Fischer Jul 20 '11 at 15:03
• @Ulrike: I wrote, that `XeTeX` needs the file name! – user2478 Jul 20 '11 at 15:34
• Ah. Sorry I read it the other way round. Doesn't this here solve the problem: tug.org/texlive/doc/texlive-en/texlive-en.html#x1-350003.4.4? (But it can also lead to trouble if too much folders are searched and used by xetex. XeTeX doesn't like it very much if a font exists in two variants.) – Ulrike Fischer Jul 20 '11 at 16:01
• @Ulrike, sure that's the problem but LuaTeX solved it in user friendly way, XeTeX not ... and of course, all fonts should go into one system and one local folder. – user2478 Jul 21 '11 at 9:47

If you want to move from XeLaTeX to LuaLaTeX, you should read lualatex-doc. If you want to use from ConTeX MkII to MkIV, many things will change.

• I'm interested in moving to a modern cutting-edge system, and mostly benefiting from font expansion while still keep an easy way to manage TTF/OTF fonts with OpenType features. I do not plan on using ConTeXt though, but rather keep with LaTeX for now (I'm using specific LaTeX packages such as `bibleref`). – raphink Jul 20 '11 at 21:12

There are some caveats with multilingual typesetting with OpenType shaping features; I'm not really the one to ask about it, though. XeTeX uses the ICU to do its OpenType magic, which as I understand things is a lot more comprehensive than what's currently done by LuaTeX and its supporting machinery. For example, unless things have changed recently, I don't believe that LuaTeX will be able to typeset Indic languages correctly.

XeTeX isn't a silver bullet here either, but I think its coverage is more comprehensive.

• Most of my needs as far as OpenType features are concerned are ligatures, letter/word spacing, oldstyle/uppercase numbers, small caps, alternate forms. Nothing really fancy. – raphink Jul 21 '11 at 8:24
• In that case no problem :) – Will Robertson Jul 25 '11 at 9:24

As I actually ended up switching from XeTeX to LuaTeX, I've met a few other problems.

Most notably:

• LetterSpace and WordSpace options in `fontspec` are not supported in LuaTeX, so you have to use `textls` from microtype like in PDFTeX in order to achieve tracking;
• `textls` sometimes break with small caps (see textls breaks smallcaps with luatex).

My main motivation for moving from XeTeX to LuaTeX was movies. As it is said in my posts (Can XeLaTeX | LuaTeX import movies ?, Why \movieref does not work under XeLaTeX) XeTeX has troubles with importing movies. The latter one is still unresolved.