To compile files that require XeLaTeX-specific options using LaTeX, use the \ifx\XeTeXversion\undefined
check.
\documentclass[a4paper,12pt]{report}
\ifx\XeTeXversion\undefined
\usepackage[utf8]{inputenc}
\else
\usepackage{fontspec}
\usepackage{xunicode}
\usepackage{xltxtra}
\setmainfont[Mapping=tex-text]{Gentium}
\fi
\begin{document}
\ifx\XeTeXversion\undefined
Hello World from LaTeX!
\else
Hello World from XeLaTeX!
\fi
\end{document}
No comments:
Post a Comment