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
    
Since you have some responses below that seem to answer your question, please consider marking one of them as ‘Accepted’ by clicking on the tickmark below their vote count (see How do you accept an answer?). This shows which answer helped you most, and it assigns reputation points to the author of the answer (and to you!). It's part of this site's idea to identify good questions and answers through upvotes and acceptance of answers. –  Jubobs Aug 13 at 16:07

3 Answers 3

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
3  
OK, I had an empty line above and below the opening. Taking those out fixed it. –  Kent Oct 29 '10 at 16:34
3  
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
up vote 0 down vote accepted

Empty lines above and below the opening caused the error. Removing the empty lines solved it.

share|improve this answer
1  
Please use the edit link on your question to add additional information. The Post Answer button should be used only for complete answers to the question. –  Christian Hupfer Aug 16 at 22:44
    
This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post. –  ChrisS Aug 16 at 23:29

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.