# Compile with XeLaTeX in TeXstudio [closed]

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


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