Unfortunately I didn't find any helpful question that already exists, so I need to open a new one on my problem.

I have two main documents I use. One is the main.tex with the entire thesis, and one is the SingleChapter.tex where I use single chapters for faster PDF creation. The files look pretty similar with both of them having some (working) header and settings part, and lots of included chapter.tex files.

When using the SingleChapter file everything works fine, but when using the main.tex I get the "no line here to end" error on


Also, with commenting these two lines out the same error occurs in the same lines.

I don't get it.

Can you please help me?

Thanks a lot! :)

  • 1
    Put the chapter command inside the include file, or don't use include but \input. – Ulrike Fischer Mar 25 '19 at 12:07
  • 2
    it will not generate the error that you state but almost always the \chapter heading should be inside the included file otherwise you get a forced page break after the heading. The error is telling you of a bad use of \\ but unless you show your code it is not possible to say what you have done wrong. – David Carlisle Mar 25 '19 at 12:08
  • 1
    also never use the explicit .tex extension with include just use \include{./Chapter/Chaptername} – David Carlisle Mar 25 '19 at 12:09
  • Hi Guys,Thanks for the quick response. I will check that, and swap the include by inputs and throw away the .tex's and report if the error still occurs. – user184234 Mar 25 '19 at 13:29
  • It's really better to put the \chapter line in the included file; leave it in the main file but comment it out -- that will allow you to take advantage of \includeonly. That said, the error is probably being reported for the line just previous to the \chapter line -- and that means it's quite possibly in another file. – barbara beeton Mar 25 '19 at 13:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.