The europecv
class is built for pdflatex
: indeed it loads the inputenc
package with the utf8x
option. One can overcome the limitation with some tricks:
\makeatletter
\@namedef{ver@inputenc.sty}{} % pretend that inputenc has been loaded
\@namedef{opt@inputenc.sty}{utf8x} % with the utf8x option
\makeatother
\documentclass[narrow,german]{europecv}
% fontspec doesn't want to see inputenc loaded,
% so now we pretend it hasn't been
\expandafter\let\csname ver@inputenc.sty\endcsname\relax
% europecv uses the \inputencoding command, that we neutralize
\providecommand{\inputencoding}[1]{}
\usepackage[a4paper,top=1.27cm,left=1.2cm,right=1cm,bottom=2cm]{geometry}
\usepackage[ngerman]{babel}
\usepackage{graphicx,fontspec}
\setmainfont[Ligatures=TeX]{Linux Biolinum O}
\ecvlastname{}
\ecvfirstname{}
\ecvaddress{}
\ecvtelephone{}
\ecvemail{}
\ecvnationality{}
\ecvdateofbirth{}
\ecvgender{}
\begin{document}
\begin{europecv}
\ecvpersonalinfo[1em]
\ecvsection{Bla Bla}
\ecvitem{}{}
\ecvitem{}{}
\ecvitem{}{}
\end{europecv}
\end{document}
You have to define a main font for the document, in order that the styles are correctly applied. The helvetica
option doesn't do anything with XeLaTeX.
It's probably better to stick with pdflatex
(or ask the class author to provide a XeLaTeX compatible version).
Actually, the patch to europecv.cls
would be very easy: change the lines
\LoadClass{article}
\RequirePackage{ucs}
\RequirePackage[utf8x]{inputenc}
into
\LoadClass{article}
\RequirePackage{ifxetex,ifluatex}
\ifxetex
\newcommand\ecv@utf[1]{#1}
\else
\ifluatex
\newcommand\ecv@utf[1]{#1}
\else
\RequirePackage{ucs}
\RequirePackage[utf8x]{inputenc}
\newcommand\ecv@utf[1]{{\inputencoding{utf8x}#1}}
\fi
\fi
assuming that using utf8x
is desirable: probably it would be best left as something to load in the document preamble. In this case the two lines after \LoadClass{article}
should simply be omitted.
The definition of \ecv@utf
appearing at the start of the file should be also omitted.