Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

In the Companion 2nd Edition Table 4.2 shows page geometry values for various font sizes of the letterpaper paper size. These differ sometimes substantially from current values of the standard classes. Is the Companion wrong here or did the values change over the years, if they did what prompted this change?

I took the liberty to take an image of the table for convenience which is shown below:

enter image description here

I also include a MWE for experimentation for those interested to print the values:

\documentclass[10pt]{book}
\usepackage{pgf}
\def\aspectratio{\pgfmathparse{\paperheight/\paperwidth} \pgfmathresult}
\def\printgeometryvalues{\leavevmode
  paperwidth \the\paperwidth\\
  paperheight \the\paperheight\\
  theheadheight \the\headheight\\
  theheadsep \the\headsep\\
  thetopmargin \the\topmargin\\
  theoddsidemargin \the\oddsidemargin\\
  theevensidemargin\the\evensidemargin\\
  thetextheight\the\textheight\\
  thetextwidth \the\textwidth\\
  themarginparsep \the\marginparsep\\
  themarginparwidth \the\marginparwidth\\
  themarginpush \the\marginparpush\\
  thevoffset \the\voffset
  thefootskip \the\footskip\\
  aspect ratio \aspectratio\\
  topskip \the\topskip\\
  voffset \the\voffset\\
  hoffset \the\hoffset\\
  topmargin \the\topmargin}
\parindent0pt
\begin{document}
\null\newpage
\printgeometryvalues
\end{document}

Of interest is the values of \topmargin, which other classes normally set to a negative value. Also IMHO the use of ditto in the table is very unusual.

share|improve this question

2 Answers 2

up vote 7 down vote accepted

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.

share|improve this answer
    
-- Thanks! I also find it interesting that the footer is placed in an hbox in the class definitions, rather than in the output routine like the header. –  Yiannis Lazarides May 7 '12 at 6:52
    
@Yiannis I'm not sure I understand the question. Perhaps you make it a separate question –  Frank Mittelbach May 7 '12 at 9:16
    
Frank thanks; I will possibly tomorrow and ping you in chat. –  Yiannis Lazarides May 7 '12 at 10:08

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

share|improve this answer
    
Thanks! Was staring me in the eye and I missed it:) Why is footskip maybe wrong? –  Yiannis Lazarides May 6 '12 at 20:31
    
You mean the comment in the code? I can't remember where that came from (I would have to look through the change log) unless @FrankMittelbach recalls.... –  David Carlisle May 6 '12 at 20:55
    
David yes the comment in the code. –  Yiannis Lazarides May 6 '12 at 21:00

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.