2

I am working on my resume with the moderncv class. Since I want it to be with a two-columns page layout, I have followed the steps in this question.

What is not working fine with that layout is the lists with \cvlistdoubleitem: in fact the items do not appear paired one next to the other but up and down.

This can be seen in the pic, in the First subset group (the second subset is a normal \cvlistitem):

How can I fix this layout? The code I am using is the following:

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

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{url}
\usepackage{relsize}
\usepackage[margin=1in]{geometry}
\usepackage{multicol}
\usepackage{lipsum}

\moderncvstyle{classic} %classic, oldstyle, banking casual
\moderncvcolor{blue} %blue orange green red purple grey black

\firstname{Fat}
\familyname{Tony}
\title{Curriculum Vitae}

\address{Somewhere in Springfield}{12345}{United States}
\email{fat.tony@themob.com}
\homepage{linkedin.com/in/fat.tony}

\setlength{\hintscolumnwidth}{2.5cm}
\begin{document}
    \makecvtitle
    \lipsum[1]

    \setlength{\hintscolumnwidth}{2.6cm} 
    \begin{multicols}{2}
    \setlength{\hintscolumnwidth}{0.175\textwidth}
    \setlength{\separatorcolumnwidth}{0.015\textwidth}
    \setlength{\maincolumnwidth}{\linewidth-\leftskip-\rightskip-\separatorcolumnwidth-\hintscolumnwidth}
    \section{Personal Information}
    \cvitem{Nationality}{Italian American}
    \cvitem{Driving License}{Cars and limos}

    \section{Education}
    \cventry{1990-1995}%
    {PhD in something something}%
    {A university}%
    {City}%
    {High grade}%
    {Some description of the thing}

    \cventry{1988--1990}%
    {Msc of science in another thing}%
    {A university}%
    {City}%
    {High grade}%
    {Some description of the thing}

    \cventry{1985-1988}{Bsc in the first thing ever}%
    {A university}%
    {City}%
    {High grade}%
    {Some description of the thing}

    \cventry{1980-1985}%
    {High school of the best school diploma}%
    {A high school}%
    {City}%
    {High grade}%
    {Some description of the thing}
    \section{Professional experience}
    \cventry{1995-present}
    {Mob boss}{A university}%
    {City}%
    {High grade}%
    {Some description of the thing}

    \section{Languages}
    \cvitem{English}{Native speaker}
    \cvitem{Sicilian}{Proficient user }
    \cvitem{Italian}{Independent user}
    \cvitem{Spanish}{Living the vida loca}

    \section{A set of skills}
    \subsection{First subset}
    \cvlistdoubleitem{First}{Second}
    \cvlistdoubleitem{Third}{Fourth}
    \cvlistdoubleitem{Here is}{two more}

    \subsection{Second subset}
    \cvlistitem{Fifth}
    \cvlistitem{Seventh}
    \cvlistitem{AAAAAAAAAA}
    \end{multicols}
\end{document}
1

The problem here is the definition of command \cvlistdoubleitem:

