3

I would like to know how I can reduce the blank space after the title in the moderncv latex template, look at the picture below :

enter image description here

EDIT :

\documentclass[10pt,a4paper]{moderncv}
\moderncvtheme[blue]{classic}                
\usepackage[utf8]{inputenc}
\usepackage[top=0.3cm, bottom=1.0cm, left=1.2cm, right=1.2cm]{geometry}
% Largeur de la colonne pour les dates
\setlength{\hintscolumnwidth}{3.5cm}
\renewcommand*{\namefont}{\fontsize{20}{20}\mdseries\upshape}

\address{X}{X}{X}    
\email{X}                      
%\homepage{X}
\mobile{X} 
\usepackage{xpatch}
\xpatchcmd{\makecvhead}{%
\usebox{\makecvheadnamebox}\fi%
\\[2.5em]%
}{%
\usebox{\makecvheadnamebox}\fi%
\\[1em]%
}{}{}
%% add the following additionally
\xpatchcmd{\makecvhead}{\quotestyle{\@quote}\end{minipage}\\[2.5em]}{%
\quotestyle{\@quote}\end{minipage}\\[1em]}{}{}
\extrainfo{X}
\firstname{X}
\familyname{X} 
\title{X} 

\begin{document}
\maketitle
0

2 Answers 2

2

If you don't use quote:

\documentclass{moderncv}
\moderncvstyle{classic}
\usepackage[scale=0.8]{geometry}
\name{The name}{}
\title{Some title}
\address{address\\address\\address\\}
\phone[mobile]{123456789}
%\quote{some quote here}
\usepackage{xpatch}
\xpatchcmd{\makecvhead}{%
  \usebox{\makecvheadnamebox}\fi%
  \\[2.5em]%
  }{%
  \usebox{\makecvheadnamebox}\fi%
  \\[1em]%                   %%% change 1em to anything you like
  }{}{}
\begin{document}
\maketitle
\section{Formations}

\end{document}

If you use quote:

\documentclass{moderncv}
\moderncvstyle{classic}
\usepackage[scale=0.8]{geometry}
\name{The name}{}
\title{Some title}
\address{address\\address\\address\\}
\phone[mobile]{123456789}
\quote{some quote here}
\usepackage{xpatch}
\xpatchcmd{\makecvhead}{%
  \usebox{\makecvheadnamebox}\fi%
  \\[2.5em]%
  }{%
  \usebox{\makecvheadnamebox}\fi%
  \\[1em]%
  }{}{}
%% add the following additionally
\xpatchcmd{\makecvhead}{\quotestyle{\@quote}\end{minipage}\\[2.5em]}{%
  \quotestyle{\@quote}\end{minipage}\\[1em]}{}{}
\begin{document}
\maketitle
\section{Formations}

\end{document}
5
  • Sorry I tried to add the code you proposed but it still doesn't work, I probably made a mistake (I'm very new to latex), please check my last edit.
    – otus
    Commented Oct 9, 2015 at 15:24
  • @otus This works for the latest version of moderncv. Please check and update.
    – user11232
    Commented Oct 9, 2015 at 15:40
  • How can I update it ? i'm using a code given by a friend on this website : fr.sharelatex.com
    – otus
    Commented Oct 9, 2015 at 15:43
  • @otus: How do I update my TeX distribution?
    – user11232
    Commented Oct 9, 2015 at 15:46
  • Just \xpatchcmd{\makecvhead}{\\[2.5em]}{\\}{}{} also works great. Thanks!
    – egormkn
    Commented Apr 28, 2021 at 11:05
0

Another easier solution is to put \vspace*{-1cm} after \maketitle.

source

You must log in to answer this question.

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