# How can I use LuaLaTeX for europasscv?

I want to write a europasscv in the same format as my other material for application etc., for which I use LuaLaTeX. The problem up to now is that I can't even make use of TeX Gyre Heros as sansfont, which is the mainfont in europassv. euopasscv doesn't seem to accept neither LuaLaTex nor fontspec.

% -- mode: latex; TeX-engine: luatex; coding: utf-8; --
\RequirePackage{xparse}
\setmainfont{TeX Gyre Heros}% [ItalicFont=TeXGyreHeros-Italic,
%              BoldFont=TeXGyreHeros-Bold,
%              BoldItalicFont=TeXGyreHeros-BoldItalic]
\setromanfont{TeX Gyre Heros}
\setsansfont{TeX Gyre Heros}% [ItalicFont=TeXGyreHeros-Italic,
%              BoldFont=TeXGyreHeros-Bold,
%              BoldItalicFont=TeXGyreHeros-BoldItalic]
\usepackage{polyglossia}
\setmainlanguage[latesthyphen=true,babelshorthands=true]{german}
\setotherlanguage[variant=british]{english}
\ecvname{My Self}
\ecvtelephone[(+49) 1234 5689]{(+49) 1234 56789}
\ecvemail{My.Self@me.me}
\ecvnationality{deutsch}
\begin{document}
\begin{europasscv}
\ecvpersonalinfo
\ecvbigitem{Angestrebter Beruf}{Bla}
\ecvsection{Berufserfahrung}
\ecvtitle{Oktober 2003 -- Juli 2004}{\emph{teaching fellow}}
\ecvitem{}{Council\newline 123, Sample Kay, 75023 Smurftown}
\ecvitem{}{Evaluation of Smurfs}
\end{europasscv}
\end{document}




LaTeX Font Warning: Font shape EU2/qhv/m/n' undefined
(Font)              usingEU2/lmr/m/n' instead on input line 20.
[...]
ABD: EveryShipout initializing macros
* XeTeX expects the source to be in UTF8 encoding %<--I'm not using XeTeX!
*** some features of other encodings may conflict, resulting in poor output.
LaTeX Font Warning: Font shape EU2/phv/m/n' undefined
(Font)              usingEU2/lmr/m/n' instead on input line 40.

As a result I neither get Heros as sansfont nor does it use any other sansfont. Instead it uses only LMRoman. Without fontspec and polyglossia it works with LuaLaTeX, but then I can't use neither the fonts I'd like to nor specials of the german language.

• If you wan't to prevent the loading of packages you can use \RequirePackage{scrlfile}\PreventPackageFromLoading{inputenc}. – Manuel Mar 11 '15 at 23:30
• In my TeXlive installation I don't have a europasscv.cls file, but only a europecv.cls file. Is it a custom class? – Astrinus Mar 11 '15 at 23:35
• Useful -- but it doesn't work in this case. – Alexander Wittmann Mar 11 '15 at 23:35
• @Astrinus: It's there in TeXLive 2014, quite new – user31729 Mar 11 '15 at 23:36
• It is a f[ra]cking new class: ctan.org/tex-archive/macros/latex/contrib/europasscv – Alexander Wittmann Mar 11 '15 at 23:37

The europasscv is not really designed for usage with some other font and with xelatex/lualatex compilation.

One way is to use the brute force and explicitly add \sffamily to the various \ecv... commands and finally, within the europasscv environment.

%\RequirePackage{xparse}
\usepackage{fontspec}
\setmainfont[
Extension=.otf,
UprightFont= *-regular,
BoldFont=*-bold,
ItalicFont=*-italic,
BoldItalicFont=*-bolditalic,
]{texgyreheros}

\setromanfont{texgyreheros}
\setsansfont[Extension=.otf,
UprightFont= *-regular,
BoldFont=*-bold,
ItalicFont=*-italic,
BoldItalicFont=*-bolditalic]
{texgyreheros}%

\usepackage{polyglossia}

\usepackage{xpatch}

\makeatletter
\makeatother

\renewcommand{\ecvcoloredtitle}{\sffamily\textcolor{ecvhighlightcolor}{\ecvcurrvitae}}
\renewcommand{\ecvsectionstyle}[1]{\textcolor{ecvsectioncolor}{\sffamily\MakeUppercase{\expandafter{#1}}}}
\renewcommand{\ecvbluenormalstyle}[1]{\sffamily\textcolor{ecvsectioncolor}{#1}}
\renewcommand{\ecvtitlestyle}[1]{\large{\ecvbluenormalstyle{#1}}}
\renewcommand{\ecvlargenormalstyle}[1]{\large \sffamily #1}
\renewcommand{\ecvLargenormalstyle}[1]{\Large \sffamily #1}

\setmainlanguage[latesthyphen=true,babelshorthands=true]{german}
\setotherlanguage[variant=british]{english}

\ecvname{My Self}
\ecvtelephone[(+49) 1234 5689]{(+49) 1234 56789}
\ecvemail{My.Self@me.me}
\ecvnationality{deutsch}

\begin{document}
\begin{europasscv}
\sffamily % Explicitly switch to sans serif
\ecvpersonalinfo
\ecvbigitem{Angestrebter Beruf}{Bla}
\ecvsection{Berufserfahrung}
\ecvtitle{Oktober 2003 -- Juli 2004}{\emph{teaching fellow}}
\ecvitem{}{Council\newline 123, Sample Kay, 75023 Smurftown}
\ecvitem{}{Evaluation of Smurfs}
\end{europasscv}
\end{document}


• According to the current fontspec manual, \setromanfont is the old form of \setmainfont and is retained only for backward compatibility. Since the example code features a \setmainfont instruction, the \setromanfont is redundant. Separately, the options passed to the \setmainfont and \setsansfont instructions are all the default ones for an otf font, and those options may thus be omitted as well. A final, truly minor, quibble: In the argument of \ecvfootnote, I'd write 2002--2014 rather than 2002-2014 in order to get an en-dash... – Mico Mar 12 '15 at 6:28
• @Mico: I am not very into xelatex so far, you I appreciate your comments of course. The -- stuff I just copied from the class ... blame the maintainer ;-) – user31729 Mar 13 '15 at 12:28
• @AlexanderWittmann: There is a new version of europasscv on TeXLive (I don't check so far), perhaps it's improved – user31729 Mar 13 '15 at 12:29
• It has not. I can use LuaLaTeX for almost all of my documents, but here it fails -- with your modifications above and some by me, it works for the most part in the main text, but not in the footer (why the f[ra]ck is \ecvpage defined inside \DeclareOption{hungarian}{?). – Alexander Wittmann Mar 13 '15 at 17:15