Next: , Previous: , Up: Lengths   [Contents][Index]


14.7 \stretch

Synopsis:

\stretch{number}

Produces a rubber length with zero natural length and number times \fill units of stretchability (see Lengths). The number can be positive or negative. This command is robust (see \protect).

It works for both vertical and horizontal spacing. In this horizontal example, LaTeX produces three tick marks, and the distance between the first and second is half again as long as the distance between the second and third.

\rule{0.4pt}{1ex}\hspace{\stretch{1.5}}%
  \rule{0.4pt}{1ex}\hspace{\stretch{1}}%
  \rule{0.4pt}{1ex} 

In this vertical example, the ‘We dedicate …’ will have three times as much space under it as above it.

\newenvironment{dedication}{% in document preamble
  \clearpage\thispagestyle{empty}% 
  \vspace*{\stretch{1}} % stretchable space at top 
  \it
}{%
  \vspace{\stretch{3}}  % space at bot is 3x as at top
  \clearpage
}
  ...
\begin{dedication}  % in document body
We dedicate this book to our wives.
\end{dedication}

Unofficial LaTeX2e reference manual