TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
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 '14 at 16:07
I've just figured out that `\hphantom{something}\` triggers this error, too. – Martin Thoma Oct 23 '15 at 13:39

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
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
The quick fix ~ added an unwanted empty space in my text. Replacing the ~ by \hglue0.001pt provided a quick fix without any actual extra space. – SDrolet Nov 29 '15 at 15:50

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
I replaced \begin{letter}{ } with \begin{letter}{~} and it works. – GeMir Sep 4 '15 at 14:33
up vote 1 down vote accepted

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

share|improve this answer
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 '14 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 '14 at 23:29

The error observed when using the 'centre' environment in the Title section of the poster (package baposter). Solution: put the title into the minipage environment.

share|improve this answer
It's hard to tell what you're suggesting here. Are you saying that you got the same error in another context, and solved it by using a minipage? If so, how do you know it will apply to this context? Post a MWE which you have compiled and shown to work in the questioner's situation, so your answer will be clearer. – dgoodmaniii May 22 '15 at 20:19

I had the same massage appearing, too.

In my case the problem was in the graphic files I included in the latex file. One can draw in Inkscape and then convert the pictures to latex files. This way whenever you write something between $ $ in the graphic file, it can be converted to latex type math text and included in the latex file as nice math pictures. The problem occurs if you add another paragraph in the text box in the Inkscape file. Then the conversion gets slightly wrong, i.e. after including it in a latex file and compiling it the picture will look correct, but the program will give you the error :

! Latex Error: There is no line here to end.

The problem is that the line indicated by the Latex compiler is nowhere near the picture that is causing the problems, so you have to find it on your own (I found it moving \end{document} up and down the latex file and checking the compilation messages). Deleting the paragraph in the text box in the graphic file solves the problem.

share|improve this answer

Your Answer


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.