diff options
author | Karl Berry <karl@freefriends.org> | 2014-11-02 21:50:27 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2014-11-02 21:50:27 +0000 |
commit | 4443aa712503e8404b2152c761c2ab5e1a98d197 (patch) | |
tree | c387f072c69b1415bca5a9878ce161eb50cad9ce /Master/texmf-dist/tex/latex | |
parent | 5c146a8c39f3d52b9b6aba7423a0984e5830f407 (diff) |
bigfoot (2nov14)
git-svn-id: svn://tug.org/texlive/trunk@35482 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex')
-rw-r--r-- | Master/texmf-dist/tex/latex/bigfoot/bigfoot.sty | 516 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/bigfoot/perpage.sty | 76 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/bigfoot/suffix.sty | 13 |
3 files changed, 370 insertions, 235 deletions
diff --git a/Master/texmf-dist/tex/latex/bigfoot/bigfoot.sty b/Master/texmf-dist/tex/latex/bigfoot/bigfoot.sty index 4a27b6154ee..ce4c14b6e6f 100644 --- a/Master/texmf-dist/tex/latex/bigfoot/bigfoot.sty +++ b/Master/texmf-dist/tex/latex/bigfoot/bigfoot.sty @@ -22,12 +22,13 @@ %% in the same archive or directory.) %% %% bigfoot is part of the bigfoot bundle for critical typesetting -%% Copyright 2004, 05, 06 David Kastrup <dak@gnu.org> +%% Copyright 2004--2014 David Kastrup <dak@gnu.org> +%% +%% The license notice and corresponding source code for this file are +%% contained in bigfoot.dtx. %% \NeedsTeXFormat{LaTeX2e} -\def\FN@next $#1: #2 #3${#2} -\ProvidesPackage{bigfoot}[\FN@next $Date: 2006/07/15 21:24:56 $ - \FN@next $Revision: 1.25 $ makes footnotes work]%} +\ProvidesPackage{bigfoot}[2014/10/23 2.0 makes footnotes work] \DeclareOption{para}{\PackageInfo{bigfoot}{Compatibility option `para' has no effect:^^J% @@ -41,6 +42,9 @@ \else\@makefnmark\nobreak\fi}} \DeclareOption{ruled}{\PassOptionsToPackage{ruled}{manyfoot}} +\DeclareOption{robust}{\def\FN@makefncall{\FN@makefnrobust}} +\DeclareOption{fragile}{\def\FN@makefncall{\FN@makefnfragile}} +\ExecuteOptions{robust} \DeclareOption{verbose}{\AtBeginDocument{% \def\@testdef #1#2#3{% \def\reserved@a{#3}% @@ -78,12 +82,13 @@ }% } -\def\MFL@minipage{% - \ifinner\else - \let\MFL@mpinsertsave\MFL@insert - \MFL@reinsert \let\MFL@insert\MFL@mpinsert - \fi -} +\def\FN@divert{% + \let\MFL@mpinsertsave\MFL@insert + \MFL@reinsert \let\MFL@insert\MFL@mpinsert} +\def\FN@enddivert{{\let\@elt\MFL@mpreinsert \MFL@list}} + +\def\MFL@minipage{\ifinner\else \FN@divert\fi} +\def\MFL@endminipage{\ifinner\else \FN@enddivert\fi} \def\MFL@mpreinsert#1#2{% \ifvoid#2\else \setbox\@tempboxa\vbox\bgroup\unvbox#2% @@ -193,6 +198,12 @@ \let\@elt\relax \expandafter\protected@xdef\csname FN@stack@#1\endcsname{% \iffalse}\fi} +\ifx\FN@beforebreak\@undefined + \let\FN@beforebreak\@empty +\fi +\ifx\FN@afterbreak\@undefined + \let\FN@afterbreak\@empty +\fi \def\FN@cache#1{\csname FN@cache\number#1\endcsname} \def\FN@sortlist{{% \setbox\z@\lastbox @@ -233,7 +244,7 @@ \global\setbox\FN@cache#2=\box\voidb@x} \def\@makefnvtext#1{% \FN@specific\FN@masterinsert\@makefntext{% - \clubpenalties\tw@\@MM\clubpenalty + \clubpenalties\thr@@\@MM\clubpenalty\z@ \vadjust{\nobreak\vskip-\baselineskip}\nobreak\hfill\break#1}} \ifx\@preparefnhtext\@undefined \def\@preparefnhtext{{% @@ -255,6 +266,9 @@ \FN@tempinfo} \fi \def\@makefnstartbox{% + \ifdefined\setspace@singlespace + \def\baselinestretch{\setspace@singlespace}% + \fi \reset@font\footnotesize \hsize\MFL@columnwidth \@parboxrestore \interlinepenalty\FN@specific\FN@masterinsert\interfootnotelinepenalty @@ -274,7 +288,7 @@ \ifx\@makefnvbox\@undefined \def\@makefnvbox#1{\vbox{% \@makefnstartbox - \clubpenalties\tw@\@MM\clubpenalty + \clubpenalties\thr@@\@MM\clubpenalty\z@ \let\@thefnmark\@empty \FN@specific\FN@masterinsert\@makefntext{\rule\z@\footnotesep \nobreak @@ -282,7 +296,7 @@ \@makefnendbox}}} \fi \def\hfootfraction{0.9} -\def\vtypefraction{0.6} +\def\vtypefraction{0.7} \def\FN@assembleboxes{% \ifhbox\z@ \dimen@\dp\z@ @@ -298,12 +312,13 @@ \setbox\z@\@makefnvbox{% {\unhbox\FN@tempbox}% \setbox\z@\lastbox\FN@joinhboxes}% - \ifdim\FN@vfound>\dimexpr\vtypefraction\p@*\FN@found\relax - \ifdim\dimexpr \ht\z@+\dp\z@>\hfootfraction\dimen@ii - \global\setbox\FN@tempbox\box\tw@ - \setbox\z@\@makefnvbox{\let\@makefnbreak\FN@pseudofillbreak - {\unhbox\FN@tempbox}\setbox\z@\lastbox\FN@joinhboxes}% - \fi + \ifcase + \ifdim\FN@vfound>\dimexpr\vtypefraction\p@*\FN@found\relax \@ne\fi + \ifdim\dimexpr \ht\z@+\dp\z@>\hfootfraction\dimen@ii \@ne\fi \z@ + \or + \global\setbox\FN@tempbox\box\tw@ + \setbox\z@\@makefnvbox{\let\@makefnbreak\FN@pseudofillbreak + {\unhbox\FN@tempbox}\setbox\z@\lastbox\FN@joinhboxes}% \fi \setbox\tw@\box\voidb@x \ht\z@\dimexpr \ht\z@+\dp\z@-\dimen@\relax @@ -338,8 +353,8 @@ \xdef\FN@found{\number\numexpr\FN@found+\@ne}% } \def\FN@pseudobreak{% - {\parskip\z@skip\parfillskip\z@skip\parindent\z@\vadjust{}\par\noindent - \vadjust{\nobreak\vskip-\baselineskip}\nobreak\hfill\break}} + {\parskip\z@skip\parfillskip\z@skip\parindent\z@\vadjust{}\par\noindent + \vadjust{\nobreak\vskip-\baselineskip}\nobreak\hfill\break}} \def\FN@pseudofillbreak{\nobreak\hskip\parfillskip\FN@pseudobreak} \def\@makefnbreak{\FN@magicglue {\footnotesep+\dp\strutbox}% {\footnotesep+\dp\strutbox+\baselineskip}% @@ -398,7 +413,7 @@ \stepcounter{FN@totalid}% \NCC@makemark{#3}% \ifnum#2<\FN@masterinsert - \FN@colorstackbgroup\MFL@minipage + \FN@colorstackbgroup\FN@divert \FN@newslot\FN@masterslot \count@\FN@id \dimen@=\dimexpr64\p@*\FN@masterinsert-\c@FN@totalid sp\relax @@ -419,43 +434,60 @@ \ifx\FN@boxtype\vbox \normalcolor\nobreak \else \FN@specific{#2}\@preparefnhtext \normalcolor \fi - \FN@specific{#2}\@makefntext - \iffalse\fi - \expandafter\xdef\csname FN@ht\number#2\endcsname{\the\footnotesep}% - \expandafter\xdef\csname FN@dp\number#2\endcsname{\the\dp\strutbox}% - \marks\FN@master{\FN@masterslot}% - \marks\FN@slave{\number\FN@id}% - \nobreak - \bgroup - \aftergroup\FN@commonending - \ifx\FN@boxtype\vbox - \rule\z@\footnotesep - \else - \ifx\FN@par\par\else - \let\FN@@par\par - \let\FN@@noindent\noindent - \let\FN@@indent\indent - \fi - \everyvbox\expandafter{\expandafter\everyvbox - \expandafter{\the\everyvbox}% - \let\par\FN@@par - \let\noindent\FN@@noindent - \let\indent\FN@@indent - \the\everyvbox}% - \let\par\FN@par - \let\noindent\FN@noindent - \let\indent\FN@indent - \fi - \afterassignment\ignorespaces - \expandafter\FN@fnotecommonii - \else + \expandafter \FN@makefncall + \else \PackageError{bigfoot}{#2 forbidden in \FN@masterinsert.}% {Higher-placed footnotes can't be anchored in inferior ones.^^J% I am not putting this text in a footnote. History:% \FN@errorstack}% \rule{1em}{\ht\strutbox}% \fi} -\def\FN@fnotecommonii#{\let\next} +\providecommand{\FN@seitenobreak}{\nobreak} +\def\FN@makefnstart{% + \expandafter\xdef\csname FN@ht\number\FN@masterinsert\endcsname + {\the\footnotesep}% + \expandafter\xdef\csname FN@dp\number\FN@masterinsert\endcsname + {\the\dp\strutbox}% + \expandafter\xdef\csname FN@wd\number\FN@masterinsert\endcsname + {\the\hsize}% + \marks\FN@master{\FN@masterslot}% + \marks\FN@slave{\number\FN@id}% + \nobreak + \ifx\FN@boxtype\vbox + \rule\z@\footnotesep + \else + \ifx\FN@par\par\else + \let\FN@@par\par + \let\FN@@noindent\noindent + \let\FN@@indent\indent + \fi + \everyvbox\expandafter{\expandafter\everyvbox + \expandafter{\the\everyvbox}% + \let\par\FN@@par + \let\noindent\FN@@noindent + \let\indent\FN@@indent + \the\everyvbox}% + \let\par\FN@par + \let\noindent\FN@noindent + \let\indent\FN@indent + \fi + \FN@seitenobreak + \afterassignment\ignorespaces} +\def\FN@makefnrobust#{% + \FN@specific\FN@masterinsert\@makefntext + \iffalse\fi + \bgroup + \aftergroup\FN@robustending + \FN@makefnstart + \let\next} +\def\FN@robustending{% + \expandafter\expandafter\expandafter + \expandafter\expandafter\expandafter\expandafter + \iffalse \FN@specific\FN@masterinsert\@makefntext\fi + \FN@commonending} +\long\def\FN@makefnfragile#1{% + \FN@specific\FN@masterinsert\@makefntext + {\FN@makefnstart#1\FN@commonending}} \newmarks\FN@color \def\FN@colorstackbgroup{\let\FN@savecolorstack\FN@colorstack \global\let\FN@colorstack\@empty @@ -469,8 +501,8 @@ \let\reset@color\FN@reset@color \let\color@begingroup\FN@color@begingroup} -\def\FN@colorstackegroup{\egroup\ifx\FN@colorstack\@empty - \global\let\FN@colorstack\FN@savecolorstack \fi} +\def\FN@colorstackegroup{\egroup + \global\let\FN@colorstack\FN@savecolorstack} \def\FN@colorstackfinish{\def\@elt##1##2{\FN@@reset@color##2}% \FN@colorstack @@ -505,9 +537,6 @@ #1% \let\@elt\relax} \def\FN@commonending{% - \expandafter\expandafter\expandafter - \expandafter\expandafter\expandafter\expandafter - \iffalse \FN@specific\FN@masterinsert\@makefntext\fi \@makefnendbox \ifx\FN@boxtype\vbox\@finalstrut\strutbox \else \unskip \fi \FN@colorstackfinish @@ -525,9 +554,12 @@ \wd\z@\dimen@ \dp\z@\FN@masterslot sp\relax \MFL@insert\FN@masterinsert{\nointerlineskip\box\z@}% + \ifdim\lastkern=\z@ \let\FN@next\@empty\else + \edef\FN@next{\kern\the\lastkern\relax}\unkern + \fi \marks\FN@slave{\number\FN@id}% - \MFL@endminipage - \FN@colorstackegroup + \expandafter\FN@enddivert\expandafter\FN@colorstackegroup + \FN@next } \dimen\footins\maxdimen \gdef\FN@nestlist{} @@ -542,7 +574,7 @@ \ifcase \ifvoid\z@\m@ne\fi \FN@config\z@ \ifnum\dp\z@=\count@\else \FN@freeslot{\number\dp\z@}\fi - \FN@retaindelayed + \expandafter\FN@retaindelayed \or {\FN@retaindelayed \nointerlineskip \box\z@}% \else \unpenalty \setbox\z@\lastbox @@ -592,8 +624,9 @@ \expandafter\expandafter\expandafter\let\FN@cache\FN@savebox=\@cclv -\expandafter\def\csname FN@ht\number\FN@savebox\endcsname{\topskip}% +\expandafter\def\csname FN@ht\number\FN@savebox\endcsname{\z@skip}% \expandafter\def\csname FN@dp\number\FN@savebox\endcsname{\maxdepth} +\expandafter\def\csname FN@wd\number\FN@savebox\endcsname{\columnwidth} \def\FN@list{\MFL@list\@elt{}\footins} @@ -654,7 +687,8 @@ \def\FN@insertmarks{% {\setbox\z@\copy\@cclv \splittopskip-\maxdimen\relax - \vbadness=\maxdimen + \vbadness=\@M + \vfuzz=\maxdimen \loop \ifvoid\z@\else {\let\@elt\FN@pseudomarks @@ -666,9 +700,16 @@ {\setbox\z@\vsplit\z@ to\maxdimen}% \next \repeat}} +\def\FootnoteMinimum{1sp} \def\FootnoteMainMinimum{0pt} +\expandafter\def\csname\string\FootnoteMinimum\number\FN@savebox +\endcsname{\FootnoteMainMinimum} \savingvdiscards=\@ne +\newcount\FN@outputflag +\FN@outputflag=3158345 \output{% + \let\@elt\relax + \ifvoid\@cclv \PackageError{bigfoot}{Empty box 255 in \output}\fi \ifnum\outputpenalty=-13750 \ifnum\insertpenalties>\z@ \PackageError{bigfoot}{Too much insertion material}{% @@ -676,7 +717,7 @@ gather all floating insertions in a single pass.^^J% Complain to the author if you consider this a bug}% \fi - \global\advance\FN@outervsize\dimexpr\ht\@cclv-\vsize\relax + \global\advance\FN@outervsize\dimexpr\ht\@cclv-\vsize \global\setbox\@cclv\box\voidb@x \else \edef\FN@outputpenalty{\number\outputpenalty}% @@ -684,21 +725,16 @@ \ifvoid\@holdpg \FN@sweeptopmarks \fi - \ifvoid\@cclv - \global\FN@outervsize\z@ - \else - \global\FN@outervsize\ht\@cclv - \global\setbox\@cclv\vbox{\unvbox\@cclv\boxmaxdepth\maxdepth}% - \global\advance\FN@outervsize-\ht\@cclv\relax - \fi + \FN@nest@iterate{\FN@insertouterspace\global\FN@outervsize + \dimexpr\z@}% + \global\advance\FN@outervsize\ht\@cclv + \global\setbox\@cclv\vbox{\unvbox\@cclv\boxmaxdepth\maxdepth}% \global\let\FN@vsadjustlist\@empty \FN@normaloutput \else - \ifvbox\@cclv - \dimen@\ht\@cclv - \global\setbox\@cclv\vbox{\unvbox\@cclv\boxmaxdepth\maxdepth}% - \global\advance\FN@outervsize\dimexpr\dimen@-\ht\@cclv\relax - \fi + \FN@nest@iterate{\FN@insertouterspace\global\advance\FN@outervsize + \dimexpr\ht\@cclv}% + \global\setbox\@cclv\vbox{\unvbox\@cclv\boxmaxdepth\maxdepth}% \FN@nest@iterate\FN@maybeinvalidatecache \vskip\z@skip \unvbox\FN@savebox @@ -714,36 +750,46 @@ \ifnum\FN@outputpenalty=-13751 \@ne\fi \tw@ \or \FN@vsadjustlist - \global\setbox\@cclv\vbox{\pagediscards}% \global\setbox\@cclv\lastbox \unskip \ifnum\FN@outputpenalty=-13749 \FN@normaloutput \else \the\FN@output + \@pageht-\vsize + \let\@currbox\footins + \@reinserts + \global\vsize-\@pageht \fi \else \dimen@\topskip \FN@vsadjustlist \setbox\z@\lastbox \unskip - \global\setbox\@cclv\vbox{\unvbox\z@ - \ifnum\outputpenalty<\@M \penalty\outputpenalty\fi - \pagediscards - \ifvbox\@cclv - \global\setbox\@cclv\vbox{\break\unvbox\@cclv}% - {\splittopskip-\maxdimen \setbox\z@\vsplit\@cclv to\z@}% - \unvbox\@cclv + \global\setbox\@cclv\vbox{% + \unvbox\z@ + \global\setbox\@cclv\vbox{\break\unvbox\@cclv}% + {\splittopskip-\maxdimen \setbox\z@\vsplit\@cclv to\z@} + \ifnum\outputpenalty=\@M + \setbox\z@\vbox{\pagediscards + \FN@cleanpagepenalty}% + \unvbox\z@ + \else + \penalty\outputpenalty + \pagediscards \fi + \unvbox\@cclv \boxmaxdepth\maxdepth}% \global\outputpenalty\FN@outputpenalty\relax \ifdim\dimen@>\z@ \hrule\@height\z@\@depth\z@ \unvcopy\FN@topmarkbox \penalty-13750 + \penalty\FN@outputflag \hrule\@height\z@\@depth\z@ \FN@insertmarks \penalty-13749 + \penalty\FN@outputflag \FN@prepareoutput \global\topskip-\maxdimen \global\vsize0.5\maxdimen @@ -755,13 +801,13 @@ \fi \fi} \def\FN@normaloutput{% - \FN@nest@iterate{\FN@insertouterspace\global\FN@vsize\dimexpr\z@}% + \global\FN@vsize\FN@outervsize + \global\advance\FN@vsize-\ht\@cclv\relax\relax \FN@nest@iterate\FN@sortinsert \FN@nest@iterate\FN@clearcache - \xdef\FN@config{\noexpand\@elt{\number0\botmarks\FN@slave}% + \xdef\FN@config{\@elt{\number0\botmarks\FN@slave}% {\number\maxdimen}}% \FN@nest@iterate\FN@reconfig - \global\advance\FN@vsize\FN@outervsize\relax \ifcase \ifnum\insertpenalties>\z@ \@ne\fi \ifnum\outputpenalty>-\@M @@ -770,16 +816,20 @@ \fi \ifdim\FN@vsize<\glueshrink\FN@vsize \thr@@ \fi \ifx\FN@vsadjustlist\@empty \else \thr@@\fi\z@ - \ifvbox\@cclv - {\vbadness\maxdimen - \global\setbox\@cclv\vbox - spread\FN@vsize{\unvbox\@cclv\boxmaxdepth\maxdepth}}% - \fi + {\vbadness\@M + \vfuzz\maxdimen + \global\setbox\@cclv\vbox + spread\FN@vsize{\unvbox\@cclv\boxmaxdepth\maxdepth}}% \the\FN@output + \let\@currbox\footins + \@pageht-\vsize + \@reinserts + \global\vsize-\@pageht \FN@nest@iterate\FN@clearcache \or \FN@restartoutput \penalty -13749 + \penalty \FN@outputflag \or \dimen@=\dimexpr\FN@vsize-\glueshrink\FN@vsize\relax \FN@prepareoutput @@ -790,12 +840,11 @@ \else \edef\FN@masterid{\number\maxdimen}% \def\FN@masterslot{-1}% - \global\setbox\@cclv\vbox{% - \box\@cclv}% + \global\setbox\@cclv\vbox{\box\@cclv}% \xdef\FN@config{\noexpand\@elt{\number0\botmarks\FN@slave}% {\number\maxdimen}}% \global\setbox\FN@savebox\vbox{}% - \gdef\FN@badness{0}% + \gdef\FN@penalties{0}% \edef\FN@defaultpenalty{\ifnum\outputpenalty<\@M \number\outputpenalty \else @@ -804,51 +853,55 @@ \@elt{}\FN@savebox\FN@nestlist\FN@mainsplitreturn \let\@elt\relax \global\setbox\FN@savebox\box\voidb@x - \count@\vbadness - \vbadness\maxdimen - \global\setbox\@cclv\vbox spread\FN@vsize\bgroup - \unvbox\@cclv - \ifnum\lastpenalty>\z@ - \unpenalty - \global\setbox\FN@tempbox\lastbox - \else - \global\setbox\FN@tempbox\box\voidb@x - \fi - \setbox\z@\lastbox - \ifvoid\z@ - \ifvbox\FN@tempbox - \ifnum\outputpenalty<\@M - \global\setbox\FN@tempbox{\unvbox\FN@tempbox - \penalty\outputpenalty}% - \fi - \global\outputpenalty=\@M + {% + \vbadness\@M + \vfuzz\maxdimen + \global\setbox\@cclv\vbox spread\FN@vsize{% + \unvbox\@cclv + \ifnum\lastpenalty>\z@ + \unpenalty + \global\setbox\FN@tempbox\lastbox + \else + \global\setbox\FN@tempbox\box\voidb@x \fi - \egroup \global\setbox\@cclv\box\voidb@x - \else - \MFL@removevboxes - \unvbox\z@ - \let\FN@defaultpenalty\@M - \FN@getbreakpenalty \setbox\z@\lastbox - \ifcase - \ifvbox\FN@tempbox \@ne\fi - \ifvoid\z@ \else \@ne\fi \z@ - \or - \global\setbox\FN@tempbox\vbox{\unvbox\z@ - \unvbox\FN@tempbox + \ifvoid\z@ + \ifvbox\FN@tempbox \ifnum\outputpenalty<\@M - \penalty\outputpenalty - \fi}% - \global\outputpenalty\FN@breakpenalty + \global\setbox\FN@tempbox{\unvbox\FN@tempbox + \penalty\outputpenalty}% + \fi + \global\outputpenalty=\@M + \fi + \else + \MFL@removevboxes + \unvbox\z@ + \edef\FN@defaultpenalty{\number\@M}% + \FN@getbreakpenalty + \setbox\z@\lastbox + \global\setbox\FN@tempbox\vbox\bgroup\unvbox\z@ + \unvbox\FN@tempbox + \ifnum\lastnodetype<\z@ + \egroup\global\setbox\FN@tempbox\box\voidb@x + \else + \ifnum\outputpenalty<\@M + \penalty\outputpenalty + \fi + \egroup + \global\outputpenalty\FN@breakpenalty + \fi \fi - \boxmaxdepth\maxdepth\egroup - \fi - \vbadness\count@ + \boxmaxdepth\maxdepth}% + }% \setbox\z@\box\FN@tempbox \let\@elt\relax \dimen@=\dimexpr\FN@vsize-\glueshrink\FN@vsize\relax \ifcase - \ifvoid\z@ \else\thr@@\fi + \ifvoid\z@ \ifnum\outputpenalty>-\@M + \ifdim\dimen@<\z@ \else \@ne \fi + \fi + \else \thr@@ + \fi \ifdim\ht\@cclv<\normalbaselineskip \@ne\fi \ifdim\dimen@<\normalbaselineskip \tw@\fi \@ne \or @@ -859,18 +912,28 @@ \global\advance\FN@outervsize-\vsize \global\deadcycles\z@ \or - \setbox\tw@\vbox{% - \the\FN@output - }% - \unvbox\tw@ - \unvbox\z@ - \FN@nest@iterate\FN@clearcache - \or + \setbox\tw@\vbox{% + \the\FN@output + }% + \unvbox\tw@ + \unvbox\z@ + \let\@currbox\footins + \@pageht-\vsize + \@reinserts + \global\vsize-\@pageht + \FN@nest@iterate\FN@clearcache + \or \FN@restartoutput \penalty -13751 + \penalty\FN@outputflag \unvbox\z@ + \ifnum\outputpenalty>\@M + \else \penalty + \ifnum\outputpenalty=\@M \z@ \else\outputpenalty\fi + \fi + \fi \fi - \fi} +} \def\FN@prepareoutput{% {\let\@elt\FN@recordinsertparam \xdef\FN@vsadjustlist{% @@ -888,6 +951,7 @@ \hrule\@height\z@\@depth\z@ \unvcopy\FN@topmarkbox \penalty -13750 + \penalty\FN@outputflag \hrule\@height\z@\@depth\z@ \FN@insertmarks \FN@prepareoutput @@ -900,11 +964,11 @@ \nointerlineskip\copy\z@ \setbox\z@ \vbox{\unvbox\z@ - \count@\FN@defaultpenalty\relax + \count@\@M \FN@getbreakpenaltyii \xdef\FN@tempinfo{\edef\noexpand\FN@breakpenalty{% - \number\ifnum\count@>-\@M \count@ - \else -\@M \fi}}}}% + \number\ifnum\count@=\@M \FN@defaultpenalty \else \count@\fi + }}}}% \FN@tempinfo} \def\FN@getbreakpenaltyii{% @@ -923,12 +987,39 @@ \count@\lastpenalty \unpenalty \expandafter\FN@getbreakpenaltyii \fi} +\def\FN@cleanpagepenalty{% + \ifcase + \ifnum\lastnodetype<\z@ \m@ne\fi + \ifnum\lastnodetype<11 \@ne\fi + \ifnum\lastnodetype>13 \@ne\fi + \numexpr\lastnodetype-9\relax + \or + \PackageError{bigfoot}{Illegal node type}{This can't happen}% + \or + \skip@=\lastskip \unskip + \expandafter \FN@cleanpagepenalty \expandafter\vskip\the + \expandafter\skip@ + \or + \dimen@=\lastkern \unkern + \expandafter \FN@cleanpagepenalty \expandafter\kern\the + \expandafter\dimen@ + \or + \count@\lastpenalty \unpenalty + \ifnum\count@=\FN@outputflag + \unpenalty\expandafter\expandafter\expandafter\FN@cleanpagepenalty + \else + \expandafter\FN@cleanpagepenalty\expandafter + \penalty\the\expandafter\expandafter\expandafter\count@ + \fi + \fi + \relax} \def\FN@mainsplitreturn{} \newdimen\FN@myvsize \newcount\bigfoottolerance \bigfoottolerance=100 \def\FN@getbadness#1{% - {\hfuzz\maxdimen\hbadness\maxdimen\setbox\z@\hbox to\z@{\hskip-#1}}} + {\hfuzz\maxdimen\hbadness\@M\setbox\z@\hbox to\z@{\hskip-#1}}} +\providecommand\footnotecarryratio{2} \def\FN@newlevel#1#2#3\FN@mainsplitreturn{% \count@\FN@cache#2% \ifvoid\count@ @@ -937,23 +1028,33 @@ {\def\FN@currentinsertion{#2}% \def\FN@currentrecursion{#3}% \let\FN@entryconfig\FN@config - \let\FN@entrybadness\FN@badness + \let\FN@entrypenalties\FN@penalties \splittopskip\csname FN@ht\number#2\endcsname\relax \splitmaxdepth\csname FN@dp\number#2\endcsname\relax - \vbadness=\maxdimen + \hsize\csname FN@wd\number#2\endcsname\relax + \vbadness=\@M \vfuzz\maxdimen \let\@elt\relax \expandafter\FN@newleveli\expandafter}% \fi} \def\FN@newleveli{% - \dimen@\dimexpr\ht\count@+\dp\count@\relax + \dimen@\dimexpr\ht\count@ + \ifnum\FN@currentinsertion=\FN@savebox + +\maxdepth + \else + +\dp\count@ + \fi\relax \global\advance\FN@vsize\dimexpr \dimen@ *\count\FN@currentinsertion/\@m\relax\relax \global\setbox\count@\vbox\bgroup\unvbox\count@ \ifnum\lastpenalty=\z@ \setbox\tw@\box\voidb@x \setbox\z@\lastbox - \FN@myvsize=\dimexpr\dimen@-\ht\z@-\dp\z@\relax + \FN@myvsize=\ifnum\lastnodetype<\z@ + \z@ + \else + \dimexpr\dimen@-\ht\z@-\dp\z@\relax + \fi \else \unpenalty \setbox\tw@\lastbox @@ -967,13 +1068,14 @@ \ht\z@=\dimexpr\ht\z@+\dp\z@-\dimen@\relax \dp\z@\dimen@ \fi - \edef\FN@bestebadness{\number\maxdimen}% + \edef\FN@bestcost{\number\maxdimen}% + \let\FN@bestbadness\FN@bestcost \let\FN@bestconfig\@undefined - \let\FN@bestvsize\z@skip + \def\FN@bestvsize{-\maxdimen}% \let\FN@splitcolors\@empty \ifnum\FN@currentinsertion=\FN@savebox \else - \def\FN@defaultpenalty{-\@M}% + \edef\FN@defaultpenalty{\number-\@M}% \edef\FN@masterslot{\number\dp\z@}% \edef\FN@masterid{\FN@slotget\FN@masterslot}% \fi @@ -983,17 +1085,19 @@ \setbox\z@\vbox{\vskip-\glueexpr(\FN@vsize-\dimexpr\FN@vsize \relax\@minus\glueshrink\FN@vsize)% *\@m/\count\FN@currentinsertion + \penalty\z@ \unvbox\z@ \ifnum\FN@defaultpenalty>-\@M - \penalty\FN@defaultpenalty\nointerlineskip + \penalty\FN@defaultpenalty\relax\nointerlineskip \vbox to\maxdimen{}% \fi}% \setbox\tw@\vsplit\z@ to% \dimexpr\FN@vsize*\@m/\count\FN@currentinsertion - -\FN@myvsize + -\FN@myvsize-\splitmaxdepth \relax \ifnum\FN@defaultpenalty>-\@M \setbox\z@\vbox\bgroup\unvbox\z@\setbox\z@\lastbox + \unskip \unpenalty \ifnum\lastnodetype<\z@ \egroup \setbox\z@\box\voidb@x @@ -1009,22 +1113,6 @@ \ifnum\FN@currentinsertion=\FN@savebox \edef\FN@slaveid{\splitbotmarks\FN@slave}% \FN@contribute@tw@ - \ifdim\FootnoteMainMinimum>\FN@myvsize - \loop - \setbox\tw@\vsplit\z@ to\z@ - \edef\FN@slaveid{\splitbotmarks\FN@slave}% - \FN@contribute@tw@ - \ifcase\ifdim\FootnoteMainMinimum>\FN@myvsize - \ifvoid\z@ - \@ne - \else - \tw@ - \fi\fi \z@ - \or - \PackageWarning{bigfoot}{too little main material}% - \else - \repeat - \fi \else \ifnum0\splitbotmarks\FN@master=\FN@masterslot \else \loop @@ -1069,12 +1157,13 @@ \fi \FN@currentrecursion \let\@elt\relax - \xdef\FN@badness{\number\FN@entrybadness}% + \xdef\FN@penalties{\number\FN@entrypenalties}% \FN@checkcurrent \ifnum - \ifdim\skip@>\z@ \FN@ebadness \else \FN@badness \fi >\FN@bestebadness + \ifdim\skip@>\z@ \FN@ebadness \else \FN@penalties \fi + >\FN@bestcost\relax \else - \xdef\FN@badness{\number\FN@entrybadness}% + \xdef\FN@penalties{\number\FN@entrypenalties}% \FN@vsizerecurse \FN@checkcurrent \fi @@ -1093,20 +1182,52 @@ \expandafter \FN@splitfurther \fi} \def\FN@checkcurrent{% + \FN@getbreakpenalty + \ifnum\FN@breakpenalty<-\@M + \edef\FN@breakpenalty{\number-\@M}% + \fi + \ifnum\FN@currentinsertion=\FN@savebox + \else + \ifdim\FN@specific\FN@currentinsertion\footnotecarryratio\p@>\z@ + \skip@ + \ifdim\FN@specific\FN@currentinsertion\footnotecarryratio\p@>\p@ + \dimexpr\ht\z@+\dp\z@\relax + \@plus-\dimexpr((\FN@myvsize+\ht\z@+\dp\z@) + *\p@/\dimexpr + \FN@specific\FN@currentinsertion + \footnotecarryratio\p@)\relax + \else + \FN@specific\FN@currentinsertion + \footnotecarryratio + \dimexpr\ht\z@+\dp\z@\relax + \@plus-\dimexpr\FN@myvsize+\ht\z@+\dp\z@\relax + \fi + \relax + \FN@getbadness\skip@ + \xdef\FN@penalties{\number\numexpr\FN@penalties+\badness}% + \fi + \fi \skip@\glueexpr\FN@vsize-\FN@myvsize *\count\FN@currentinsertion/\@m\relax - \FN@getbreakpenalty \FN@getbadness\skip@ - \xdef\FN@badness{\number\numexpr\FN@badness+% + \xdef\FN@penalties{\number\numexpr\FN@penalties+% \FN@breakpenalty+\@M}% \ifnum\badness>\@M \edef\FN@ebadness{\number\numexpr\maxdimen-\@ne}% \else \ifnum\badness=\@M - \edef\FN@ebadness{\number\numexpr\maxdimen-\tw@}% + \ifdim\skip@<\vsize + \edef\FN@ebadness{\number\numexpr\maxdimen-\tw@}% + \else + \edef\FN@ebadness{\number\numexpr\maxdimen}% + \fi \else \edef\FN@ebadness{\number\numexpr - \FN@badness+\badness}% + \FN@penalties+\badness + \ifdim\FN@specific\FN@currentinsertion\FootnoteMinimum>\FN@myvsize + 1000000 + \fi + }% \fi \fi \dimen@\glueexpr\FN@bestvsize\relax @@ -1117,10 +1238,10 @@ \@ne \fi \fi - \ifnum\FN@bestebadness>\FN@ebadness \@ne\fi - \ifnum\FN@bestebadness<\FN@ebadness \tw@\fi + \ifnum\FN@bestcost>\FN@ebadness \@ne\fi + \ifnum\FN@bestcost<\FN@ebadness \tw@\fi \ifdim\skip@<\z@ - \ifdim\dimen@<\skip@ \@ne \else \tw@\fi + \ifdim\dimen@<\skip@ \@ne \fi \tw@ \fi \ifdim\dimen@>\skip@ \@ne\fi \tw@} \def\FN@mayberecordbest{% @@ -1128,8 +1249,8 @@ \FN@checkforbest \or \xdef\FN@tempinfo{\def\noexpand\FN@bestvsize{\the\skip@}% - \def\noexpand\FN@bestebadness{\FN@ebadness}% - \def\noexpand\FN@bestbadness{\number\FN@badness}% + \def\noexpand\FN@bestcost{\FN@ebadness}% + \def\noexpand\FN@bestbadness{\number\FN@penalties}% \def\noexpand\FN@bestconfig{\FN@config}% \def\noexpand\FN@bestslaveid{\FN@slaveid}% \def\noexpand\FN@bestsplitcolors{\FN@splitcolors}% @@ -1144,9 +1265,7 @@ \copy\z@\break\nointerlineskip \copy\FN@tempbox\penalty\FN@tempbox \let\@elt\FN@copycachebox - \FN@currentrecursion - \xdef\FN@tempinfo{\FN@myvsize=\the\FN@myvsize\relax}}% - \FN@tempinfo + \FN@currentrecursion}% \setbox\z@ \vbox\bgroup \unvbox\z@ @@ -1157,8 +1276,8 @@ \ifcase\FN@checkforbest \or \xdef\FN@tempinfo{\def\noexpand\FN@bestvsize{\the\skip@}% - \def\noexpand\FN@bestebadness{\FN@ebadness}% - \def\noexpand\FN@bestbadness{\number\FN@badness}% + \def\noexpand\FN@bestcost{\FN@ebadness}% + \def\noexpand\FN@bestbadness{\number\FN@penalties}% \def\noexpand\FN@bestconfig{\FN@config}% \def\noexpand\FN@bestslaveid{\FN@slaveid}% \def\noexpand\FN@bestsplitcolors{\FN@splitcolors}% @@ -1173,7 +1292,7 @@ \or \global\let\FN@config\FN@bestconfig \global\FN@vsize\FN@bestvsize - \global\let\FN@badness\FN@bestbadness + \global\let\FN@penalties\FN@bestbadness \egroup \setbox\z@\vbox{\unvbox\tw@ \FN@restoreboxes}% \let\FN@splitcolors\FN@bestsplitcolors @@ -1184,7 +1303,7 @@ \ifnum\FN@currentinsertion=\FN@savebox \else \setbox\z@\vbox{% - \dimen@\dp\z@ + \prevdepth\dp\z@ \unvbox\z@ \ifvoid\FN@tempbox \else @@ -1192,16 +1311,18 @@ \marks\FN@master{\FN@masterslot}% \marks\FN@slave{\FN@slaveid}% \FN@coloraftersplit\FN@splitcolors + \FN@specific\FN@currentinsertion\FN@afterbreak \nobreak \unvbox\FN@tempbox}% + \FN@specific\FN@currentinsertion\FN@beforebreak \ht\FN@tempbox \dimexpr\ht\FN@tempbox+\dp\FN@tempbox-\FN@masterslot sp\relax \dp\FN@tempbox\FN@masterslot sp\relax \wd\FN@tempbox\maxdimen \fi - \ifdim\dimen@<\splitmaxdepth - \hrule\@height-\dimen@ \@width\z@ - \@depth \splitmaxdepth \relax \fi}% + \ifdim\prevdepth<\splitmaxdepth + \hrule\@height-\prevdepth \@width\z@ + \@depth \splitmaxdepth \relax \fi}% \ht\z@=\dimexpr\ht\z@+\dp\z@-\FN@masterslot sp\relax \dp\z@=\FN@masterslot sp \fi @@ -1300,16 +1421,13 @@ \csname MFL@start#1\endcsname{#2}\fi#3} \@onlypreamble\FN@maybestart \AtBeginDocument{\@ifundefined{footinsdefault}% - {\DeclareNewFootnote[plain]{default}% + {\newfootnote[plain]{default}% {\let\@elt\FN@maybestart - \MFL@list\relax}}{}% - \let\c@footnote\c@footnotedefault - \let\thefootnote\thefootnotedefault - \def\thefootnotedefault{\thefootnote}% + \MFL@list\relax} + }{}% + \def\@footnotetext{\Footnotetextdefault{}} + \def\p@footnotedefault{\p@footnote} } -\def\footnote{\footnotedefault} -\def\footnotemark{\footnotemarkdefault} -\def\footnotetext{\footnotetextdefault} \endinput %% %% End of file `bigfoot.sty'. diff --git a/Master/texmf-dist/tex/latex/bigfoot/perpage.sty b/Master/texmf-dist/tex/latex/bigfoot/perpage.sty index 3f4d8e216f4..6ddf546230e 100644 --- a/Master/texmf-dist/tex/latex/bigfoot/perpage.sty +++ b/Master/texmf-dist/tex/latex/bigfoot/perpage.sty @@ -22,12 +22,22 @@ %% in the same archive or directory.) %% %% perpage is part of the bigfoot bundle for critical typesetting -%% Copyright 2002, 03, 04, 05, 06 David Kastrup <dak@gnu.org> +%% Copyright 2002--2014 David Kastrup <dak@gnu.org> +%% +%% The license notice and corresponding source code for this file are +%% contained in perpage.dtx. %% \NeedsTeXFormat{LaTeX2e} -\def\next$#1: #2 #3${#2} -\ProvidesPackage{perpage}[\next$Date: 2006/07/15 21:43:23 $ - \next$Revision: 1.12 $ Reset/sort counters per page] +\ProvidesPackage{perpage}[2014/10/25 2.0 Reset/sort counters per page] +\def\pp@cl@begin{\z@\z@ \begingroup} +\def\pp@cl@end{\afterassignment\pp@cl@end@ii \count@} +\def\pp@cl@end@ii{% + \relax + \expandafter\endgroup + \ifnum\count@<\z@ + \expandafter\pp@cl@end@iii + \fi} +\def\pp@cl@end@iii\stepcounter#1{} \newcommand\AddAbsoluteCounter[1] {\@ifundefined{c@abs#1}{% \expandafter\newcount\csname c@abs#1\endcsname @@ -35,9 +45,9 @@ \global\expandafter\let\csname cl@abs#1\endcsname\@empty \expandafter\xdef\csname theabs#1\endcsname{% \noexpand\number \csname c@abs#1\endcsname}% - \global\@namedef{c@pabs@#1}{\z@=\z@{% - \stepcounter{abs#1}% - \afterassignment}\count@}% + \global\@namedef{c@pabs@#1}{\pp@cl@begin + \stepcounter{abs#1}% + \pp@cl@end}% \@addtoreset{pabs@#1}{#1}}{}} \AddAbsoluteCounter{page} \def\theabspage{\ifx\thepage\relax @@ -63,7 +73,8 @@ \addtocounter{pp@a@#1}\m@ne \@addtoreset{pchk@#1}{#1}% \AtBeginDocument{\setcounter{pp@a@#1}\z@}% - \edef\next{\noexpand\AtEndDocument{\noexpand\setcounter{pp@a@#1}{% + \edef\next{\noexpand\AtEndDocument + {\noexpand\setcounter{pp@a@#1}{% \number\value{pp@a@#1}}}}\next} \@onlypreamble\pp@makeperpage \def\pp@chkvlist{% @@ -84,15 +95,14 @@ \fi} \def\pp@fetchctr#1{\expandafter\expandafter\expandafter\pp@fetchctrii \csname pp@r@#1@\number\value{pp@a@#1}\endcsname - \@empty\@empty} + {}{}} \global\let\theperpage\@empty -\def\pp@fetchctrii#1#2#3{\edef\pp@label{#1}% - \edef\pp@page{#2}% +\def\pp@fetchctrii#1#2#3{\def\pp@label{#1}% + \def\pp@page{#2}% \gdef\theperpage{#3}} -\def\c@pchk@#1{\z@=\z@ - \begingroup +\def\c@pchk@#1{\pp@cl@begin \pp@fetchctr{#1}\let\next\pp@page \addtocounter{pp@a@#1}\@ne \pp@fetchctr{#1}% @@ -107,16 +117,18 @@ \pp@chkvlist \dimen@=\lastkern \ifdim\dimen@=\z@ \else \unkern\fi + \count@=\lastpenalty \protected@write\@auxout{}{\next}% - \ifdim\dimen@=\z@ \nobreak \else \kern\dimen@\fi - \afterassignment\endgroup\count@} + \ifdim\dimen@=\z@ + \penalty \ifnum\count@<\@M \@M \else \count@ \fi + \else \kern\dimen@\fi + \pp@cl@end} +\def\pp@labeldef#1#2#3#4#5{\@newl@bel{pp@r@#2}{#3}{{#1}{#4}{#5}}} \def\pp@pagectr#1#2#3#4{\@ifundefined{c@pp@a@#1}{}{% \addtocounter{pp@a@#1}\@ne - \edef\next{\noexpand - \@newl@bel{pp@r@#1}{#2}{{\number\value{pp@a@#1}}{#3}% - {#4}}}\next}} -\def\c@schk@#1{\z@=\z@ - \begingroup + \expandafter\pp@labeldef\expandafter + {\number\value{pp@a@#1}}{#1}{#2}{#3}{#4}}} +\def\c@schk@#1{\pp@cl@begin \addtocounter{pp@a@#1}\@ne \ifnum\value{#1}=\@ne \expandafter\xdef\csname pp@g@#1\endcsname{\number\value{pp@a@#1}}% @@ -132,11 +144,9 @@ \count@0\csname pp@g@#1@#3\endcsname \advance\count@\@ne \expandafter\xdef\csname pp@g@#1@#3\endcsname{\number\count@}% - \edef\next{\noexpand - \@newl@bel{pp@r@#1}{#2}{{\number\count@}{#3}% - {#4}}}\next}} -\def\c@spchk@#1{\z@=\z@ - \begingroup + \expandafter\pp@labeldef\expandafter + {\number\count@}{#1}{#2}{#3}{#4}}} +\def\c@spchk@#1{\pp@cl@begin \addtocounter{pp@a@#1}\@ne \pp@fetchctr{#1}% \ifx\pp@page\@empty @@ -150,10 +160,18 @@ \setcounter{pp@a@#1}{\value{pp@r@#1}}% \fi \global\expandafter\let\csname pp@page@#1\endcsname\next - \edef\next{\noexpand - \@newl@bel{pp@r@#1}{#2}{{\number\value{pp@a@#1}}{#3}% - {#4}}}\next}} - + \expandafter\pp@labeldef\expandafter + {\number\value{pp@a@#1}}{#1}{#2}{#3}{#4}}} +\AtBeginDocument{% + \begingroup + \@testdef{}{undefined}{}% + \expandafter + \endgroup + \ifx\@undefined\relax + \let\pp@@testdef\@testdef + \def\@testdef#1#2#3{{\pp@@testdef{#1}{#2}{#3}% + \if@tempswa\aftergroup\@tempswatrue\fi}}% + \fi} \endinput %% %% End of file `perpage.sty'. diff --git a/Master/texmf-dist/tex/latex/bigfoot/suffix.sty b/Master/texmf-dist/tex/latex/bigfoot/suffix.sty index f78ef43636b..4d38f2b7631 100644 --- a/Master/texmf-dist/tex/latex/bigfoot/suffix.sty +++ b/Master/texmf-dist/tex/latex/bigfoot/suffix.sty @@ -21,14 +21,13 @@ %% same distribution. (The sources need not necessarily be %% in the same archive or directory.) %% -%% perpage is part of the bigfoot bundle for critical typesetting -%% Copyright 2002, 03, 04, 05, 06 David Kastrup <dak@gnu.org> +%% suffix is part of the bigfoot bundle for critical typesetting +%% Copyright 2002--2006 David Kastrup <dak@gnu.org> %% -\def\next$#1: #2 #3${#2} -\edef\next{\noexpand - \ProvidesPackage{suffix}[\next$Date: 2006/07/15 21:24:56 $ - \next$Revision: 1.5 $ Variant command support]} -\next +%% The license notice and corresponding source code for this file are +%% contained in suffix.dtx. +%% +\ProvidesPackage{suffix}[2006/07/15 1.5a Variant command support] \ifcase\ifx\eTeXversion\@undefined \@ne\fi \ifnum\eTeXversion<\tw@ \@ne\fi\z@ \else |