diff options
author | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
commit | e0c6872cf40896c7be36b11dcc744620f10adf1d (patch) | |
tree | 60335e10d2f4354b0674ec22d7b53f0f8abee672 /macros/latex/contrib/placeins |
Initial commit
Diffstat (limited to 'macros/latex/contrib/placeins')
-rw-r--r-- | macros/latex/contrib/placeins/placeins-doc.pdf | bin | 0 -> 255447 bytes | |||
-rw-r--r-- | macros/latex/contrib/placeins/placeins-doc.tex | 75 | ||||
-rw-r--r-- | macros/latex/contrib/placeins/placeins.sty | 99 | ||||
-rw-r--r-- | macros/latex/contrib/placeins/placeins.txt | 43 |
4 files changed, 217 insertions, 0 deletions
diff --git a/macros/latex/contrib/placeins/placeins-doc.pdf b/macros/latex/contrib/placeins/placeins-doc.pdf Binary files differnew file mode 100644 index 0000000000..a9432ecf78 --- /dev/null +++ b/macros/latex/contrib/placeins/placeins-doc.pdf diff --git a/macros/latex/contrib/placeins/placeins-doc.tex b/macros/latex/contrib/placeins/placeins-doc.tex new file mode 100644 index 0000000000..1514bf8826 --- /dev/null +++ b/macros/latex/contrib/placeins/placeins-doc.tex @@ -0,0 +1,75 @@ +\documentclass[pagesize=auto, fontsize=12pt, DIV=9, parskip=half]{scrartcl} + +\usepackage{fixltx2e} +\usepackage{etex} +\usepackage{lmodern} +\usepackage[T1]{fontenc} +\usepackage{textcomp} +\usepackage{microtype} +\usepackage{hyperref} + +\newcommand*{\mail}[1]{\href{mailto:#1}{\texttt{#1}}} +\newcommand*{\pkg}[1]{\textsf{#1}} +\newcommand*{\cs}[1]{\texttt{\textbackslash#1}} +\makeatletter +\newcommand*{\cmd}[1]{\cs{\expandafter\@gobble\string#1}} +\makeatother +\newcommand*{\opt}[1]{\texttt{#1}} + +\addtokomafont{title}{\rmfamily} + +\title{The \pkg{placeins} package\thanks{This manual corresponds to \pkg{placeins.sty}~ver~2.2, dated~April 18, 2005.}} +\author{Donald Arseneau\thanks{\mail{asnd@triumf.ca}}} +\date{April 18, 2005} + + +\begin{document} + +\maketitle + +\begin{sloppypar} + \pkg{Placeins.sty} keeps floats `in their place', preventing them from floating + past a ``\cmd{\FloatBarrier}'' command into another section. To use it, declare + ``\verb+\usepackage{placeins}+'' and insert ``\cmd{\FloatBarrier}'' at places that floats + should not move past, perhaps at every ``\cmd{\section}''. +\end{sloppypar} + + +\minisec{Option: \opt{[section]}} + +\begin{sloppypar} + A more convenient way to stop floats at section boundaries is to change + the definition of ``\cmd{\section}'' to include ``\cmd{\FloatBarrier}'', either at the + beginning, before ``\cmd{\@startsection}'', or in the `style' specification (see + The \LaTeX\ Companion, section~2.2.2; or~2.3 in the 1st ed). If you specify + ``\verb+\usepackage[section]{placeins}+'', then the ``\cmd{\section}'' command will be + redefined with ``\cmd{\FloatBarrier}'' inserted at the beginning. +\end{sloppypar} + + +\minisec{Options: \opt{[above]} \opt{[below]}} + +Something you may not like is that, by default, ``\cmd{\FloatBarrier}'' is very +strict, and will (try to) prevent a float from appearing above the start +of the current section or below the start of the next section, even +though the float is still on the same page as its intended section. +Each restriction can be relaxed separately by using the ``\opt{[above]}'' and +``\opt{[below]}'' package options: ``\opt{[above]}'' allows floats to appear above their +section, if on the same page; ``\opt{[below]}'' allows below. + +NOTE! The original version of \pkg{placeins.sty} acted like it was loaded +with the option ``\opt{[above]}'' specified. + +There is a problem with \LaTeX's ``\cmd{\suppressfloats}'' being out of step with +the page breaking (see usenet msg \texttt{<yfi656pbsn0.fsf@triumf.ca>} and thread) +which sometimes allows a float to go above a ``\cmd{\FloatBarrier}'' placed near +the top of a page. Maybe \pkg{placeins} will fix it sometime later. + + +\minisec{Option: \opt{[verbose]}} + +There is a package option ``\opt{[verbose]}'' that causes many messages to be +written in the log file. It might be used to answer the question: +`How did \emph{that} get \emph{there}?!?' + +\end{document} diff --git a/macros/latex/contrib/placeins/placeins.sty b/macros/latex/contrib/placeins/placeins.sty new file mode 100644 index 0000000000..84a28341e5 --- /dev/null +++ b/macros/latex/contrib/placeins/placeins.sty @@ -0,0 +1,99 @@ +% P L A C E I N S . S T Y ver 2.2 April 18, 2005 +% Donald Arseneau asnd@triumf.ca +% 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 + +%====================== BEGIN INSTRUCTIONS =========================== + + p l a c e i n s . s t y ver 2.2 April 18, 2005 + Donald Arseneau asnd@triumf.ca + + +Placeins.sty keeps floats `in their place', preventing them from floating +past a "\FloatBarrier" command into another section. To use it, declare +"\usepackage{placeins}" and insert "\FloatBarrier" at places that floats +should not move past, perhaps at every "\section". + +Option: [section] + +A more convenient way to stop floats at section boundaries is to change +the definition of "\section" to include "\FloatBarrier", either at the +beginning, before "\@startsection", or in the `style' specification (see +The LaTeX Companion, section 2.2.2; or 2.3 in the 1st ed). If you specify +"\usepackage[section]{placeins}", then the "\section" command will be +redefined with "\FloatBarrier" inserted at the beginning. + +Options: [above] [below] + +Something you may not like is that, by default, "\FloatBarrier" is very +strict, and will (try to) prevent a float from appearing above the start +of the current section or below the start of the next section, even +though the float is still on the same page as its intended section. +Each restriction can be relaxed separately by using the "[above]" and +"[below]" package options: "[above]" allows floats to appear above their +section, if on the same page; "[below]" allows below. + +NOTE! The original version of placeins.sty acted like it was loaded +with the option "[above]" specified. + +There is a problem with LaTeX's "\suppressfloats" being out of step with +the page breaking (see usenet msg <yfi656pbsn0.fsf@triumf.ca> and thread) +which sometimes allows a float to go above a "\FloatBarrier" placed near +the top of a page. Maybe placeins will fix it sometime later. + +Option: [verbose] + +There is a package option "[verbose]" that causes many messages to be +written in the log file. It might be used to answer the question: +`How did *that* get *there*?!?' + +%====================== END INSTRUCTIONS ======================== + +Test file integrity: ASCII 32-57, 58-126: !"#$%&'()*+,-./0123456789 +:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ diff --git a/macros/latex/contrib/placeins/placeins.txt b/macros/latex/contrib/placeins/placeins.txt new file mode 100644 index 0000000000..aee762d13d --- /dev/null +++ b/macros/latex/contrib/placeins/placeins.txt @@ -0,0 +1,43 @@ + + p l a c e i n s . s t y ver 2.2 April 18, 2005 + Donald Arseneau asnd@triumf.ca + + +Placeins.sty keeps floats `in their place', preventing them from floating +past a "\FloatBarrier" command into another section. To use it, declare +"\usepackage{placeins}" and insert "\FloatBarrier" at places that floats +should not move past, perhaps at every "\section". + +Option: [section] + +A more convenient way to stop floats at section boundaries is to change +the definition of "\section" to include "\FloatBarrier", either at the +beginning, before "\@startsection", or in the `style' specification (see +The LaTeX Companion, section 2.2.2; or 2.3 in the 1st ed). If you specify +"\usepackage[section]{placeins}", then the "\section" command will be +redefined with "\FloatBarrier" inserted at the beginning. + +Options: [above] [below] + +Something you may not like is that, by default, "\FloatBarrier" is very +strict, and will (try to) prevent a float from appearing above the start +of the current section or below the start of the next section, even +though the float is still on the same page as its intended section. +Each restriction can be relaxed separately by using the "[above]" and +"[below]" package options: "[above]" allows floats to appear above their +section, if on the same page; "[below]" allows below. + +NOTE! The original version of placeins.sty acted like it was loaded +with the option "[above]" specified. + +There is a problem with LaTeX's "\suppressfloats" being out of step with +the page breaking (see usenet msg <yfi656pbsn0.fsf@triumf.ca> and thread) +which sometimes allows a float to go above a "\FloatBarrier" placed near +the top of a page. Maybe placeins will fix it sometime later. + +Option: [verbose] + +There is a package option "[verbose]" that causes many messages to be +written in the log file. It might be used to answer the question: +`How did *that* get *there*?!?' + |