# What is XeTeX exactly and why should I use it?

I have been using LaTeX for five years now and have been using PDFLaTeX ever since. I find it hard to monitor the progress of LaTeX development. Recently there is a lot of talk about XeTeX. What is that exactly? Does it make sense to switch to it?

• Related questions: Differences between LuaTeX, ConTeXt and XeTeX really covers this, and Frequently loaded packages: Differences between pdfLaTeX and XeLaTeX has useful pointers on moving from Pdflatex to Xelatex. Sep 23, 2010 at 7:16
• One feature that I don't like is: Neither `xetex` nor `xelatex` support clipping! See this warning message. Aug 3, 2011 at 15:56
• `xetex` cannot determine the correct dimension of imported JPG images. We must convert the JPG to PDF first then `xetex` can produce the correct output. See here for the details. Aug 3, 2011 at 21:26
• This piece does a great job of explaining the differences between LaTeX, pdfTeX, XeLaTeX, LuaTeX, and ConTeXt: sharelatex.com/blog/2012/12/01/… Jul 15, 2013 at 1:29
• One of the many problems with the Stack Exchange network is that even though it's been 10 years since this question was asked, and I'd like to know what the current answer to the question would be, to ask it as a separate question would be considered duplication. Mar 23, 2020 at 20:20

If you have trouble with fonts and character sets, it may be for you: lots of people have the experience that things just work with Xetex which require fiddling with Pdftex. Two capabilities:

1. Xetex assumes its input is Unicode. To use Unicode with Pdftex, you need Tex code that manipulates encoding tables, like the `{inputenc}` Latex package;
2. Xetex treats many system fonts, like TTF and OTF, on a par with Tex fonts. Using them is generally no harder than giving the path to the fonts. Pdftex needs to have the font metrics described to it for system fonts. Luatex can figure out this from system fonts, but it's not a perfectly troublefree matter yet.

If these aren't issues for you, then there's not much reason to consider moving to Xetex. Pdftex has more sophisticated microtypography.

Look at Joseph Wright's answer to the Differences between LuaTeX, ConTeXt and XeTeX question: Luatex is intended to be the successor project to Pdftex, and he is informative about what is ahead.

• On point 1, if you use any non-European script, using XeTeX makes life simple, and should be your first choice. The `inputenc` package only covers a limited part of Unicode. Aug 3, 2011 at 15:55
• @AlanMunn But is pdfLaTeX still preferred for less popular languages which are supported by babel but not polyglossia? People talk as though XeLaTeX/LuaLaTeX is a linguist's dream and I'm sure that's true for some languages (especially those written in non-Latin alphabets) but I can't figure out any solution for hyphenation in polyglossia for some languages. Or can you continue to use babel with XeLaTeX/LuaLaTeX? (I had the impression not but its only an impression.) EDIT: Isee the next ans. says babel works but is not recommended. Why not?
– cfr
Jan 15, 2014 at 23:38
• @AlanMunn Thanks. Do you happen to know: Is the plan for polyglossia to eventually replace babel? If so, will languages currently supported by babel get support in polyglossia or will support for them disappear (or is this just unknown)?
– cfr
Jan 16, 2014 at 0:12
• @cfr Plan? You think there's a plan? :) This is open source software... But seriously, I think that both packages will develop independently and the invisible hand of the market will decide. (And I can't believe I just said that!) Jan 16, 2014 at 17:03
• @AlanMunn Open source doesn't mean there's no plan. Indeed, their proliferation is sometimes a challenge in itself. Whether any of them get carried out is a different question. ;) I guess I am just worried that languages supported by babel will disappear and TeX without hyphenation patterns is not much use. So I was really just wondering if anybody had thought much about this since polyglossia currently focuses support on a popular subset of languages supported by babel, as far as I can tell. But thanks for the insight. If babel continues to develop, that's much more hopeful.
– cfr
Jan 16, 2014 at 19:40

I've switched to XeLaTeX a couple of months ago in order to use Open Type Fonts. Although I find the system stable and easy to use with the excellent `fontspec` package, there a few issues that should be mentioned:

• If you are using ligatures such as old style figures you cannot copy & paste text from a PDF (see Small-caps, old-style numbers, and some ligatures produce odd symbols in PDF copy text?). Instead that text will be represented by missing symbols. That is an absolute killer if you want your documents do be indexed or want that others can copy and paste easily.

• Someone (not me) mentioned on tex.sx that development of XeTeX has been progressing very slowly as the developer is busy with other things (no rant or criticism intended!). That means that it might take very long for a particular feature to be implemented or bugs to be fixed.

• As mentioned before, microtypography is currently an issue with XeTeX.

• It is recommended not to use `babel` with XeTeX (although it works if you are just using "Latin" languages).

These four issues (particularly the first one!) have convinced me to use LuaTeX instead of XeTeX as all of them are resolved in LuaTeX. I have yet to find any issues with it (apart from that it is a little slow with my fairly complicated templates). So if you want to change from pdfLaTeX you could also consider LuaTeX.

• Are any of these issues resolved with Lua(La)TeX?
– Ingo
Mar 28, 2012 at 10:21
• Yes, that's what I wanted to say (obviously not clearly enough). 1) Copy and paste of ligatures is possible, just as it is in PdfLaTex. 2) AFAIK the development team is very active. 3) LuaTeX supports protrusion and font expansion directly. 4) Babel is supported, although polyglossia is not (yet).
– Jörg
Mar 28, 2012 at 10:55
• "ligatures such as old style figures"… text figures and ligatures are different things, no?
– mk12
May 26, 2013 at 20:20

Here is a point that is implicit in the thorough comments and linked answers referenced above, but possibly not obvious.

Installing and managing fonts in traditional TeX systems can be daunting. For me, given that I want to focus on writing rather than software management, messing around with fonts was often not worth the trouble. XeTeX allows me to use lots of fonts easily while remaining ignorant (i.e. while allowing me to keep my time free for learning those things that are most important for me). On a Mac, at least, it's trivially easy to install fonts using a program like OS X's Font Book, and then XeTeX lets me pull those fonts into my LaTeX documents. Sounds like something similar is true for other popular operating systems.

With XeLaTeX you can just write texts of different languages together, as simple and natural as you do in Notepad, HTML, Microsoft Word and any other modern ones. You don't need to learn and write `babel` or `CJK` just to get the things done as they should be.

I don't use many fonts so not familiar to XeLaTeX's advantages on fonts.

• Sadly, without `babel`, words in languages other than English won't be hyphenated correctly, so XeTeX all by itself isn't much help. Apr 4, 2020 at 14:38