TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have just started to have a look at XeTeX and I am wondering whether to make the switch, however I am a bit scared... ...and I am basically wondering if I have to take the step fully or if I can have my document running on both engines somehow?

There seems to be some problems with utf8 encodings but can they be solved?

share|improve this question
You want a polyglot document? – Seamus Apr 6 '11 at 14:35
related question: tex.stackexchange.com/questions/2984/… – matth May 2 '12 at 9:26
up vote 30 down vote accepted

You can use ifxetex to insert code meant only for one engine. Basically you will have to adapt inputenc (don't load it with xetex), font loading, perhaps language setup (babel/polyglossia), perhaps some driver options (but in general packages load the correct driver automatically).

 %font commands
 %font packages
share|improve this answer
\ifxetex requires the ifxetex package, of course. – wasteofspace Apr 6 '11 at 18:28
And there's \ifluatex all the same. – ℝaphink Aug 7 '12 at 14:54
Maybe a little problem with the aux files, like .toc by example, if you use non ascii character. – jpayansomet Mar 21 '13 at 19:35

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.