I would be really grateful, if anybody could help with this. If I compile the code (see MWE below) the text that is written in the second argument of cvitem continues beyond the right margin until the very end of the paper. What do I need to do in order to have automatic line breaks in the second argument of \cvitem
?
\documentclass[11pt,a4paper,sans]{moderncv}
\moderncvstyle{classic}
\moderncvcolor{blue}
\usepackage[scale=0.75]{geometry}
\AtBeginDocument{\hypersetup{colorlinks,linkcolor=cyan,urlcolor=cyan}}
\firstname{Jane}
\familyname{Doe}
\title{Curriculum Vitae}
\address{Street}{City}{}
\mobile{Number}
\email{email}
\begin{document}
\makecvtitle
\section{Education}
\cventry
{2020--2025}
{Degree}
{University}
{Location}
{Some info including a link in my real document. The automatic linebreak works here, but not below}
{\cvitem{Item 1}{This is the description of item 1 and it is very long so I need an automatic linebreak here so the text doesn't go beyond the linewidth.}
\cvitem{Item 2}{This is the description of item 2 and it is very long so I need an automatic linebreak here which I don't know how to create.}
\cvitem{Item 3}{This is the description of item 3 and it is even longer and spans across multiple lines so I need an automatic linebreak so the text doesn't go beyond the linewidth, but I don't know how to create this.}
}
\end{document}
Best Answer
The line break does happen automatically. The problem is that you are missing an argument to
\cventry
, then it takes the\cvitem
s as argument.From
moderncv
's GitHub page, the arguments to\cventry
are:and you didn't have
\textit{Grade}
. You must have this argument, even if empty ({}
).If you want to change the alignment of the
\cvitem
s you should, instead, increase the value of\hintscolumnwidth
and decrease that of\maincolumnwidth
. The\cvitem
s are typeset using atabular
with two columns each with one of those two widths.For example, to make indentation of
Item X
be4cm
:Compilable MWE: