# Making sure that text is aligned between bottoms (and tops) of pages

Here is a LaTeX document:

\documentclass[a4paper,11pt]{book}

\usepackage[paper=a4paper,twoside=true,lmargin=4cm,
rmargin=4cm,bindingoffset=0cm]{geometry}

\begin{document}

\end{document}


If you typeset this, you will notice that there is a weird space between the paragraphs on page 3, causing the bottoms of page 2 and 3 to be misaligned.

Why does this happen, and how can it be fixed?

-
The paragraphs are quite epic in length. The 'weird space' is an example of Knuth's stretchable glue. The glue at the paragraph break is stretched to allow the surrounding paragraphs to take up the 'perfect' amount of space- which is why page 3 looks good, and uses all of the page. Pages 1 and 2 don't have any paragraph breaks, so there's no opportunity for extra glue, so there's no flexibility, so TeX can't (by default) make them beautiful. –  cmhughes Aug 31 '12 at 19:34

As cmhughes explained, the page foot can only be adjusted when there is some stretchable space on the page.

Looking a bit deeper, one could ask why the parskip is stretched to adjust the foot? The answer is because the text height is not a multiple of line height.

This is usually ignored for TeX documents because paragraphs are short or there is other stretchable glue made by displayed equations or lists so there isn't a line grid on the page anyway.

In your concrete example, the annoying space vanishes if you force text height to be a multiple of line height, for instance

\usepackage{calc}

\usepackage[paper=a4paper,twoside=true,lmargin=4cm,
rmargin=4cm,bindingoffset=0cm,textheight=45\baselineskip+\topskip]{geometry}


Adding \topskip is neccessary because the first line doesn't occupy a full \baselineskip.

-

Why not? Probably is the best compromise between LaTeX default rules in the case of this highly dense text.

But if for you is more important the aligned bottom margins that maintain some space between paragraphs, then \raggedbottom at the end of the preamble solved the problem. Or even \setlength{\parskip}{0ex}.

-