summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2006-01-11 23:53:29 +0000
committerKarl Berry <karl@freefriends.org>2006-01-11 23:53:29 +0000
commit3b357a6a26df0b61818ef04839f9ec172515a54b (patch)
tree23506084e638376285380cd55b1654f51143510a /Master/texmf-dist/source
parentfaca1b69882dc17b029983d4c7d045d6d49b5cd6 (diff)
trunk/Master/texmf-dist/source/latex/fnbreak
git-svn-id: svn://tug.org/texlive/trunk@293 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source')
-rw-r--r--Master/texmf-dist/source/latex/fnbreak/latex/fnbreak/fnbreak.dtx259
-rw-r--r--Master/texmf-dist/source/latex/fnbreak/latex/fnbreak/fnbreak.ins24
-rw-r--r--Master/texmf-dist/source/latex/fnbreak/latex/fnbreak/fnbreak.xml28
3 files changed, 311 insertions, 0 deletions
diff --git a/Master/texmf-dist/source/latex/fnbreak/latex/fnbreak/fnbreak.dtx b/Master/texmf-dist/source/latex/fnbreak/latex/fnbreak/fnbreak.dtx
new file mode 100644
index 00000000000..e794e4e7742
--- /dev/null
+++ b/Master/texmf-dist/source/latex/fnbreak/latex/fnbreak/fnbreak.dtx
@@ -0,0 +1,259 @@
+% \iffalse meta comment
+% File: fnbreak.dtx Copyright (C) 2003, 2004 Harald Harders
+% \fi
+%
+% \iffalse
+%
+%<*driver>
+\documentclass{ltxdoc}
+\title{The \texttt{fnbreak} package}
+\author{Harald Harders\\\texttt{h.harders@tu-bs.de}}
+\date{Version \fileversion, \filedate, Printed \today}
+\EnableCrossrefs
+\CodelineIndex
+\DoNotIndex{\def,\edef,\let,\newcommand,\newenvironment,\newcounter}
+\DoNotIndex{\setcounter,\space}
+\CodelineNumbered
+\RecordChanges
+\CheckSum{132}
+\IfFileExists{fnbreak-v.tex}{%
+ \input{fnbreak-v.tex}
+ \GetFileInfo{fnbreak-v.tex}
+}{%
+ \PackageError{fnbreak}{File fnbreak-v.tex not found,
+ please\MessageBreak
+ run `latex fnbreak.ins' first}{No additional help}%
+ \def\fileversion{\textbf{??}}%
+ \def\filedate{\textbf{??}}%
+}
+\begin{document}
+ \DocInput{fnbreak.dtx}
+\end{document}
+%</driver>
+% \fi
+%
+% \changes{0.01}{2003/04/03}{First version}
+%
+% \maketitle
+% \begin{abstract}
+% \noindent This package detects footnotes that are split over several
+% pages. It writes a warning into the log file.
+% \end{abstract}
+%
+% \tableofcontents
+%
+% \section*{Copyright}
+% Copyright 2003, 2004 Harald Harders.
+%
+% This program can be redistributed and/or modified under the terms
+% of the LaTeX Project Public License Distributed from CTAN
+% archives in directory macros/latex/base/lppl.txt; either
+% version 1.3 of the License, or any later version.
+%
+% \section{The user interface}
+%
+% To use this package place
+%\begin{verbatim}
+%\usepackage{fnbreak}
+%\end{verbatim}
+% in the preamble of your document.
+%
+% If a footnote is split over a page break, a warning like the
+% following is put into the log:
+%\begin{verbatim}
+%Package fnbreak Warning: Footnote number 1 (label `a')
+%(fnbreak) has been split over different pages:
+%(fnbreak) page 1 to page 2.
+%\end{verbatim}
+% Sometimes, complicated footnote labels are used (for example, when
+% using symbols):
+%\begin{verbatim}
+%Package fnbreak Warning: Footnote number 1 (label `\ensuremath {*}')
+%(fnbreak) has been split over different pages:
+%(fnbreak) page 1 to page 2.
+%\end{verbatim}
+% In some cases may this even break the function.
+% To avoid these problems, you may give the package option |nolabel|:
+%\begin{verbatim}
+%\usepackage[nolabel]{fnbreak}
+%\end{verbatim}
+% Then the label is omitted in the warning:
+%\begin{verbatim}
+%Package fnbreak Warning: Footnote number 1
+%(fnbreak) has been split over different pages:
+%(fnbreak) page 1 to page 2.
+%\end{verbatim}
+%
+% When using the package option |verbose| the fnbreak package writes a
+% message for every footnote, even if it is completely on one page.
+%
+% \StopEventually{\PrintChanges \PrintIndex}
+%
+% \section{The implementation}
+%
+% The approach of this package is very simple:
+% At the begin and the end of each footnote text, the footnote number
+% and current page are written to the aux file. Then, it is tested if
+% both pages are the same for each footnote.
+%
+% Heading of the package:
+% \begin{macrocode}
+%<package>\ProvidesPackage{fnbreak}
+%<version>\ProvidesFile{fnbreak-v.tex}
+%<package|version> [2004/04/06 v1.10 Warning for pagebreak in footnote (HH)]
+%<*package>
+% \end{macrocode}
+% Declare an option to show not only the footnote number but also the
+% label.
+% \changes{1.10}{2004/04/06}{Add option `verbose'}%
+% \begin{macrocode}
+\newif\iffnb@showlabel
+\fnb@showlabeltrue
+\newif\iffnb@verbose
+\DeclareOption{nolabel}{\fnb@showlabelfalse}
+\DeclareOption{verbose}{\fnb@verbosetrue}
+\ProcessOptions\relax
+% \end{macrocode}
+% Define default values in order to avoid possible problems:
+% \changes{1.00}{2004/04/01}{Correct some internal macro names}%
+% \begin{macrocode}
+\xdef\fnb@@footnotestartnum{0}
+\xdef\fnb@@footnotestartpage{0}
+% \end{macrocode}
+% When the aux file is read the first time (before \cs{begin\{document\}},
+% do nothing:
+% \begin{macrocode}
+\def\fnb@footnotestart#1#2#3{}
+\def\fnb@footnoteend#1#2#3{}
+% \end{macrocode}
+% Define the working commands at \cs{begin\{document\}} in order to
+% activate them when the aux file is read at the end of the document:
+% \begin{macrocode}
+\AtBeginDocument{%
+% \end{macrocode}
+% If the start of a footnote has been found, just define commands
+% containing the footnote number (only for debugging) and the start page:
+% \begin{macrocode}
+ \def\fnb@footnotestart#1#2#3{%
+ \xdef\fnb@@footnotestartnum{#1}%
+ \xdef\fnb@@footnotestartpage{#3}%
+ }%
+% \end{macrocode}
+% \changes{1.00}{2004/04/01}{No need to have numerical page numbers
+% anymore}%
+% \changes{1.00}{2004/04/01}{Use the footnote number instead of the
+% label, show both in the warning}%
+% If the end of a footnote has been found, test wheather the footnote
+% numbers fit and wheather the start and end pages are the same. If
+% one of the tests fails, generate a warning:\footnote{Thanks to
+% Bastien Roucaries for pointing at a problem with symbol footnote
+% marks.}
+% \begin{macrocode}
+ \def\fnb@footnoteend#1#2#3{%
+ \xdef\fnb@@footnoteendnum{#1}%
+ \xdef\fnb@@footnoteendpage{#3}%
+% \end{macrocode}
+% Test if start and end refer to the same footnote.
+% \begin{macrocode}
+ \ifx\fnb@@footnotestartnum\fnb@@footnoteendnum
+% \end{macrocode}
+% Test if the footnote ends on the same page it has started.
+% \begin{macrocode}
+ \ifx\fnb@@footnotestartpage\fnb@@footnoteendpage
+% \end{macrocode}
+% Yes, the footnote is completely on one page.
+% Print a message if |verbose| mode is requested.
+% \begin{macrocode}
+ \iffnb@verbose
+ \message{Package fnbreak: Footnote number #1
+ \iffnb@showlabel(label `#2') \fi^^J%
+ \space\space\space\space\space\space
+ \space\space\space\space\space\space
+ \space\space\space\space\space
+ completely on page #3.}%
+ \fi
+ \else
+% \end{macrocode}
+% No, the footnote contains a pagebreak.
+% Print a warning.
+% \begin{macrocode}
+ \PackageWarningNoLine{fnbreak}{Footnote number #1
+ \iffnb@showlabel(label `#2')\fi
+ \MessageBreak
+ has been split over different pages:\MessageBreak
+ page \fnb@@footnotestartpage\space to page #3}%
+% \end{macrocode}
+% Redefine the \cs{fnb@globalwarning} to print a warning at the end of
+% the log file.
+% \begin{macrocode}
+ \def\fnb@globalwarning{%
+ \PackageWarningNoLine{fnbreak}{There are footnotes with a
+ pagebreak.\MessageBreak
+ Check if they are acceptable}%
+ }%
+ \fi
+ \else
+% \end{macrocode}
+% This macro trys to handle different footnotes.
+% This may not happen and is an internal error.
+% \begin{macrocode}
+ \PackageError{fnbreak}{Internal problem:\MessageBreak
+ Start and stop marker of footnote do not fit:\MessageBreak
+ start: \fnb@@footnotestartnum, page \fnb@@footnotestartpage,
+ end: #1, page #3}{%
+ This error may not happen.
+ Please try to make a short example which shows this behaviour
+ and send a bug report to h.harders@tu-bs.de.}%
+ \fi
+ }%
+ }
+% \end{macrocode}
+% Define command that writes the footnote start marker to the aux
+% file:
+% \begin{macrocode}
+ \def\fnb@fnstart{\@bsphack
+ \protected@write\@auxout{}{%
+ \string\fnb@footnotestart{\the\c@footnote}{\thefootnote}{\thepage}%
+ }%
+ \@esphack
+ }
+% \end{macrocode}
+% Define command that writes the footnote end marker to the aux file:
+% \begin{macrocode}
+ \def\fnb@fnend{\@bsphack
+ \protected@write\@auxout{}{%
+ \string\fnb@footnoteend{\the\c@footnote}{\thefootnote}{\thepage}%
+ }%
+ \@esphack
+ }
+% \end{macrocode}
+% \changes{1.00}{2004/04/01}{Patch \cs{@footnotetext} instead of
+% re-writing it}%
+% Redefine \cs{@footnotetext} by patching the calls \cs{fnb@fnstart}
+% and \cs{fnb@fnend} after all other packages have been
+% loaded.\footnote{Thanks to Bastien Roucaries for that patch}
+% \begin{macrocode}
+\AtBeginDocument{%
+ \newcommand\fnb@orig@footnotetext{}%
+ \let\fnb@orig@footnotetext\@footnotetext
+ \long\def\@footnotetext#1{\fnb@orig@footnotetext{\fnb@fnstart#1\fnb@fnend}}%
+% \end{macrocode}
+% \changes{1.10}{2004/04/06}{Write a warning at the end of the log
+% file}%
+% Append \cs{fnb@globalwarning} to \cs{@dofilelist} in order to print
+% the global warning \cs{fnb@globalwarning} after all other messages,
+% e.g., the \cs{listfiles} list.
+% \begin{macrocode}
+ \newcommand\fnb@dofilelist{}%
+ \let\fnb@dofilelist\@dofilelist
+ \def\@dofilelist{\fnb@dofilelist\fnb@globalwarning}%
+}
+% \end{macrocode}
+% Initialise \cs{fnb@globalwarning} to print no warning by default.
+% \begin{macrocode}
+\newcommand\fnb@globalwarning{}%
+\let\fnb@globalwarning\relax
+%</package>
+% \end{macrocode}
+%
+% \Finale
diff --git a/Master/texmf-dist/source/latex/fnbreak/latex/fnbreak/fnbreak.ins b/Master/texmf-dist/source/latex/fnbreak/latex/fnbreak/fnbreak.ins
new file mode 100644
index 00000000000..574099dca6c
--- /dev/null
+++ b/Master/texmf-dist/source/latex/fnbreak/latex/fnbreak/fnbreak.ins
@@ -0,0 +1,24 @@
+\input docstrip.tex
+\preamble
+
+ fnbreak package
+
+ Copyright 2003, 2004 Harald Harders
+
+ This program can be redistributed and/or modified under the terms
+ of the LaTeX Project Public License Distributed from CTAN
+ archives in directory macros/latex/base/lppl.txt; either
+ version 1.3 of the License, or any later version.
+
+ h.harders@tu-bs.de
+
+\endpreamble
+
+\askforoverwritefalse
+
+\generate{%
+ \file{fnbreak.sty}{\from{fnbreak.dtx}{package}}%
+ \file{fnbreak-v.tex}{\from{fnbreak.dtx}{version}}%
+}
+
+\endbatchfile \ No newline at end of file
diff --git a/Master/texmf-dist/source/latex/fnbreak/latex/fnbreak/fnbreak.xml b/Master/texmf-dist/source/latex/fnbreak/latex/fnbreak/fnbreak.xml
new file mode 100644
index 00000000000..e3bff810d40
--- /dev/null
+++ b/Master/texmf-dist/source/latex/fnbreak/latex/fnbreak/fnbreak.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0"?>
+<!DOCTYPE entry SYSTEM "../catalogue.dtd">
+<entry id="fnbreak"
+ datestamp="2004/04/06"
+ modifier="h.harders@tu-bs.de">
+ <about>
+ <name>fnbreak</name>
+ <caption>Warn for splitted footnotes.</caption>
+ <author>
+ <name>Harald Harders</name>
+ <email>h.harders@tu-bs.de</email>
+ </author>
+ <license type="lppl"/>
+ <version>
+ <number>1.10</number>
+ </version>
+ </about>
+ <description>
+ <abstract>
+ This package detects footnotes that are split over several pages.
+ It writes a warning into the log file.
+ </abstract>
+ </description>
+ <distribution>
+ <texlive>latex3</texlive>
+ <ctan>macros/latex/contrib/fnbreak</ctan>
+ </distribution>
+</entry>