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.

In a letter-class document that had no previous errors I am suddenly getting the error message:

"There's no line here to end" \opening{text}

I've used this file many times and today it starts giving this error. How do I troubleshoot this?

share|improve this question
    
Read the FAQ, in particular this. –  Jukka Suomela Oct 29 '10 at 15:26
    
The error should have given you a line number corresponding to where that error occurred. Look there, and at the one or two lines above it. Is there a newline command ending a blank line? –  Willie Wong Oct 29 '10 at 15:28
2  
Did anything change between the last time you compiled it without errors and today? Did you change the file (if so, can you undo those changes to back it into working state)? Did you change packages or distributions? –  Matthew Leingang Oct 29 '10 at 15:43

2 Answers 2

Check for \newline or \\ commands and what comes before. For instance don't write \\\\ to get one further empty line. Possible reasons and solutions are given here in the UK TeX FAQ: No line here to end.

To complement this: sometimes you really wish to break a line but LaTeX doesn't allow it because you are in vertical mode. In such cases \leavevmode directly before \newline or \\ helps. Some people use a quick fix and insert some empty space like in ~\\ to repair that.

share|improve this answer
2  
OK, I had an empty line above and below the opening. Taking those out fixed it. –  Kent Oct 29 '10 at 16:34
    
Why did you write the quick fix at the end of the answer? Gnarf. +1 anyhow ;) –  k0pernikus Apr 22 '13 at 14:32

I have had exactly the same problem with one difference: the source file wasn't mine, I received it by email. It worked for the sender, but I got the "There's no line here to end" error associated with an \opening{} command in my machine.

Matching the code against a letter class intro in a blog, Geek Thoughts, I found a difference: the lacking of a second argument for \begin{letter}. Once provided, everything worked fine for me.

Hope it helps.

share|improve this answer

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.