summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/chkfloat
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/chkfloat')
-rw-r--r--Master/texmf-dist/tex/latex/chkfloat/chkfloat.sty38
1 files changed, 38 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/chkfloat/chkfloat.sty b/Master/texmf-dist/tex/latex/chkfloat/chkfloat.sty
new file mode 100644
index 00000000000..63f28da894f
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/chkfloat/chkfloat.sty
@@ -0,0 +1,38 @@
+%%
+%% This is file `chkfloat.sty'.
+%%
+%% Author: Tomas "tohecz" Hejda <tohecz@gmail.com>
+%%
+%% Licenced under LaTeX-Project Public License version 1.3 or newer.
+%%
+\NeedsTeXFormat{LaTeX2e}[1995/06/01]
+\ProvidesPackage{chkfloat}[2012/08/19 v0.1 chkfloat: check for moved floats]
+
+% tolerances
+\PassOptionsToPackage{patch}{kvoptions}
+\RequirePackage{kvoptions}
+\DeclareStringOption{tolerance}
+\def\chkfloat@tolerance{1}
+\ProcessKeyvalOptions*
+
+% store original macros \@float and \@caption
+\let\chkfloat@float\@float
+\let\chkfloat@caption\@caption
+% make \@float remember the page where the float should be
+\def\@float{\edef\chkfloat@page{\thepage}\chkfloat@float}
+% make \@caption write to a file .fof the information about final page, original page and float caption
+\def\@caption#1[#2]#3{\chkfloat@caption{#1}[#2]{#3}%
+ \addtocontents{fof}{\protect\chkfloat@{\thepage}{\chkfloat@page}{\csname fnum@#1\endcsname: #2}}%
+}
+% checking macro
+\def\chkfloat@#1#2#3{\ifnum#1>\numexpr#2+\chkfloat@tolerance\relax
+ \begingroup\let\on@line\@gobble\def\nobreakspace{ }\GenericWarning{}{Float misplaced on pages #2->#1, #3}\endgroup
+\fi
+}
+% process the file .fof
+\@starttoc{fof}
+
+\endinput
+%%
+%% End of file `chkfloat.sty'.
+%% \ No newline at end of file