# How to debug issue where LaTeX refuses to produce more than 7 pages? [closed]

I consider myself quite experienced in this field by now. But today I am totally stumped. I have a .tex file where LaTeX truncates anything after page 7. It used to be that I had a \newpage in the middle of page 7 but if I remove that thing it will nicely place the things that should be on top of page 8 on the bottom of page 7 and then refuse to do page 8 so there is nothing at that specifik place ending the document. Rather it seems something else is going on. But how do I try to figure it out?

I have searched the log file for warnings and errors and all I have are a few warnings about fonts being loaded multiple times and some not being found so it uses fall backs. That can hardly be it I am thinking...

EDIT:

I have tried for a while now and decided to share my code: https://gist.github.com/jonalv/6305c13c491b65bf4d8e6cb709a41f18

in the hope that someone can figure it out...

• Make a copy and then start to remove things until you find the culprit. – Ulrike Fischer Jan 20 at 10:43
• Do you get any warning and/or error messages? If so, what do they say? – Mico Jan 20 at 10:51
• tex only stops and finalizes the PDF if it executes \@@end which means in latex usually either \end{document} or \stop so you are executing one of those somewhere around page 7... – David Carlisle Jan 20 at 11:15
• @DavidCarlisle Or there is an unbalanced brace that makes TeX to read everything up to the end and to give up; but in this case an error message would be issued. – egreg Jan 20 at 11:19
• \let\clearpage\relax is not a good idea ..., even more if you forget to close the group meant to keep this local. – Ulrike Fischer Jan 20 at 13:41

You are getting a warning in the log:

(\end occurred inside a group at level 1)

### simple group (level 1) entered at line 70 ({)
### bottom level


This indicates something is wrong. And if one looks at line 70 one can see the culprit:

{\let\clearpage\relax\chapter*{Databases exercise 1}


You are redefining \clearpage to do nothing but don't close the group as a brace is missing, and so \clearpage is missing at end document (where it is really needed).

• I actually don't know why I would do this but good catch! and thanks :) – jonalv Jan 20 at 14:03

Well, this is not the most elegant solution, but I added a \newpage just before \end{document} and it compiles all the pages as intended.

• This is not a solution. After any error the PDF is not usable. – David Carlisle Jan 20 at 17:22