I'm doing my cv with the moderncv package and I'm using the classic style. I would like to add a date of birth line directly above the adress. Does anyone know how to do this? I've tried various solutions but they all seem to be broken.
[Tex/LaTex] Moderncv adding date of birth to personal information
moderncv
Best Answer
To put the date of birth above the address, you'll have to tweak the CV header created by moderncv, by redefining the command which prints the header. I would suggest creating a new command
\dateofbirth
, so you can still use\extrainfo
for (well...) extra info. I try to describe the procedure rather generally, so you can also adapt it to other styles then the classic style.If you look at the structure of the moderncv package, you'll find the package you load (
moderncv.cls
), as well as many other files. On line 317, you'll find the command definition for\moderncvstyle
:This simply loads a package which is called
moderncvstyle
+ the name of the style you are using, that isclassic
in your case. We'll thus continue with the filemoderncvstyleclassic.sty
. There, on line 45, the heading is defined as\moderncvhead[...]{1}
. To find out what that means, we have to find the definition of\moderncvhead
, which is on line 321, back in the filemoderncv.cls
:This is also a
\RequirePackage
command, which converts the second argument of\moderncvhead
to roman numbers. As the classic style calls\moderncvhead
with the argument 1 (or in roman: i ), this will load the packagemoderncvheadi.sty
. Now finally, there (lines 63-134) we find the definition of\makecvhead
, which creates the heading. The task is now to tweak this command so that it prints the date of birth above the address.In order to do that, you should copy the existing definition into your preamble and change it there. To add the date of birth, we simply create a new command
and print the date of birth if
\@dateofbirth
exists (is defined):Everything put together into a small MWE yields