diff thesis/extraplaceins.sty @ 510:f639e2139ce2

much happier with image placement now.
author Robert McIntyre <rlm@mit.edu>
date Sun, 30 Mar 2014 01:34:43 -0400
parents
children
line wrap: on
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/thesis/extraplaceins.sty	Sun Mar 30 01:34:43 2014 -0400
     1.3 @@ -0,0 +1,120 @@
     1.4 +%  P L A C E I N S . S T Y          ver 2.2  April 18, 2005
     1.5 +%  Donald Arseneau                  asnd@triumf.ca
     1.6 +%
     1.7 +%  Modified on March 6, 2011
     1.8 +%  Lex Fridman                      lexfridman@gmail.com
     1.9 +%  See: http://bit.ly/h2Se0u
    1.10 +%
    1.11 +%  Keep floats `in their place'; don't let them float into another section.
    1.12 +%  Instructions are below.
    1.13 +%
    1.14 +%  placeins.sty is freely released to the public domain.
    1.15 +
    1.16 +
    1.17 +\def\@fb@botlist{\@botlist}
    1.18 +\def\@fb@topbarrier{\suppressfloats[t]}
    1.19 +
    1.20 +\catcode`\V=14 % `V' is a comment character unless [verbose]
    1.21 +
    1.22 +\@ifundefined{DeclareOption}{}%
    1.23 +{\DeclareOption{below}{\def\@fb@botlist{}}
    1.24 + \DeclareOption{above}{\def\@fb@topbarrier{}}
    1.25 + \DeclareOption{section}{\AtBeginDocument{%
    1.26 +     \expandafter\renewcommand\expandafter\section\expandafter
    1.27 +       {\expandafter\@fb@secFB\section}%
    1.28 +     \newcommand\@fb@secFB{\FloatBarrier
    1.29 +     \gdef\@fb@afterHHook{\@fb@topbarrier \gdef\@fb@afterHHook{}}}
    1.30 +     \g@addto@macro\@afterheading{\@fb@afterHHook}
    1.31 +     \gdef\@fb@afterHHook{}
    1.32 +  }}
    1.33 + \DeclareOption{subsection}{\AtBeginDocument{%
    1.34 +     \expandafter\renewcommand\expandafter\subsection\expandafter
    1.35 +       {\expandafter\@fb@subsecFB\subsection}%
    1.36 +     \newcommand\@fb@subsecFB{\FloatBarrier
    1.37 +     \gdef\@fb@afterHHook{\@fb@topbarrier \gdef\@fb@afterHHook{}}}
    1.38 +     \g@addto@macro\@afterheading{\@fb@afterHHook}
    1.39 +     \gdef\@fb@afterHHook{}
    1.40 +  }}
    1.41 + \DeclareOption{subsubsection}{\AtBeginDocument{%
    1.42 +     \expandafter\renewcommand\expandafter\subsubsection\expandafter
    1.43 +       {\expandafter\@fb@subsubsecFB\subsubsection}%
    1.44 +     \newcommand\@fb@subsubsecFB{\FloatBarrier
    1.45 +     \gdef\@fb@afterHHook{\@fb@topbarrier \gdef\@fb@afterHHook{}}}
    1.46 +     \g@addto@macro\@afterheading{\@fb@afterHHook}
    1.47 +     \gdef\@fb@afterHHook{}
    1.48 +  }}
    1.49 + \DeclareOption{verbose}{\catcode`\V=9 }% Activate things after `V'
    1.50 + \ProvidesPackage{placeins}[2005/04/18 \space  v 2.2]
    1.51 + \ProcessOptions 
    1.52 +} % end of \@ifundefined
    1.53 +
    1.54 +\def\FloatBarrier{\par\begingroup \let\@elt\relax
    1.55 +V\edef\@tempa{\write\m@ne{Package placeins Info: Float barrier, from
    1.56 +V  input line \the\inputlineno, processed on page \thepage, lands on
    1.57 +V  page \noexpand\thepage. }}\@tempa
    1.58 + \edef\@tempa{\@fb@botlist\@deferlist\@dbldeferlist}%
    1.59 + \ifx\@tempa\@empty V\PackageInfo{placeins}{No floats held,}%
    1.60 + \else
    1.61 +    \ifx\@fltovf\relax % my indicator of recursion
    1.62 +       \if@firstcolumn V\PackageWarning{placeins}{Some floats are stuck,}%
    1.63 +         \clearpage 
    1.64 +       \else V\PackageInfo{placeins}{Eject a column and check again:}%
    1.65 +         \null\newpage\FloatBarrier 
    1.66 +       \fi
    1.67 +    \else V\PackageInfo{placeins}{Must dump some floats}%
    1.68 +       \newpage \let\@fltovf\relax V\PackageInfo{placeins}{Check again:}%
    1.69 +       \FloatBarrier % recurse once only
    1.70 + \fi\fi \endgroup
    1.71 + \@fb@topbarrier }
    1.72 +
    1.73 +\catcode`\V=11
    1.74 +\endinput
    1.75 +
    1.76 +%====================== BEGIN INSTRUCTIONS ===========================
    1.77 +
    1.78 +  p l a c e i n s . s t y          ver 2.2  April 18, 2005
    1.79 +  Donald Arseneau                  asnd@triumf.ca
    1.80 +
    1.81 +
    1.82 +Placeins.sty keeps floats `in their place', preventing them from floating
    1.83 +past a "\FloatBarrier" command into another section.  To use it, declare
    1.84 +"\usepackage{placeins}" and insert "\FloatBarrier" at places that floats 
    1.85 +should not move past, perhaps at every "\section".  
    1.86 +
    1.87 +Option:  [section]
    1.88 +
    1.89 +A more convenient way to stop floats at section boundaries is to change 
    1.90 +the definition of "\section" to include "\FloatBarrier", either at the
    1.91 +beginning, before "\@startsection", or in the `style' specification (see 
    1.92 +The LaTeX Companion, section 2.2.2; or 2.3 in the 1st ed).  If you specify 
    1.93 +"\usepackage[section]{placeins}", then the "\section" command will be 
    1.94 +redefined with "\FloatBarrier" inserted at the beginning.
    1.95 +
    1.96 +Options:  [above]  [below]
    1.97 +
    1.98 +Something you may not like is that, by default, "\FloatBarrier" is very 
    1.99 +strict, and will (try to) prevent a float from appearing above the start 
   1.100 +of the current section or below the start of the next section, even 
   1.101 +though the float is still on the same page as its intended section.  
   1.102 +Each restriction can be relaxed separately by using the "[above]" and 
   1.103 +"[below]" package options: "[above]" allows floats to appear above their 
   1.104 +section, if on the same page; "[below]" allows below.
   1.105 +
   1.106 +NOTE!  The original version of placeins.sty acted like it was loaded
   1.107 +with the option "[above]" specified.
   1.108 +
   1.109 +There is a problem with LaTeX's "\suppressfloats" being out of step with 
   1.110 +the page breaking (see usenet msg <yfi656pbsn0.fsf@triumf.ca> and thread)
   1.111 +which sometimes allows a float to go above a "\FloatBarrier" placed near
   1.112 +the top of a page. Maybe placeins will fix it sometime later.
   1.113 +
   1.114 +Option: [verbose]
   1.115 +
   1.116 +There is a package option "[verbose]" that causes many messages to be
   1.117 +written in the log file.  It might be used to answer the question:
   1.118 +`How did *that* get *there*?!?'
   1.119 +
   1.120 +%====================== END INSTRUCTIONS ========================
   1.121 +
   1.122 +Test file integrity:  ASCII 32-57, 58-126:  !"#$%&'()*+,-./0123456789
   1.123 +:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~