-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplaceins.sty
50 lines (44 loc) · 1.84 KB
/
placeins.sty
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
40
41
42
43
44
45
46
47
48
49
50
% P L A C E I N S . S T Y ver 2.2 April 18, 2005
% Donald Arseneau [email protected]
% Keep floats `in their place'; don't let them float into another section.
% Instructions are below.
%
% placeins.sty is freely released to the public domain.
\def\@fb@botlist{\@botlist}
\def\@fb@topbarrier{\suppressfloats[t]}
\catcode`\V=14 % `V' is a comment character unless [verbose]
\@ifundefined{DeclareOption}{}%
{\DeclareOption{below}{\def\@fb@botlist{}}
\DeclareOption{above}{\def\@fb@topbarrier{}}
\DeclareOption{section}{\AtBeginDocument{%
\expandafter\renewcommand\expandafter\section\expandafter
{\expandafter\@fb@secFB\section}%
\newcommand\@fb@secFB{\FloatBarrier
\gdef\@fb@afterHHook{\@fb@topbarrier \gdef\@fb@afterHHook{}}}
\g@addto@macro\@afterheading{\@fb@afterHHook}
\gdef\@fb@afterHHook{}
}}
\DeclareOption{verbose}{\catcode`\V=9 }% Activate things after `V'
\ProvidesPackage{placeins}[2005/04/18 \space v 2.2]
\ProcessOptions
} % end of \@ifundefined
\def\FloatBarrier{\par\begingroup \let\@elt\relax
V\edef\@tempa{\write\m@ne{Package placeins Info: Float barrier, from
V input line \the\inputlineno, processed on page \thepage, lands on
V page \noexpand\thepage. }}\@tempa
\edef\@tempa{\@fb@botlist\@deferlist\@dbldeferlist}%
\ifx\@tempa\@empty V\PackageInfo{placeins}{No floats held,}%
\else
\ifx\@fltovf\relax % my indicator of recursion
\if@firstcolumn V\PackageWarning{placeins}{Some floats are stuck,}%
\clearpage
\else V\PackageInfo{placeins}{Eject a column and check again:}%
\null\newpage\FloatBarrier
\fi
\else V\PackageInfo{placeins}{Must dump some floats}%
\newpage \let\@fltovf\relax V\PackageInfo{placeins}{Check again:}%
\FloatBarrier % recurse once only
\fi\fi \endgroup
\@fb@topbarrier }
\catcode`\V=11
\endinput