I am aware that most people seem to suggest using minipages or boxes, but minipages have numerous pathological problems in this context, and most other solutions don't accomodate equations.

I'm unwilling to use \raggedbottom because it messes with the positioning of my footers and page numbers, and also, I don't really like it. I only want underfull pages to happen when it's really important that some content stays together and there's no other way.

So, I'm wondering if it's possible to reduce the penalty for underfull pages so that it's never the maximum penalty, and thus \nopagebreak and \begin{samepage} can actually function as they should.

  • 1
    if \raggedbottom is affecting the position of page numbers and the page foot, then something seems very wrong with your page setup, that shouldn't happen. Commented Feb 28, 2018 at 0:23

1 Answer 1


Possibly you could use a version of \raggedbottom that has \def\@textbottom{\vskip \z@ \@plus 1sp} (or perhaps something a bit bigger) but any finite stretch will over-stretch giving graduated badness for underfull pages. as opposed to the standard \raggedbottom that has \def\@textbottom{\vskip \z@ \@plus.0001fil} so no penalty having short content, or the standard \flushbottom which has \let\@textbottom\relax so maximumn 10000 penalty for a page being short unless the page content supplies stretch glue.

  • Could you explain please how to patch \raggedbottom?
    – Alexey
    Commented Jul 7, 2019 at 13:26

You must log in to answer this question.

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