[Tex/LaTex] Compile with XeLaTeX in TeXstudio

compilingerrorstexstudio

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:

\documentclass[xcolor=sgvnames,a4paper,12pt,abntfigtabnum,normaltoc,capchap,rm,amstex,t]{report}
\usepackage[portuguese]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{fontspec,xltxtra,xunicode}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\title{Equa\c{c}\~oes Diferenciais Ordinárias}
\author{Raimundo Benedito do Nascimento}
%\date{}                                          

\begin{document}
\maketitle
\chapter{Introdu\c cão}
\section{Preliminares}
\end{document} 

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?

Best Answer

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

I have the Italian version of TeXstudio:

enter image description here

Related Question