blob: a30aa51a16c3ca9525a0e3a382dd900f3a074182 (
plain)
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
32
33
34
35
36
37
38
39
|
%% LaTeX2e file `needspace.sty'
%% generated by the `filecontents' environment
%% from source `needspace' on 2010/09/12.
%%
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{needspace}[2010/09/12 v1.3c reserve vertical space]
\newcommand{\needspace}[1]{%
\begingroup
\setlength{\dimen@}{#1}%
\vskip\z@\@plus\dimen@
\penalty -100\vskip\z@\@plus -\dimen@
\vskip\dimen@
\penalty 9999%
\vskip -\dimen@
\vskip\z@skip % hide the previous |\vskip| from |\addvspace|
\endgroup
}
\newcommand{\Needspace}{\@ifstar{\@sneedsp@}{\@needsp@}}
\newcommand{\@sneedsp@}[1]{\par \penalty-100\begingroup
\setlength{\dimen@}{#1}%
\dimen@ii\pagegoal \advance\dimen@ii-\pagetotal
\ifdim \dimen@>\dimen@ii
\break
\fi\endgroup}
\newcommand{\@needsp@}[1]{\par \penalty-100\begingroup
\setlength{\dimen@}{#1}%
\dimen@ii\pagegoal \advance\dimen@ii-\pagetotal
\ifdim \dimen@>\dimen@ii
\ifdim \dimen@ii>\z@
\vfil
\fi
\break
\fi\endgroup}
|