I'm writing a report in LaTeX using the Overleaf online editor. For some reason - when translating to pdf - it arranges all contents far-left and doesn't fill out to the right. Does someone know how to fix this?

Below is an example of what it looks like. First page of my ToC is aligned as should be, but the second page f*cks up and then the rest of the pages in my pdf stay left-aligned as well.


I've styled my Overleaf project with several .tex files. My main.tex looks like this:





%--------------------Make usable space all of page



Please, if anyone has any suggestions as to how I can fix this, it will be greatly appreciated!


1 Answer 1


You have not posted a testable fragment but the cause is clearly


You can not change these settings mid page. Changing them after \begin{document} is not really supported, latex has to set up various page parameters and it does this at \begin{document}.

Move that block to the preamble (or better use the geometry package rather than low level assignments to set the page size.

If you really want to change the page size mid-document, you need to reset the internal parameters to match, and do it after a \clearpage forced page break, or more simply use the geometry package interface to changing the page size for specific pages.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .