Page geometry discrepancies

oooh, it's all a bit of a distant memory (both code and book) but size10.clo has

\if@compatibility
  \setlength\topmargin{27pt}
\else
  \setlength\topmargin{\paperheight}
  \addtolength\topmargin{-2in}
  \addtolength\topmargin{-\headheight}
  \addtolength\topmargin{-\headsep}
  \addtolength\topmargin{-\textheight}
  \addtolength\topmargin{-\footskip}     % this might be wrong!
  \addtolength\topmargin{-.5\topmargin}
  \@settopoint\topmargin
\fi

In other words the 27pt value you show in the table only applies in compatibility mode (ie compatibility with LaTeX 2.09) triggered by using \documentstyle rather than \documentclass


I fear the table has been copied directly from the first edition to the second and nobody ever noticed that it was wrong until now. As David remarked it shows the LaTeX 2.09 values which are still being used with LaTeX2e if used in compatibility mode, i.e., with \documentstyle rather than \documentclass.

The first edition of the LaTeX Companion was written at the time 2e was being finalized and at that time the values may have been still correct even for 2e. But at some point (one would need to look through the rcs logs of that time) we decided to adjust the layout depending on the chosen paper size. Basically the code in size10.clo et al attempts to center the text body on the page and thus calculates \topmargin, \oddsidemargin and \evensidemargin based on the selected paper size option.

For the horizontal sizes this can be done in a precise way, but for the vertical positioning it is not so clear to what extend you want to could the running header and footer. The code is not fully counting in the footer (which is normally only holding a page number if anything) and I guess the "% this might be wrong" is probably just commenting on this. However, the default settings in the standard classes never tried to provide anything more than a "reasonable" way to get text on paper and as we all know aren't necessary examples of great design.

Anyway, this is worth an errata entry for the LaTeX Companion 2ed, and I will add it during the next days.