1

I'm currently creating a CV with moderncv in Overleaf. I'm using pdfLaTeX and the 2014 (Legacy) version of TeX Live. (I am trying to reuse a template from my professor which displays incorrectly if using a more recent version). There are still a few problems I am having with getting my output to display correctly. Here is my code:

\documentclass[11pt,a4paper,roman]{moderncv}
\moderncvstyle{banking}
\moderncvcolor{black}
\usepackage[utf8]{inputenc}
\usepackage[scale=0.76]{geometry}
\name{John}{Doe}
\title{Resumé tite}
\address{street and number}{postcode city}{country}
\phone[mobile]{+1~(234)~567~890}
\phone[fixed]{+2~(345)~678~901}
\phone[fax]{+3~(456)~789~012}
\email{[email protected]}

\begin{document}
\makecvtitle

\section{EMPLOYMENT}
\vspace{1pt}
\cventry{}{}{Assistant Professor}{Since March 2020}{}{Department 
        of LaTeX, Science University}{}

% --------------------------------------------------------------------
\section{EDUCATION}
\vspace{1pt}
\cventry{}{}{PhD, Science University}{2019}{}
        {Thesis title: \textit{Lorem Ipsum} \\ Supervisor: Jacob Smith}{}


\end{document}

enter image description here

I would like to be able to increase the vertical space between the title line and the address line. I would also like to remove the blank lines between the bolded text and the normal text underneath (e.g. "Assistant Professor" and "Department of LaTeX, Science University").

1 Answer 1

0

I would like to be able to increase the vertical space between the title line and the address line.

If you are using banking style of moderncv, the definition of \makehead is defined in moderncvheadiii.sty as follows:

\@initializecommand{\makehead}{%
  \setlength{\makeheaddetailswidth}{0.8\textwidth}%
  \hfil%
  \parbox{\makeheaddetailswidth}{%
    \centering%
    \namestyle{\@firstname~\@lastname}%
    \ifthenelse{\equal{\@title}{}}{}{\titlestyle{~|~\@title}}\\
    \if@details{%
      \addressfont\color{color2}%
      \ifthenelse{\isundefined{\@addressstreet}}{}{\addtomakeheaddetails{\addresssymbol\@addressstreet}%
        \ifthenelse{\equal{\@addresscity}{}}{}{\addtomakeheaddetails[~--~]{\@addresscity}}%
        \ifthenelse{\equal{\@addresscountry}{}}{}{\addtomakeheaddetails[~--~]{\@addresscountry}}%
        
...

}

So all what you need to do is to hack this to insert some vertical space between \\ and \if@details. This is all the hack you need to do around \makecvtitle in your document:

\begin{document}
\makeatletter
\let\if@detailsoriginal\if@details
\def\if@details{\vskip1.0\baselineskip\if@detailsoriginal}
\makecvtitle
\let\if@details\if@detailsoriginal
\makeatother

You can change the space amount by modifying the value of 1.0\baselineskip.

Result: Reult


I would also like to remove the blank lines between the bolded text and the normal text underneath (e.g. "Assistant Professor" and "Department of LaTeX, Science University").

If you are using banking style of moderncv, the definition of \cventry is defined in moderncvbodyiii.sty as follows:

\renewcommand*{\cventry}[7][.25em]{
  \begin{tabular*}{\maincolumnwidth}{l@{\extracolsep{\fill}}r}%
    {\bfseries #4} & {\bfseries #5}\\%
    {\itshape #3\ifthenelse{\equal{#6}{}}{}{, #6}} & {\itshape #2}\\%
  \end{tabular*}%
        
  ...
  
  }

You see a tabular* environment inside. So what you need to do is to change \arraystretch. For example, if you write this in your preamble you can smash the interline between the bolded text and the normal text by setting the stretch zero:

\let\cventryoriginal\cventry
\def\cventry#1#2#3#4#5#6#7{\bgroup\renewcommand\arraystretch{0}\cventryoriginal{#1}{#2}{#3}{#4}{#5}{#6}{#7}\egroup}

Result: Result

Again, you can change the amount of vertical space by modifying the value of \arraystretch{0}.


Update: as for moderncv 2012 ver.

The title command \makecvtitle calls for \maketitle which is defined in moderncvstylebanking.sty as follows:

\renewcommand*{\maketitle}{%
  \setlength{\maketitlewidth}{0.8\textwidth}%
  \hfil%
  \parbox{\maketitlewidth}{%
    \centering%
    \namestyle{\@firstname~\@familyname}%
    \ifthenelse{\isundefined{\@title}}{}{\titlestyle{~|~\@title}}\\%
    \addressfont\color{color2}%
    \ifthenelse{\isundefined{\@addressstreet}}{}{\addtomaketitle{\addresssymbol\@addressstreet}%
      \ifthenelse{\equal{\@addresscity}{}}{}{\addtomaketitle[~--~]{\@addresscity}}\flushmaketitle\@firstmaketitleelementtrue\\}

...

}

So all what you need to do is to hack this to insert some vertical space between \\ and \addressfont. This is all the hack you need to do around \makecvtitle in your document:

\begin{document}
\let\addressfontoriginal\addressfont
\def\addressfont{\vskip1.0\baselineskip\addressfontoriginal}
\makecvtitle
\let\addressfont\addressfontoriginal

You can change the space amount by modifying the value of 1.0\baselineskip.

4
  • @AboAmmer your style of banking 2014 seems a slightly different from my style of banking 2017. e.g. yours does not have an empty line between address and phone number while mine does as a default. I suppose, however, that my solution would work as well on yours. Good luK!
    – domperor
    Jul 28, 2020 at 6:44
  • Thanks for you help! I tried both codes and they work! I managed to fix the second problem, but I'm still having trouble with the first problem. Unfortunately, the first code you gave only works with newer versions of Tex Live, which I am unable to use because of display issues when I run my code with newer versions. Would you happen to know how to make a similar hack with the 2014 (or earlier) version of moderncv? I think the relevant definitions are in moderncvstylebanking.sty as moderncvheadiii.sty did not exist at the time.
    – A.B.
    Jul 29, 2020 at 1:23
  • Edit: It's line 103 in moderncvstylebanking.sty for moderncv version 1.2.0. launchpad.net/moderncv/+milestone/1.2.0
    – A.B.
    Jul 29, 2020 at 2:07
  • Thanks for the link for 2012 ver. of moderncv. I have added it to the answer.
    – domperor
    Jul 29, 2020 at 2:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .