diff options
author | Karl Berry <karl@freefriends.org> | 2012-08-20 22:39:24 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2012-08-20 22:39:24 +0000 |
commit | fcbf59f6f4e30fd0acf97087ff5e62b11af41c2d (patch) | |
tree | 651d5582008b30782a7d450140bb825a03beae0a /Master/texmf-dist/tex/latex | |
parent | e2ed98d1225ce866bbcaf6263ad27a2e8f8d0991 (diff) |
new latex package chkfloat (20aug12)
git-svn-id: svn://tug.org/texlive/trunk@27473 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex')
-rw-r--r-- | Master/texmf-dist/tex/latex/chkfloat/chkfloat.sty | 38 |
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 |