[Tex/LaTex] Vertical alignment of cvline in moderncv

moderncvvertical alignment

I am currently updating my CV and using the moderncv package. When I've updated the 'Languages' section, I've encountered a problem:

\documentclass[11pt,a4paper]{moderncv}

\moderncvtheme[grey]{casual}
\usepackage[english,ngerman]{babel}
\usepackage[utf8]{inputenc}                 

\firstname{Firstname}
\familyname{Name}

\setlength{\hintscolumnwidth}{0.3\textwidth} % widen first column within CV 

\begin{document}

    \maketitle
    \section{Languages}
    \cvline{German}{Hallo, mein Name ist Fritz, Ich would like to haben ein Sauerkraut with Schnitzel, bitte. Und dazu ein deutsches Weizenbier. Bitte wo ist der Schlossmuseum? I know a little German, he's sitting over there.}
    \cvline{German Sign Language (DGS)}{Basics}

\end{document}

That results in:
Image: result

So my question is: Is it possible to adjust the vertical alignment of the first respectively of the second column in a cvline to middle? I would like that the Basics is in the middle (vertically) of the German Sign Language (DGS). The other case (aligning the left column vertically) is not that important to me.

Best Answer

In the following example I defined a \ccvitem command that behaves as \cvitem, but with vertical alignment of the columns content (instead of p{...} columns, \ccvitem uses m{...} columns available through the array package):

\documentclass[11pt,a4paper]{moderncv}

\moderncvtheme[grey]{casual}
\usepackage[english,ngerman]{babel}
\usepackage[utf8]{inputenc}                 
\usepackage{array}

\firstname{Firstname}
\familyname{Name}

\setlength{\hintscolumnwidth}{0.3\textwidth} % widen second column within CV 

\makeatletter
\newcommand*{\ccvitem}[3][.25em]{%
  \begin{tabular}{@{}m{\hintscolumnwidth}@{\hspace{\separatorcolumnwidth}}m{\maincolumnwidth}@{}}%
    \raggedleft\hintstyle{#2} &{#3}%
  \end{tabular}%
  \par\addvspace{#1}}
\makeatother

\begin{document}

    \maketitle
    \section{Languages}
    \cvitem{German}{Hallo, mein Name ist Fritz, Ich would like to haben ein Sauerkraut with Schnitzel, bitte. Und dazu ein deutsches Weizenbier. Bitte wo ist der Schlossmuseum? I know a little German, he's sitting over there.}
    \cvitem{German Sign Language (DGS)}{Basics}
    \ccvitem{German}{Hallo, mein Name ist Fritz, Ich would like to haben ein Sauerkraut with Schnitzel, bitte. Und dazu ein deutsches Weizenbier. Bitte wo ist der Schlossmuseum? I know a little German, he's sitting over there.}
    \ccvitem{German Sign Language (DGS)}{Basics}

\end{document}

enter image description here

By the way, you could use \cvitem instead of \cvline that appears to be still around just for compatibility with older versions of moderncv.