Possible Duplicate:
Can I write a document that is compilable with both latex and xetex?

I use XeLaTeX for my documents, and have a font set that I like. However, I also work with coauthors who aren't quite ready for xelatex yet, and use PDFLaTeX (or even plain LaTeX).

I'd like to construct a macro that includes certain content (fontspec and certain font packages) if I use XeLaTeX and other content if using PDFLaTeX/LaTeX. For example, something like

\if <*using xelatex*>
\setmainfont{<*my favorite font*>}

How would I set this up?

marked as duplicate by egreg, lockstep, N.N., Joseph Wright Oct 7 '11 at 15:37

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

Browse other questions tagged or ask your own question.