File: needspace.sty

package info (click to toggle)
tetex-src 2.0.2a-3
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 71,124 kB
  • ctags: 1,576
  • sloc: makefile: 1,764; sh: 1,181; perl: 925; lisp: 342; python: 251; sed: 138; ansic: 138; xml: 96; yacc: 52
file content (31 lines) | stat: -rw-r--r-- 879 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
% needspace.sty
%
% Provides a command to reserve space at the bottom of a page. If there
% is not enough space on the current page (column) a new page (column)
% is started.
%
% author: Peter Wilson (CUA)
%         (now at peter.r.wilson@boeing.com)
% Copyright 1996
% Released under the LaTeX Project Public License
%
%
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{needspace}[2002/09/11 v1.2 reserve vertical space]

\newcommand{\needspace}[1]{{%
  \setlength{\dimen@}{#1}%
  \vskip \z@ \@plus \dimen@\pagebreak[3]\vskip \z@ \@plus -\dimen@\relax}}


\endinput

% Example use:
% previous text.\par
% \needspace{5\baselineskip} % need next 5 lines on a single page/column
% The next five lines ...
%
% Changes v1.2 (2002/09/11)
% o At the suggestion of Robin Fairbairns, added use of \dimen@ to capture 
%   the argument so that calc package commands can be used in the argument.
%