moderncv,另一个 \makelettertitle 的“这里没有结束行”问题

moderncv,另一个 \makelettertitle 的“这里没有结束行”问题

因此,我正在编写我的简历,但收到了这个烦人的错误信息:

There's no line here to end. \makelettertitle

这是我的 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}

我已经红了问题,但这些问题与我的不符。这段代码有什么问题?提前致谢!

答案1

flushright从 的参数中删除环境\date

要向下移动日期,您可以使用

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

在此处输入图片描述

代码:

\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}

相关内容