24

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?

jonalv
  • 11,466

1 Answers1

33

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).

\usepackage{ifxetex}
\ifxetex
 \usepackage{fontspec}
 %font commands
\else
 \usepackage[utf8]{inputenc}
 \usepackage[T1]{fontenc}
 %font packages
\fi
Ulrike Fischer
  • 327,261