Vertically centering right column text with respect to left column text

Asked by Romain Vidaillac

Hi all,

I want to customize the moderncv class for my taste and I am not able to vertically center the right text column with respect to the left text column when this latter is longer than hintscolumnwidth i.e. it takes two lines on the left column.

Below is an example of what I currently have ( "***" are whitespaces written to keep the formatting intact):

Left column ******* Rigth column

_____________ *** COMPUTER SKILLS (section title)

***Programming ***C++, Java

I would like the text "C++, Java" to be vertically centered with respect to "Programming languages" so it would have to be half a line below its actual position with no horizontal shift.

I did some manipulations in moderncv.cls but without much results as my Latex classes knowledge is really limited. I believe we need to write another command specially for this purpose but I have not been able to do so. I know this may sound fastidious but i have a disease called "the knack" ( :).

Any constructive answer is welcome,
Thanks in advance,

Question information

English Edit question
moderncv Edit question
Xavier Danaux Edit question
Last query:
Last reply:
Revision history for this message
Xavier Danaux (xdanaux) said :

Hi Romain,

Changing the code to do that would be quite difficult, as somehow you have to figure out the vertical length of the rendered right text in order to correctly center the left part. I believe this can be done with the multirow package, but would require some extensive rework of the code.

More important, I really don't see the improvement from a typographical perspective. Centering vertically would be counter-productive, as it would hide away information from the reader: reading the left header / description before reading the right details is the right "information path" and exposes the logical structure of the resume. There is no typographical reason to want to center the left heading.

Kind regards,


Revision history for this message
Romain Vidaillac (romain-vidaillac-deactivatedaccount) said :

Hi Xavier,

Thanks for your quick response.

I understand your point. I agree with you that the reader has to first read the hint and then the main (right) column. However, when the left column takes two lines and the right one only one, I find more aesthetic to have the right column text centered. I don't think this half line shift would change the "information path".

For a more general case, as you mentioned, we would have to know the right text length but I don't want to deal with it because, as you mentioned again, it would be against the logical structure of the resumé.

So I believe these assumptions (assuming the left column is only two line long and the right one is only one line long) simplify somehow the problem as we now know the length of the shift to be applied, witch is a constant value. You have interpreted the problem as centering the left text column with respect to the right one, and I have seen it as centering the right text column with respect to the left one (based on past assumptions), both views are perfectly right but maybe one is easier to implement than the other.

I will try to come up with a solution in the next couple of weeks (and hoppefuly post it here) but this may take longer as I don't have much time to dedicate to it. I have tried to write a new command based on the cvline command (like you did for cvlistitem, cvlistdoubleitem...) but I believe that the cvline command is made in a way that no vertical shift could be applied to its content. Am I right?

Thanks again for your help,


Revision history for this message
Xavier Danaux (xdanaux) said :

Hi Romain,

You can try to use \vspace inside \cvline, though I am not 100% sure this works. If not, just make a box (\mbox or \makebox) for the left part, of the desired height, and vertically center the text within. I am still not convinced it is a good idea typographically though...

Kind regards,


Revision history for this message
Romain Vidaillac (romain-vidaillac-deactivatedaccount) said :

Hi again,

Finaly, it took me less than expected thanks to your hint.

So in the file moderncv.cls I added the following code below the block of instructions "% usage: \cvline{margintext}{linetext}" :

% usage: \cvlinecentered{margintext}{linetext}
    \raggedleft\hintfont{#2}&\multirow{2}*{#3}\\ %

It's basicaly the same as cvline execpt that the multirow fonction is used for argument #3. I also added the package multirow (\usepackage{multirow}) in the .tex file in order for the fonction mutirow to be recognized.

Here are the original and modified compiled files:

The modified .tex code is as below:

\cvline{Electronic}{FPGA, PIC}
\cvlinecentered{Programming languages}{C++, Java}
\cvline{Marital status}{Single}

So much for that! Thanks again Xavier.



Revision history for this message
Xavier Danaux (xdanaux) said :

You're most welcome!

Have a great day,


Can you help with this problem?

Provide an answer of your own, or ask Romain Vidaillac for more information if necessary.

To post a message you must log in.