\renewcommand*{\cvlistdoubleitem}[3][.25em]{%
  \cvitem[#1]{}{\listitemsymbol\begin{minipage}[t]{\listdoubleitemcolumnwidth}#2\end{minipage}%
  \hfill% fill of \separatorcolumnwidth
  \ifthenelse{\equal{#3}{}}%
    {}%
    {\listitemsymbol\begin{minipage}[t]{\listdoubleitemcolumnwidth}#3\end{minipage}}}}

The used length \listdoubleitemcolumnwidth depends on length \maincolumnwidth as you can see from the definitions in file moderncvbodyi.sty:

  \setlength{\maincolumnwidth}{\textwidth-\leftskip-\rightskip-\separatorcolumnwidth-\hintscolumnwidth}%
  \setlength{\listitemcolumnwidth}{\maincolumnwidth-\listitemsymbolwidth}%
  \setlength{\doubleitemcolumnwidth}{\maincolumnwidth-\hintscolumnwidth-\separatorcolumnwidth-\separatorcolumnwidth}%
  \setlength{\doubleitemcolumnwidth}{0.5\doubleitemcolumnwidth}%
  \setlength{\listdoubleitemcolumnwidth}{\maincolumnwidth-\listitemsymbolwidth-\separatorcolumnwidth-\listitemsymbolwidth}%
  \setlength{\listdoubleitemcolumnwidth}{0.5\listdoubleitemcolumnwidth}%

So you simply need to add the both definition for length \listdoubleitemcolumnwidth after you defined the other length after starting environment multicols (see the added two lines to your code marked with <=========, scroll to the right to see both):

\begin{multicols}{2}
\setlength{\hintscolumnwidth}{0.175\textwidth}
\setlength{\separatorcolumnwidth}{0.015\textwidth}
\setlength{\maincolumnwidth}{\linewidth-\leftskip-\rightskip-\separatorcolumnwidth-\hintscolumnwidth}
\setlength{\listdoubleitemcolumnwidth}{\maincolumnwidth-\listitemsymbolwidth-\separatorcolumnwidth-\listitemsymbolwidth}% <================================================
\setlength{\listdoubleitemcolumnwidth}{0.5\listdoubleitemcolumnwidth} % <==============================

So at last you have to follow the advice in your linked question:

For different commands, you might have to tweak different lengths, and you might have to fiddle around to get a pleasing result.

In your case you need to add a corrected length \listdoubleitemcolumnwidth after starting multicols.

The following complete MWE

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

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{url}
\usepackage{relsize}
\usepackage[margin=1in]{geometry}
\usepackage{multicol}
\usepackage{lipsum}

\moderncvstyle{classic} %classic, oldstyle, banking casual
\moderncvcolor{blue} %blue orange green red purple grey black

\firstname{Fat}
\familyname{Tony}
\title{Curriculum Vitae}

\address{Somewhere in Springfield}{12345}{United States}
\email{fat.tony@themob.com}
\homepage{linkedin.com/in/fat.tony}

% copied from moderncvbodyi.sty
%\renewcommand*{\cvlistdoubleitem}[3][.25em]{%
  %\cvitem[#1]{}{\listitemsymbol\begin{minipage}[t]{\listdoubleitemcolumnwidth}#2\end{minipage}%
  %\hfill% fill of \separatorcolumnwidth
  %\ifthenelse{\equal{#3}{}}%
    %{}%
    %{\listitemsymbol\begin{minipage}[t]{\listdoubleitemcolumnwidth}#3\end{minipage}}}}


\begin{document}

\makecvtitle
\lipsum[1]

    \begin{multicols}{2}
    \setlength{\hintscolumnwidth}{0.175\textwidth}
    \setlength{\separatorcolumnwidth}{0.015\textwidth}
    \setlength{\maincolumnwidth}{\linewidth-\leftskip-\rightskip-\separatorcolumnwidth-\hintscolumnwidth}
    \setlength{\listdoubleitemcolumnwidth}{\maincolumnwidth-\listitemsymbolwidth-\separatorcolumnwidth-\listitemsymbolwidth}% <================================================
    \setlength{\listdoubleitemcolumnwidth}{0.5\listdoubleitemcolumnwidth} % <==============================

    \section{Personal Information}
    \cvitem{Nationality}{Italian American}
    \cvitem{Driving License}{Cars and limos}

    \section{Education}
    \cventry{1990-1995}%
    {PhD in something something}%
    {A university}%
    {City}%
    {High grade}%
    {Some description of the thing}

    \cventry{1988--1990}%
    {Msc of science in another thing}%
    {A university}%
    {City}%
    {High grade}%
    {Some description of the thing}

    \cventry{1985-1988}{Bsc in the first thing ever}%
    {A university}%
    {City}%
    {High grade}%
    {Some description of the thing}

    \cventry{1980-1985}%
    {High school of the best school diploma}%
    {A high school}%
    {City}%
    {High grade}%
    {Some description of the thing}
    \section{Professional experience}
    \cventry{1995-present}
    {Mob boss}{A university}%
    {City}%
    {High grade}%
    {Some description of the thing}

    \section{Languages}
    \cvitem{English}{Native speaker}
    \cvitem{Sicilian}{Proficient user }
    \cvitem{Italian}{Independent user}
    \cvitem{Spanish}{Living the vida loca}

\section{A set of skills}
\subsection{First subset}
\cvlistdoubleitem{First}{Second}
\cvlistdoubleitem{Third}{Fourth}
\cvlistdoubleitem{Here is}{two more}

    \subsection{Second subset}
    \cvlistitem{Fifth}
    \cvlistitem{Seventh}
    \cvlistitem{AAAAAAAAAA}
    \end{multicols}
\end{document}

you get the following wished result:

wished resulting pdf

  • Excellent explanation, the trick works perfectly. Thank you very much! – GGiacomo Dec 11 '18 at 15:04
0

Edit: I've updated my answer with a modified \cvlistdoubleitem command.

The modernCV class (v2.0.0) uses the following definition for cvlistdoubleitem:

\renewcommand*{\cvlistdoubleitem}[3][.25em]{%
  \cvitem[#1]{}{\listitemsymbol\begin{minipage}[t]{\listdoubleitemcolumnwidth}#2\end{minipage}%
  \hfill% fill of \separatorcolumnwidth
  \ifthenelse{\equal{#3}{}}%
    {}%
    {\listitemsymbol\begin{minipage}[t]{\listdoubleitemcolumnwidth}#3\end{minipage}}}}

The \hfill in there and the minipage with \listdoubleitemcolumnwidth seem problematic for your two-column layout. I've modified the command, creating \cvlistdoubleitemnew:

LaTeX

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

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{url}
\usepackage{relsize}
\usepackage[margin=1in]{geometry}
\usepackage{multicol}
\usepackage{lipsum}

\moderncvstyle{classic} %classic, oldstyle, banking casual
\moderncvcolor{blue} %blue orange green red purple grey black

\firstname{Fat}
\familyname{Tony}
\title{Curriculum Vitae}

\address{Somewhere in Springfield}{12345}{United States}
\email{fat.tony@themob.com}
\homepage{linkedin.com/in/fat.tony}

% copied from moderncvbodyi.sty
\newcommand{\cvlistdoubleitemnew}[3][.25em]{%
  \cvitem[#1]{}{\listitemsymbol\begin{minipage}[t]{0.4\listdoubleitemcolumnwidth}#2\end{minipage}%
  \ifthenelse{\equal{#3}{}}%
    {}%
    {\listitemsymbol\begin{minipage}[t]{0.4\listdoubleitemcolumnwidth}#3\end{minipage}}}}

\begin{document}
    \makecvtitle
    \lipsum[1]

    \begin{multicols}{2}
    \setlength{\hintscolumnwidth}{0.175\textwidth}
    \setlength{\separatorcolumnwidth}{0.015\textwidth}
    \setlength{\maincolumnwidth}{\linewidth-\leftskip-\rightskip-\separatorcolumnwidth-\hintscolumnwidth}
    \section{Personal Information}
    \cvitem{Nationality}{Italian American}
    \cvitem{Driving License}{Cars and limos}

    \section{Education}
    \cventry{1990-1995}%
    {PhD in something something}%
    {A university}%
    {City}%
    {High grade}%
    {Some description of the thing}

    \cventry{1988--1990}%
    {Msc of science in another thing}%
    {A university}%
    {City}%
    {High grade}%
    {Some description of the thing}

    \cventry{1985-1988}{Bsc in the first thing ever}%
    {A university}%
    {City}%
    {High grade}%
    {Some description of the thing}

    \cventry{1980-1985}%
    {High school of the best school diploma}%
    {A high school}%
    {City}%
    {High grade}%
    {Some description of the thing}
    \section{Professional experience}
    \cventry{1995-present}
    {Mob boss}{A university}%
    {City}%
    {High grade}%
    {Some description of the thing}

    \section{Languages}
    \cvitem{English}{Native speaker}
    \cvitem{Sicilian}{Proficient user }
    \cvitem{Italian}{Independent user}
    \cvitem{Spanish}{Living the vida loca}

    \section{A set of skills}
    \subsection{First subset}
    \cvlistdoubleitemnew{First}{Second}
    \cvlistdoubleitemnew{Third}{Fourth}
    \cvlistdoubleitemnew{Here is}{two more}

    \subsection{Second subset}
    \cvlistitem{Fifth}
    \cvlistitem{Seventh}
    \cvlistitem{AAAAAAAAAA}
    \end{multicols}
\end{document}

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.