2

I'd like a vertically centered letter under letterhead, when a letter is less than a page. When a letter is more than a page, I'd like to achieve a minimum spacing between the letter and letterhead.

The format of the documents is:

[Letterhead]
- leading-space -
[Text]
- trailing-space -

I've thought to add \vfill at leading-space and trailing-space. This seems to accomplish what I want for letters of one page. However, when the document is over a page long the leading-space is inappropriately large - notably when there's an enumerate environment in the text.

I'd be grateful for thoughts and suggestions on how to accomplish this vertical spacing for both long and short (one page) letters.

Note that this is similar to Centering text on a page, except I'm not writing poetry. First, I'm using the memoir class, and second I'm not writing poetry – which would seem to make the verse package inappropriate.

I also note that the letter package accomplishes this sort of spacing, though I admit that I looked at the package and did not understand how it did so.

EDIT: The problem seems related to an enumerate. Example code is as follows:

\documentclass[oneside,11pt]{memoir}
\usepackage{lipsum}
\begin{document}
\lipsum[1] % Letterhead

 \begin{vplace}
 \lipsum[2] % Text
  \begin{enumerate}[1.] % more Text (albeit enumerated)
    \item{}abc
    \item{}ghi
  \end{enumerate}\par 
 \lipsum[3-6] % more Text
 \end{vplace}
\end{document}

If one removes the enumerated list, then the vertical spacing of the typesetting comes out as one would expect. However, with the enumerated list there's a very strange and large space between the Letterhead and first paragraph of Text.

What's causing the large space? Is it possible to eliminate it (without removing the enumerated content).

4

2 Answers 2

2

does this help?

\documentclass[oneside,11pt]{memoir}
\usepackage{lipsum}
\begin{document}
\lipsum[1] % Letterhead

 \begin{vplace}
 \lipsum[2] % Text

\bigskip\noindent
    \begin{minipage}{\linewidth}
    \begin{enumerate}[1.] % more Text (albeit enumerated)
    \item{}abc
    \item{}ghi
  \end{enumerate}
\end{minipage}  \par\bigskip
 \lipsum[3-6] % more Text
 \end{vplace}
\end{document}
2
  • I was going to suggest this as a solution too, but I'm curious as to why the problem arises in the first place. (And as Brian notes in the comments, \vfil shows the same behaviour too.)
    – Alan Munn
    Aug 19, 2011 at 17:22
  • I'm quite curious, too. It seems counterintuitive that wrapping an enumeration in a box would improve the pagination; I'd expect the opposite (if anything) to happen to proper pagination by the TeX algorithms (as enumerations, you'd think, would break at each \item, whereas a minipage would break with less information about the 'break-ability' of its contents (i.e. you'd think minipage would obfuscate the relevant semantics by "hiding" the list's breakable places). Great solution though, @Herbert, but it seems unintuitive (to me)! I'd love to know more. Aug 21, 2011 at 0:44
3

The question is interesting. After an enumerate environment, LaTeX puts a negative vertical penalty (-51) which gives a good page break point. When the paragraph following the list is completed, TeX proceeds to examine where to break the page (it exercises the page builder, in the terminology of the TeXbook).

The "least cost break point" is found exactly after the list, because of that negative penalty: the \vspace*{\stretch{1}} provided by the vplace environment supplies the necessary vertical space.

The documentation of the memoir class doesn't tell it very clearly, but vplace should be used only for objects that fit into a page: it just adds infinitely stretchable space before and after it. Indeed it's defined as

\newenvironment{vplace}[1][1]
  {\par\vspace*{\stretch{#1}}}
  {\vspace*{\stretch{1}}\par}

which is not what you wanted.

Note
The -51 penalty comes from the code of \endtrivlist, where it says \@endparenv, which in turn does \addpenalty\@endparpenalty; \@endparpenalty is set to -\@lowpenalty and \@lowpenalty=51.

2
  • Thanks for the answer – great insight. In place of vspace, is there an option you would you suggest? Is the vfil/vfill option better in any way? Aug 22, 2011 at 14:01
  • 1
    With \vfill you'd get the same.
    – egreg
    Aug 22, 2011 at 19:50

You must log in to answer this question.

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