view thesis/extraplaceins.sty @ 570:9647f0168287

update for interview.
author Robert McIntyre <rlm@mit.edu>
date Tue, 15 Jul 2014 02:46:00 -0400
parents f639e2139ce2
children
line wrap: on
line source
1 % P L A C E I N S . S T Y ver 2.2 April 18, 2005
2 % Donald Arseneau asnd@triumf.ca
3 %
4 % Modified on March 6, 2011
5 % Lex Fridman lexfridman@gmail.com
6 % See: http://bit.ly/h2Se0u
7 %
8 % Keep floats `in their place'; don't let them float into another section.
9 % Instructions are below.
10 %
11 % placeins.sty is freely released to the public domain.
14 \def\@fb@botlist{\@botlist}
15 \def\@fb@topbarrier{\suppressfloats[t]}
17 \catcode`\V=14 % `V' is a comment character unless [verbose]
19 \@ifundefined{DeclareOption}{}%
20 {\DeclareOption{below}{\def\@fb@botlist{}}
21 \DeclareOption{above}{\def\@fb@topbarrier{}}
22 \DeclareOption{section}{\AtBeginDocument{%
23 \expandafter\renewcommand\expandafter\section\expandafter
24 {\expandafter\@fb@secFB\section}%
25 \newcommand\@fb@secFB{\FloatBarrier
26 \gdef\@fb@afterHHook{\@fb@topbarrier \gdef\@fb@afterHHook{}}}
27 \g@addto@macro\@afterheading{\@fb@afterHHook}
28 \gdef\@fb@afterHHook{}
29 }}
30 \DeclareOption{subsection}{\AtBeginDocument{%
31 \expandafter\renewcommand\expandafter\subsection\expandafter
32 {\expandafter\@fb@subsecFB\subsection}%
33 \newcommand\@fb@subsecFB{\FloatBarrier
34 \gdef\@fb@afterHHook{\@fb@topbarrier \gdef\@fb@afterHHook{}}}
35 \g@addto@macro\@afterheading{\@fb@afterHHook}
36 \gdef\@fb@afterHHook{}
37 }}
38 \DeclareOption{subsubsection}{\AtBeginDocument{%
39 \expandafter\renewcommand\expandafter\subsubsection\expandafter
40 {\expandafter\@fb@subsubsecFB\subsubsection}%
41 \newcommand\@fb@subsubsecFB{\FloatBarrier
42 \gdef\@fb@afterHHook{\@fb@topbarrier \gdef\@fb@afterHHook{}}}
43 \g@addto@macro\@afterheading{\@fb@afterHHook}
44 \gdef\@fb@afterHHook{}
45 }}
46 \DeclareOption{verbose}{\catcode`\V=9 }% Activate things after `V'
47 \ProvidesPackage{placeins}[2005/04/18 \space v 2.2]
48 \ProcessOptions
49 } % end of \@ifundefined
51 \def\FloatBarrier{\par\begingroup \let\@elt\relax
52 V\edef\@tempa{\write\m@ne{Package placeins Info: Float barrier, from
53 V input line \the\inputlineno, processed on page \thepage, lands on
54 V page \noexpand\thepage. }}\@tempa
55 \edef\@tempa{\@fb@botlist\@deferlist\@dbldeferlist}%
56 \ifx\@tempa\@empty V\PackageInfo{placeins}{No floats held,}%
57 \else
58 \ifx\@fltovf\relax % my indicator of recursion
59 \if@firstcolumn V\PackageWarning{placeins}{Some floats are stuck,}%
60 \clearpage
61 \else V\PackageInfo{placeins}{Eject a column and check again:}%
62 \null\newpage\FloatBarrier
63 \fi
64 \else V\PackageInfo{placeins}{Must dump some floats}%
65 \newpage \let\@fltovf\relax V\PackageInfo{placeins}{Check again:}%
66 \FloatBarrier % recurse once only
67 \fi\fi \endgroup
68 \@fb@topbarrier }
70 \catcode`\V=11
71 \endinput
73 %====================== BEGIN INSTRUCTIONS ===========================
75 p l a c e i n s . s t y ver 2.2 April 18, 2005
76 Donald Arseneau asnd@triumf.ca
79 Placeins.sty keeps floats `in their place', preventing them from floating
80 past a "\FloatBarrier" command into another section. To use it, declare
81 "\usepackage{placeins}" and insert "\FloatBarrier" at places that floats
82 should not move past, perhaps at every "\section".
84 Option: [section]
86 A more convenient way to stop floats at section boundaries is to change
87 the definition of "\section" to include "\FloatBarrier", either at the
88 beginning, before "\@startsection", or in the `style' specification (see
89 The LaTeX Companion, section 2.2.2; or 2.3 in the 1st ed). If you specify
90 "\usepackage[section]{placeins}", then the "\section" command will be
91 redefined with "\FloatBarrier" inserted at the beginning.
93 Options: [above] [below]
95 Something you may not like is that, by default, "\FloatBarrier" is very
96 strict, and will (try to) prevent a float from appearing above the start
97 of the current section or below the start of the next section, even
98 though the float is still on the same page as its intended section.
99 Each restriction can be relaxed separately by using the "[above]" and
100 "[below]" package options: "[above]" allows floats to appear above their
101 section, if on the same page; "[below]" allows below.
103 NOTE! The original version of placeins.sty acted like it was loaded
104 with the option "[above]" specified.
106 There is a problem with LaTeX's "\suppressfloats" being out of step with
107 the page breaking (see usenet msg <yfi656pbsn0.fsf@triumf.ca> and thread)
108 which sometimes allows a float to go above a "\FloatBarrier" placed near
109 the top of a page. Maybe placeins will fix it sometime later.
111 Option: [verbose]
113 There is a package option "[verbose]" that causes many messages to be
114 written in the log file. It might be used to answer the question:
115 `How did *that* get *there*?!?'
117 %====================== END INSTRUCTIONS ========================
119 Test file integrity: ASCII 32-57, 58-126: !"#$%&'()*+,-./0123456789
120 :;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~