Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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{mail@exampl.ecom}

\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... ;)

share|improve this question

1 Answer 1

up vote 4 down vote accepted

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\\\ }
share|improve this answer
    
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 '12 at 12:41
1  
yes you can put the optional argument back just leave the \ at the end eg country\protect\\[1em]\ –  David Carlisle Oct 5 '12 at 12:55
    
Thanks, that worked! (I didn't understand before why the three slashes solve the problem, now I did.) –  lumbric Oct 6 '12 at 13:32
    
@lumbric If you don't like 3 slashes, you can use \\~ ;) –  tohecz Oct 8 '12 at 20:19

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.