I'm working with TexStudio + TexLive 2016, I believe that, among LaTeX editors, TeXstudio has the best user interface, even having a licensed version of WinEdt, I still prefer TeXstudio.

Now I'm compiling with XeLaTeX and LuaLaTeX. The result is OK when I use Winedt or TecnicCenter, but when I use TeXstudio to compile the following code:

\title{Equa\c{c}\~oes Diferenciais Ordinárias}
\author{Raimundo Benedito do Nascimento}

\chapter{Introdu\c cão}

I get the following error message:

Fatal fontspec error: "cannot-use-pdftex"
The fontspec package requires either XeTeX or LuaTeX.
You must change your typesetting engine to, e.g., "xelatex" or "lualatex"
instead of plain "latex" or "pdflatex".
For immediate help type H <return>.

Could you help me, please?

  • 3
    Welcome to TeX.SX! Please note that this site requires that question (and answer) be written in English. Your English need not be perfect, of course, but please try to translate your question, if you want to increase your chances of getting an answer – GuM Apr 30 '17 at 23:22
  • 3
    In any case, your problem seems quite simple, and the error message explains it fully: you are trying to compile your source with pdflatex, not with xelatex… But I’m wondering if you can understand my words too… – GuM Apr 30 '17 at 23:30
  • 4
    I'm voting to close this question as off-topic because it's (a) caused by using pdflatex with fontspec (and the error message solves this) and (b) not written in English. – TeXnician May 1 '17 at 6:56

Your code works if you compile it with Tools > Commands > XeLaTeX.

I have the Italian version of TeXstudio:

enter image description here

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