<< | Page list | >>
How to use LyX with LuaTeX
LuaTeX is a new TeX typesetting engine that fully supports Unicode and modern font technologies such as OpenType. It has been designed by parts of the pdfTeX team as the dedicated successor of pdfTeX, the current standard engine. Like XeTeX, LuaTeX allows the user to use any font installed on the system it runs on. Font selection and manipulation is controlled by the package (fontspec) also used in XeTeX. Compared to XeTeX, LuaTeX supports font expansion using the microtype package. When LuaTeX is directed to use font expansion, it may use a wider or narrower variant of a font to make interword spacing more even and lower the number of hyphenated words. See the documentation for the microtype package for more details (microtype is installed by default by TeXLive and MiKTeX). However, some microtypographic features are not supported by LuaTeX yet, namely kerning and spacing (see table 1 in section 3.1 of microtype's manual). If you need one of those features in your document, you are better off with pdfTeX.
Furthermore, LuaTeX also has a dedicated scripting interface (which, as the name implies, can run scripts in the language Lua). This allows for several tricks that are not possible with classic LaTeX or XeTeX. For instance, you can send your document through a spell-checker while outputting it to PDF (the errors will be marked in the PDF), you can extract all actual hyphenations to a typified list (which helps hyphenation checking), selectively disable ligatures and all sort of other fancy stuff (development on this has just started).
LuaTeX is still in beta status, although it is improving rapidly.
Modern fonts often have additional features that are only available in their OpenType format. For instance, TeX Gyre Termes is a free Times clone that offers, among other features old-style (lower case) numerals. They cannot be used as standard replacement for lining numerals unless the OpenType version of the font is used. The standard engine pdfTeX cannot use OpenType fonts, whereas XeTeX and LuaTeX can. But only LuaTeX currently supports both OpenType support and font expansion.
In short: Use LuaTeX whenever you need to use OpenType fonts and you require microtypographical features that XeTeX does not support.
Both LuaTeX and XeTeX allow to use any OpenType and TrueType font for your documents, and both support Unicode natively. However, there are pros and cons for either engine, which will be sketched in what follows.
XeTeX only supports PDF while LuaTeX supports DVI and PostScript output additionally.
Furthermore, LuaTeX has a scripting interface which allows for some fancy processing tricks (see above for some examples).
XeTeX supports less microtypographic features than LuaTeX.
However, XeTeX currently supports more writing systems and scripts (Arabic, Hindi, etc.) than LuaTeX. XeTeX is thus the preferred engine for most languages that use non-alphabetic or non-Right-to-Left scripts.
As of version 0.76, LuaTeX does not support 1
Also, XeTeX exists and has been productively used for longer time than LuaTeX. So LuaTeX can be considered less "mature" and "stable" than XeTeX.
Since LyX 2.0 you only need to click Document→Settings→Fonts→Use non-TeX fonts (via XeTeX/LuaTeX). Then you can immediately View→PDF (LuaTeX) or View→DVI (LuaTeX).
A bug in LuaTeX means that fonts installed in your user directory may not be available on some systems (e.g. recent Ubuntu). In brief, the trouble is that LuaTeX does not know to look in
ln -s ~/.local/share/fonts ~/.fonts
If you already have a
See the explanation of the XeTeX site.