Once again I had to prepare a CV for an application. I’m using the moderncv package to create the CV in \(\LaTeX\) and I was always bothered about the title of the document. Today I spend some time to fix that.

 moderncv produces an ugly title
moderncv produces an ugly title

Using moderncv you can produce really fancy CV’s with very little effort. But unfortunately, by default it produces an ugly title (see the screenshot taken from Okular). As you can see, there is some character that cannot be displayed by certain tools.

I guess most of my “CV-reviewers” don’t care about this little issue, if they recognize it at all, but it bothers me whenever I have to create a resumé. I already tried to override it using the hyperref package, but wherever I put the statement it seems to have no effect.

However, since moderncv is open source (yeah! lovit) I took a look at the code to see how they produce the title. It was quite easy to find the concerning statement (in my case /usr/share/texlive/texmf-dist/tex/latex/moderncv/moderncv.cls:96 , texlive-latex-extra@2012.20120611-2):

\AtEndPreamble{
  \@ifpackageloaded{CJK}
    {\RequirePackage[unicode]{hyperref}}
    {\RequirePackage{hyperref}}
    \hypersetup{
      breaklinks,
      baseurl       = http://,
      pdfborder     = 0 0 0,
      pdfpagemode   = UseNone,% do not show thumbnails or bookmarks on opening
      pdfpagelabels = false,% to avoid a warning setting it automatically to false anyway, because hyperref detects \thepage as undefined (why?)
      pdfstartpage  = 1,
      pdfcreator    = {\LaTeX{} with `moderncv' package},
%      pdfproducer   = {\LaTeX{}},% will/should be set automatically to the correct TeX engine used
      bookmarksopen = true,
      bookmarksdepth= 2,% to show sections and subsections
      pdfauthor     = {\@firstname{}~\@familyname{}},
      pdftitle      = {\@firstname{}~\@familyname{} -- \@title{}},
      pdfsubject    = {Resum\'{e} of \@firstname{}~\@familyname{}},
      pdfkeywords   = {\@firstname{}~\@familyname{}, curriculum vit\ae{}, resum\'{e}}}
  \pagenumbering{arabic}% has to be issued after loading hyperref
}

As expected the pdftitle contains a double-hyphen that is converted by latex to a dash. Apparently a problem for some programs. To fix this issue you could sudo:modify this file, but that’s of course messy. Better add something like the following to the end of the header of your document:

\AtEndPreamble{
\hypersetup{pdftitle={Your New Title}}
}

This will override the broken output of the package.


Martin Scharm

stuff. just for the records.

Do you like this page?
You can actively support me!

1 comment

Tom | Permalink |

Your display font doesn’t seem include the n-dash – Halbgeviertstrich – which once was the European standard for separating parenthetical expressions. In this regard moderncv’s use to denote a relationship is unobjectionable and esthetically pleasing.

My guess is most systems would display that character correctly – even Windows since their Unicode display fonts have been fairly comprehensive for many years now and the n-dash is far from being uncommon. I use the Ubuntu font on all of my devices, so I can’t speak to that.

It puzzles me though that your KDE fails at such a simple display issue.

Leave a comment

There are multiple options to leave a comment: