XeLaTex and TexMaker “cannot-use-pdftex”

I would like to use the CV template provided by this link.

In the .tex file the author recommends to compile with XeLaTeX. In TeXmaker 4.0, I've used the right option to compile but the following error showed up:

! Fatal fontspec error: "cannot-use-pdftex"

Should I try to compile using the LuaLaTeX support?

EDIT The texlive-xetex package was not installed on the system

sudo apt-get install texlive-xetex


-> Now I can compile. Another error came out:

File layaureo.sty' not found

EDIT 2 I installed texlive-lang-italian package

sudo apt-get install texlive-lang-italian


Now the error is:

! Font \XeTeXLink@font=pzdr at 0.00002pt not loadable: Metric (TFM) file or ins

Solved using

sudo apt-get install texlive-fonts-recommended


from my old question

-
Then you are not using XeLaTeX. May be add %!TEX TS-program = xelatex as the first line of the document. –  Manuel Apr 23 at 21:17
I've added it to the first line. Still getting the same error. –  narutov6 Apr 23 at 22:29
Sorry, I misunderstood TeXWorks, I don't know if TeXMaker follows those directives. Are you sure you told the program to call XeLaTeX? Because for what you say, it seems that it's calling pdfLaTeX. –  Manuel Apr 23 at 22:40
Yes it was correctly set up. The texlive-xetex package was not installed! That's weird, it should have been marked as a dependency for the texmaker –  narutov6 Apr 23 at 22:58

If you compile with XeLaTeX and have the Fontin fonts installed on your system it works fine after some modifications to the preamble and the very beginning of the file.

The main modifications consisted in deleting some obsolete options or packages, and the \fb switch-font command defined just after \begin{document}; re-defining it with fontspec and using Latin Modern rather than Computer Modern since the former exists in Opentype format.

Here is the beginning I used to compile:

%----------------------------------------------------------------------------------------
%   PACKAGES AND OTHER DOCUMENT CONFIGURATIONS
%----------------------------------------------------------------------------------------

\documentclass[a4paper,10pt]{article} % Default font size and paper size

\defaultfontfeatures{Mapping=tex-text}
\setmainfont[SmallCapsFont = Fontin SmallCaps]{Fontin} % Main document font
\newfontface\fb{LMRoman10}

\usepackage{parskip, url} % Formatting packages%% xunicode,xltxtra are obsolete
\usepackage[dvipsnames]{xcolor} % Required for specifying custom colors usenames,
%% usenames is an obsolete option

\usepackage[big]{layaureo} % Margin formatting of the A4 page, an alternative to layaureo %can be \usepackage{fullpage}
% To reduce the height of the top margin uncomment: \addtolength{\voffset}{-1.3cm}

\usepackage{titlesec} % Used to customize the \section command
\titleformat{\section}{\Large\scshape\raggedright}{}{0em}{}[\titlerule] % Text formatting of sections
\titlespacing{\section}{0pt}{3pt}{3pt} % Spacing around sections

\begin{document}

\pagestyle{empty} % Removes page numbering

%----------------------------------------------------------------------------------------
%   NAME AND CONTACT INFORMATION
%----------------------------------------------------------------------------------------

-
I've deleted the \fp command. Same Error Fatal fontspec error: "cannot-use-pdftex". The fontspec package requires either XeTeX or LuaTeX to function. You must change your typesetting engine to, e.g., "xelatex" or "lualatex" instead of plain "latex" or "pdflatex". See the fontspec documentation for further information. –  narutov6 Apr 23 at 22:37
I finally found out what's the problem (personally I use WinEdt so it took me some time to understand why it compiled fine with me and not with you…). The reason is that 1) there is no XeLaTeX submenu in the Tools menu 2) Quick Build (F1 key) has pdflatex as the default engine. So you have to go to Options -> Configure TeXmaker and change Quick Build settings in favour of XeLaTeX. Now I can compile even from TeXmaker –  Bernard Apr 23 at 23:30
Thank you. The problem was the missing xetex package –  narutov6 Apr 23 at 23:38
xetex is not a package, but one of the tex engines — unfortunately not easily accessible from within TeXmaker:( –  Bernard Apr 23 at 23:47

The package required to compile using XeLaTeX was not installed on my linux ditribution. Solved with:

sudo apt-get install texlive-xetex
`
-