I've been trying to change the font with modernCV for quite a while now, but nothing seems to work. I'm using LuaTex. To start with, I tried changing it from sans to roman, although the font changes, you can see that nothing is being italicized or bolded as it should be.
\documentclass[11pt,a4paper,roman]{moderncv}
\moderncvicons{awesome}%marvosym
% moderncv themes
\moderncvstyle{banking} % casual/classic/oldstyle/banking/fancy
\moderncvcolor{green} % blue/orange/green/red/purple/grey/black
\nopagenumbers{} % uncomment to suppress automatic page numbering
% adjust the page margins
\usepackage[scale=0.75, top=2cm, bottom=2cm]{geometry}
% personal data
\name{First}{Last}
\address{Address}{City}{Country}
\phone[mobile]{123456}
\email{abc@gmail.com}
%----------------------------------------------------------------------------------
% content
%----------------------------------------------------------------------------------
\begin{document}
%----- resume ---------------------------------------------------------
\makecvtitle
%==============================================================================================================================
% EXPERIENCE
%==============================================================================================================================
\section{Experience}
\cventry{May 2015 -- July 2015}{Intern Research Assistant}{Institute of Whatever}{XXX, YYY}{Supervisor: Dr. ABC}{{}
\vspace{4pt}
\begin{itemize}%
\item Nice stuff.
\end{itemize}}
\vspace{7pt}
\end{document}
First image is how it looks with sans on line 1, and second is how it looks with roman. Nothing is in bold or italics as you can see.
Afterwards, I tried multiple methods to change the font, all of them did absolutely nothing:
-
I tried the two answers here:
Change font used by moderncv\documentclass{moderncv}
\usepackage{mathpazo}
\renewcommand{\sfdefault}{\rmdefault} -
The answer here with xelatex:
Is there any way to use a custom font with moderncv?\usepackage{fontspec}
\setmainfont[Ligatures=TeX]{Calibri} -
I tried the answer here as well, as this was my main goal: Change body font in moderncv without affecting the other fonts
My original goal was to remove the italics from fields 1, 2 and 5 from CV entry (date, position and supervisor/extra info). None of those worked.
With the MWE provided on answer 3, some stuff worked but some didn't. For example, I could change the font size of the title but I could not do a single thing for the hint font, it would never change.
I would appreciate any help.
EDIT:
Clarification: my original problem involves
-
Changing the whole document's font (solved, see below).
-
Changing the font in fields 1, 2 and 5 of the
cventry
command.
Following @Ulrike Fischer's comment, I added
\setmainfont{Times New Roman}
after \moderncvstyle{banking}
and the first issue has been fixed. Now I get a roman font where things are italicized and bolded as they should be.
However, if I add \renewcommand*{\hintfont}{\upshape}
, the font for the dates stays in Italics. I cannot change its size with \renewcommand*\hintfont{\fontsize{40}{24}}
either, and I have no idea how to change fields 2 and 5 to non-italic.
Edit: As noted in the comments, the way to fix this is to add \upshape before specific fields, preferably with a wrapper for cventry. Redefining does not work for me.
Best Answer
As asked in the comments I convert my comments to a (short) answer:
The banking-style is not adapted to lualatex, it loads an unsuitable font. So to change the document font add
\setmainfont{Latin Modern Roman}
(or some other font) after loading banking.The
\itshape
is hardcoded in cventry (in moderncvbodyiii.sty). To change this you will have to add\upshape
directly in the entries, e.g.\cventry{\upshape May 2015 -- July 2015}
, or write some wrapper command.