Serif text with sans-serif headers

Asked by Fredrik Lindgren

Hi,

Would it be possible to add the option of using a serif font for the text while a sans-serif font is used for the headers (name, section titles, etc.)? If you specify serif/roman you currently get serif text for everything (with the casual CV style).

Question information

Language:
English Edit question
Status:
Solved
For:
moderncv Edit question
Assignee:
Xavier Danaux Edit question
Solved by:
Xavier Danaux
Solved:
Last query:
Last reply:
Revision history for this message
Best Xavier Danaux (xdanaux) said :
#1

Hi Fredrik,

You can easily change all the fonts used. Here are for example the definitions for the classic style:
\renewcommand*{\namefont}{\fontsize{34}{36}\mdseries\upshape}
\renewcommand*{\titlefont}{\LARGE\mdseries\slshape}
\renewcommand*{\addressfont}{\small\mdseries\slshape}
\renewcommand*{\quotefont}{\large\slshape}
\renewcommand*{\sectionfont}{\Large\mdseries\upshape}
\renewcommand*{\subsectionfont}{\large\mdseries\upshape}
\renewcommand*{\hintfont}{}

Just redefine the font you want to change, adding e.g. \sffamily (for sans serif), \rmfamily (for roman) or explicitly calling a specific font.

Kind regards,

Xavier

Revision history for this message
Fredrik Lindgren (lindgren-fredrik) said :
#2

Thanks Xavier Danaux, that solved my question.