summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2023-03-21 16:44:53 +0000
committerKarl Berry <karl@freefriends.org>2023-03-21 16:44:53 +0000
commit2265ce5c20cccb0d14ebdf930bd9e62ba5ce04e5 (patch)
tree454364671f9b2c5df56302a0fef09ecd256c0537 /Master/texmf-dist/tex
parent5bb8efa6a6fc727a01dab44dc384c4a14c3dd7f3 (diff)
fnbreak (18mar23)
git-svn-id: svn://tug.org/texlive/trunk@66615 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r--Master/texmf-dist/tex/latex/fnbreak/fnbreak.sty171
1 files changed, 94 insertions, 77 deletions
diff --git a/Master/texmf-dist/tex/latex/fnbreak/fnbreak.sty b/Master/texmf-dist/tex/latex/fnbreak/fnbreak.sty
index c74d658f82c..a80f9c9f182 100644
--- a/Master/texmf-dist/tex/latex/fnbreak/fnbreak.sty
+++ b/Master/texmf-dist/tex/latex/fnbreak/fnbreak.sty
@@ -8,37 +8,67 @@
%%
%% fnbreak package
%%
-%% Copyright 2003, 2004, 2006, 2010, 2012 Harald Harders
+%% Copyright (c) 2003, 2004, 2006, 2010, 2012, 2023 Harald Harders (harald.harders@gmx.de; inactive)
+%% (2023-03-18 update done by H.-Martin Muench, Martin.Muench AT Uni-Bonn.de)
%%
-%% 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.
-%%
-%% harald.harders@gmx.de
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either
+%% version 1.3c of this license or (at your option) any later
+%% version. This version of this license is in
+%% https://www.latex-project.org/lppl/lppl-1-3c.txt
+%% and the latest version of this license is in
+%% https://www.latex-project.org/lppl.txt
+%% and version 1.3c or later is part of all distributions of
+%% LaTeX version 2005-12-01 or later.
%%
+\NeedsTeXFormat{LaTeX2e}[2017/04/15]
\ProvidesPackage{fnbreak}
- [2012/01/01 v1.30 Warning for pagebreak in footnote (HH)]
+ [2023-03-18 v1.40 Warning for pagebreak in footnote (HH)]
+
\RequirePackage{ifthen}
+
\newif\iffnb@showlabel
\newif\iffnb@verbose
+
\DeclareOption{label}{\fnb@showlabeltrue}
\DeclareOption{nolabel}{\fnb@showlabelfalse}
\DeclareOption{verbose}{\fnb@verbosetrue}
\DeclareOption{nonverbose}{\fnb@verbosefalse}
\ExecuteOptions{label,nonverbose}
\ProcessOptions\relax
+
\newcommand*\fnbreakverbose{\fnb@verbosetrue}
\newcommand*\fnbreaknonverbose{\fnb@verbosefalse}
\newcommand*\fnbreaklabel{\fnb@showlabeltrue}
\newcommand*\fnbreaknolabel{\fnb@showlabelfalse}
+
\newcounter{fnb@@numberpages}
+
\newif\iffnb@@isdoublepage
+
\xdef\fnb@@footnotestartnum{0}
\xdef\fnb@@footnotestartpage{0}
+\def\fnb@globalwarning{}
\def\fnb@footnotestart#1#2#3{}
\def\fnb@footnoteend#1#2#3{}
-\AtBeginDocument{%
+
+\def\fnb@fnstart{\@bsphack
+ \protected@write\@auxout{}{%
+ \string\fnb@footnotestart{\the\c@footnote}{\thefootnote}{\thepage}%
+ }%
+ \@esphack%
+ }
+
+\def\fnb@fnend{\@bsphack
+ \protected@write\@auxout{}{%
+ \string\fnb@footnoteend{\the\c@footnote}{\thefootnote}{\thepage}%
+ }%
+ \@esphack%
+ }
+
+\providecommand\IfFormatAtLeastTF{\@ifl@t@r\fmtversion}
+
+\AtBeginDocument{% = \AddToHook{begindocument}
\def\fnb@footnotestart#1#2#3{%
\xdef\fnb@@footnotestartnum{#1}%
\gdef\fnb@@footnotestartpage{#3}%
@@ -46,99 +76,86 @@
\def\fnb@footnoteend#1#2#3{%
\xdef\fnb@@footnoteendnum{#1}%
\def\fnb@@footnoteendpage{#3}%
- \ifx\fnb@@footnotestartnum\fnb@@footnoteendnum
+ \ifx\fnb@@footnotestartnum\fnb@@footnoteendnum%
\ifthenelse{\equal{\fnb@@footnotestartpage}{\fnb@@footnoteendpage}}{%
- \iffnb@verbose
- \begingroup
+ \iffnb@verbose%
+ \begingroup%
\def\MessageBreak{^^J(fnbreak)\@spaces\@spaces\@spaces\@spaces}%
- \set@display@protect
+ \set@display@protect%
\immediate\write\@unused{^^JPackage fnbreak Note:%
- \space\space\space\space Footnote number #1
- \iffnb@showlabel\MessageBreak (label `#2') \fi
- \MessageBreak
+ \space\space\space\space Footnote number #1%
+ \iffnb@showlabel\MessageBreak (label `#2') \fi%
+ \MessageBreak%
completely on page #3.^^J}%
- \endgroup
- \fi
+ \endgroup%
+ \fi%
}{%
\setcounter{fnb@@numberpages}{0}%
- \if@twoside
+ \if@twoside%
\ifnum\number0<0\fnb@@footnoteendpage{}%
\ifnum\number0<0\fnb@@footnotestartpage{}%
\setcounter{fnb@@numberpages}{\fnb@@footnoteendpage}%
\addtocounter{fnb@@numberpages}{-\fnb@@footnotestartpage}%
\addtocounter{fnb@@numberpages}{1}%
\ifodd \fnb@@footnotestartpage{}%
- \fnb@@isdoublepagefalse
- \else
+ \fnb@@isdoublepagefalse%
+ \else%
\ifnum \thefnb@@numberpages=2{}%
- \fnb@@isdoublepagetrue
- \else
- \fnb@@isdoublepagefalse
- \fi
- \fi
- \fi
- \fi
- \fi
- \ifnum\thefnb@@numberpages=0
- \PackageWarningNoLine{fnbreak}{Footnote number #1
- \iffnb@showlabel\MessageBreak (label `#2')\fi
- \MessageBreak
- has been split over different pages:\MessageBreak
+ \fnb@@isdoublepagetrue%
+ \else%
+ \fnb@@isdoublepagefalse%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \ifnum\thefnb@@numberpages=0%
+ \PackageWarningNoLine{fnbreak}{Footnote number #1%
+ \iffnb@showlabel\MessageBreak (label `#2')\fi%
+ \MessageBreak%
+ has been split over different pages:\MessageBreak%
page \fnb@@footnotestartpage\space to page #3}%
- \else
- \iffnb@@isdoublepage
- \PackageWarningNoLine{fnbreak}{Footnote number #1
- \iffnb@showlabel\MessageBreak (label `#2')\fi
- \MessageBreak
- has been split over different pages (double page):\MessageBreak
+ \else%
+ \iffnb@@isdoublepage%
+ \PackageWarningNoLine{fnbreak}{Footnote number #1%
+ \iffnb@showlabel\MessageBreak (label `#2')\fi%
+ \MessageBreak%
+ has been split over different pages (double page):\MessageBreak%
page \fnb@@footnotestartpage\space to page #3}%
- \else
- \PackageWarningNoLine{fnbreak}{Footnote number #1
- \iffnb@showlabel\MessageBreak (label `#2')\fi
- \MessageBreak
- has been split over different pages (flipside):\MessageBreak
+ \else%
+ \PackageWarningNoLine{fnbreak}{Footnote number #1%
+ \iffnb@showlabel\MessageBreak (label `#2')\fi%
+ \MessageBreak%
+ has been split over different pages (flipside):\MessageBreak%
page \fnb@@footnotestartpage\space to page #3}%
- \fi
- \fi
+ \fi%
+ \fi%
\def\fnb@globalwarning{%
- \PackageWarningNoLine{fnbreak}{There are footnotes with a
- pagebreak.\MessageBreak
+ \PackageWarningNoLine{fnbreak}{There are footnotes with a %
+ pagebreak.\MessageBreak%
Check if they are acceptable}%
}%
}%
- \else
- \PackageError{fnbreak}{Internal problem:\MessageBreak
- Start and stop marker of footnote do not fit:\MessageBreak
- start: \fnb@@footnotestartnum, page \fnb@@footnotestartpage,
+ \else%
+ \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
+ This error may not happen. %
+ Please try to make a short example which shows this behaviour %
and send a bug report to harald.harders@gmx.de.}%
- \fi
- }%
- }
- \def\fnb@fnstart{\@bsphack
- \protected@write\@auxout{}{%
- \string\fnb@footnotestart{\the\c@footnote}{\thefootnote}{\thepage}%
- }%
- \@esphack
- }
- \def\fnb@fnend{\@bsphack
- \protected@write\@auxout{}{%
- \string\fnb@footnoteend{\the\c@footnote}{\thefootnote}{\thepage}%
+ \fi%
}%
- \@esphack
- }
-\AtBeginDocument{%
\newcommand\fnb@orig@footnotetext{}%
- \let\fnb@orig@footnotetext\@footnotetext
+ \let\fnb@orig@footnotetext\@footnotetext%
\long\def\@footnotetext#1{\fnb@orig@footnotetext{\fnb@fnstart#1\fnb@fnend}}%
- \newcommand\fnb@dofilelist{}%
- \let\fnb@dofilelist\@dofilelist
- \def\@dofilelist{\fnb@dofilelist\fnb@globalwarning}%
-}
-\newcommand\fnb@globalwarning{}%
-\let\fnb@globalwarning\relax
+ \IfFormatAtLeastTF{2021-11-15}{%
+ \AddToHook{enddocument/info}{\fnb@globalwarning}%
+ }{\newcommand\fnb@dofilelist{}%
+ \let\fnb@dofilelist\@dofilelist%
+ \def\@dofilelist{\fnb@dofilelist\fnb@globalwarning}%
+ }%
+ }
\endinput
%%
%% End of file `fnbreak.sty'.