# Switching to an “enhanced” latex

I'm a long time LaTeX user and have a pretty efficient workflow already set up for writing LaTeX document, however I've pretty much missed the entire wave of "alternate" and "enhanced" LaTeX replacements like LuaTeX and XeTeX. I've been wanting to try out a new typesetting engine, but am interested in making a switch only to something that I can keep using long term.

For someone writing for the sciences, what would be an efficient path to switch from LaTeX, minimizing the dip in productivity? Particularly, how well do existing LaTeX packages (of most interest - publisher specific packages like revtex) interface with LaTeX alternatives? Are there any distinct advantages that someone writing for scientific publication or engineering documentation would find useful in other *TeX's ?

The main advantages of using xelatex or lualatex (my personal favorite) instead of pdflatex are:

• you get native utf8 compatibility,
• you can use any OpenType and TrueType font, i.e. basically any font,
• you can use advanced font features, such as special ligatures, alternate glyphs, etc, and
• you can easily add code scripts inside your TeX files, and these can even access TeX internals (lualatex only, and only for the braves :)),
• you make the switch to a modern TeX engine, something you will anyways have to do one day (lualatex is the official successor to pdflatex AFAIK).

As for drawbacks / incompatibilities, there are no real technical hurdles that should prevent someone from switching IMHO:

• pstricks doesn't work, but pgf/tikz is superior anyways,
• most of the features of microtype are now available (under lualatex, only character protrusion is available under xelatex) and the few remaining are being worked on,
• polyglossia is not a perfect replacement yet for babel but it's not that of a showstopper in my view, and
• last time I checked, xe- / lualatex replacement for CJK weren't yet up to par with it, but it's irrelevant for most western users (and I assume you are).

So, the biggest showstopper in my opinion is not that something is preventing you to migrate, but someone: most journals who only accept pdflatex-compatible input and will probably be the last ones to make the switch, your thesis supervisor who is too old to learn something new, your colleagues who are too lazy to, ... :(

For detailed lists about the switches from pdflatex to xe- or lualatex, check these questions:

• pstricks works fine with xelatex. – Torbjørn T. Jul 27 '13 at 15:24
• @TorbjørnT. Oh, I always thought it didn't... Well, that's one less reason not to switch! – Xavier Jul 27 '13 at 15:25
• Most of microtypes features don't work with XeLaTeX, at least according to the doc as I understand: Letterspacing, font expansion, interword spacing and kerning. – Juri Robl Jul 27 '13 at 15:34
• @JuriRobl True, just corrected my answer for that. I am a lualatex user, and thought that the features were also implemented for / in xelatex. – Xavier Jul 27 '13 at 19:08

There are a few things you have to change in your document, like the fontenc package. Also there are some packages which you don't work or have only limited functionality (at least at the moment), like microtype. And LuaLaTex compiling takes ages compared to pdflatex (at least in my experience).

You can on the other hand use any fonts installed on your system, and there are some packages only available for LuaLaTex. And of course you can use lua with LuaLaTex, which is really easy compared to programming in (La)TeX.

It is not so much an either/or as it is a need of specific features, as summarized by Xavier. There's not much difference. For instance with XeLaTeX/LuaLaTeX you can more readily choose system fonts, but with XeLaTeX you're missing some microtype features (its biggest drawback). Both XeLaTeX and LuaLaTeX are notably slower on my system with large documents. So sometimes I use pdfLaTex while drafting and switch to XeLaTeX towards the end.

It's pretty easy to make documents that can be used with different TeX flavors, for instance using the iftex package.

Here's an example of a document that various over the engine.

\documentclass[paper=a6]{scrartcl}
\usepackage[english]{babel}
\usepackage{iftex}
\ifPDFTeX% when compiling with pdflatex
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[largesmallcaps, fulloldstylenums, widermath]{kpfonts}
\else% when compiling with xe- or lualatex
\usepackage[math-style=ISO]{unicode-math}
\usepackage{fontspec}
\defaultfontfeatures{Numbers=OldStyle}
\setmathfont[Scale=MatchLowercase]{TeX Gyre Pagella Math}
\fi
$$y=x^2+\epsilon$$