3

I am using the package moderncv to create my CV. Unfortunately I can't manage to include a letter as it is done in one of the examples in the CTAN repository (PDF file, TEX file).

The command \makelettertitle seems to cause the problem. Without this command the LaTeX file compiles. With the command I get the following error:

! LaTeX Error: There's no line here to end.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              

l.47 \makelettertitle

Minimal example:

%% LyX 2.0.2 created this file.  For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[12pt,a4paper,naustrian]{moderncv}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage{color}
\usepackage{babel}

\usepackage[scale=0.75]{geometry}

\moderncvtheme[grey]{classic}

\firstname{My}
\familyname{Name}
\title{CV}
\address{Street}{somewhere\protect\\[0.1em] country\protect\\[0.2em]}
\mobile{+1231231231323}
\email{[email protected]}

\begin{document}

\maketitle
\section{Section} 
\cvitem{something}{something}
\cvitem{something}{something}

\clearpage{}

\recipient{Company Recruitment team}{Company, Inc.\\123 somestreet\\some city}
\date{January 01, 1984}
\opening{Dear Sir or Madam,}
\closing{Yours faithfully,}
\enclosure[Attached]{curriculum vit\ae{}}

\makelettertitle

Testtext.

\makeletterclosing


\end{document}

Edit:

The answer solves the problem, but unfortunately only partly. The \makelettertitle command displays the address in a wrong way. I filed a bug report here. My solution for now is to leave out the country... ;)

0

1 Answer 1

4

You can't have a trailing \\ in the address. the coding is a bit odd but this seems to work.

 \address{Street}{somewhere\protect\\ country\protect\\\ }
4
  • Wow thanks! Strangly \maketitle can deal with the tailing \`. Is it possible to increase the distance to the next line as done with [0.2em]` in my minimal example?
    – lumbric
    Oct 5, 2012 at 12:41
  • 1
    yes you can put the optional argument back just leave the \ at the end eg country\protect\\[1em]\ Oct 5, 2012 at 12:55
  • Thanks, that worked! (I didn't understand before why the three slashes solve the problem, now I did.)
    – lumbric
    Oct 6, 2012 at 13:32
  • @lumbric If you don't like 3 slashes, you can use \\~ ;)
    – yo'
    Oct 8, 2012 at 20:19

You must log in to answer this question.

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