summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/chkfloat
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /macros/latex/contrib/chkfloat
Initial commit
Diffstat (limited to 'macros/latex/contrib/chkfloat')
-rw-r--r--macros/latex/contrib/chkfloat/README44
-rw-r--r--macros/latex/contrib/chkfloat/chkfloat.pdfbin0 -> 51550 bytes
-rw-r--r--macros/latex/contrib/chkfloat/chkfloat.sty38
-rw-r--r--macros/latex/contrib/chkfloat/chkfloat.tex39
4 files changed, 121 insertions, 0 deletions
diff --git a/macros/latex/contrib/chkfloat/README b/macros/latex/contrib/chkfloat/README
new file mode 100644
index 0000000000..e272582e8a
--- /dev/null
+++ b/macros/latex/contrib/chkfloat/README
@@ -0,0 +1,44 @@
+ The chkfloat package
+ Checking floats that get too far from their origin
+
+
+File: README
+Author: Tomas Hejda
+E-mail: tohecz@gmail.com
+
+
+DESCRIPTION
+===========
+
+This package provides one single feature. It shows a warning whenever
+a float is placed more than a pre-defined pages from its orinigal
+page.
+
+Copyright: (C) 2012 Tomas Hejda
+Licence: The LaTeX Project Public License version 1.3 or higher
+ http://www.ctan.org/tex-archive/help/Catalogue/licenses.lppl.html
+
+FILES IN DISTRIBUTION
+=====================
+
+ README This file.
+ chkfloat.sty Class file.
+ chkfloat.pdf Documentation file.
+ chkfloat.tex Documentation source file.
+
+BASIC INSTALLATION
+====================
+
+ The minimum requirement to use the package is the to have
+ chkfloat.sty in a directory where TeX can find it.
+
+ For a basic installation on a TDS compliant system, move the
+ following files to the following directories:
+
+ <texmf>/tex/latex/chkfloat/
+ chkfloat.sty
+
+ <texmf>/doc/latex/chkfloat/
+ README
+ chkfloat.pdf
+
diff --git a/macros/latex/contrib/chkfloat/chkfloat.pdf b/macros/latex/contrib/chkfloat/chkfloat.pdf
new file mode 100644
index 0000000000..c7e9e84b23
--- /dev/null
+++ b/macros/latex/contrib/chkfloat/chkfloat.pdf
Binary files differ
diff --git a/macros/latex/contrib/chkfloat/chkfloat.sty b/macros/latex/contrib/chkfloat/chkfloat.sty
new file mode 100644
index 0000000000..63f28da894
--- /dev/null
+++ b/macros/latex/contrib/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
diff --git a/macros/latex/contrib/chkfloat/chkfloat.tex b/macros/latex/contrib/chkfloat/chkfloat.tex
new file mode 100644
index 0000000000..008bd8c669
--- /dev/null
+++ b/macros/latex/contrib/chkfloat/chkfloat.tex
@@ -0,0 +1,39 @@
+\documentclass{article}
+
+\usepackage{hyperref,url,a4wide}
+
+\title{The {\sffamily chkfloat} package ver.\@ 0.1}
+\author{Tom\'a\v s Hejda \\ \href{mailto:tohecz@gmail.com}{tohecz@gmail.com}}
+\date{19 August 2012}
+
+\begin{document}
+
+\maketitle
+
+\paragraph{Overview.}
+The package {\sffamily chkfloat} provides one single feature.
+It shows a warning whenever a float is placed more than \verb:tolerance: pages from its orinigal page.
+
+\paragraph{Interference.}
+The package should interfere well with other float-related packages like {\sffamily float} or {\sffamily floatrow}.
+If any problem is spotted, feel free to contact the package author.
+
+\paragraph{Package options.}
+The package has a single option \verb:tolerance: which is preset to \verb:1:.
+To change the value, use e.g. \verb:\usepackage[tolerance=0]{chkfloat}:.
+
+\paragraph{Implementation.}
+The package code is documented.
+The implementation is based on the macros that create `List of Figures' and similar lists.
+A new fake list is created with file extension \verb:.fof: and we store the information
+ about each float's ``original'' page and ``final'' page.
+On the next run, these lines are loaded and processed.
+
+\paragraph{Version history.}
+Version 0.1 is the first version.
+
+\paragraph{Licence.}
+This material is subject to the \LaTeX{} Project Public Licence.
+See \url{http://www.ctan.org/tex-archive/help/Catalogue/licenses.lppl.html} for the details of that licence.
+
+\end{document} \ No newline at end of file