# Computer Modern with fontspec in XeLateX (package mod)

I'd like to type my CV/resume form Friggeri's template (http://www.latextemplates.com/template/friggeri-resume-cv) that is based on Helvetica Neue fonts which I do not have on my computer and the package 'fontspec'. In the class file friggeri-cv.cls, the Helvetica fonts are called by:

\newfontfamily\bodyfont[]{Helvetica Neue}
\newfontfamily\thinfont[]{Helvetica Neue UltraLight}

\defaultfontfeatures{Mapping=tex-text}
\setmainfont[Mapping=tex-text, Color=textcolor]{Helvetica Neue Light}


I've made a few conclusive tries with TrueType/OpenType fonts installed on my computer (e.g., Calibri) but I'd like to use Computer Modern instead since I do prefer this font. Replacing Helvetica Neue by cmr or cmss on the go (e.g.,

\newfontfamily\bodyfont[]{cmss}
% ...
\setmainfont[Mapping=tex-text, Color=textcolor]{cmss}


don't work because he can't find the fonts (of course I do not have a TrueType version of Computer Modern/Latin Modern) and replacing the code by

%\newfontfamily\bodyfont[]{Helvetica Neue}
\def\bodyfont{\sf}
%\newfontfamily\thinfont[]{Helvetica Neue UltraLight}
\def\thinfont{\sf\sl}    %not exactly what I'm looking for but to ensure the command responds

\renewcommand*{\familydefault}{\sfdefault}
\defaultfontfeatures{Mapping=tex-text, Color=textcolor}
%\setmainfont[Mapping=tex-text, Color=textcolor]{Computer Modern Roman}


gets me this error when I compile:

! TeX capacity exceeded, sorry [input stack size=5000].
\font@name ->
\EU1/lmss/m/n/14.4
l.35 \section{contact}


I'm quite new with XeLaTeX and I'm looking for a (preferably simple and straightforward) way to rewrite this part of the Friggeri CV template to use "native" Computer Modern fonts instead of TT/OT fonts. The Cls file can be retrieved at the URL above and here is a shortened and bib-free version of Friggeri's example code :

\documentclass[]{friggeri-cv}

\begin{document}

\begin{aside} % In the aside, each new line forces a line break
\section{contact}
City, State 12345
\section{languages}
english mother tongue
spanish \& italian fluency
\section{programming}
CSS3 \& HTML5
\end{aside}

\section{education}

\begin{entrylist}
\entry
{2011--2012}
{Masters {\normalfont of Commerce}}
{The University of California, Berkeley}
{Thesis explored the idea that money...}
\entry
{2007--2008}
{The University of California, Berkeley}
{Specialization in Commerce}
\end{entrylist}

\section{experience}

\begin{entrylist}
\entry
{2012--Now}
{LEHMAN BROTHERS}
{Los Angeles, California}
{\emph{1\textsuperscript{st} Year Analyst} \\
\end{entrylist}
\end{document}


Thanks in advance for any help.

• Use Latin Modern Roman and Latin Modern Sans, or CMU Serif and CMU Sans, not cmr and cmss. – egreg Dec 11 '14 at 12:28
• Why don't yiu have TT Latin Modern fonts? These should come with every TeX distribution – MaxNoe Dec 11 '14 at 12:30
• Doing font stuff is generally more complicated in LaTeX than in XeLaTeX, so I recommend you use the CMU .ttf fonts. – Sverre Dec 11 '14 at 15:42
• Thank you for your very usefull answers. I'm actually a total noob at Xe(La)TeX and although I've been using LaTeX since 8 years or so, I only used CMR fonts which I find the most confortable to read but if I had had Helvetica on my PC, I wouldn't have tried to change it in the first place. I finally used an OT version of Latin Modern (I seriously didn't know that such was provided) Thanks again, an I think I'll go back to my metafonts and PSTricks! – Julien Dec 11 '14 at 22:09
• @egreg I would have suggested exactly the same. Do you want to write up an answer? – Johannes_B Oct 7 '15 at 10:54

Package fontspec wants to have the name of the font. For Computer modern, this is CMU Serif and CMU Sans.
The Latin Modern fonts provide an enhancement of Computer Modern, including many carefully designed diacritics. If you need more letters than the english alphabet uses, LM is recommended. This would be Latin Modern Roman and Latin Modern Sans.
You can also use Latin Modern Mono if you need a mono-spaced font.