This question already has an answer here:

I started taking a CV Template which I need to edit. This one: https://es.sharelatex.com/templates/cv-or-resume/moderncv-classic

So It turns that my name is longer than "John Doe". If I go to the editor, main.txt, and find the line 26

% personal data

and change it to

% personal data
\name{John}{Martinez Rodriguez}

You can see that now the name stays like this, in the document:

John Martinez

And I want it to appear like

Martinez Rodriguez

Could you help me with this, please?

marked as duplicate by Mensch, Phelype Oleinik, Stefan Pinnow, siracusa, Troy Nov 28 '18 at 0:54

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.


There are a couple of possibilities. I don't know the template, so you have to decide for yourself what is the best solution:

Possibility 1

Add \\ in front of M in Martinez. This adds a line break before your last name. Also if it occurs elsewhere! Your last name will still be split if too long.

Possibility 2

Put your last name in a mbox: \name{John}{\mbox{Martinez Rodriguez}}. Your last name will never be split but rather overlap other text.

Possibility 3

Use ~ as a non-breaking space in your name. Probably you will have to take care of hyphenation of your name though. You can do this by e.g. setting \hyphenpenalty to 10000.

  • Tha'ts a perfect answer. Thank you very much!! – Javier Jul 8 '18 at 20:56

Not the answer you're looking for? Browse other questions tagged or ask your own question.