4

I'm writing my CV with the moderncv package and I'd like the un-bold the text in front of each language.

In the following example, "Spoken" and "Barely Spoken" are bold, which I don't like. I searched in the moderncv.cls file but I can't find "\cvlanguage" definition, although I can find \cventry

\documentclass[10pt,a4paper]{moderncv}
\moderncvtheme[blue]{classic}                
\usepackage[utf8]{inputenc}
\usepackage[frenchb]{babel}

\firstname{John}
\familyname{Doe}
\title{The burger flipper}
\address{The big street}{neverland}
\mobile{MyMobile000000}
\email{mymail@mymail.com}
\extrainfo{99 year-old}

\begin{document}
\maketitle

\section{Languages}
\cvlanguage{language1}{Spoken}{bla bla dygfzeiu rzegouerhg regoeru}
\cvlanguage{language2}{Barely Spoken}{}

\end{document}
  • The definition of \cvlanguage is in moderncvcompatibility.sty and it is \newcommand*{\cvlanguage}[3]{\cvitemwithcomment{#1}{#2}{#3}}. So you had to find the re-definition of \cvitemwithcomment in moderncvstyleclassic.sty. – karlkoeller Nov 5 '13 at 19:36
  • BTW: Welcome to TeX.SX! – karlkoeller Nov 5 '13 at 19:37
5

Add the following lines in your preamble

\usepackage{xpatch}
\xpatchcmd{\cvitemwithcomment}{\bfseries}{\mdseries}{}{}
\xpatchcmd{\cvitemwithcomment}{\bfseries}{\mdseries}{}{}

so that your MWE becomes:

\documentclass[10pt,a4paper]{moderncv}
\moderncvtheme[blue]{classic}
\usepackage[utf8]{inputenc}
\usepackage[frenchb]{babel}

\firstname{John}
\familyname{Doe}
\title{The burger flipper}
\address{The big street}{neverland}
\mobile{MyMobile000000}
\email{mymail@mymail.com}
\extrainfo{99 year-old}

\usepackage{xpatch}
\xpatchcmd{\cvitemwithcomment}{\bfseries}{\mdseries}{}{}
\xpatchcmd{\cvitemwithcomment}{\bfseries}{\mdseries}{}{}

\begin{document}
\maketitle

\section{Languages}
\cvlanguage{language1}{Spoken}{bla bla dygfzeiu rzegouerhg regoeru}
\cvlanguage{language2}{Barely Spoken}{}

\end{document} 

Output:

enter image description here

Note that (thanks to Werner for the comment) you can also replace the above three lines with

\usepackage{regexpatch}
\xpatchcmd*{\cvitemwithcomment}{\bfseries}{\mdseries}{}{}

In this case, the *-variant of \xpatchcmd is used to replace both instances of \bfseries.


Instead, if you need to change it only for one instance, you can insert \mdseries (which overwrites the default \bfseries) in the second argument, for example

\cvlanguage{language1}{\mdseries Spoken}{bla bla dygfzeiu rzegouerhg regoeru}
  • regexpatch allows for \xpatchcmd*, which does a "replace-all". See my deleted answer (take it if you feel it necessary). – Werner Nov 5 '13 at 19:12
  • @Werner, thanks. I'll add it in the answer (never used that package before). – karlkoeller Nov 5 '13 at 19:15
  • @karlkoeller One should be careful in replacing xpatch with regexpatch: if the command to be patched contains “@-commands” the patch should be between \makeatletter and \makeatother in any case (with xpatch it would be necessary only if the actual arguments to \xpatchcmd contains @-commands). I'm thinking how to lift off this limitation. It's not really serious: before trying to patch a command one has to see its definition anyway. – egreg Nov 5 '13 at 22:28
  • @egreg Thanks for your comment. I've never used regexpatch before, so I'll take a look at its documentation. In this case, the re-definition of \cvitemwithcomment does not contain any "@-commands". Should I add \makeatletter and \makeatother anyway? – karlkoeller Nov 6 '13 at 5:50
  • @karlkoeller Only if the original macro body contains @-commands. – egreg Nov 6 '13 at 7:25
3

Instead of redefining any definition you can redefine \bfseries. Of course the results in the drawback that you can't use \bfseries inside you current \cvlanguage.

\begingroup
\let\bfseries\relax
\cvlanguage{language1}{Spoken}{bla bla dygfzeiu rzegouerhg regoeru}
\endgroup
  • 1
    A minor work-around is required if you actually want to use \bfseries anywhere within that construct though... – Werner Nov 5 '13 at 19:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.