From fcbf59f6f4e30fd0acf97087ff5e62b11af41c2d Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Mon, 20 Aug 2012 22:39:24 +0000 Subject: new latex package chkfloat (20aug12) git-svn-id: svn://tug.org/texlive/trunk@27473 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/tex/latex/chkfloat/chkfloat.sty | 38 +++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 Master/texmf-dist/tex/latex/chkfloat/chkfloat.sty (limited to 'Master/texmf-dist/tex') 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 +%% +%% 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 -- cgit v1.2.3