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'm recieving seemingly random There's no line here to end errors at different parts in my code. At first I thought they were truly random and that I had some weird configuration error somewhere, but after more thorough investigations I have found that the error occurs when a page break and an extra line break within a paragraph coincide.

For example, if I have a paragraph containing an eqnarray* environment, and the entire paragraph does not fit on the page (so that the page breaks in the middle of the paragraph, usually between a line of text and the eqnarray*), I get the error.

Does anyone have any idea why this happens?

share|improve this question
7  
Avoid eqnarray, better use align of the amsmath package. You probably have misplaced \\ check if you really need this there. Perhaps show the relevant piece of code. –  Stefan Kottwitz Dec 9 '11 at 7:51
    
Have a look at Error message: There's no line here to end, and please tell us if that helped. We would close this question as a duplicate then. –  Stefan Kottwitz Dec 9 '11 at 8:03
    
do you have a blank line or \` before the eqnarray`? either of those is a bad idea. in fact, it's a bad idea before any display material; in math composition, for good style it is recommended that at least one text line appear at the top of a page before a display, to provide continuity for the reader. –  barbara beeton Dec 9 '11 at 14:07

1 Answer 1

up vote 2 down vote accepted

It turned out this wasn't at all related to any code I had in my actual document, but to a header definition I use in a package I've authored myself. If some fields where empty, some parts of the header ended up with two \\ following directly on each other. The first page had \maketitle on it, and thus didn't print out the header area, so the error didn't occur until LaTeX tried to create the second page - completely unrelated to what was in the document at the pagebreak.

Lessons learned:

  • When things go wrong at page breaks, don't only check the document itself - also check the header and footer definitions.

  • When authoring your own packages, make sure they don't make any unrealistic assumptions, such as "the document author will always want a subtitle"...

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.