5

You may know that there exists cvdoubleitem in moderncv with which you can put double items in one line. Is there a way to self-define a cvtripleitem so as to put triple items in one line?

\documentclass[10pt,a4paper,sans]{moderncv}
\moderncvtheme[blue]{classic}
\usepackage[T1]{fontenc}
\usepackage[utf8x]{inputenc}
\usepackage[english]{babel}
\usepackage{helvet}
\usepackage[scale=0.9]{geometry}
\name{John}{Doe}

\begin{document}
\maketitle

\section{aaa}
\cvdoubleitem{xxxx}{aaaaa}{yyyyy}{bbbbb}
% what I want is: \cvtripleitem{xxx}{aaa}{yyy}{bbb}{zzz}{ccc}
\end{document} 
1
  • I've updated my answer with a simplification that might be of interest for you. Apr 16 '14 at 22:01
7

Here's one possibility:

\documentclass{moderncv}
\moderncvtheme{classic}
\usepackage[scale=0.9]{geometry}

\newlength\Tripleitemmaincolumnwidth
\newlength\tripleitemmaincolumnwidth

\AtBeginDocument{%
\setlength\tripleitemmaincolumnwidth{% 
  \maincolumnwidth-2\hintscolumnwidth-2\separatorcolumnwidth}%
\setlength\tripleitemmaincolumnwidth{.333333\tripleitemmaincolumnwidth}%   
  }

\newcommand*{\cvtripleitem}[7][.25em]{%
 \cvitem[#1]{#2}{%
   \begin{minipage}[t]{\tripleitemmaincolumnwidth}#3\end{minipage}%
   \hfill
   \begin{minipage}[t]{\hintscolumnwidth}\raggedleft\hintstyle{#4}\end{minipage}%
   \hspace*{\separatorcolumnwidth}%
   \begin{minipage}[t]{\tripleitemmaincolumnwidth}#5\end{minipage}%
   \hfill
   \begin{minipage}[t]{\hintscolumnwidth}\raggedleft\hintstyle{#6}\end{minipage}%
   \hspace*{\separatorcolumnwidth}%
   \begin{minipage}[t]{\tripleitemmaincolumnwidth}#7\end{minipage}%
   }%
}

\name{John Doe}{}

\begin{document}

\section{Computer skills}
\cvdoubleitem{category 1}{XXX, YYY, ZZZ}{category 4}{XXX, YYY, ZZZ}
\section{Computer skills}
\cvtripleitem{category 1}{XXX, YYY, ZZZ}{category 2}{XXX, YYY, ZZZ}{category 3}{XXX, YYY, ZZZ}

\end{document}

enter image description here

You can use \cvtripleitem in a similar fashion to \cvdoubleitem, but with two additional mandatory arguments (for the third item in the row).

Take into account that, depending on the document page layout, the space reserved for the items might be too narrow.

0

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.