3

I'm using the memoir document class.

Is there a way to apply spacing per page so that the content on each page is vertically centered? I'm thinking of something along the lines of \raggedbottom or \flushbottom not \vfill or \centering. I want this to be applied to every page using (presumably) one command at the top of the document.

I am currently using \raggedbottom because I dislike the spacing between paragraphs from \flushbottom (the default?). On some pages the content does not vertically fill the page, say 8 inches of a 12 inch high page, ignoring page margins. In those cases I want there to be 2 inches of padding above the content and 2 inches below the content, not 4 inches below the content.

Thanks!

0

1 Answer 1

2

You may try

\raggedbottom
\makeatletter
\let\@texttop\@textbottom
\makeatother
4
  • Mostly works, only caveat for me is that it doesn't work with \clearpage. Whenever a \clearpage occurs that page (the one that has been cleared) does not vertically center the content.
    – jdw
    Nov 22, 2016 at 17:08
  • 1
    It appears I should be using \pagebreak not \clearpage. That fixes the issue for me.
    – jdw
    Nov 22, 2016 at 17:13
  • 1
    @jdw. Indeed. When LaTeX builds the page, it puts \@texttop before the text and \@textbottom after the text. \raggedbottom defines \@texttop as \relax and \@textbottom as \vskip 0pt plus .0001fil which means glue with infinite stretchabiity but of very low order. If you make \@texttop equals to \@textbottom, you have the same glue with the same stretchability before and after your text, which means centering. \breakpage, just cuts the text and everything goes well. Nov 22, 2016 at 18:04
  • 1
    @jdw. \clearpage adds \vskip 0pt plus 1fil between your text and \@textbottom, which is glue with infinite stretchability of a higher order. This crushes the glue in \@texttop. Either don't use \clearpage or redefines \@texttop and \@textbottom as \vfill. Nov 22, 2016 at 18:07

You must log in to answer this question.

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