2

When I am writing my CV, when I use \email to show my email there is an additional space.

Could you please help me to fix it?

enter image description here

Part of code:

 \documentclass[12pt]{moderncv}   
 \moderncvstyle{oldstyle}               
 \moderncvcolor{grey}                         
 \firstname{FirstName}
 \familyname{FamilyName}
 \title{Curriculum Vitae}                    
 \address{address}  
 \mobile{mobile}
 \email{myemailislong@gmail.com}
 \begin{document}
 \makecvtitle
 abc
 \end{document}
7
  • 1
    Hello and welcome to the forum! Can you post a MWE (Minimal Working Example) to help us find the bug in your code?
    – Tim Hilt
    Mar 11, 2020 at 21:01
  • As always on the site: you'll have much better luck if you provide a full (but minimal) example others can copy and test as is. We don't even know what document class you're using, so not much to go on.
    – daleif
    Mar 11, 2020 at 21:02
  • That is not a full example others can copy and test as is
    – daleif
    Mar 11, 2020 at 21:23
  • @daleif what do you mean by full example? I added a part of my code that could be run by anyone. Mar 11, 2020 at 21:27
  • You cannot run that example by copying it to a blank document and run it through, say, pdflatex. For example there is no body env. The as mentioned the example should contain everything another person needs in order to use it. Else we have to make guesses and we know from experience that thst can go very wrong
    – daleif
    Mar 11, 2020 at 21:33

1 Answer 1

2

Well, I'm not sure you want to read this ...

The culprit of style oldstyle of class moderncv is that the available place in the first column containing your personal datas including your email is very short with standard configuration. That is the reason you get in your case with the long email address an big empty space and an (I guess unwanted!) hyphenation of the email address.

There are only two ways to get rid of that:

  1. Give the email address more space so that it can be printed in one line. That means all your datas in your cv have less space in the second column of your cv.
  2. Rewrite the definition of the layout of the header for this style completly. Sorry, I have not the time to do this ...

So let us have a look to solution 1:

You can define the length of the first column in your cv containing the personal datas with the command \setlength{\hintscolumnwidth}{4.9cm} in the preamble of your cv. Play with the used length to fit your needs (depends on how long your real used email address is ...).

Please see the following MWE

\documentclass[12pt]{moderncv}

\moderncvstyle{oldstyle}
\moderncvcolor{grey}

\firstname{FirstName}
\familyname{FamilyName}
\title{Curriculum Vitae}
\address{address}
\mobile{mobile}
\email{myemailislong@gmail.com}

\setlength{\hintscolumnwidth}{4.9cm} % <================================


\begin{document}
\makecvtitle

\section{Text}
abc

\section{Text}
abc
\end{document}

and its result (I marked the two columns for a better understanding):

resulting cv with the marked two columns

Just a personal remark: for me styles classic or casual fit better your need if you have a very long email address. Please try them too.

1

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.