# Moving from pdfLaTeX to XeTeX - what do I need to know?

I've used pdfLaTeX for some time, but have encountered problems wanting to use other fonts than the defaults. I've been recommended to use XeTeX instead, as this supports usage of system fonts directly without having to convert and fiddle with them to get them to work under pdfLaTeX.

I generated PDF documents directly using `pdflatex`, where all graphics are also PDF documents. Here's a list of the packages I used in my last TeX document:

``````\usepackage[sortcites=true]{biblatex}
\usepackage{babel}
\usepackage{csquotes}
\usepackage{url}
\usepackage{fullpage}
\usepackage{titlesec}
\usepackage{listings}
\usepackage[usenames, dvipsnames]{color}
\usepackage{subfig}
\usepackage{graphicx}
\usepackage{tikz-timing}
\usepackage{lscape}
\usepackage{booktabs}
\usepackage{threeparttable}
``````

I've also used `microtype` and I've heard there's something iffy about that in XeTeX.

Under these circumstances, what do I need to know to successfully (and with as little pain as possible) transition from pdfLaTeX to XeTeX? Are there some packages I cannot use anymore? Or some features that doesn't work in XeTeX? Do I need to change some syntax in the document itself, or rewrite some stuff?

I still want to generated PDf documents as final output, of course, and use PDF documents as graphics. Will that be a problem? I should probably also mention that I run MiKTeX 2.8 on my Windows machine, and latest Ubuntu on my laptop. I write and generate documents on both machines.

-
Perhaps take a look at: tex.stackexchange.com/questions/2984 –  Joseph Wright Dec 23 '10 at 11:43
Why don't you switch from PDFTeX to LuaTeX? It should give you the same benefit while keeping most compatibility with PDFTeX. –  topskip Jun 18 '12 at 10:49

Given your package list, I think it would work as-is, but you should replace the `babel` package by the more modern `polyglossia` package for XeTeX. For font selection use the `fontspec` package, and for microtypography you need the newest development version of the `microtype` package.

Just try to compile the document with XeTeX after making these changes, and if you notice that something is wrong, ask specific questions.

-
For microtype he/she will also need miktex 2.9. I don't think that miktex 2.8. has the actual xetex. Also protrusion will work, but not font expansion. –  Ulrike Fischer Dec 23 '10 at 12:22

Switching from pdflatex to xelatex (tex-live on Ubuntu) went rather smooth in my case for most packages. However, two issues came up I am still struggling with:

1. tikz and transparency: some packages use the preview package internally, and there is an issue with tikz+transparency+preview. See Transparency in tikz, preview package and xelatex

2. pdf layers (OCG) seem to no longer work, as existing packages build on pdflatex functionality not available in xelatex. See PDF Layers (OCG) using xelatex

-
I could solve issue 1 by upgrading my LaTeX distribution from TL2009 (which comes with my Ubuntu 10.04 LTS version) to TL2011. –  TeXter Jun 20 '12 at 4:13
OCG's can be used in xetex now, see the package ocg-p. –  robert.marik.cz Dec 17 '12 at 23:00