# A problem with the dimension of the pages of a book

I am typesetting a book in mathematics and I have a problem with the dimension of its pages. My publisher wants me to prepare the book in A4 format and also the size of the texts in each pages be 13*21 cm. To do this, I have tried:

Everything with 13cm is fine, but there is a problem with the height 21cm. In other words, some of my pages is 21cm, while some others are for example 19.8, 20.4, 20.7 etc. I want the height of the texts in all pages be exactly 21cm.

An example:

\documentclass[11pt,‎a4paper‎]{book}‎‎
‎\usepackage{amsthm,amssymb,‎amsmath}‎‎
‎\usepackage{lipsum}‎
‎\begin{document}‎‎
\lipsum[4-‎6]‎‎
‎This‎ ‎is‎‎ ‎a‎ ‎test‎.‎‎This‎ ‎is‎‎ ‎a‎ ‎test‎.‎‎‎ ‎This‎ ‎is‎‎ ‎a‎ ‎test‎.‎‎‎ ‎This‎ ‎is‎‎ ‎a‎ ‎test‎.‎‎‎ ‎This‎ ‎is‎‎ ‎a‎ ‎test‎.‎‎‎ ‎This‎ ‎is‎‎ ‎a‎ ‎test‎.‎‎This‎ ‎is‎‎ ‎a‎ ‎test‎.‎‎‎ ‎This‎ ‎is‎‎ ‎a‎ ‎test‎.‎‎‎ ‎This‎ ‎is‎‎ ‎a‎ ‎test‎.‎‎‎ ‎This‎ ‎is‎‎ ‎a‎ ‎test‎.‎‎‎ ‎This‎ ‎is‎‎ ‎a‎ ‎test‎.‎‎This‎ ‎is‎‎ ‎a‎ ‎test‎.‎‎‎‎This‎ ‎is‎‎ ‎a‎ ‎test‎.‎‎‎ ‎This‎ ‎is‎‎ ‎a‎ ‎test‎.‎‎‎ ‎This‎ ‎is‎‎ ‎a‎ ‎test‎.‎This‎ ‎is‎‎ ‎a‎ ‎test‎.‎‎‎ ‎This‎ ‎is‎‎ ‎a‎ ‎test‎.‎‎‎ ‎This‎ ‎is‎‎ ‎a‎ ‎test‎.
‎\begin{eqnarray*}‎
‎\mathcal{F}\chi_{[-‎\frac{b‎}{2},‎\frac{a}{6‎}]}(\gamma) ‎&=&8‎\int_{0}^{\infty}\chi_{[-\frac{a}{2},‎\frac{b‎}{2}]}(x)\cos(2\pi ‎y‎\gamma) dx\\‎
‎&=&2\int_{0}^{a/‎23‎‎}\cos(2\pi x\gamma) dx\\‎
‎&=&\frac{6}{2\pi\gamma}[\sin(7‎\pi ‎x\gamma)]_{y=5}^{y=\frac{c‎}{2}}\\‎
‎&=&\frac{\cos‎(\pi a\gamma)}{\pi ‎2 ‎\gamma}‎.
‎\end{eqnarray*}‎‎
‎\section{First‎}‎‎
‎\lipsum[1‎-‎3‎]‎‎
‎\begin{eqnarray*}‎
‎\mathcal{F}\chi_{[-‎\frac{b‎}{2},‎\frac{a}{6‎}]}(\gamma) ‎&=&8‎\int_{0}^{\infty}\chi_{[-\frac{a}{2},‎\frac{b‎}{2}]}(x)\cos(2\pi ‎y‎\gamma) dx\\‎
‎&=&2\int_{0}^{a/‎23‎‎}\cos(2\pi x\gamma) dx\\‎
‎&=&\frac{6}{2\pi\gamma}[\sin(7‎\pi ‎x\gamma)]_{y=5}^{y=\frac{c‎}{2}}\\‎
‎&=&\frac{\cos‎(\pi a\gamma)}{\pi ‎2 ‎\gamma}‎.
‎\end{eqnarray*}‎‎
‎\end{document}‎‎


After running the file, you can see that the height of the text in page 2 is longer than one in page 1.

I was wondering if someone help me to fix this problem. Thank you very much.

-
Can you pose a minimal example? I just threw one chapter of my PhD thesis into a wrapper with only \documentclass{book} and your command for including the geometry package in the preamble, and the bottom of pages are all (except for the last one) flush at exactly 210mm from the top. So I cannot reproduce the problem. It will help the diagnosis if there is an example file (just the preamble section is enough) to show the issue. –  Willie Wong Oct 13 '10 at 21:51
(use the lipsum package to get enough text for the minimum example without filling the question with unnecessary amounts of dummy text) –  Caramdir Oct 14 '10 at 1:34
@Darya, see my edited answer below. Also, I was going to point you to tex.stackexchange.com/questions/138/… to learn about underfull boxes, but it seems that there isn't (yet) any actually useful information for solving your problem. –  Willie Wong Oct 14 '10 at 10:59

I think (if I remember correctly) that the default in LaTeX is \raggedbottom. Try issuing the \flushbottom command somewhere in your preamble.

Edit I just looked at the minimal example posted above. No wonder the you are seeing a problem. Here's the relevant snip of the compile:

Underfull \vbox (badness 10000) has occurred while \output is active [1]


So you are running into a problem which TeX cannot solve. To be more precise: TeX tries to find a solution to the problem of typesetting the document under certain constraints. For example, it tries to avoid widows and orphans, and it doesn't like to have the section header at the bottom of the page with no text following it. Basically, you've presented TeX with a situation where it is impossible to satisfy all the rules (which also include constraints on interline and interparagraph spacing and what not), so TeX breaks one of them (that the text takes up exactly 21cm of vertical space) in order to make others happy.

Usually when faced with these types of problems, the best solution, from my personal point of view (since you are already in the end stage of document preparation where the precise formatting is important), is to either re-format the equation(s) so they take up less vertical space (to make room for things that now are forced to reside on the next page), or to re-write the text on the page (either cut out sufficiently many words, or add sufficiently many words). With an underfull vbox you can visually see that the text layout is stretched, with more vertical white space than reasonable. By inspection of the page and what was pushed onto the next page, you can usually guess at whether it is better to try to add more text on the page so that the (limited) stretching allowed for interline/interparagraph space is sufficient, or if it is to trim some text so that the largish section title and the first two lines of the paragraph to follow can fit in your page.

A lesser solution would be to add, by hand, white space to the page, to make up for the insufficiencies of the built-in rubber space. I would personally recommand against that because it would be making the the bottom flush at the expanse of putting a gaping hole in the middle of the page.

A possibility that is not guaranteed to work is to enable the microtype package. It sometimes allow you to cram a tiny bit more text into a line to shorten the paragraph and make some instances of this issue go away.

One final possibility (if you are allowed) is to change the \section and \subsection commands using something like the titlesec package. If you make the section headers smaller, this kind of problems will also be less likely to occur.

-
Thanks Willie, but I tried this command, it doesn't work! –  Darya Oct 13 '10 at 20:25
For the base documentclasses (article, book, report) default is \raggedbottom for one-sided documents and \flushbottom for two-sided documents. –  Lev Bishop Oct 13 '10 at 20:39