0

So, I'm working on my cv, but I get this annoying error message:

There's no line here to end. \makelettertitle

Here is my MWE:

\documentclass[12pt,a4paper,sans]{moderncv}
\usepackage{pdfpages}
\usepackage[utf8]{inputenc}  
\usepackage[ngerman]{babel}
\usepackage{textcomp}   
\usepackage{lipsum}
\moderncvtheme[blue]{classic} 
\setlength{\hintscolumnwidth}{3.5cm}    
\usepackage[scale=0.82]{geometry}

\firstname{First name}
\familyname{Last name}
\address{Street}{Postal code City}{Country}
\phone[mobile]{+1234567890}                   
\email{[email protected]}    

\begin{document}
\makecvtitle

\section{Professional career}
\cventry{1}{A}{A}{}{}{}
\cventry{2}{B}{B}{}{}{}
\cventry{3}{C}{C}{}{}{}
\cventry{4}{D}{D}{}{}{}

\section{Academic background}
\cventry{5}{E}{E}{E}{E}{}
\cventry{6}{F}{F}{F}{E}{}  

\section{Scholar background}
\cventry{7}{G}{G}{G}{}{}{}
\cventry{8}{H}{H}{H}{}{}{}
\cventry{9}{I}{I}{I}{}{}{}

\section{Languages}
\cvitemwithcomment{Native languages}{\textbf{J}}{}
\cvitemwithcomment{Foreign languages}{\textbf{K}}{\begin{flushleft}business fluent\end{flushleft}}

\newpage
\section{Computer literacy}
\cvitemwithcomment{Scientific Software}{\textbf{L}}{\begin{flushleft}advanced\end{flushleft}}
\cvitemwithcomment{}{\textbf{M}}{\begin{flushleft}basics\end{flushleft}}
\cvitemwithcomment{Office--Software}{\textbf{N}}{\begin{flushleft}advanced\end{flushleft}}

\section{Hobbies}
\cvitem{Sports}{O}
\cvitem{Other}{P}

\clearpage
%-----       letter           ---------------------------------------------------------
\recipient{Q}{Q}
\date{\begin{flushright}May 23, 2017\end{flushright}}
\opening{Dear Ms. Q}
\closing{In anticipation for a personal conversation,}
\enclosure[Attached]{Attachments}          
\makelettertitle
\lipsum[1]
\makeletterclosing
\end{document}

I have already red this and this questions, but those issues do not match mine. What is wrong with this code? Thanks in advance!!

2
  • 1
    Remove the flushright environment from \date. It seems that you write english - maybe you want to replace ngerman by english in the babel option.
    – esdd
    Commented May 23, 2017 at 22:04
  • @esdd, thanks a lot! flushright was a try to get the date between recipient and opening. Thanks for the english advice, I just forgot to change the language.
    – Dmitri
    Commented May 23, 2017 at 22:11

1 Answer 1

1

Remove the flushright environment from the argument of \date.

To shift the date down you could use

\usepackage{xpatch}
\makeatletter
\xpatchcmd\makeletterhead
  {\@date}{\vskip\baselineskip\hfill\@date}
  {}{\PatchFailed}
\makeatother

enter image description here

Code:

\documentclass[12pt,a4paper,sans]{moderncv}
\usepackage{pdfpages}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{textcomp}
\usepackage{lipsum}
\moderncvtheme[blue]{classic} 
\setlength{\hintscolumnwidth}{3.5cm}
\usepackage[scale=0.82]{geometry}

\firstname{First name}
\familyname{Last name}
\address{Street}{Postal code City}{Country}
\phone[mobile]{+1234567890}
\email{[email protected]}

\usepackage{xpatch}
\makeatletter
\xpatchcmd\makeletterhead
  {\@date}{\vskip\baselineskip\hfill\@date}
  {}{\PatchFailed}
\makeatother

\begin{document}
\recipient{Q}{Q}
\date{May 23, 2017}
\opening{Dear Ms. Q}
\closing{In anticipation for a personal conversation,}
\enclosure[Attached]{Attachments}
\makelettertitle
\lipsum[1]
\makeletterclosing
\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .