3

Here is the syntax of \cventry:

\cventry{1}{2}{3}{4}{5}{desc}

How to insert multiple paragraph in a desc part. Also it seems that cventry does not span in multiple pages which make the CV to seem awkward.

7

For the first problem, without redifining anything you can just use \endgraf at the desired paragraph break:

\cventry{1}{2}{3}{4}{5}{desc .... \endgraf descr ...}

Sample output

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

\moderncvstyle{casual} 
\moderncvcolor{blue}   

\usepackage{lipsum} %Just for dummy text

\name{John}{Doe}
\title{Resum\'e title}  

\begin{document}

\makecvtitle

\section{Education}
\cventry{year--year}{Degree}{Institution}{City}{\textit{Grade}}{Description}
\cventry{year--year}{Degree}{Institution}{City}{\textit{Grade}}{Description
text that is long and stretches over several lines.  Description
text that is long and stretches over several lines.  Description
text that is long and stretches over several lines.  Description
text that is long and stretches over several lines.  \endgraf Description
text that is long and stretches over several lines.  Description
text that is long and stretches over several lines.  Description
text that is long and stretches over several lines.  Description
text that is long and stretches over several lines.} 

\cventry{year--year}{Degree}{Institution}{City}{\textit{Grade}}{\lipsum[1-10]}
\end{document}

For the page breaks, you need to redefine \cventry. In the process you may as well allow ordinary paragraph breaks in the description (by making this a "long" command). The approach below is to define \cventrys as items in a special list customised via the enumitem pakcage. If this interferes with other uses of \cventry then you could define a newcommands \longcventry and \longcvitem with the definitions below and leave the original definitions intact.

Sample output

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

\moderncvstyle{casual} 
\moderncvcolor{blue}   

\usepackage{enumitem}

\renewcommand{\cventry}[7][.25em]{%
  \cvitem[#1]{#2}{%
    {\bfseries#3}%
    \ifthenelse{\equal{#4}{}}{}{, {\slshape#4}}%
    \ifthenelse{\equal{#5}{}}{}{, #5}%
    \ifthenelse{\equal{#6}{}}{}{, #6}%
    .\strut%
    \newline{\small\strut #7 \par}}}

\renewcommand{\cvitem}[3][.25em]{%
  \begin{mycvlist}
    \item[#2] #3
    \end{mycvlist}
    \addvspace{#1}}

\newlist{mycvlist}{description}{1}
\setlist[mycvlist]{labelwidth=\hintscolumnwidth,labelsep=\separatorcolumnwidth,leftmargin=!,align=right,font=\normalfont}

\usepackage{lipsum} %Just for dummy text

\name{John}{Doe}
\title{Resum\'e title}  

\begin{document}

\makecvtitle

\section{Education}
\cventry{year--year}{Degree}{Institution}{City}{\textit{Grade}}{Description}
\cventry{year--year}{Degree}{Institution}{City}{\textit{Grade}}{Description
text that is long and stretches over several lines.  Description
text that is long and stretches over several lines.  Description
text that is long and stretches over several lines.  Description
text that is long and stretches over several lines.  \par Description
text that is long and stretches over several lines.  Description
text that is long and stretches over several lines.  Description
text that is long and stretches over several lines.  Description
text that is long and stretches over several lines.} 

\cventry{year--year}{Degree}{Institution}{City}{\textit{Grade}}{\lipsum[1-10]}
\end{document}

The reason some redefinition is necessary, is that as standard cventry builds a tabular and then puts the description part in a minipage, but neither tabular' norminipage' will break over pages.

Addition If you need long labels then you need to use a slightly more elaborate definition for \cvitem wrapping the label in a box and making sure the text inside is right aligned:

\renewcommand{\cvitem}[3][.25em]{%
  \begin{mycvlist}
    \item[{\parbox[t][\baselineskip]{\labelwidth}{\raggedleft #2}}] #3
    \end{mycvlist}
    \addvspace{#1}}

Unfortunately enumitem does contain a standard option for this.

Multiline label sample

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

\moderncvstyle{casual} 
\moderncvcolor{blue}   

\usepackage{enumitem}

\renewcommand{\cventry}[7][.25em]{%
  \cvitem[#1]{#2}{%
    {\bfseries#3}%
    \ifthenelse{\equal{#4}{}}{}{, {\slshape#4}}%
    \ifthenelse{\equal{#5}{}}{}{, #5}%
    \ifthenelse{\equal{#6}{}}{}{, #6}%
    .\strut%
    \newline{\small\strut #7 \par}}}

\renewcommand{\cvitem}[3][.25em]{%
  \begin{mycvlist}
    \item[{\parbox[t][\baselineskip]{\labelwidth}{\raggedleft #2}}] #3
    \end{mycvlist}
    \addvspace{#1}}

\newlist{mycvlist}{description}{1}
\setlist[mycvlist]{labelwidth=\hintscolumnwidth,labelsep=\separatorcolumnwidth,align=right,leftmargin=!,font=\normalfont}

\usepackage{lipsum} %Just for dummy text

\name{John}{Doe}
\title{Resum\'e title}  

\begin{document}

\makecvtitle

\section{Education}
\cventry{year--year}{Degree}{Institution}{City}{\textit{Grade}}{\lipsum[2]} 

\cventry{year--year, year--year and year--year}{Degree}{Institution}{City}{\textit{Grade}}{\lipsum[1-10]}
\end{document}
1

Very late answer, I know, but I found Andrew's response to be excellent. The only issue I had was that some of the text from the first argument of \cventry and \cvitem was inside the left margin. This happened because the text in these arguments was longer than the allocated width. I fixed this by changing the align option. I changed

\setlist[mycvlist]{labelwidth=\hintscolumnwidth,labelsep=\separatorcolumnwidth,leftmargin=!,align=right,font=\normalfont}

to

\setlist[mycvlist]{labelwidth=\hintscolumnwidth,labelsep=\separatorcolumnwidth,leftmargin=!,align=parleft,font=\normalfont}.

This will seem trivial to many people, but as a fairly new user this wasn't obvious to me.

  • Good point. However, this changes the alignment of labels to the left rather than the right. Fixing that needs more work, and I have now added such a version to my answer. – Andrew Swann Apr 13 '16 at 7:40

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.