1

I have an itemize which perfectly fits to the end of the page. However when I add more text after it, last bullet of itemize is moved to the next page with the new text. Is there a way how to prevent this?

I'm using Overleaf.

I've tried \newpage \pagebreak \clearpage. When using the \newpage, it puts the last item on a new page, then blanks the rest of the page, and put the new text on the following page.

eXPRESS
  • 113
  • 1
    Did you try \newpage after your itemize? – SebGlav Apr 22 '21 at 15:52
  • @SebGlav Yes, sorry I should've mention that. I've tried \newpage \pagebreak and \clearpage. – eXPRESS Apr 22 '21 at 15:59
  • It would be a lot easier for us if you can distill a MWE showing your problem. Ideally you will have two versions: one with the list just fitting, and one with the list not fitting. – Willie Wong Apr 22 '21 at 16:16
  • 1
    Also: What happens when you put \newpage? It should not put the last item on the same page with the added text; does it put the last item on a new page, and then blanks the rest of the page, and put the new text on the following page? – Willie Wong Apr 22 '21 at 16:18
  • @WillieWong You are ofc right, however I'm using some predefined template, lot of commands, re-definitions and macros I don't fully understand so I hoped that this is either some well known situation or that there exist some magical command which will override everything. – eXPRESS Apr 22 '21 at 16:32
  • @WillieWong The second, it puts the last item in itemize to the new page, then blanks the rest of the whole page (because of \newpage) and the text go to following page. – eXPRESS Apr 22 '21 at 16:33
  • Do you know how to check the logs on Overleaf? If so, open up the log file for the version where everything fits on the same page, and see if the log file contains anything about Overfull \vbox. – Willie Wong Apr 22 '21 at 18:28
  • 1
    My guess is that your list is in fact too long for one page, but when there is no further material LaTeX consider the lesser of two evils a slightly overfull page. If you are happy with the layout with the list on the same page, you can try using \enlargethispage (see http://www.emerson.emory.edu/services/latex/latex2e/latex2e_103.html; how much you enlarge by depends a bit on the situation, but you can use a single \baselineskip to start). I would not suggest messing about with this until you are done with the writing and are just doing final formatting adjustments. – Willie Wong Apr 22 '21 at 18:34
  • @WillieWong Yes, you are exactly right! Adding \enlargethispage{1pt} did the trick for me. That is probably why I was also not able to recreate it in empty document. There are page numbering and custom page margins and if I enlarge more it will get overlapped. I think you should expand your comment into an answer so I can accept it. – eXPRESS Apr 23 '21 at 09:37

1 Answers1

2

My guess is that your list is in fact too long for one page, even when there were not following material.

Aside: internally LaTeX when doing typesetting does a sort of optimization process where it tries to pick the "least bad" option under the circumstances (when no good option is available). (You can learn more about this by reading about penalties.) (To make this optimization problem actually solvable usually, a lot of "lengths" are specified internally with glue so that there is a bit of wiggle room allowed.)

It just happens that you ended up in a borderline situation where whatever configuration you are using and whatever text/figures/etc. you have lined things up so that

  • when there are no text following the list, TeX decided that it is better to cram everything onto one page.
  • when there is text following the list, certain penalties are no longer in force and TeX decides now that it is better to let the list overflow to the next page.

In situations like this when you want to override the decisions made by the engine, the \enlargethispage{<length>} command can be useful. Issued with a positive length you make the text height larger and can cram in more stuff; issued with a negative length you can make the text height smaller (to force some material to the next page).

Note: Obviously commands like this are very sensitive to exactly where it is issued; if you change preceding text and pagebreaks, the command may cause unintended consequences. These sorts of fine-tuning really should be left to the end when you are already completely satisfied with the content and general presentation, and are just fiddling around with the minutiae to make things prettier.

Willie Wong
  • 24,733
  • 8
  • 74
  • 106