3

In a moderncv document, I'd like to list within a cvitem several items in two columns (preferably using multicol).

However, this messes up the vertical alignment of the cvitem - the title to the left is shifted upward or downward (if a minipage is used):

image of MWE

What's the right way to set up two columns of items in moderncv's cvitem, so that it's not vertically shifted?

MWE:

\documentclass[11pt,a4paper,sans]{moderncv}

\moderncvstyle{classic}
\moderncvcolor{blue}

\usepackage[utf8]{inputenc}

\usepackage{multicol}
\setlength{\multicolsep}{0pt}

\firstname{First}
\familyname{Last}

\begin{document}
\makecvtitle

\cvitem{default}{
\begin{itemize}
    \item default itemize without multicols
    \item second item 
\end{itemize}}

\cvitem{multicols}{
    \begin{multicols}{2} 
        \begin{itemize} 
            \item item 1 
            \item item 2 
            \item item 3 
            \item item 4 
        \end{itemize}
    \end{multicols}}

\cvitem{minipage}{%
    \begin{minipage}[t]{\linewidth}
        \begin{itemize}
            \begin{multicols}{2}
                \item Item a
                \item Item b
                \item Item c
                \item Item d
            \end{multicols}
        \end{itemize}
\end{minipage}}

\end{document}

1 Answer 1

1

In your case the issue comes with environment multicols, it simply adds some blank space you do not want.

I didn't investigate where that blank space comes from excactly, but you can use the following work around:

    \vspace{-10pt}% <===================================================
%   \vspace{-0.8\baselineskip}% <=======================================

Add one of the commands shown above, I used the first one in the following complete mwe. Add this command before you start environment multicols.

With the following compete MWE

\documentclass[11pt,a4paper,sans]{moderncv}

\moderncvstyle{classic}
\moderncvcolor{blue}

\usepackage[utf8]{inputenc}

\usepackage{multicol}
\setlength{\multicolsep}{0pt}

\firstname{First}
\familyname{Last}

\begin{document}
\makecvtitle

\cvitem{default}{
\begin{itemize}
    \item default itemize without multicols
    \item second item 
\end{itemize}}

\cvitem{multicols}{
    \vspace{-10pt}% <===================================================
%   \vspace{-0.8\baselineskip}% <=======================================
    \begin{multicols}{2} 
        \begin{itemize} 
            \item item 1 
            \item item 2 
            \item item 3 
            \item item 4 
        \end{itemize}
    \end{multicols}}

\cvitem{minipage}{%
    \begin{minipage}[t]{\linewidth}
        \begin{itemize}
            \begin{multicols}{2}
                \item Item a
                \item Item b
                \item Item c
                \item Item d
            \end{multicols}
        \end{itemize}
\end{minipage}}

\end{document}

you get the result:

enter image description here

Play with the used values to fit your needs ...

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.