texlive[61979] Master/texmf-dist: footmisc (11feb22)

commits+karl at tug.org commits+karl at tug.org
Fri Feb 11 22:53:45 CET 2022


Revision: 61979
          http://tug.org/svn/texlive?view=revision&revision=61979
Author:   karl
Date:     2022-02-11 22:53:45 +0100 (Fri, 11 Feb 2022)
Log Message:
-----------
footmisc (11feb22)

Modified Paths:
--------------
    trunk/Master/texmf-dist/source/latex/footmisc/footmisc.dtx
    trunk/Master/texmf-dist/source/latex/footmisc/footmisc.ins
    trunk/Master/texmf-dist/tex/latex/footmisc/footmisc.sty

Added Paths:
-----------
    trunk/Master/texmf-dist/doc/latex/footmisc/README.md
    trunk/Master/texmf-dist/doc/latex/footmisc/announce.txt
    trunk/Master/texmf-dist/doc/latex/footmisc/changes.txt
    trunk/Master/texmf-dist/doc/latex/footmisc/footmisc-code.pdf
    trunk/Master/texmf-dist/doc/latex/footmisc/footmisc-code.tex
    trunk/Master/texmf-dist/doc/latex/footmisc/footmisc-doc.pdf
    trunk/Master/texmf-dist/doc/latex/footmisc/footmisc-doc.tex
    trunk/Master/texmf-dist/tex/latex/footmisc/footmisc-2011-06-06.sty

Removed Paths:
-------------
    trunk/Master/texmf-dist/doc/latex/footmisc/README
    trunk/Master/texmf-dist/doc/latex/footmisc/footmisc.pdf

Deleted: trunk/Master/texmf-dist/doc/latex/footmisc/README
===================================================================
--- trunk/Master/texmf-dist/doc/latex/footmisc/README	2022-02-11 07:44:03 UTC (rev 61978)
+++ trunk/Master/texmf-dist/doc/latex/footmisc/README	2022-02-11 21:53:45 UTC (rev 61979)
@@ -1,9 +0,0 @@
-This package is long-established and widely used.  It derives from
-several pieces of work done in pre-LaTeX 2e days by other authors;
-over the years, there is none of that basis that I have not developed
-and/or improved.
-
-A .tds.zip file is available on CTAN.
-
-Robin Fairbairns
-rf10<snail-shape>cam.ac.uk

Added: trunk/Master/texmf-dist/doc/latex/footmisc/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/footmisc/README.md	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/footmisc/README.md	2022-02-11 21:53:45 UTC (rev 61979)
@@ -0,0 +1,24 @@
+# footmisc package
+
+-----
+
+This is the footmisc package originally written by Robin Fairbairns,
+these days maintained and developed further by Frank Mittelbach.
+
+
+Package source can be found at:
+
+https://github.com/FrankMittelbach/fmitex-footmisc/
+
+and issues can be logged there
+
+The license is LPPL 1.3c.
+
+-----
+
+Copyright (C) 1995-2011 Robin Fairbairns<br />
+Copyright (C) 2018-2022 Frank Mittelbach<br />
+<https://latex-project.org/> <br />
+All rights reserved.
+
+


Property changes on: trunk/Master/texmf-dist/doc/latex/footmisc/README.md
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/footmisc/announce.txt
===================================================================
--- trunk/Master/texmf-dist/doc/latex/footmisc/announce.txt	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/footmisc/announce.txt	2022-02-11 21:53:45 UTC (rev 61979)
@@ -0,0 +1,13 @@
+ Previous version was 5.5b from 2011. This is now version 6.  A few
+ bugs have been fixed and the following new options have been added:
+
+   - bottomfloats
+   - bottomfootnotes
+   - abovefloats
+   - belowfloats
+
+ For details see the package documentation.
+
+ There is a rollback possibility using either a date '[=YYYY-MM-DD]'
+ or the string '[=v5]' as the second optional argument to \usepackage,
+ e.g., \usepackage{footmisc}[=v5].


Property changes on: trunk/Master/texmf-dist/doc/latex/footmisc/announce.txt
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/footmisc/changes.txt
===================================================================
--- trunk/Master/texmf-dist/doc/latex/footmisc/changes.txt	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/footmisc/changes.txt	2022-02-11 21:53:45 UTC (rev 61979)
@@ -0,0 +1,17 @@
+2022-02-05  Frank Mittelbach  <Frank.Mittelbach at latex-project.org>
+
+	* footmisc.dtx:
+	Previous version was 5.5b from 2011. This is now version 6.
+	A few bugs have been fixed and the following new options have
+	been added:
+
+	  - bottomfloats
+	  - bottomfootnotes
+	  - abovefloats
+	  - belowfloats
+
+	For details see the package documentation.
+
+	There is a rollback possibility using either a date
+	'[=YYYY-MM-DD]' or the string '[=v5]' as the second optional
+	argument to \usepackage, e.g., \usepackage{footmisc}[=v5].


Property changes on: trunk/Master/texmf-dist/doc/latex/footmisc/changes.txt
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/footmisc/footmisc-code.pdf
===================================================================
(Binary files differ)

Index: trunk/Master/texmf-dist/doc/latex/footmisc/footmisc-code.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/footmisc/footmisc-code.pdf	2022-02-11 07:44:03 UTC (rev 61978)
+++ trunk/Master/texmf-dist/doc/latex/footmisc/footmisc-code.pdf	2022-02-11 21:53:45 UTC (rev 61979)

Property changes on: trunk/Master/texmf-dist/doc/latex/footmisc/footmisc-code.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/footmisc/footmisc-code.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/footmisc/footmisc-code.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/footmisc/footmisc-code.tex	2022-02-11 21:53:45 UTC (rev 61979)
@@ -0,0 +1,4 @@
+% this will typeset documentation + code
+
+\AtBeginDocument{\AlsoImplementation}
+\input{footmisc.dtx}


Property changes on: trunk/Master/texmf-dist/doc/latex/footmisc/footmisc-code.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/footmisc/footmisc-doc.pdf
===================================================================
(Binary files differ)

Index: trunk/Master/texmf-dist/doc/latex/footmisc/footmisc-doc.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/footmisc/footmisc-doc.pdf	2022-02-11 07:44:03 UTC (rev 61978)
+++ trunk/Master/texmf-dist/doc/latex/footmisc/footmisc-doc.pdf	2022-02-11 21:53:45 UTC (rev 61979)

Property changes on: trunk/Master/texmf-dist/doc/latex/footmisc/footmisc-doc.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/footmisc/footmisc-doc.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/footmisc/footmisc-doc.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/footmisc/footmisc-doc.tex	2022-02-11 21:53:45 UTC (rev 61979)
@@ -0,0 +1,6 @@
+% this will typeset only documentation but not the code
+
+\AtBeginDocument{\OnlyDescription
+%                 \let\tableofcontents\relax
+                 }
+\input{footmisc.dtx}


Property changes on: trunk/Master/texmf-dist/doc/latex/footmisc/footmisc-doc.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Deleted: trunk/Master/texmf-dist/doc/latex/footmisc/footmisc.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/source/latex/footmisc/footmisc.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/footmisc/footmisc.dtx	2022-02-11 07:44:03 UTC (rev 61978)
+++ trunk/Master/texmf-dist/source/latex/footmisc/footmisc.dtx	2022-02-11 21:53:45 UTC (rev 61979)
@@ -1,6 +1,26 @@
-%\iffalse meta-comment, etc.
-%% This is footmisc.dtx, and it's -*-LaTeX-*- text
+% \iffalse meta-comment
 %
+%% File: footmisc.dtx (C) Copyright 1995-2011 Robin Fairbairns
+%%                    (C) Copyright 2018-2022 Frank Mittelbach
+%
+% It may be distributed and/or modified under the conditions of the
+% LaTeX Project Public License (LPPL), either version 1.3c of this
+% license or (at your option) any later version.  The latest version
+% of this license is in the file
+%
+%    https://www.latex-project.org/lppl.txt
+%
+% This bundle has the status "maintained" and the current maintainer
+% is Frank Mittelbach.
+%
+% The development version of the bundle can be found at
+%
+%    https://github.com/FrankMittelbach/fmitex-footmisc/
+%
+% for those people who are interested or want to report an issue.
+%
+%
+%
 % We use the same body for the \cs{ProvidesFile} as for the
 % \cs{ProvidesPackage} command.
 %
@@ -11,9 +31,14 @@
 %<*dtx>
 \ProvidesFile{footmisc.dtx}%
 %</dtx>
+%<+package>\providecommand\DeclareRelease[3]{}
+%<+package>\providecommand\DeclareCurrentRelease[2]{}
+%<+package>
+%<+package>\DeclareRelease{v5}{2011-06-06}{footmisc-2011-06-06.sty}
+%<+package>\DeclareCurrentRelease{}{2022-02-10}
 %<package>\ProvidesPackage{footmisc}%
 %<*!debugins>
-        [2011/06/06 v5.5b
+        [2022/02/10 v6.0a
 %</!debugins>
 %<package>     a miscellany of footnote facilities%
 %<*dtx>
@@ -20,7 +45,7 @@
                footmisc package source file%
 %</dtx>
 %<*!debugins>
-                   ]% $Id: footmisc.dtx,v 4.25 2011/06/06 14:25:44 rf10 Exp rf10 $
+                   ]
 %</!debugins>
 %    \end{macrocode}
 %
@@ -30,9 +55,10 @@
 %<*driver>
 \setcounter{errorcontextlines}{999}
 \documentclass{ltxdoc}
+\usepackage{hyperref}
 %    \end{macrocode}
 %
-% we limit the things that we will index
+% We limit the things that we will index
 %    \begin{macrocode}
 \DoNotIndex{\#,\@MM,\@cclv,\@gobble,\@ifnextchar,\@ifundefined}
 \DoNotIndex{\|,\advance,\begingroup,\bgroup,\box,\csname}
@@ -51,7 +77,7 @@
 \DoNotIndex{\wd,\xdef,\@}
 \GetFileInfo{footmisc.dtx}
 \EnableCrossrefs
-% to get documented source of the package, comment out the next line,
+% To get documented source of the package, comment out the next line,
 % and uncomment the following one; otherwise, create yourself
 % (somewhere on your LaTeX input path) a file ltxdoc.cfg that contains
 % simply          \AtBeginDocument{\AlsoImplementation}
@@ -63,37 +89,48 @@
 \end{document}
 %</driver>
 %    \end{macrocode}
+%
 % \fi
 %
-% \CheckSum{1711}
 %
+%
 % \title{\texttt{footmisc} ---\\
 %        a portmanteau package\\
-%        for customising footnotes in \LaTeX\thanks{This file has
+%        for customizing footnotes in \LaTeX\thanks{This file has
 %          version number \fileversion, last revised \filedate}}
-% \author{Robin Fairbairns\thanks{University of Cambridge Computer
-%     Laboratory, William Gates Building, J.\,J. Thompson Avenue, 
-%     Cambridge, CB2 0FD, UK
-%     (\texttt{rf10<snail-shape>cam.ac.uk})}}
+% \author{Robin Fairbairns\thanks{Formerly: University of Cambridge Computer
+%     Laboratory, Cambridge, UK} \and
+%   Frank Mittelbach\thanks{Responsible maintainer since 2018}}
 % \maketitle
 %
+%
+% \newcommand\fmi[1]{\begin{quote} TODO: \itshape #1\end{quote}}
+% \newcommand\NEW[1]{\marginpar{\mbox{}\hfill\fbox{New: #1}}}
+% \providecommand\pkg[1]{\texttt{#1}}
+%
+%
 % \section*{Copyright statement}
 %
 % \noindent Program: \texttt{footmisc.dtx}\par
-% \noindent Copyright 1995 1996 1998 1999 2001--2003 2008 2009 Robin Fairbairns
+% \noindent Copyright 1995--2011 Robin Fairbairns\par
+% \noindent Copyright 2018--2022 Robin Fairbairns, Frank Mittelbach
 %
 % This program is offered under the terms
-% of the LaTeX Project Public License, version 1.3c of this license or
+% of the \LaTeX{} Project Public License, version 1.3c of this license or
 % (at your option) any later version.  The latest version of this
-% license is in http://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.
+% license is in \texttt{https://www.latex-project.org/lppl.txt}, and version
+% 1.3c or later is part of all distributions of \LaTeX{} version
+% 2008 or later.
 %
-% This work has the LPPL maintenance status `author-maintained'.
+% This work has the LPPL maintenance status `maintained'.
 %
+%
+% \tableofcontents
+%
+%
 % \section*{History}
 %
-% This package originated as support of a personal project, which I
+% This package originated as support of a personal project, which I (Robin)
 % was switching to \LaTeX{} 2e over the Christmas holiday period of
 % 1993, using the first \ensuremath{\beta} release.
 %
@@ -102,10 +139,23 @@
 % used by a package written by Mark Wooding.  So the package is now
 % known (as you can see) as ``footmisc''.
 %
+% Frank took over maintenance in 2018 but due to other commitments never
+% got around finishing the changes he started to make in 2018.
+%
+% In 2022 a few new options (\texttt{abovefloats},
+% \texttt{belowfloats}, \texttt{bottomfloats}, and \texttt{bottomfootnotes})
+% got introduced and the package now works
+% with \textsf{hyperref} regardless of loading order. There arem
+% however, still a few restrictions when using both packages together,
+% in particular the \texttt{multiple} option does not fully work.
+%
+%
+%
+%
 % \section{User interface~--- package options}
 %
 % The \textsf{footmisc} package provides several different
-% customisations of the way foonotes are represented in \LaTeXe{}
+% customizations of the way footnotes are represented in \LaTeXe{}
 % documents (the sources of the code in this package are various, but
 % all of it has been massaged by the author; where the code comes from
 % elsewhere, there are attributions given below, somewhere or other).
@@ -130,7 +180,7 @@
 % so an additional pass for this purpose shouldn't cause any
 % additional problem.  The option includes code to report that
 % `\emph{Label(s) may have changed}', which will help the poor user to
-% realise that (yet) another run is in order.
+% realize that (yet) another run is in order.
 %
 % \subsection{Option \texttt{para}}
 %
@@ -220,7 +270,7 @@
 % confound automatic generation procedures.  In the same situation,
 % the \texttt{symbol*} option produces information messages and a
 % warning message at end document, and the user may scan the log for
-% those messages \emph{after} processing has stabilised.  The option
+% those messages \emph{after} processing has stabilized.  The option
 % produces numbers (17 and higher, in the case of the default symbol
 % set) in place of symbols, when the footnote number is too large.
 %
@@ -227,6 +277,9 @@
 % \subsection{The \cs{setfnsymbol} and \cs{DefineFNsymbols} commands}
 % \label{footnote-symbols}
 %
+% \fmi{At some point in the past this interface got extended, but the
+%     documentation lags behind so this needs updating.}
+%
 % These commands permit the definition and use of alternative
 % (ordered) sets of symbols for numbering footnotes.  \LaTeX{} of
 % course comes with such a set ready-defined, but the choice of
@@ -266,18 +319,87 @@
 % This last set, known as \texttt{lamport*} is selected as the default
 % symbol set by the package.
 %
-% \subsection{Option \texttt{bottom}}
 %
-% This option forces footnotes to the bottom of the page; this is only
-% noticeably useful in case that \cs{raggedbottom} is in effect, when
+% \subsection{Options altering the footnotes/floats relationship}
+%
+% In \LaTeX{} the default order on a page is ``page text'' followed by
+% ``footnotes'' (if any) followed by ``bottom floats'' (if any). The
+% spacing between the three components depends of whether pages are
+% always stretched to the same height (\cs{flushbottom} as used by the
+% book class) or if they
+% can run short  (\cs{raggedbottom} as used by the article or report
+% class).
+% If \cs{raggedbottom} is in force, then 
 % \LaTeX{} would normally set the footnotes a mere
-% \cs{skip}\cs{footins} distant from the bottom of the text.
+% \cs{skip}\cs{footins} distant from the bottom of the text and bottom
+% floats follow separated by \cs{textfloatsep}. Both spaces might get
+% stretched if \cs{flushbottom} is in force.
 %
-% There's a further infelicity in \LaTeX{}'s placing of footnotes of
-% the bottom of pages: if a bottom float appears on a page, \LaTeX{}
-% places the footnote \emph{above} it.  The \texttt{bottom} option
-% places the footnote at the foot of the page.
+% If\NEW{2022-02}
+% you want to diverge from this default placement, then  there are
+% a number of alterations that can be made:
+% \begin{itemize}
+% \item the order of footnotes and floats can be swapped; and
+% \item both footnotes and floats can be forced to the bottom (i.e.,
+% \cs{raggedbottom} then only applies to pages with neither), or
+% \item only one of them is forced to the bottom, the other stays
+% close to the text.
+% \end{itemize}
+% These can be achieved by applying one or more of the options
+% discussed below.
+%^^A \texttt{abovefloats}, \texttt{belowfloats}, \texttt{bottom},
+%^^A \texttt{bottomfloats}, or \texttt{bottomfootnotes}.
 %
+%
+%
+% \subsubsection{Options \texttt{abovefloats} and \texttt{belowfloats}}
+%
+% These\NEW{2022-02}
+% two options describe the footnote placement with respect to
+% floats on the page. \LaTeX's default is \texttt{abovefloats}, but it
+% can still be useful to specify it because it fixes the bug discussed
+% in section~\ref{sec:spacebug}.
+%
+%
+% \subsubsection{Option \texttt{bottom}}
+%
+% This option forces footnotes \emph{and} floats to the bottom and
+% also implies \texttt{belowfloats}. If you want both at the bottom
+% but footnotes first, then add \texttt{abovefloats} in addition.
+%
+% \subsubsection{Options \texttt{bottomfloats} and
+% \texttt{bottomfootnotes}}
+%
+% If\NEW{2022-02}
+% you want force only floats or only footnotes to the bottom then
+% use one of these options. As they naturally define the order, i.e.,
+% in case of \texttt{bottomfloats} footnotes are obviously earlier, the
+% options \texttt{abovefloats} and \texttt{belowfloats} are
+% meaningless and are ignored if given.
+%
+%
+% \subsubsection{Fixing a strange behavior of \LaTeX}
+% \label{sec:spacebug}
+%
+% In\NEW{2022-02}
+% the default case (if \pkg{footmisc} is not loaded) \LaTeX{} shows
+% a somewhat strange discrepancy: on most pages the
+% footnotes are attached a distance of \cs{skip}\cs{footins} from the
+% main text, even if that page is run short (i.e., with
+% \cs{raggedbottom} in force). However, whenever the is some
+% infinite stretch at the end of the page, e.g., from using \cs{newpage} or
+% \cs{clearpage} the footnotes are pushed to the bottom (in particular
+% on the last page of a document or chapter).
+%
+% This is automatically corrected if \pkg{footmisc} is loaded with any
+% of the options that deal with footnote placement, i.e.,
+% \texttt{abovefloats}, \texttt{belowfloats}, \texttt{bottom},
+% \texttt{bottomfloats}, or \texttt{bottomfootnotes}. In particular,
+% if you want to have the standard \LaTeX{} placement (but with this
+% strange behavior fixed, apply \texttt{abovefloats} (which is the
+% normal order but with the bug fixed).
+%
+%
 % \subsection{Option \texttt{marginal}}
 %
 % This option adjusts the position of footnote mark relative to the
@@ -405,7 +527,7 @@
 % letters.  However, the numbers used by \cs{footnotemark} make
 % reference to the `main'
 % footnote counter, and are set in whatever is the current style for
-% that: this behaviour often surprises, and there's no obvious way in
+% that: this behavior often surprises, and there's no obvious way in
 % standard \LaTeX{} to ``get around'' it.  The command
 % \cs{mpfootnotemark} gets around this problem in a minipage, by
 % generating footnote marks in the same way as those used by
@@ -418,7 +540,8 @@
 % subsequent \cs{footnotemark} or \cs{mpfootnotemark}.  This is a
 % tedious way of going about things, and doesn't allow representation
 % of all possible forms of footnote mark; \cs{footref} is a form of
-% reference command that sets the reference as if it were a footnote.
+% reference command that sets the reference as if it were
+% a footnote.\footnote{This command is already provided by the \LaTeX{} format.}
 % The label should be set \emph{within} the argument of the footnote
 % command that is being labelled:
 % \begin{verbatim}
@@ -431,7 +554,7 @@
 %
 % The \textsf{footmisc} package modifies several parts of the \LaTeX{}
 % kernel; what gets modified depends on the options you select.  This
-% behaviour can cause problems with other packages, particularly those
+% behavior can cause problems with other packages, particularly those
 % that also modify the kernel.
 %
 % Known interactions are:
@@ -444,6 +567,8 @@
 % \item[\normalfont\textsf{memoir} class] The class emulates
 %   \textsf{setspace}, and we detect that emulation and deal with it
 %   in the same way as \textsf{setspace}.
+%
+% \iffalse FMi: this should now work!
 % \item[\normalfont\textsf{hyperref}] The \textsf{hyperref} package
 %   has ambitions to make hyperlinks from footnote marks to the
 %   corresponding footnote body; naturally this causes grief to
@@ -453,6 +578,8 @@
 %   \quad\verb|\usepackage[hyperfootnotes=false,...]{hyperref}|\\
 %   Further work on the interaction between the two packages is
 %   proposed, but not yet scheduled.
+% \fi
+%
 % \item[\normalfont\textsf{manyfoot}] The \textsf{manyfoot} package
 %   permits several independent sequences of footnotes.  Some
 %   preliminary work towards interworking with \textsf{footmisc} has
@@ -470,9 +597,9 @@
 %<*package>
 %    \end{macrocode}
 %
-% Now declare what environment we need:
+% Now declare what environment we need: version 6 needs a fairly recent \LaTeX.
 %    \begin{macrocode}
-\NeedsTeXFormat{LaTeX2e}[1994/12/01]
+\NeedsTeXFormat{LaTeX2e}[2020/10/01]
 %    \end{macrocode}
 %
 % We need a token register in case we have to patch \cs{@makecol}:
@@ -487,13 +614,14 @@
 %    \begin{macrocode}
 \providecommand\protected at writeaux{%
   \protected at write\@auxout
-}%    \end{macrocode}
+}
+%    \end{macrocode}
 % \end{macro}
 %
 % \begin{macro}{\l at advance@macro}
-% \begin{macro}{@@dvance at macro}
+% \begin{macro}{\@@dvance at macro}
 % \begin{macro}{\@advance at macro}
-% We make the following (\cs{@@dvance at macro}) generalisable as follows
+% We make the following (\cs{@@dvance at macro}) generalizable as follows
 % (the global form isn't used in this package \dots\ yet):
 %
 %    \begin{macrocode}
@@ -513,20 +641,9 @@
 % \end{macro}
 % \end{macro}
 %
-% \begin{macro}{\ifFN at etex}
-% Check whether we're using etex
-%    \begin{macrocode}
-\newif\ifFN at etex
-\ifx\dimexpr\undefined
-  \FN at etexfalse
-\else
-  \FN at etextrue
-\fi
-%    \end{macrocode}
-% \end{macro}
 % \begin{macro}{\footnotemargin}
 % Finally, we define the length used by the \texttt{marginal} option,
-% and initialise it as if we've not had the option.
+% and initialize it as if we've not had the option.
 %    \begin{macrocode}
 \newdimen\footnotemargin
 \footnotemargin1.8em\relax
@@ -545,7 +662,7 @@
 % This is a declaration that appears in the original \LaTeX{} book.
 % Since it appeared in the old |pagefoots.sty| (presumably since it
 % goes so naturally with the |perpage| option), I've added this
-% trivial piece of customisation to the package.
+% trivial piece of customization to the package.
 %
 %    \begin{macrocode}
 \DeclareOption{symbol}{\renewcommand\thefootnote{\fnsymbol{footnote}}}
@@ -558,8 +675,10 @@
 % number.  We use a robust version of the ``extended ordinary'' symbol set,
 % described later (in section~\ref{footnote-symbols}).
 %    \begin{macrocode}
+\newif\ifFN at robust \FN at robustfalse
 \DeclareOption{symbol*}{%
   \renewcommand\thefootnote{\@fnsymbol\c at footnote}%
+  \FN at robusttrue
   \AtEndOfPackage{\setfnsymbol{lamport*-robust}}%
 }
 %    \end{macrocode}
@@ -600,7 +719,7 @@
 % \subsection{The \texttt{side} option}
 %
 % \begin{macro}{\ifFN at sidefn}
-% Simply changes the behaviour of \cs{@footnotetext}; incompatible
+% Simply changes the behavior of \cs{@footnotetext}; incompatible
 % with paragraph footnotes.
 %    \begin{macrocode}
 \newif\ifFN at sidefn  \FN at sidefnfalse
@@ -662,18 +781,99 @@
 %    \end{macrocode}
 % \end{macro}
 %
-% \subsection{The \texttt{bottom} option}
 %
-% \begin{macro}{\ifFN at bottom}
-% All this needs to do is to set a flag to say that it should happen
+% \subsection{Fixing the \LaTeX{} misbehavior with respect to spacing}
+%
+%
+%  \begin{macro}{\ifFN at fixskip}
+%    We maintain a boolean to decide if we want to fix that, by
+% default we don't but if any placement option is given we apply the fix.
 %    \begin{macrocode}
-\newif\ifFN at bottom  \FN at bottomfalse
+\newif\ifFN at fixskip      \FN at fixskipfalse
+%    \end{macrocode}
+%  \end{macro}
+%
+% \subsection{The footnote/float placement options}
+%
+% We have up to three blocks on a page (four if you count
+% top-floats). If there is any excess space that needs to be added the
+% question is where that goes:
+% \begin{enumerate}
+% \item above footnotes and floats;
+% \item between footnotes and floats;
+% \item after footnotes and floats;
+% \item nowhere in particular (everything is equally spaced out).
+% \end{enumerate}
+% Technically, the last two cases can be combined in one:
+% \cs{raggedbottom} adds some ``fill'' space at the very bottom (which
+% covers case 3) and \cs{flushbottom} puts nothing in this place, so
+% covers case 4 if we do not add any \cs{vfill} elsewhere.
+%
+%
+% \begin{macro}{\FN at ORspacehandling}
+%    We record in which case we want to be in
+%   \cs{FN at ORspacehandling}. The default is case 3.
+%    \begin{macrocode}
+\let\FN at ORspacehandling\thr@@
+%    \end{macrocode}
+% \end{macro}
+%
+%
+%
+% \subsubsection{The \texttt{bottom} option}
+%
+%  \begin{macro}{\ds at bottom}
+%  The \texttt{bottom} option implements case 1 and puts the footnotes
+%  by default below the floats.
+%    \begin{macrocode}
 \DeclareOption{bottom}{%
-  \FN at bottomtrue
+  \let\FN at ORspacehandling\@ne
+  \FN at abovefloatsfalse
+%    \end{macrocode}
+%    We also state that we want to fix \LaTeX{} space issue (as we do
+%    in all other options.
+%    \begin{macrocode}
+  \FN at fixskiptrue
 }
 %    \end{macrocode}
+%  \end{macro}
+%
+% \subsection{The \texttt{abovefloats}, \texttt{belowfloats} options}
+%
+% \begin{macro}{\ifFN at abovefloats}
+%    All this needs to do is to set a flag to say that it should happen.
+%    \begin{macrocode}
+\newif\ifFN at abovefloats  \FN at abovefloatstrue
+%    \end{macrocode}
 % \end{macro}
 %
+%
+% \begin{macro}{ds at abovefloats,ds at belowfloats}
+%    These options change the order and that's it.
+%    \begin{macrocode}
+\DeclareOption{abovefloats}{\FN at abovefloatstrue  \FN at fixskiptrue}
+\DeclareOption{belowfloats}{\FN at abovefloatsfalse \FN at fixskiptrue}
+%    \end{macrocode}
+% \end{macro}
+%
+% \subsection{The \texttt{bottomfloats}, \texttt{bottomfootnotes} options}
+%
+% \begin{macro}{ds at bottomfloats,ds at bottomfootnotes}
+%    These options are for case 2. In addition they have to say what
+%    comes first.
+%    \begin{macrocode}
+\DeclareOption{bottomfloats}{%
+  \let\FN at ORspacehandling\tw@
+  \FN at abovefloatstrue \FN at fixskiptrue
+}
+\DeclareOption{bottomfootnotes}{%
+  \let\FN at ORspacehandling\tw@
+  \FN at abovefloatsfalse \FN at fixskiptrue
+}
+%    \end{macrocode}
+% \end{macro}
+%
+%
 % \subsection{The \texttt{marginal} option}
 %
 % Again, the processing of the option is pretty trivial:
@@ -824,268 +1024,469 @@
 % hacked to achieve our effects, and we do all of this now, according
 % to flags set in option processing.
 %
-% \subsection{The output routine}
+% \subsection{The output routine part}
 %
-% Now; do we need to mess about with the output routine?  If either
-% |para| or |bottom| has been invoked, we do.
+%    We interface with \cs{@makecol} from the kernel. Eventually this
+%    should move directly into the kernel.
+%
+%    In order for other packages to prepend or append code to
+%    \cs{@makecol}, they can use the generic command hooks
+%    \texttt{cmd/@makecol/before} and \texttt{cmd/@makecol/after}, so
+%    there is nothing we need to do here.
+%
+%
+%
+%  \begin{macro}{\@makecol}
+%    \cs{@makecol} is shortened a lot, basically all the hardwired
+%    code in the middle has moved into a configuration point.
 %    \begin{macrocode}
-\let  \if at tempswa  \ifFN at bottom
-\ifFN at para    \@tempswatrue \fi
-\if at tempswa
+\def \@makecol {%
+  \@kernel at before@cclv
+  \setbox\@outputbox \box\@cclv
 %    \end{macrocode}
-% \dots{} so we've patching to do.
+%    The only real addition is the next command which either does
+%    nothing or removes an infinite glue from the bottom of the
+%    \cs{@outputbox}.
+%    \begin{macrocode}
+  \@outputbox at removebskip
+%    \end{macrocode}
+%    Any ``here'' floats in the \cs{@outputbox} are now handled so we
+%    recycle their registers and put them back to the \cs{@freelist}.
+%    \begin{macrocode}
+  \let\@elt\relax
+  \xdef\@freelist{\@freelist\@midlist}%
+  \global \let \@midlist \@empty
+%    \end{macrocode}
+%    Here we have the configurable part.
+% \fmi{Interface to configuration points will change in the future}
+%    \begin{macrocode}
+  \@makecol at appendblocks 
+%    \end{macrocode}
+%    The we deal with any \cs{enlargethispage} or run the normal code
+%    to build a column.
+%    \begin{macrocode}
+  \ifvbox\@kludgeins
+     \@makespecialcolbox
+  \else
+     \@makenormalcolbox
+  \fi
+  \global \maxdepth \@maxdepth
+}
+%    \end{macrocode}
+%  \end{macro}
 %
-% First, we ensure that \cs{@makecol} is as expected from the time at
-% which these macros were written: since we're going to patch it, we
-% had better be sure that we're patching the right thing.  (There was
-% a minuscule change to the definition 1999, but this doesn't as far
-% as I can tell make any difference to the semantics of the definition
-% we base our patch on.)
+%
+%  \begin{macro}{\@outputbox at depth}
+%    We need to know the depth of \cs{@outputbox} once in a
+%    while. Rather than using a temp dimen (as it was done in the
+%    past), we give it a proper register.
 %    \begin{macrocode}
-  \@ifl at t@r\fmtversion{2005/12/01}{%
-    \CheckCommand*\@makecol{\ifvoid \footins
-        \setbox\@outputbox \box\@cclv
-      \else
-        \setbox\@outputbox \vbox{%
-          \boxmaxdepth \@maxdepth                   
-          \unvbox\@cclv
-          \vskip \skip\footins
-          \color at begingroup
-            \normalcolor\footnoterule
-            \unvbox\footins
-          \color at endgroup
-        }%
-      \fi
-      \let \@elt \relax
-      \xdef\@freelist{\@freelist\@midlist}%
-      \global\let\@midlist\@empty
-      \@combinefloats
-      \ifvbox\@kludgeins
-        \@makespecialcolbox
-      \else
-        \setbox\@outputbox \vbox to\@colht{%
-          \@texttop \dimen@\dp\@outputbox
-          \unvbox\@outputbox
-          \vskip -\dimen@\@textbottom
-        }%
-      \fi
-      \global\maxdepth\@maxdepth
-    }
-  }{%
-  \@ifl at t@r\fmtversion{2003/12/01}{%
-    \CheckCommand*\@makecol{\ifvoid \footins
-        \setbox\@outputbox \box\@cclv
-      \else
-        \setbox\@outputbox \vbox{%
-          \boxmaxdepth\@maxdepth
-          \@tempdima\dp\@cclv
-          \unvbox\@cclv
-          \vskip \skip\footins
-          \color at begingroup
-            \normalcolor
-            \footnoterule
-            \unvbox\footins
-          \color at endgroup
-        }%
-      \fi
-      \let \@elt \relax
-      \xdef\@freelist{\@freelist\@midlist}%
-      \global\let\@midlist\@empty
-      \@combinefloats
-      \ifvbox\@kludgeins
-        \@makespecialcolbox
-      \else
-        \setbox\@outputbox \vbox to\@colht{%
-          \@texttop
-          \dimen@\dp\@outputbox
-          \unvbox\@outputbox
-          \vskip -\dimen@
-          \@textbottom
-        }%
-      \fi
-      \global\maxdepth\@maxdepth
-    }%
-  }{%
-    \@ifl at t@r\fmtversion{1999/12/01}{%
-      \CheckCommand*\@makecol{\ifvoid \footins
-          \setbox\@outputbox \box\@cclv
-        \else                           
-          \setbox\@outputbox \vbox{%
-            \boxmaxdepth\@maxdepth
-            \@tempdima\dp\@cclv
-            \unvbox\@cclv
-            \vskip \skip\footins
-            \color at begingroup
-              \normalcolor\footnoterule
-              \unvbox\footins
-            \color at endgroup
-          }%
-        \fi
-        \xdef\@freelist{\@freelist\@midlist}%
-        \global\let\@midlist\@empty
-        \@combinefloats
-        \ifvbox\@kludgeins
-          \@makespecialcolbox
-        \else
-          \setbox\@outputbox \vbox to\@colht{%
-            \@texttop \dimen@\dp\@outputbox
-            \unvbox\@outputbox
-            \vskip -\dimen@\@textbottom
-          }%
-        \fi
-        \global\maxdepth\@maxdepth
+\newdimen\@outputbox at depth
+%    \end{macrocode}
+%  \end{macro}
+%
+%  \begin{macro}{\@makenormalcolbox}
+%    Taken out of \cs{@makecol} for readability.
+%    \begin{macrocode}
+\def \@makenormalcolbox {%
+   \setbox\@outputbox \vbox to\@colht {%
+       \@texttop
+       \@outputbox at depth \dp\@outputbox
+       \unvbox \@outputbox
+       \vskip -\@outputbox at depth
+       \@textbottom
       }%
-    }%
-  }{%
-      \CheckCommand*\@makecol{\ifvoid \footins
-        \setbox\@outputbox \box\@cclv
-      \else
-        \setbox\@outputbox \vbox{%
-          \boxmaxdepth\@maxdepth
-          \unvbox\@cclv
-          \vskip \skip\footins
-          \color at begingroup
-            \normalcolor\footnoterule
-            \unvbox\footins
-          \color at endgroup
-        }%
-      \fi
-      \xdef\@freelist{\@freelist\@midlist}%
-      \global\let\@midlist\@empty
-      \@combinefloats
-      \ifvbox\@kludgeins
-        \@makespecialcolbox
-      \else
-        \setbox\@outputbox \vbox to\@colht{%
-          \@texttop \dimen@\dp\@outputbox
-          \unvbox\@outputbox
-          \vskip -\dimen@\@textbottom
-        }%
-      \fi
-      \global\maxdepth\@maxdepth
-    }%
-  }%
 }
 %    \end{macrocode}
+%  \end{macro}
 %
-% If we're doing paragraph footnotes, the output routine needs
-% different code to place the actual text.  We prepare this code here,
-% since it's potentially used in two different places.
 %
-% We prepare the code in a token register to be used at the
-% appropriate place in the patching of \cs{@makecol}; thus it becomes
-% a token register containing code to place stuff in a token register
+%  \begin{macro}{\@makespecialcolbox}
+%    Make the colbox when \cs{enlargethispage} was used.
 %    \begin{macrocode}
-  \ifFN at para
+\def \@makespecialcolbox {%
+   \@outputbox at append {\vskip-\@outputbox at depth}%
+   \@tempdima \@colht
+   \ifdim \wd\@kludgeins>\z@
+     \advance \@tempdima -\ht\@outputbox
+     \advance \@tempdima \pageshrink
+     \setbox\@outputbox \vbox to \@colht {%
+       \unvbox\@outputbox
+       \vskip \@tempdima
+       \@textbottom
+       }%
+   \else
+     \advance \@tempdima -\ht\@kludgeins
+     \setbox \@outputbox \vbox to \@colht {%
+       \vbox to \@tempdima {%
+         \unvbox\@outputbox
+         \@textbottom}%
+       \vss}%
+   \fi
+   {\setbox \@tempboxa \box \@kludgeins}%
+}
 %    \end{macrocode}
+%  \end{macro}
 %
-% We make a box out of the paragraph of footnotes, and then stuff the
-% contents of the box into that which is going to be \cs{ship}ped
-% |out|.
+%
+%  \begin{macro}{\@outputbox at removebskip}
+%    
+%    This is really a bug fix for the kernel, but perhaps one has to
+%    make it optional because it is in there since day one). If
+%    \cs{raggedbottom} is in force, footnotes get attached to the main
+%    galley at a distance of \cs{footskip} on all pages except on
+%    those that are ended by \cs{newpage} or \cs{clearpage} where the
+%    \cs{vfil} from \cs{newpage} pushes the footnotes to the very bottom.
+%
+%    This is kind of a weird difference to a page  ending with
+%    \cs{pagebreak}---in that case the page is also run
+%    short, but the footnotes are not pushed to the bottom.
+%
+%    This is fixed by \cs{@outputbox at removebskip} but only if the
+%    switch \texttt{FN at fixskip} is set to true (which is done whenever
+%    \pkg{footmisc} is called with with an option specifying the
+%    footnote placement, i.e., not  in the default case).
 %    \begin{macrocode}
-    \FN at temptoken{%
-      \toks@\expandafter{\the\toks@
-        \vskip\skip\footins
-        \color at begingroup
-          \normalcolor\footnoterule
-          \global\setbox\FN at tempboxc\vbox{\makefootnoteparagraph}%
-          \unvbox\FN at tempboxc
-        \color at endgroup
+\ifFN at fixskip
+  \def\@outputbox at removebskip{%
+%    \end{macrocode}
+%    We first test if we are in a \cs{raggedbottom} layout. If not we
+%    do nothing, but we don't disable the code because
+%    \cs{raggedbottom} may get used only for some parts of the
+%    document.
+%    \begin{macrocode}
+    \ifx\@textbottom\relax \else
+%    \end{macrocode}
+%    We then append some negative glue at the end of \cs{@outputbox}
+%    provided it has a glue stretch order of 1 or more (i.e., contains
+%    a \texttt{fil} or \texttt{fill} part).
+%    \begin{macrocode}
+      \@outputbox at append{%
+        \@tempskipa\lastskip
+        \ifnum \gluestretchorder\@tempskipa>\z@
+          \vskip-\@tempskipa
+%    \end{macrocode}
+%  \begin{macro}{\@outputbox at reinsertbskip}
+%    We also record the value so that it can be reinserted
+%    elsewhere. As we have to do this globally, we also need to
+%    explicitly reset it if we don't find any such glue.
+%    \begin{macrocode}
+          \xdef\@outputbox at reinsertbskip
+              {\noexpand\@outputbox at append{\vskip\the\@tempskipa}}%
+        \else
+          \global\let\@outputbox at reinsertbskip\relax
+        \fi
       }%
-    }%
+   \fi
+  }
 %    \end{macrocode}
+%    We need a trivial top-level definition for
+%    \cs{@outputbox at reinsertbskip} in case the first page has no
+%    bottom glue and the command gets called.
+%    \begin{macrocode}
+\let\@outputbox at reinsertbskip\relax
+%    \end{macrocode}
+%    If nothing should get fixed we set both commands to \cs{relax}.
+%    \begin{macrocode}
+\else
+  \let\@outputbox at removebskip \relax
+  \let\@outputbox at reinsertbskip\relax
+\fi
+%    \end{macrocode}
+%  \end{macro}
+%  \end{macro}
 %
-% If we're not doing paragraph footnotes, we insert the little bit of
-% code that would have been replaced by the stuff above:
+%
+%  \begin{macro}{\@kernel at before@cclv}
+%  \begin{macro}{\@kernel at before@footins}
+%    These two commands are internal kernel hooks intended for tagging
+%    support in case that is active. By default they do nothing (and
+%    may have been defined already by \cs{DocumentMetadata}).
 %    \begin{macrocode}
-  \else
-    \FN at temptoken{%
-      \toks@\expandafter{\the\toks@
-        \vskip\skip\footins
-        \color at begingroup
-          \normalcolor\footnoterule
-          \unvbox\footins
-        \color at endgroup
+\providecommand\@kernel at before@cclv{}
+\providecommand\@kernel at before@footins{}
+%    \end{macrocode}
+%  \end{macro}
+%  \end{macro}
+%
+%
+%
+%
+% \subsection{The output routine configuration components}
+%
+%    Here we provide the components that are used to define
+%    \cs{@makecol at appendblocks}.
+%
+%
+%  \begin{macro}{@outputbox at append}
+%
+%    This general purpose command alters the \cs{@outputbox} box by
+%    appending material to it. As this is a box typesetting operation
+%    we make sure that the last line of the box reflects the true
+%    depth of the last line (in case that is needed later). We also
+%    expose the current depth of \cs{@outputbox} as
+%    \cs{@outputbox at depth} before unboxing so that its value can be
+%    used by \verb=#1= if wanted.
+%    \begin{macrocode}
+\def\@outputbox at append #1{%
+%  \if!\detokenize{#1}!\else
+     \setbox\@outputbox \vbox {%
+       \boxmaxdepth \@maxdepth
+       \@outputbox at depth\dp\@outputbox      % if needed in #1
+       \unvbox \@outputbox
+       #1%
+     }%
+%  \fi
+}
+%    \end{macrocode}
+%  \end{macro}
+%
+%
+%
+%
+%  \begin{macro}{\@outputbox at appendfootnotes}
+%
+%    This command appends the footnotes to the \cs{@outputbox} (if
+%    there are any). If not then it does nothing.
+%    \begin{macrocode}
+\def\@outputbox at appendfootnotes {%
+   \ifvoid\footins \else
+%    \end{macrocode}
+%    First come two configuration points: what to do if we are in a split
+%    footnote situation and a second one that does some manipulation
+%    of the \cs{footins} box before it gets appended.
+% \fmi{this code will get revised as part of CP handling  in the future}
+%    \begin{macrocode}
+     \@makecol at handlesplitfootnotes
+     \@makecol at preparefootinshook
+%    \end{macrocode}
+%    Then the footnotes are appended:
+%    \begin{macrocode}
+     \@outputbox at append{%
+       \vskip \skip\footins
+       \@kernel at before@footins
+       \color at begingroup
+         \normalcolor
+         \footnoterule
+%    \end{macrocode}
+%    Support for \pkg{pdfcolfoot}, eventually this can go once color
+%    is properly supported.
+%    \begin{macrocode}
+         \csname pdfcolfoot at current\endcsname
+         \unvbox \footins
+       \color at endgroup
       }%
-    }%
   \fi
+}
 %    \end{macrocode}
+%  \end{macro}
 %
-% Now we start building up the revised version of \cs{@makecol}.  The
-% definition starts out in \cs{toks@}; first the \textsf{bottom} version:
+%
+%
+%  \begin{macro}{\@outputbox at attachfloats}
+%  \begin{macro}{\@outputbox at attachtopfloats}
+%  \begin{macro}{\@outputbox at attachbottomfloats}
+%    Attaching top and bottom floats can usually be done in one go,
+%    but for special layouts we might want more control so we provide
+%    also separate commands.
 %    \begin{macrocode}
-  \ifFN at bottom
-    \toks@{\setbox\@outputbox \box\@cclv
-      \xdef\@freelist{\@freelist\@midlist}%
-      \global\let\@midlist\@empty
-      \@combinefloats
-      \ifvoid\footins
-      \else
-        \setbox\@outputbox \vbox\bgroup
-          \boxmaxdepth\@maxdepth
-          \unvbox\@outputbox
-          \vfill\relax
+\let \@outputbox at attachfloats \@combinefloats
+%    \end{macrocode}
+%    
+%    \begin{macrocode}
+\def \@outputbox at attachtopfloats {%
+  \ifx \@toplist\@empty \else \@cflt \fi
+}  
+\def \@outputbox at attachbottomfloats {%
+    \ifx \@botlist\@empty \else \@cflb \fi
+}  
+%    \end{macrocode}
+%  \end{macro}
+%  \end{macro}
+%  \end{macro}
+%
+%
+%
+%
+%  \begin{macro}{\@makecol at handlesplitfootnotes}
+%  \begin{macro}{\@makecol at splitfootnotemessagehook}
+%    This is only an early draft and doesn't do much.
+%    Contains  incomplete preparation for tagging commented out.
+% \fmi{Interfaces and code will change in the future}
+%    \begin{macrocode}
+\def\@makecol at handlesplitfootnotes {%
+%  \ifx\splitfootnote at continuation\@empty \else
+%    \setbox\footins\vbox{\splitfootnote at continuation\unvbox\footins}%
+%    \global\let\splitfootnote at continuation\@empty
+%  \fi
+  \ifnum\insertpenalties>\z@
+    \@makecol at splitfootnotemessagehook
+%    \setbox\footins\vbox{\unvbox\footins --- END at split}%
+%    \gdef\splitfootnote at continuation    {--- START after split}%
+  \fi
+}
+%\def\splitfootnote at continuation{}
+%    \end{macrocode}
+%    This  could issue warning if split footnotes are encountered.
+%    \begin{macrocode}
+\let \@makecol at splitfootnotemessagehook \@empty
+%    \end{macrocode}
+%  \end{macro}
+%  \end{macro}
+%
+%
+%
+%  \begin{macro}{\@makecol at preparefootinshook}
+%    
+%    Configuration point to support manipulation of footins box
+%    (result needs to be moved back in there). Used by the
+%    \texttt{para} option.
+% \fmi{Interface will change in the future}
+%    \begin{macrocode}
+\let \@makecol at preparefootinshook \@empty
+%    \end{macrocode}
+%
+%    Footnote box layout for para footnotes;
+%    this would also be the hook to support dblfootnotes (from the
+%    \texttt{dblfnote} package if we integrate that).
+%    \begin{macrocode}
+\ifFN at para
+  \def\@makecol at preparefootinshook {%
+     \global\setbox\footins\vbox{\FN at makefootnoteparagraph}%
     }
-    \the\FN at temptoken
-    \toks@\expandafter{\the\toks@\egroup\fi}
+\fi
 %    \end{macrocode}
+%  \end{macro}
 %
-% Not putting stuff at the bottom: footnotes are placed using the
-% kernel's algorithm.
+%
+%
+% \subsection{The \cs{@makecol} configuration based on options}
+%
+%
+%    Placement of footnotes in relation to main galley and floats is
+%    covered by the value of \cs{FN at ORspacehandling} (distribution of
+%    space) and the status of the switch \texttt{@abovefloats}.
+%
 %    \begin{macrocode}
+\ifcase \FN at ORspacehandling\relax
+%---------------------------------------------------------
+% 0 = undefined
+%---------------------------------------------------------
+\ERROR
+\or
+%---------------------------------------------------------
+% 1 = space above footnotes and floats
+%---------------------------------------------------------
+%    \end{macrocode}
+%    All excess space are above the footnote and bottom float
+%    blocks. The order of the blocks depend on \texttt{@abovefloats}:
+%    \begin{macrocode}
+  \ifFN at abovefloats
+%---------------------------------------------------------
+%    \end{macrocode}
+%    Footnotes above floats both at bottom:
+%    \begin{macrocode}
+    \def\@makecol at appendblocks {%
+       \@outputbox at append{\vfill}%
+       \@outputbox at appendfootnotes
+       \@outputbox at attachfloats
+      }
+%---------------------------------------------------------
   \else
-    \toks@{\ifvoid\footins
-        \setbox\@outputbox\box\@cclv
-      \else
-        \setbox\@outputbox \vbox\bgroup
-        \boxmaxdepth\@maxdepth
-        \unvbox\@cclv
+%    \end{macrocode}
+%    Footnotes below floats:
+%    \begin{macrocode}
+    \def\@makecol at appendblocks {%
+       \@outputbox at append{\vfill}%
+       \@outputbox at attachfloats
+       \@outputbox at appendfootnotes
     }
-    \the\FN at temptoken
+  \fi
+\or
+%---------------------------------------------------------
+% 2 = space between footnotes and floats (or floats and footnotes)
+%---------------------------------------------------------
+  \ifFN at abovefloats
+%---------------------------------------------------------
 %    \end{macrocode}
-%
-% Finally, close the \cs{setbox} and the \cs{ifvoid} and tag the parts
-% of the definition  of \cs{@makecol} up to the end of the definition
-% of the \textsf{bottom} version on to \cs{toks@}.
+%    Footnotes first then space then floats at bottom:
 %    \begin{macrocode}
-    \toks@\expandafter{\the\toks@
-      \egroup
-      \fi
-      \xdef\@freelist{\@freelist\@midlist}%
-      \global\let\@midlist\@empty
-      \@combinefloats
-    }%
+     \def\@makecol at appendblocks {%
+        \@outputbox at appendfootnotes
+        \@outputbox at append{\vfill}%
+        \@outputbox at attachfloats
+     }
+%---------------------------------------------------------
+  \else
+%    \end{macrocode}
+%    Then the other way around:
+%    \begin{macrocode}
+     \def\@makecol at appendblocks {%
+        \@outputbox at attachfloats
+        \@outputbox at append{\vfill}%
+        \@outputbox at appendfootnotes
+     }
+%---------------------------------------------------------
   \fi
+\or
+%---------------------------------------------------------
+% 3 = space below footnotes and floats
+%---------------------------------------------------------
 %    \end{macrocode}
-%
-% Finally, create the new definition from the resulting object with
-% the remainder of the original \cs{@makecol} tagged on at the end.
+%    If the excess spaces goes on the bottom we don't append
+%    \cs{vfill} there. Instead we make use of the fact that
+%    \cs{raggedbottom} already puts a stretchable space there, and if
+%    we are in a \cs{flushbottom} scenario then any excess space is
+%    supposed to be distributed across the whole page.
 %    \begin{macrocode}
-  \toks@\expandafter{\the\toks@  
-    \ifvbox\@kludgeins
-      \@makespecialcolbox
-    \else
-      \setbox\@outputbox \vbox to\@colht{%
-        \@texttop \dimen@\dp\@outputbox
-        \unvbox\@outputbox
-        \vskip -\dimen@\@textbottom
-      }%
-    \fi
-    \global\maxdepth\@maxdepth
-  }
-  \edef\@makecol{\the\toks@}
+  \ifFN at abovefloats
+%---------------------------------------------------------
+    \def\@makecol at appendblocks {%
+       \@outputbox at appendfootnotes
+       \@outputbox at attachfloats
 %    \end{macrocode}
-%
-% All of the above occurred conditionally on the `or' of
-% \cs{ifFN at para} and \cs{ifFN at bottom}, so we now close the
-% conditional.
+%    We do, however, reinsert the bottom skip from \cs{newpage} if it
+%    was taken out earlier. This is, strictly speaking, not necessary
+%    in most cases, but it is a \cs{vfil} while \cs{raggedbottom} is
+%    only generating \verb=\vspace{0pt plus .0001fil}=, so if you have
+%    several \cs{vfil} on the page before the \cs{newpage} you would
+%    alter the space distribution if one is taken out.
 %    \begin{macrocode}
+       \@outputbox at reinsertbskip
+    }
+  \else
+%---------------------------------------------------------
+%    \end{macrocode}
+%    Same thing but with blocks swapped.
+%    \begin{macrocode}
+    \def\@makecol at appendblocks {%
+       \@outputbox at attachfloats
+       \@outputbox at appendfootnotes
+       \@outputbox at reinsertbskip
+}
+%---------------------------------------------------------
+  \fi
+\else
+%---------------------------------------------------------
+% 3 > undefined
+%---------------------------------------------------------
+%    \end{macrocode}
+%    The \cs{ERROR} here and above should never execute, like ``This
+%    can't happen'' in the \TeX{} program code. If they execute then code
+%    is badly broken.
+%    \begin{macrocode}
+\ERROR
 \fi
+
 %    \end{macrocode}
 %
 %
 % \subsection{The requirements of \cs{@footnotetext}}
 %
+% Instead of (re)defining \cs{@footnotetext} we define
+% \cs{FN at footnotetext} and at the end we check what we do with it,
+% depending on whether or not \texttt{hyperref} was loaded.
+%
 % \begin{macro}{\ifFN at baselinestretch}
 % \begin{macro}{\FN at singlespace}
 % Whatever we do, we are going to patch \cs{@footnotetext}; so first
@@ -1119,7 +1520,7 @@
 % footnotes:
 %    \begin{macrocode}
 \ifFN at para
-  \renewcommand\@footnotetext[1]{%
+  \long\def\FN at footnotetext#1{%
     \insert\footins{%
 %    \end{macrocode}
 % insert compatibility code with |setspace.sty| if necessary
@@ -1139,10 +1540,10 @@
 %    \end{macrocode}
 %
 % We set the paragraph in an \cs{hbox} and apply the fudge factor
-% here:
+% here (these days done with e\TeX{} methods):
 %
 %    \begin{macrocode}
-        \setbox\FN at tempboxa=\hbox{%
+        \setbox\FN at tempboxa\hbox{%
 %    \end{macrocode}
 %
 % This needs a parameter; the rule should be moved to the beginning of
@@ -1161,13 +1562,9 @@
             \hskip\footglue
           }% end of \@makefntext parameter
         }% end of \hbox
-        \dp\FN at tempboxa=0pt
-        \ifFN at etex
-          \ht\FN at tempboxa=\dimexpr\wd\FN at tempboxa *
-                          \footnotebaselineskip / \columnwidth\relax
-        \else
-          \ht\FN at tempboxa=\fudgefactor\wd\FN at tempboxa
-        \fi
+        \dp\FN at tempboxa\z@
+        \ht\FN at tempboxa\dimexpr\wd\FN at tempboxa *%
+                        \footnotebaselineskip / \columnwidth\relax
         \box\FN at tempboxa
       \color at endgroup
     }%
@@ -1182,7 +1579,7 @@
 %    \begin{macrocode}
 \else
   \ifFN at sidefn
-    \renewcommand\@footnotetext[1]{%
+    \long\def\FN at footnotetext#1{%
       \marginpar{%
 %    \end{macrocode}
 % insert compatibility code with |setspace.sty| if necessary
@@ -1203,7 +1600,7 @@
       \FN at mf@prepare
     }%
   \else
-    \renewcommand\@footnotetext[1]{%
+    \long\def\FN at footnotetext#1{%
       \insert\footins{%
 %    \end{macrocode}
 % insert compatibility code with \textsf{setspace} if necessary
@@ -1235,6 +1632,9 @@
 %    \end{macrocode}
 %
 %
+%
+%
+%
 % \subsection{Support code for paragraph footnotes}
 %
 % This code used (most inefficiently) to be in the argument of the
@@ -1302,29 +1702,17 @@
 %    \end{macrocode}
 % \end{macro}
 %
-% \begin{macro}{\fudgefactor}
-% Now we derive a fudge factor from the baselineskip we've just
-% established (we use \cs{dimexpr} if we're in etex, so there's no need
-% for the fudge factor in that case).
-%    \begin{macrocode}
-  \ifFN at etex
-  \else
-    \@tempdima=\footnotebaselineskip \multiply\@tempdima by 1024
-    \divide \@tempdima by \columnwidth \multiply\@tempdima by 64
-    \xdef\fudgefactor{\strip at pt\@tempdima }%
-  \fi
-%    \end{macrocode}
-% \end{macro}
 %
-% \begin{macro}{\makefootnoteparagraph}
+ 
+% \begin{macro}{\FN at makefootnoteparagraph}
 % For use in the output routine
 %    \begin{macrocode}
-  \long\def\makefootnoteparagraph{\unvbox\footins \makehboxofhboxes
-    \setbox\FN at tempboxa=\hbox{\unhbox\FN at tempboxa \removehboxes}
+  \long\def\FN at makefootnoteparagraph{\unvbox\footins \FN at makehboxofhboxes
+    \setbox\FN at tempboxa=\hbox{\unhbox\FN at tempboxa \FN at removehboxes}%
 %    \end{macrocode}
 % Now we are ready to set the paragraph:
 %    \begin{macrocode}
-    \hsize\columnwidth
+    \FN at setfootnoteparawidth
     \@parboxrestore
     \baselineskip=\footnotebaselineskip
     \noindent
@@ -1334,11 +1722,11 @@
 %    \end{macrocode}
 % \end{macro}
 %
-% \begin{macro}{\makehboxofhboxes}
-% \begin{macro}{\removehboxes}
-% Support code for \cs{makefootnoteparagraph}
+% \begin{macro}{\FN at makehboxofhboxes}
+% \begin{macro}{\FN at removehboxes}
+% Support code for \cs{FN at makefootnoteparagraph}
 %    \begin{macrocode}
-  \def\makehboxofhboxes{\setbox\FN at tempboxa=\hbox{}%
+  \def\FN at makehboxofhboxes{\setbox\FN at tempboxa=\hbox{}%
     \loop
       \setbox\FN at tempboxb=\lastbox
       \ifhbox\FN at tempboxb
@@ -1345,9 +1733,9 @@
       \setbox\FN at tempboxa=\hbox{\box\FN at tempboxb\unhbox\FN at tempboxa}%
     \repeat
   }
-  \def\removehboxes{\setbox\FN at tempboxa=\lastbox
+  \def\FN at removehboxes{\setbox\FN at tempboxa=\lastbox
     \ifhbox
-      \FN at tempboxa{\removehboxes}%
+      \FN at tempboxa{\FN at removehboxes}%
       \unhbox\FN at tempboxa
     \fi
   }
@@ -1357,363 +1745,42 @@
 % \end{macro}
 %
 %
-% \subsection{The other footnote commands}\label{sec:perpage-code}
 %
-% \begin{macro}{\ifFN at pp@footnotehint}
-% A conditional needed by the perpage code: must be defined outside
-% the \textsl{perpage} conditional
-%    \begin{macrocode}
-\newif\ifFN at pp@footnotehint
-%    \end{macrocode}
-% \end{macro}
 %
-% \begin{macro}{\c at pp@next at reset}
-% Counter used to store information about the next reset of the
-% footnote number, in perpage mode.
-%    \begin{macrocode}
-\newcounter{pp at next@reset}%
-%    \end{macrocode}
-% \end{macro}
 %
-% \begin{macro}{\ifFN at pp@towrite}
-% A conditional that mediates the interaction between the
-% \texttt{perpage} option and the \texttt{multiple} option.
-%    \begin{macrocode}
-\newif\ifFN at pp@towrite
-\FN at pp@towritefalse
-%    \end{macrocode}
-% \end{macro}
+%  \begin{macro}{\FN at setfootnoteparawidth}
+%    What we have to use as the width for the footnote paragraph
+%   depends on whether or not we typeset in several columns. If single
+%   column or normal two-column is used then the right value is
+%   \cs{columnwidth}. However, inside a \texttt{multicols} environment
+%   we need to use \cs{textwidth} as the footnotes there will span
+%   across all columns.
 %
-% \begin{macro}{\ifFN at pp@lastseq}
-% We prevent endless processions of diagnostics `footnote sequence
-% lost' by using this conditional (again, needs to be defined outside
-% the \textsl{perpage} conditional:
+%   To detect if we are inside such an environment we look at
+%   \cs{doublecolnumber} which is only positive if inside such an
+%   environment.
 %    \begin{macrocode}
-%<*PPdebug>
-\newif\ifFN at pp@lastseq
-\global\FN at pp@lastseqfalse
-%</PPdebug>
+\@ifpackageloaded{multicol}
+  {\def\FN at setfootnoteparawidth
+    {\hsize\ifnum\doublecol at number>\@ne
+                  \textwidth
+            \else \columnwidth \fi}}
+  {\def\FN at setfootnoteparawidth{\hsize\columnwidth}}
 %    \end{macrocode}
 % \end{macro}
 %
-% Now, do we need to patch \cs{footnote} for per-page footnotes?
-%    \begin{macrocode}
-\ifFN at perpage
-  \CheckCommand*\footnote{\@ifnextchar [%]
-    \@xfootnote
-    {%
-      \stepcounter\@mpfn \protected at xdef\@thefnmark{\thempfn}%
-      \@footnotemark \@footnotetext
-    }%
-  }
-  \renewcommand*\footnote{\@ifnextchar [%]
-    \@xfootnote
-    {%
-      \stepcounter\@mpfn \protected at xdef\@thefnmark{\thempfn}%
-      \FN at pp@footnote\@footnotemark
-%    \end{macrocode}
 %
-% In case that we're \emph{not} running \texttt{multiple} option,
-% \cs{@footnotemark} \emph{won't} have written details to the |.aux|
-% file, so do it now:
-%    \begin{macrocode}
-      \ifFN at pp@towrite
-        \FN at pp@writetemp
-        \FN at pp@towritefalse
-      \fi
-      \@footnotetext
-    }%
-  }
-%    \end{macrocode}
 %
-% And the analagous change for \cs{footnotemark}
-%    \begin{macrocode}
-  \CheckCommand*\footnotemark{%
-    \@ifnextchar [%]
-    \@xfootnotemark
-    {%
-      \stepcounter{footnote}%
-      \protected at xdef\@thefnmark{\thefootnote}%
-      \@footnotemark
-    }%
-  }
-  \renewcommand*\footnotemark{%
-    \@ifnextchar [%]
-    \@xfootnotemark
-    {%
-      \stepcounter{footnote}%
-      \protected at xdef\@thefnmark{\thefootnote}%
-      \FN at pp@footnote\@footnotemark
-%    \end{macrocode}
 %
-% again, tidy up if we're not doing \texttt{multiple} option
-%    \begin{macrocode}
-      \ifFN at pp@towrite
-        \FN at pp@writetemp
-        \FN at pp@towritefalse
-      \fi
-    }%
-  }
-%    \end{macrocode}
 %
-% \begin{macro}{\FN at pp@initialstab}
-% Now the supporting commands\dots
+% \subsection{The other footnote commands}\label{sec:perpage-code}
 %
-% if we encounter no information in the |.aux| file, we make a first
-% stab resetting footnote on the page number counter
-%    \begin{macrocode}
-  \gdef\FN at pp@initial at stab{\@addtoreset{footnote}{page}}
-  \AtBeginDocument{\FN at pp@initial at stab}
-%    \end{macrocode}
-% \end{macro}
 %
-% We use a counter to keep pace with the footnotes: this counter is
-% used in the data that's written to the |.aux| file, and matched to
-% create the correct footnote numbers on the second and subsequent
-% passes.
+%   We delegate the perpage option to a different package \ldots
 %    \begin{macrocode}
-  \newcounter{@fnserial}
-%    \end{macrocode}
-%
-% \begin{macro}{\FN at pp@cpage}
-% The package requires a ``knowledge'' of the current page number.
-% It's kept in \cs{FN at pp@cpage}
-%    \begin{macrocode}
-  \def\FN at pp@cpage{0}
-%    \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\footnotehint}
-% However, the progress of page numbers isn't predictable, so we have
-% a flag saying `reset footnote number'.  The flag is for indirect use
-% by people who diddle with the page number, via the \cs{footnotehint}
-% command, as well as various places where we \emph{know} there could
-% be a discontinuity.
-%    \begin{macrocode}
-  \FN at pp@footnotehinttrue
-  \newcommand{\footnotehint}{%
-    \setcounter{footnote}{0}%
-    \protected at writeaux\relax{\protect\FN at pp@footnotehinttrue}%
-    \@tempcnta\c@@fnserial
-    \advance\@tempcnta\@ne
-    \global\c at pp@next at reset\@tempcnta
-  }
-  \AtBeginDocument{\protected at writeaux\relax{%
-      \protect\providecommand{\protect\FN at pp@footnotehinttrue}{}%
-    }%
-  }
-%    \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\FN at pp@lastfoot}
-% Dummy value for the number of the last footnote we came across.
-%    \begin{macrocode}
-\def\FN at pp@lastfoot{-1}
-%    \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\FN at pp@footnote at aux}
-% The command \cs{FN at pp@footnote at aux} is written to the |.aux| file
-% for every footnote counter allocated (other than in minipages):\\
-% |#1| is the footnote serial number\\
-% |#2| is the page the footnote was actually written on
-%    \begin{macrocode}
-  \newcommand{\FN at pp@footnote at aux}[2]{%
-    \ifnum\FN at pp@lastfoot<#1
-      \ifFN at pp@footnotehint
-        \FN at pp@resetfn{#1}{#2}%
-        \FN at pp@footnotehintfalse
-      \else
-        \gdef\@tempa{#2}%
-        \ifx\@tempa\FN at pp@cpage
-        \else
-          \FN at pp@resetfn{#1}{#2}%
-        \fi
-      \fi
-      \def\FN at pp@lastfoot{#1}%
-%<*PPdebug>
-    \else
-      \ifFN at pp@debug
-        \typeout{not considering footnote serial number #1
-          (last valid was \FN at pp@lastfoot)}%
-      \fi
-%</PPdebug>
-    \fi
-%    \end{macrocode}
-%
-% Since we've now had at least one item of footnote information from
-% a |.aux| file, we can't allow footnote resetting per page.
-%    \begin{macrocode}
-    \global\let\FN at pp@initial at stab\relax
-  }
-%    \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\FN at pp@resetfn}
-% Set the flag to reset the footnote number; this constructs a chain
-% through the footnote serial numbers at the start of each page
-%    \begin{macrocode}
-  \newcommand{\FN at pp@resetfn}[2]{%
-    \gdef\FN at pp@cpage{#2}%
-    \expandafter\gdef
-      \csname FN at pp@next-\FN at pp@prev at foot\endcsname{#1}%
-    \def\FN at pp@prev at foot{#1}%
-    \expandafter\xdef
-      \csname FN at pp@next-\FN at pp@prev at foot\endcsname{\the\@MM}%
-  }
-%    \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\FN at pp@prev at foot}
-% The base of the footnote serial number chain (this element is never
-% looked at: footnote serial 1 must always have number 1)
-%    \begin{macrocode}
-  \newcommand{\FN at pp@prev at foot}{root}
-%    \end{macrocode}
-% \end{macro}
-%
-% again, avoid confusion; also establish \cs{FN at pp@footnote at aux} in the
-% |.aux| file
-%    \begin{macrocode}
-  \AtBeginDocument{\protected at writeaux\relax{%
-      \protect\providecommand{\protect\FN at pp@footnote at aux}[2]{}}%
-    \c at pp@next at reset\@ne
-  }
-%    \end{macrocode}
-%
-% At end document, establish a new \cs{FN at pp@footnote at aux} which 
-% checks whether numbers have changed during the scan of the |.aux|
-% files for changed labels and the like
-%    \begin{macrocode}
-  \AtEndDocument{\let\FN at pp@footnote at aux\FN at pp@footnote at endaux
-    \def\FN at pp@lastfoot{-1}%
-    \FN at pp@footnotehintfalse
-    \renewcommand{\FN at pp@prev at foot}{root}
-  }
-%    \end{macrocode}
-%
-% \begin{macro}{\FN at pp@footnote at endaux}
-% The footnote analysis command for end document
-%    \begin{macrocode}
-  \newcommand{\FN at pp@footnote at endaux}[2]{%
-    \ifnum\FN at pp@lastfoot<#1
-      \ifFN at pp@footnotehint
-        \FN at pp@resetfn at end{#1}{#2}%
-        \FN at pp@footnotehintfalse
-      \else
-        \gdef\@tempa{#2}%
-        \ifx\@tempa\FN at pp@cpage
-        \else
-          \FN at pp@resetfn at end{#1}{#2}%
-        \fi
-      \fi
-      \def\FN at pp@lastfoot{#1}%
-%<*PPdebug>
-    \else
-      \ifFN at pp@debug
-        \typeout{not considering footnote serial number #1
-          (last valid was \FN at pp@lastfoot)}%
-      \fi
-%</PPdebug>
-    \fi
-  }
-%    \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\FN at pp@resetfn at end}
-% Deal with the \verb'.aux' file footnote details, at end document
-%    \begin{macrocode}
-  \newcommand{\FN at pp@resetfn at end}[2]{%
-    \def\@tempa{#1}%
-    \expandafter\ifx\csname FN at pp@next-\FN at pp@prev at foot\endcsname\@tempa%
-    \else
-      \@tempswatrue
-%<*PPdebug>
-      \ifFN at pp@debug
-        \expandafter\ifx\csname FN at pp@next-\FN at pp@prev at foot\endcsname\relax
-          \ifFN at pp@lastseq\else
-            \typeout{footnote sequence lost between pages
-              \FN at pp@cpage\space and #2}%
-            \global\FN at pp@lastseqtrue
-          \fi
-        \else
-          \typeout{footnotes changed between pages \FN at pp@cpage\space and #2:
-            next was \csname FN at pp@next-\FN at pp@prev at foot\endcsname, now #1}%
-          \global\FN at pp@lastseqfalse
-        \fi
-      \fi
-%</PPdebug>
-    \fi
-    \gdef\FN at pp@prev at foot{#1}%
-    \gdef\FN at pp@cpage{#2}%
-  }
-%    \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\clearpage}
-% \begin{macro}{\FN at pp@@clearpage}
-% Now, how do we cope with \cs{include}d documents?  We can't insert
-% anything (the |includex| package offers \cs{AtBeginIncludedDocument}
-% but there's no corresponding command for files included by the
-% kernel \cs{include}.  So we insert a footnote hint at every
-% \cs{clearpage}
-%    \begin{macrocode}
-\let\FN at pp@@clearpage\clearpage
-\renewcommand{\clearpage}{\footnotehint\FN at pp@@clearpage}
-%    \end{macrocode}
-% \end{macro}
-% \end{macro}
-%
-% \begin{macro}{\FN at pp@footnote}
-% The business end of the option: a macro to decide on footnote
-% numbers, called from \cs{footnote} and \cs{footnotemark} (see
-% above).
-%    \begin{macrocode}
-\def\FN at pp@footnote{%
-  \if at minipage\else
-    \global\advance\c@@fnserial\@ne
-    \if at filesw
-%    \end{macrocode}
-%
-% In case we're also doing \texttt{multiple} option, we now save up
-% the command to write to the |.aux| file, and mark we've done so
-%    \begin{macrocode}
-      \xdef\FN at pp@writetemp{%
-        \noexpand\protected at writeaux\relax{%
-          \string\FN at pp@footnote at aux
-            {\the\c@@fnserial}{\noexpand\thepage}%
-        }%
-      }%
-      \FN at pp@towritetrue
-    \fi
-    \ifnum\c at pp@next at reset>\c@@fnserial
-    \else
-      \global\expandafter\csname c@\@mpfn\endcsname\@ne
-      \protected at xdef\@thefnmark{\thempfn}%
-%    \end{macrocode}
-%
-% Now look at the next element in the chain:
-%    \begin{macrocode}
-      \expandafter\let\expandafter\@tempa
-        \csname FN at pp@next-\number\c at pp@next at reset\endcsname
-%    \end{macrocode}
-%
-% If the chain is broken here, set the next reset point to something
-% (one hopes) infeasibly large\dots{} a weak point?
-%    \begin{macrocode}
-      \ifx\@tempa\relax
-        \global\c at pp@next at reset\@MM
-      \else
-        \global\c at pp@next at reset\@tempa
-      \fi
-    \fi
-  \fi
-}
-%    \end{macrocode}
-% \end{macro}
-%
-% End of code loaded when \texttt{perpage} option is given
-%    \begin{macrocode}
+\ifFN at perpage
+  \RequirePackage{perpage}
+  \MakePerPage{footnote}
 \fi
 %    \end{macrocode}
 %
@@ -1808,13 +1875,13 @@
 %
 % \begin{macro}{\multiplefootnotemarker}
 % \begin{macro}{\multfootsep}
-% \begin{macro}{\@footnotemark}
+% \begin{macro}{\FN at footnotemark}
 % \begin{macro}{\FN at mf@prepare}
 % \begin{macro}{\FN at mf@check}
 % This (revised) code derives from a suggestion by Alexander Rozhenko
 % (the author of the \textit{manyfoot} package): the intention is that
 % \textit{footmisc} and \textit{manyfoot} should be able to
-% `interwork', in the sense that each would recognise the other's
+% `interwork', in the sense that each would recognize the other's
 % footnote marks and behave appropriately.  The trick is that
 % both \cs{footnote}  and \cs{footnotemark} insert a marker (a
 % cancelling pair of kerns of \cs{multiplefootnotemarker} (of opposite
@@ -1826,15 +1893,18 @@
 \ifFN at multiplefootnote
   \providecommand*{\multiplefootnotemarker}{3sp}
   \providecommand*{\multfootsep}{,}
-  \CheckCommand*\@footnotemark{%
+%
+% FMi: not checking, more harm than gain  
+%  \CheckCommand*\@footnotemark{%
+%    \leavevmode
+%    \ifhmode\edef\@x at sf{\the\spacefactor}\nobreak\fi
+%    \@makefnmark
+%    \ifhmode\spacefactor\@x at sf\fi
+%    \relax
+%  }
+%
+  \newcommand*\FN at footnotemark{%
     \leavevmode
-    \ifhmode\edef\@x at sf{\the\spacefactor}\nobreak\fi
-    \@makefnmark
-    \ifhmode\spacefactor\@x at sf\fi
-    \relax
-  }
-  \renewcommand*\@footnotemark{%
-    \leavevmode
     \ifhmode
       \edef\@x at sf{\the\spacefactor}%
       \FN at mf@check
@@ -1841,16 +1911,6 @@
       \nobreak
     \fi
     \@makefnmark
-%    \end{macrocode}
-%
-% if we're also doing option \texttt{perpage}, write its stuff to the
-% |.aux| file for it, so the \emph{wotsit} node doesn't interfere with
-% our \cs{kern} detection.
-%    \begin{macrocode}
-    \ifFN at pp@towrite
-      \FN at pp@writetemp
-      \FN at pp@towritefalse
-    \fi
     \FN at mf@prepare
     \ifhmode\spacefactor\@x at sf\fi
     \relax
@@ -1873,6 +1933,10 @@
 %    \begin{macrocode}
 \else
   \let\FN at mf@prepare\relax
+%    \end{macrocode}
+%    Need to provide a definition for \cs{FN at footnotemark} in that case.
+%    \begin{macrocode}
+  \let\FN at footnotemark\@footnotemark
 \fi
 %    \end{macrocode}
 % \end{macro}
@@ -1946,10 +2010,10 @@
 % \end{macro}
 % \end{macro}
 %
+% \section{Symbol option variants}
+%
 % \begin{macro}{\setfnsymbol}
 % \begin{macro}{\FN at fnsymbol@lamport}
-% \section{Symbol option variants}
-%
 % Lamport's choice of symbols for \cs{fnsymbol} wasn't entirely
 % ``traditional'', so we (now) provide alternatives.  The
 % \cs{setfnsymbol} command offers a small number of choices, and the
@@ -2021,26 +2085,18 @@
 % Note that doubled-up (and worse\,---\,see below) symbols need braces
 % around them.
 %    \begin{macrocode}
-\newcommand{\DefineFNsymbols}{%
-        \@ifstar{\@tempswbtrue\@DefineFNsymbols}%
-                {\@tempswbfalse\@DefineFNsymbols}%
-}
-\newcommand{\@DefineFNsymbols}[1]{%
-  \@ifnextchar[% ]
-    {\@DefineFNsymbols@{#1}}{\@DefineFNsymbols@{#1}[text]}%
-}
-\def\@DefineFNsymbols@#1[#2]#3{%
-  \expandafter\ifx\csname FN at fnsymbol@#1\endcsname\relax
-    \PackageInfo{footmisc}{Declaring symbol style #1}%
+\DeclareDocumentCommand\DefineFNsymbols {smO{text}m}{%
+  \expandafter\ifx\csname FN at fnsymbol@#2\endcsname\relax
+    \PackageInfo{footmisc}{Declaring symbol style #2}%
   \else
-    \PackageWarning{footmisc}{Redeclaring symbol style #1}%
+    \PackageWarning{footmisc}{Redeclaring symbol style #2}%
   \fi
   \toks@{}%
   \def\@tempb{\end}%
-  \FN at build@symboldef#3\end
+  \FN at build@symboldef#4\end
   \def\@tempc{math}%
-  \def\@tempd{#2}%
-  \expandafter\xdef\csname FN at fnsymbol@#1\endcsname##1{%
+  \def\@tempd{#3}%
+  \expandafter\xdef\csname FN at fnsymbol@#2\endcsname##1{%
     \ifx\@tempc\@tempd
       \noexpand\ensuremath
     \else
@@ -2050,15 +2106,15 @@
       \noexpand\ifcase##1%
       \the\toks@
       \noexpand\else
-      \if at tempswb
-        \noexpand\@ctrerr
-      \else
-        \noexpand\@arabic##1\noexpand\FN at orange##1%
-      \fi
+      \IfBooleanTF#1{\noexpand\@ctrerr}%
+        {\noexpand\FN at orange##1}%
       \noexpand\fi
     }%
   }%
 }
+%    \end{macrocode}
+%
+%    \begin{macrocode}
 \def\FN at build@symboldef#1{%
   \def\@tempa{#1}%
   \ifx\@tempa\@tempb
@@ -2080,30 +2136,24 @@
 % Now do the same job for the ``modern'' way of having both text and
 % maths variants of everything.
 %    \begin{macrocode}
-\newcommand{\DefineFNsymbolsTM}{%
-        \@ifstar{\@tempswbtrue\@DefineFNsymbolsTM}%
-                {\@tempswbfalse\@DefineFNsymbolsTM}}%
-\newcommand{\@DefineFNsymbolsTM}[2]{%
-  \expandafter\ifx\csname FN at fnsymbol@#1\endcsname\relax
-    \PackageInfo{footmisc}{Declaring symbol style #1}%
+\DeclareDocumentCommand\DefineFNsymbolsTM {smm}{%
+  \expandafter\ifx\csname FN at fnsymbol@#2\endcsname\relax
+    \PackageInfo{footmisc}{Declaring symbol style #2}%
   \else
-    \PackageWarning{footmisc}{Redeclaring symbol style #1}%
+    \PackageWarning{footmisc}{Redeclaring symbol style #2}%
   \fi
   \toks@{}%
   \def\@tempb{\end}%
-  \FN at build@symboldefTM#2\end\@null
-  \expandafter\xdef\csname FN at fnsymbol@#1\endcsname##1{%
+  \FN at build@symboldefTM#3\end\@null
+  \expandafter\xdef\csname FN at fnsymbol@#2\endcsname##1{%
     \noexpand\ifcase##1%
       \the\toks@
     \noexpand\else
-      \if at tempswb
-        \noexpand\@ctrerr
-      \else
-        \noexpand\@arabic##1\noexpand\FN at orange##1%
-      \fi
-    \noexpand\fi
+      \IfBooleanTF#1{\noexpand\@ctrerr}%
+        {\noexpand\FN at orange##1}%
+      \noexpand\fi
   }%
-}%
+}
 %    \end{macrocode}
 % Note that this version has two variants of every definition, so
 % needs two stopper codes above.
@@ -2121,29 +2171,6 @@
 % \end{macro}
 % \end{macro}
 %
-% \begin{macro}{\TextOrMath}
-% This is a stripped down (e-\TeX{} only) version of what appears in
-% fixltx2e.  If the command's already defined, we assume it's that
-% version.
-%    \begin{macrocode}
-\@ifundefined{TextOrMath}{%
-  \@ifundefined{eTeXversion}{%
-    \PackageError{footmisc}{Can't define commands for footnote symbol}%
-                           {Use e-LaTeX, or load package fixltx2e before 
-                             footmisc}%
-  }{%
-    \protected\expandafter\def\csname TextOrMath\space\endcsname{%
-      \ifmmode \expandafter\@secondoftwo
-      \else    \expandafter\@firstoftwo   \fi
-    }
-    \edef\TextOrMath#1#2{%
-      \expandafter\noexpand\csname TextOrMath\space\endcsname
-	{#1}{#2}%
-    }%
-  }%
-}{}
-%    \end{macrocode}
-% \end{macro}
 %
 % \begin{macro}{\FN at orange}
 % \begin{macro}{\@fnsymbol at orange}
@@ -2152,10 +2179,13 @@
 % they're allowed to\,--\,e.g., in the \texttt{symbol*} option).
 %    \begin{macrocode}
 \def\FN at orange#1{%
-  \@bsphack
-  \PackageInfo{footmisc}{Footnote number \number#1 out of range}%
-  \protect\@fnsymbol at orange
-  \@esphack
+  \ifFN at robust
+    \@arabic#1%
+    \@bsphack
+    \PackageInfo{footmisc}{Footnote number \number#1 out of range}%
+    \protect\@fnsymbol at orange
+    \@esphack
+  \else \@ctrerr \fi
 }
 \global\let\@diagnose at fnsymbol@orange\relax
 \AtEndDocument{\@diagnose at fnsymbol@orange}
@@ -2173,18 +2203,6 @@
 % \end{macro}
 % \end{macro}
 %
-% \begin{macro}{\textbardbl}
-% This is defined in recent \LaTeX{} releases, but not in (for
-% example) that distributed with the last release of te\TeX{}.  Since
-% it's needed in some symbol set definitions (including Lamport's) we
-% define it here.
-%    \begin{macrocode}
-\@ifundefined{textbardbl}{%
-  \DeclareTextSymbol{\textbardbl}{OMS}{107}%
-  \DeclareTextSymbolDefault{\textbardbl}{TS1}}{}%
-%    \end{macrocode}
-% (This definition comes from the \LaTeX{} sources.)
-% \end{macro}
 %
 % \begin{macro}{\FN at fnsymbol@bringhurst}
 % \begin{macro}{\FN at fnsymbol@chicago}
@@ -2195,8 +2213,8 @@
 % footnote symbols, plus a robust version of the original Lamport set,
 % and an extended version of Lamport's original
 %    \begin{macrocode}
-\DefineFNsymbolsTM*{bringhurst}{%
-  \textasteriskcentered *
+\DefineFNsymbolsTM{bringhurst}{%
+  \textasteriskcentered *%
   \textdagger    \dagger
   \textdaggerdbl \ddagger
   \textsection   \mathsection
@@ -2203,8 +2221,8 @@
   \textbardbl    \|%
   \textparagraph \mathparagraph
 }%
-\DefineFNsymbolsTM*{chicago}{%
-  \textasteriskcentered *
+\DefineFNsymbolsTM{chicago}{%
+  \textasteriskcentered *%
   \textdagger    \dagger
   \textdaggerdbl \ddagger
   \textsection   \mathsection
@@ -2211,8 +2229,8 @@
   \textbardbl    \|%
   \#\#%
 }%
-\DefineFNsymbolsTM*{wiley}{
-  \textasteriskcentered *
+\DefineFNsymbolsTM{wiley}{%
+  \textasteriskcentered *%
   {\textasteriskcentered\textasteriskcentered}{**}%
   \textdagger    \dagger
   \textdaggerdbl \ddagger
@@ -2220,8 +2238,8 @@
   \textparagraph \mathparagraph
   \textbardbl    \|%
 }%
-\DefineFNsymbolsTM{lamport-robust}{
-  \textasteriskcentered *
+\DefineFNsymbolsTM{lamport-robust}{%
+  \textasteriskcentered *%
   \textdagger    \dagger
   \textdaggerdbl \ddagger
   \textsection   \mathsection
@@ -2232,7 +2250,7 @@
   {\textdaggerdbl\textdaggerdbl}{\ddagger\ddagger}%
 }
 \DefineFNsymbolsTM*{lamport*}{%
-  \textasteriskcentered *
+  \textasteriskcentered *%
   \textdagger    \dagger
   \textdaggerdbl \ddagger
   \textsection   \mathsection
@@ -2253,7 +2271,7 @@
 }
 \setfnsymbol{lamport*}
 \DefineFNsymbolsTM{lamport*-robust}{%
-  \textasteriskcentered *
+  \textasteriskcentered *%
   \textdagger    \dagger
   \textdaggerdbl \ddagger
   \textsection   \mathsection
@@ -2281,30 +2299,7 @@
 %
 % \section{Other miscellaneous commands}
 %
-% \subsection{Footnote references}
 %
-% \begin{macro}{\footref}
-% Syntax: \cs{footref}\marg{label-name}
-%
-% One often wishes to refer to a footnote; in some circumstances,
-% \cs{footnotemark} just isn't good enough (for example, inside a
-% |minipage|, when \cs{footnotemark} creates a reference to footnotes
-% outside the minipage).
-%
-% \cs{footref} addresses this problem by making a label reference that
-% actually looks like a \cs{footnotemark}.  (The command is available
-% in the |memoir| class, and we therefore \cs{providecommand} it
-% rather than defining it ``outright''.)
-%    \begin{macrocode}
-\providecommand*{\footref}[1]{%
-  \begingroup
-    \unrestored at protected@xdef\@thefnmark{\ref{#1}}%
-  \endgroup
-  \@footnotemark
-}
-%    \end{macrocode}
-% \end{macro}
-%
 % \subsection{Minipage \cs{footnotemark}s}
 %
 % \begin{macro}{\mpfootnotemark}
@@ -2333,7 +2328,27 @@
 %    \end{macrocode}
 % \end{macro}
 %
+%
+%   If \textsf{hyperref} was loaded first, it has saved
+%   \cs{@footnotetext} and \cs{@footnotemark} away and then redefined
+%   them. The saved versions are now wrong, so we reassign them.
 %    \begin{macrocode}
+\@ifpackageloaded{hyperref}{%
+  \let\H@@footnotetext\FN at footnotetext
+  \let\H@@footnotemark\FN at footnotemark
+}{%
+%    \end{macrocode}
+%   If \textsf{hyperref} wasn't loaded we copy our new definitions to
+%   \cs{@footnotetext} and \cs{@footnotemark} for actual use. If
+%   \textsf{hyperref} is loaded later it will do its magic and save
+%   our definitions.
+%    \begin{macrocode}
+  \let \@footnotetext \FN at footnotetext
+  \let\@footnotemark  \FN at footnotemark
+}
+%    \end{macrocode}
+%
+%    \begin{macrocode}
 \endinput
 %</package>
 %    \end{macrocode}
@@ -2340,19 +2355,3 @@
 %
 % \Finale
 %
-%
-%% \CharacterTable
-%%  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
-%%   Lower-case    \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
-%%   Digits        \0\1\2\3\4\5\6\7\8\9
-%%   Exclamation   \!     Double quote  \"     Hash (number) \#
-%%   Dollar        \$     Percent       \%     Ampersand     \&
-%%   Acute accent  \'     Left paren    \(     Right paren   \)
-%%   Asterisk      \*     Plus          \+     Comma         \,
-%%   Minus         \-     Point         \.     Solidus       \/
-%%   Colon         \:     Semicolon     \;     Less than     \<
-%%   Equals        \=     Greater than  \>     Question mark \?
-%%   Commercial at \@     Left bracket  \[     Backslash     \\
-%%   Right bracket \]     Circumflex    \^     Underscore    \_
-%%   Grave accent  \`     Left brace    \{     Vertical bar  \|
-%%   Right brace   \}     Tilde         \~}

Modified: trunk/Master/texmf-dist/source/latex/footmisc/footmisc.ins
===================================================================
--- trunk/Master/texmf-dist/source/latex/footmisc/footmisc.ins	2022-02-11 07:44:03 UTC (rev 61978)
+++ trunk/Master/texmf-dist/source/latex/footmisc/footmisc.ins	2022-02-11 21:53:45 UTC (rev 61979)
@@ -1,45 +1,70 @@
-\input docstrip.tex
+%%
+%% This file will generate fast loadable files and documentation
+%% driver files from the dtx file(s) in this package when run through
+%% LaTeX or TeX.
+%%
+%% Copyright (c) 1995-2011 Robin Fairbairns
+%% Copyright (c) 2018-2022 Robin Fairbairns, Frank Mittelbach
+%% 
+%% 
+%% This file is part of the footmisc Bundle for LaTeX.
+%% -------------------------------------------------------
+%% 
+%% It 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.
+%% 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 2008 or later.
+%% 
+%% In particular, NO PERMISSION is granted to modify the contents of this
+%% file since it contains the legal notices that are placed in the files
+%% it generates.
+%% 
+%% 
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+\input l3docstrip
 
+\keepsilent
+
+\usedir{tex/latex/contrib/footmisc}
+
 \preamble
-----------------------------------------------------------------------
-The footmisc package -- variations of footnote typesetting
-Copyright (c) 2008 Robin Fairbairns
 
-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. The latest version of this license is in:
-http://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.
+This is a generated file.
 
-This work has the LPPL maintenance status `author-maintained'.
+Copyright (c) 1995-2011 Robin Fairbairns
+Copyright (c) 2018-2022 Robin Fairbairns, Frank Mittelbach
 
-This work consists of the files footmisc.dtx, footmisc.ins, and README
-and the derived files footmisc.sty and footmisc.pdf.
------------------------------------------------------------------------
+This file was generated from file(s) of the LaTeX `footmisc Bundle'.
+--------------------------------------------------------------------
 
+It 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.
+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 2008 or later.
+
+This work has the LPPL maintenance status 'maintained'.
+
+This file may only be distributed together with a copy of the LaTeX
+`footmisc Bundle'. You may however distribute the `footmisc Bundle'
+without such generated files.
+
+The newest sources can be found below
+
+   https://github.com/FrankMittelbach/fmitex-footmisc/
+
+where one can also log issues in case there are any.
+
 \endpreamble
 
-\def\batchfile{footmisc.ins}
-\keepsilent
-\Msg{*** Generating the footmisc package ***}
-\askforoverwritefalse
-\generate{%
-  \file{footmisc.sty}{\from{footmisc.dtx}{package}}%
-}
 
+\generate{\file{footmisc.sty}{\from{footmisc.dtx}{package}}}
 
-\ifToplevel{
-\Msg{***********************************************************}
-\Msg{*}
-\Msg{* To finish the installation you have to move the file}
-\Msg{* footmisc.sty into a directory searched by TeX}
-\Msg{*}
-\Msg{* Usual TDS location:}
-\Msg{* \space\space tex/latex/footmisc}
-\Msg{*}
-\Msg{* Happy TeXing}
-\Msg{*}
-\Msg{***********************************************************}
-}
-
 \endbatchfile

Added: trunk/Master/texmf-dist/tex/latex/footmisc/footmisc-2011-06-06.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/footmisc/footmisc-2011-06-06.sty	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/footmisc/footmisc-2011-06-06.sty	2022-02-11 21:53:45 UTC (rev 61979)
@@ -0,0 +1,949 @@
+%%
+%% This is file `footmisc.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% footmisc.dtx  (with options: `package')
+%% ----------------------------------------------------------------------
+%% The footmisc package -- variations of footnote typesetting
+%% Copyright (c) 2008 Robin Fairbairns
+%% 
+%% 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. The latest version of this license is in:
+%% http://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.
+%% 
+%% This work has the LPPL maintenance status `author-maintained'.
+%% 
+%% This work consists of the files footmisc.dtx, footmisc.ins, and README
+%% and the derived files footmisc.sty and footmisc.pdf.
+%% -----------------------------------------------------------------------
+%% 
+%% This is footmisc.dtx, and it's -*-LaTeX-*- text
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{footmisc}%
+        [2011/06/06 v5.5b
+     a miscellany of footnote facilities%
+                   ]% $Id: footmisc.dtx,v 4.25 2011/06/06 14:25:44 rf10 Exp rf10 $
+\NeedsTeXFormat{LaTeX2e}[1994/12/01]
+\newtoks\FN at temptoken
+\providecommand\protected at writeaux{%
+  \protected at write\@auxout
+}%    \end{macrocode}
+\def\l at advance@macro{\@@dvance at macro\edef}
+\def\@@dvance at macro#1#2#3{\expandafter\@tempcnta#2\relax
+  \advance\@tempcnta#3\relax
+  #1#2{\the\@tempcnta}%
+}
+\let\@advance at macro\l at advance@macro
+\newif\ifFN at etex
+\ifx\dimexpr\undefined
+  \FN at etexfalse
+\else
+  \FN at etextrue
+\fi
+\newdimen\footnotemargin
+\footnotemargin1.8em\relax
+\DeclareOption{symbol}{\renewcommand\thefootnote{\fnsymbol{footnote}}}
+\DeclareOption{symbol*}{%
+  \renewcommand\thefootnote{\@fnsymbol\c at footnote}%
+  \AtEndOfPackage{\setfnsymbol{lamport*-robust}}%
+}
+\newif\ifFN at para  \FN at parafalse
+\DeclareOption{para}{\ifFN at sidefn
+    \PackageError{footmisc}{Option "\CurrentOption" incompatible with
+      option "side"}%
+      {I shall ignore "\CurrentOption"}%
+  \else
+    \FN at paratrue
+  \fi
+}
+\newif\ifFN at sidefn  \FN at sidefnfalse
+\DeclareOption{side}{\ifFN at para
+    \PackageError{footmisc}{Option "\CurrentOption" incompatible with
+      option "para"}%
+      {I shall ignore "\CurrentOption"}%
+  \else
+    \FN at sidefntrue
+  \fi
+}
+\let\footnotelayout\@empty
+\DeclareOption{ragged}{%
+  \@ifundefined{RaggedRight}%
+    {\renewcommand\footnotelayout{\linepenalty50 \raggedright}}%
+    {\renewcommand\footnotelayout{\linepenalty50 \RaggedRight}}%
+}
+\newif\ifFN at perpage
+\FN at perpagefalse
+\DeclareOption{perpage}{%
+  \FN at perpagetrue
+}
+\newif\ifFN at bottom  \FN at bottomfalse
+\DeclareOption{bottom}{%
+  \FN at bottomtrue
+}
+\DeclareOption{marginal}{%
+  \footnotemargin-0.8em\relax
+}
+\DeclareOption{flushmargin}{%
+  \footnotemargin0pt\relax
+}
+\newif\ifFN at hangfoot  \FN at hangfootfalse
+\DeclareOption{hang}{%
+  \FN at hangfoottrue
+}
+\newcommand*\hangfootparskip{0.5\baselineskip}
+\newcommand*\hangfootparindent{0em}%
+\DeclareOption{norule}{%
+  \renewcommand\footnoterule{}%
+  \advance\skip\footins 4\p@\@plus2\p@\relax
+}
+\DeclareOption{splitrule}{%
+  \gdef\split at prev{0}
+  \let\pagefootnoterule\footnoterule
+  \let\mpfootnoterule\footnoterule
+  \def\splitfootnoterule{\kern-3\p@ \hrule \kern2.6\p@}
+  \def\footnoterule{\relax
+    \ifx \@listdepth\@mplistdepth
+      \mpfootnoterule
+    \else
+      \ifnum\split at prev=\z@
+        \pagefootnoterule
+      \else
+        \splitfootnoterule
+      \fi
+      \xdef\split at prev{\the\insertpenalties}%
+    \fi
+  }%
+}
+\newif\ifFN at stablefootnote  \FN at stablefootnotefalse
+\DeclareOption{stable}{\FN at stablefootnotetrue}
+\newif\ifFN at multiplefootnote  \FN at multiplefootnotefalse
+\DeclareOption{multiple}{\FN at multiplefootnotetrue}
+\ProcessOptions
+\let  \if at tempswa  \ifFN at bottom
+\ifFN at para    \@tempswatrue \fi
+\if at tempswa
+  \@ifl at t@r\fmtversion{2005/12/01}{%
+    \CheckCommand*\@makecol{\ifvoid \footins
+        \setbox\@outputbox \box\@cclv
+      \else
+        \setbox\@outputbox \vbox{%
+          \boxmaxdepth \@maxdepth
+          \unvbox\@cclv
+          \vskip \skip\footins
+          \color at begingroup
+            \normalcolor\footnoterule
+            \unvbox\footins
+          \color at endgroup
+        }%
+      \fi
+      \let \@elt \relax
+      \xdef\@freelist{\@freelist\@midlist}%
+      \global\let\@midlist\@empty
+      \@combinefloats
+      \ifvbox\@kludgeins
+        \@makespecialcolbox
+      \else
+        \setbox\@outputbox \vbox to\@colht{%
+          \@texttop \dimen@\dp\@outputbox
+          \unvbox\@outputbox
+          \vskip -\dimen@\@textbottom
+        }%
+      \fi
+      \global\maxdepth\@maxdepth
+    }
+  }{%
+  \@ifl at t@r\fmtversion{2003/12/01}{%
+    \CheckCommand*\@makecol{\ifvoid \footins
+        \setbox\@outputbox \box\@cclv
+      \else
+        \setbox\@outputbox \vbox{%
+          \boxmaxdepth\@maxdepth
+          \@tempdima\dp\@cclv
+          \unvbox\@cclv
+          \vskip \skip\footins
+          \color at begingroup
+            \normalcolor
+            \footnoterule
+            \unvbox\footins
+          \color at endgroup
+        }%
+      \fi
+      \let \@elt \relax
+      \xdef\@freelist{\@freelist\@midlist}%
+      \global\let\@midlist\@empty
+      \@combinefloats
+      \ifvbox\@kludgeins
+        \@makespecialcolbox
+      \else
+        \setbox\@outputbox \vbox to\@colht{%
+          \@texttop
+          \dimen@\dp\@outputbox
+          \unvbox\@outputbox
+          \vskip -\dimen@
+          \@textbottom
+        }%
+      \fi
+      \global\maxdepth\@maxdepth
+    }%
+  }{%
+    \@ifl at t@r\fmtversion{1999/12/01}{%
+      \CheckCommand*\@makecol{\ifvoid \footins
+          \setbox\@outputbox \box\@cclv
+        \else
+          \setbox\@outputbox \vbox{%
+            \boxmaxdepth\@maxdepth
+            \@tempdima\dp\@cclv
+            \unvbox\@cclv
+            \vskip \skip\footins
+            \color at begingroup
+              \normalcolor\footnoterule
+              \unvbox\footins
+            \color at endgroup
+          }%
+        \fi
+        \xdef\@freelist{\@freelist\@midlist}%
+        \global\let\@midlist\@empty
+        \@combinefloats
+        \ifvbox\@kludgeins
+          \@makespecialcolbox
+        \else
+          \setbox\@outputbox \vbox to\@colht{%
+            \@texttop \dimen@\dp\@outputbox
+            \unvbox\@outputbox
+            \vskip -\dimen@\@textbottom
+          }%
+        \fi
+        \global\maxdepth\@maxdepth
+      }%
+    }%
+  }{%
+      \CheckCommand*\@makecol{\ifvoid \footins
+        \setbox\@outputbox \box\@cclv
+      \else
+        \setbox\@outputbox \vbox{%
+          \boxmaxdepth\@maxdepth
+          \unvbox\@cclv
+          \vskip \skip\footins
+          \color at begingroup
+            \normalcolor\footnoterule
+            \unvbox\footins
+          \color at endgroup
+        }%
+      \fi
+      \xdef\@freelist{\@freelist\@midlist}%
+      \global\let\@midlist\@empty
+      \@combinefloats
+      \ifvbox\@kludgeins
+        \@makespecialcolbox
+      \else
+        \setbox\@outputbox \vbox to\@colht{%
+          \@texttop \dimen@\dp\@outputbox
+          \unvbox\@outputbox
+          \vskip -\dimen@\@textbottom
+        }%
+      \fi
+      \global\maxdepth\@maxdepth
+    }%
+  }%
+}
+  \ifFN at para
+    \FN at temptoken{%
+      \toks@\expandafter{\the\toks@
+        \vskip\skip\footins
+        \color at begingroup
+          \normalcolor\footnoterule
+          \global\setbox\FN at tempboxc\vbox{\makefootnoteparagraph}%
+          \unvbox\FN at tempboxc
+        \color at endgroup
+      }%
+    }%
+  \else
+    \FN at temptoken{%
+      \toks@\expandafter{\the\toks@
+        \vskip\skip\footins
+        \color at begingroup
+          \normalcolor\footnoterule
+          \unvbox\footins
+        \color at endgroup
+      }%
+    }%
+  \fi
+  \ifFN at bottom
+    \toks@{\setbox\@outputbox \box\@cclv
+      \xdef\@freelist{\@freelist\@midlist}%
+      \global\let\@midlist\@empty
+      \@combinefloats
+      \ifvoid\footins
+      \else
+        \setbox\@outputbox \vbox\bgroup
+          \boxmaxdepth\@maxdepth
+          \unvbox\@outputbox
+          \vfill\relax
+    }
+    \the\FN at temptoken
+    \toks@\expandafter{\the\toks@\egroup\fi}
+  \else
+    \toks@{\ifvoid\footins
+        \setbox\@outputbox\box\@cclv
+      \else
+        \setbox\@outputbox \vbox\bgroup
+        \boxmaxdepth\@maxdepth
+        \unvbox\@cclv
+    }
+    \the\FN at temptoken
+    \toks@\expandafter{\the\toks@
+      \egroup
+      \fi
+      \xdef\@freelist{\@freelist\@midlist}%
+      \global\let\@midlist\@empty
+      \@combinefloats
+    }%
+  \fi
+  \toks@\expandafter{\the\toks@
+    \ifvbox\@kludgeins
+      \@makespecialcolbox
+    \else
+      \setbox\@outputbox \vbox to\@colht{%
+        \@texttop \dimen@\dp\@outputbox
+        \unvbox\@outputbox
+        \vskip -\dimen@\@textbottom
+      }%
+    \fi
+    \global\maxdepth\@maxdepth
+  }
+  \edef\@makecol{\the\toks@}
+\fi
+\newif\ifFN at setspace
+\@ifpackageloaded{setspace}{%
+  \FN at setspacetrue
+  \@ifclassloaded{memoir}{%
+    \let\FN at baselinestretch\m at m@singlespace
+  }{%
+    \let\FN at baselinestretch\setspace at singlespace
+  }%
+}{%
+  \FN at setspacefalse
+}
+\ifFN at para
+  \renewcommand\@footnotetext[1]{%
+    \insert\footins{%
+      \ifFN at setspace
+        \let\baselinestretch\FN at baselinestretch
+      \fi
+      \reset at font\footnotesize
+      \interlinepenalty\interfootnotelinepenalty
+      \splittopskip\footnotesep
+      \splitmaxdepth \dp\strutbox
+      \floatingpenalty\@MM
+      \hsize\columnwidth
+      \@parboxrestore
+      \protected at edef\@currentlabel{\csname p at footnote\endcsname\@thefnmark}%
+      \color at begingroup
+        \setbox\FN at tempboxa=\hbox{%
+          \@makefntext{\ignorespaces#1\strut
+            \penalty-10\relax
+            \hskip\footglue
+          }% end of \@makefntext parameter
+        }% end of \hbox
+        \dp\FN at tempboxa=0pt
+        \ifFN at etex
+          \ht\FN at tempboxa=\dimexpr\wd\FN at tempboxa *
+                          \footnotebaselineskip / \columnwidth\relax
+        \else
+          \ht\FN at tempboxa=\fudgefactor\wd\FN at tempboxa
+        \fi
+        \box\FN at tempboxa
+      \color at endgroup
+    }%
+    \FN at mf@prepare
+  }
+\else
+  \ifFN at sidefn
+    \renewcommand\@footnotetext[1]{%
+      \marginpar{%
+        \ifFN at setspace
+          \let\baselinestretch\FN at baselinestretch
+        \fi
+        \reset at font\footnotesize
+        \protected at edef\@currentlabel{%
+          \csname p at footnote\endcsname\@thefnmark
+        }%
+        \color at begingroup
+          \@makefntext{%
+            \ignorespaces#1%
+          }%
+        \color at endgroup
+      }%
+      \FN at mf@prepare
+    }%
+  \else
+    \renewcommand\@footnotetext[1]{%
+      \insert\footins{%
+        \ifFN at setspace
+          \let\baselinestretch\FN at baselinestretch
+        \fi
+        \reset at font\footnotesize
+        \interlinepenalty\interfootnotelinepenalty
+        \splittopskip\footnotesep
+        \splitmaxdepth \dp\strutbox
+        \floatingpenalty\@MM
+        \hsize\columnwidth
+        \@parboxrestore
+        \protected at edef\@currentlabel{%
+          \csname p at footnote\endcsname\@thefnmark
+        }%
+        \color at begingroup
+          \@makefntext{%
+            \rule\z@\footnotesep
+            \ignorespaces#1\@finalstrut\strutbox
+          }%
+        \color at endgroup
+      }%
+      \FN at mf@prepare
+    }%
+  \fi
+\fi
+\ifFN at para
+  \let\FN at tempboxa\@tempboxa
+  \newbox\FN at tempboxb
+  \newbox\FN at tempboxc
+  \newskip\footglue \footglue=1em plus.3em minus.3em
+  \long\def\@makefntext#1{\leavevmode
+    \@makefnmark\nobreak
+    \hskip.5em\relax#1%
+  }
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+  \newdimen\footnotebaselineskip
+  {%
+    \footnotesize
+    \global
+      \footnotebaselineskip=\normalbaselineskip
+  }
+  \ifFN at etex
+  \else
+    \@tempdima=\footnotebaselineskip \multiply\@tempdima by 1024
+    \divide \@tempdima by \columnwidth \multiply\@tempdima by 64
+    \xdef\fudgefactor{\strip at pt\@tempdima }%
+  \fi
+  \long\def\makefootnoteparagraph{\unvbox\footins \makehboxofhboxes
+    \setbox\FN at tempboxa=\hbox{\unhbox\FN at tempboxa \removehboxes}
+    \hsize\columnwidth
+    \@parboxrestore
+    \baselineskip=\footnotebaselineskip
+    \noindent
+    \rule{\z@}{\footnotesep}%
+    \unhbox\FN at tempboxa\par
+  }
+  \def\makehboxofhboxes{\setbox\FN at tempboxa=\hbox{}%
+    \loop
+      \setbox\FN at tempboxb=\lastbox
+      \ifhbox\FN at tempboxb
+      \setbox\FN at tempboxa=\hbox{\box\FN at tempboxb\unhbox\FN at tempboxa}%
+    \repeat
+  }
+  \def\removehboxes{\setbox\FN at tempboxa=\lastbox
+    \ifhbox
+      \FN at tempboxa{\removehboxes}%
+      \unhbox\FN at tempboxa
+    \fi
+  }
+\fi
+\newif\ifFN at pp@footnotehint
+\newcounter{pp at next@reset}%
+\newif\ifFN at pp@towrite
+\FN at pp@towritefalse
+\ifFN at perpage
+  \CheckCommand*\footnote{\@ifnextchar [%]
+    \@xfootnote
+    {%
+      \stepcounter\@mpfn \protected at xdef\@thefnmark{\thempfn}%
+      \@footnotemark \@footnotetext
+    }%
+  }
+  \renewcommand*\footnote{\@ifnextchar [%]
+    \@xfootnote
+    {%
+      \stepcounter\@mpfn \protected at xdef\@thefnmark{\thempfn}%
+      \FN at pp@footnote\@footnotemark
+      \ifFN at pp@towrite
+        \FN at pp@writetemp
+        \FN at pp@towritefalse
+      \fi
+      \@footnotetext
+    }%
+  }
+  \CheckCommand*\footnotemark{%
+    \@ifnextchar [%]
+    \@xfootnotemark
+    {%
+      \stepcounter{footnote}%
+      \protected at xdef\@thefnmark{\thefootnote}%
+      \@footnotemark
+    }%
+  }
+  \renewcommand*\footnotemark{%
+    \@ifnextchar [%]
+    \@xfootnotemark
+    {%
+      \stepcounter{footnote}%
+      \protected at xdef\@thefnmark{\thefootnote}%
+      \FN at pp@footnote\@footnotemark
+      \ifFN at pp@towrite
+        \FN at pp@writetemp
+        \FN at pp@towritefalse
+      \fi
+    }%
+  }
+  \gdef\FN at pp@initial at stab{\@addtoreset{footnote}{page}}
+  \AtBeginDocument{\FN at pp@initial at stab}
+  \newcounter{@fnserial}
+  \def\FN at pp@cpage{0}
+  \FN at pp@footnotehinttrue
+  \newcommand{\footnotehint}{%
+    \setcounter{footnote}{0}%
+    \protected at writeaux\relax{\protect\FN at pp@footnotehinttrue}%
+    \@tempcnta\c@@fnserial
+    \advance\@tempcnta\@ne
+    \global\c at pp@next at reset\@tempcnta
+  }
+  \AtBeginDocument{\protected at writeaux\relax{%
+      \protect\providecommand{\protect\FN at pp@footnotehinttrue}{}%
+    }%
+  }
+\def\FN at pp@lastfoot{-1}
+  \newcommand{\FN at pp@footnote at aux}[2]{%
+    \ifnum\FN at pp@lastfoot<#1
+      \ifFN at pp@footnotehint
+        \FN at pp@resetfn{#1}{#2}%
+        \FN at pp@footnotehintfalse
+      \else
+        \gdef\@tempa{#2}%
+        \ifx\@tempa\FN at pp@cpage
+        \else
+          \FN at pp@resetfn{#1}{#2}%
+        \fi
+      \fi
+      \def\FN at pp@lastfoot{#1}%
+    \fi
+    \global\let\FN at pp@initial at stab\relax
+  }
+  \newcommand{\FN at pp@resetfn}[2]{%
+    \gdef\FN at pp@cpage{#2}%
+    \expandafter\gdef
+      \csname FN at pp@next-\FN at pp@prev at foot\endcsname{#1}%
+    \def\FN at pp@prev at foot{#1}%
+    \expandafter\xdef
+      \csname FN at pp@next-\FN at pp@prev at foot\endcsname{\the\@MM}%
+  }
+  \newcommand{\FN at pp@prev at foot}{root}
+  \AtBeginDocument{\protected at writeaux\relax{%
+      \protect\providecommand{\protect\FN at pp@footnote at aux}[2]{}}%
+    \c at pp@next at reset\@ne
+  }
+  \AtEndDocument{\let\FN at pp@footnote at aux\FN at pp@footnote at endaux
+    \def\FN at pp@lastfoot{-1}%
+    \FN at pp@footnotehintfalse
+    \renewcommand{\FN at pp@prev at foot}{root}
+  }
+  \newcommand{\FN at pp@footnote at endaux}[2]{%
+    \ifnum\FN at pp@lastfoot<#1
+      \ifFN at pp@footnotehint
+        \FN at pp@resetfn at end{#1}{#2}%
+        \FN at pp@footnotehintfalse
+      \else
+        \gdef\@tempa{#2}%
+        \ifx\@tempa\FN at pp@cpage
+        \else
+          \FN at pp@resetfn at end{#1}{#2}%
+        \fi
+      \fi
+      \def\FN at pp@lastfoot{#1}%
+    \fi
+  }
+  \newcommand{\FN at pp@resetfn at end}[2]{%
+    \def\@tempa{#1}%
+    \expandafter\ifx\csname FN at pp@next-\FN at pp@prev at foot\endcsname\@tempa%
+    \else
+      \@tempswatrue
+    \fi
+    \gdef\FN at pp@prev at foot{#1}%
+    \gdef\FN at pp@cpage{#2}%
+  }
+\let\FN at pp@@clearpage\clearpage
+\renewcommand{\clearpage}{\footnotehint\FN at pp@@clearpage}
+\def\FN at pp@footnote{%
+  \if at minipage\else
+    \global\advance\c@@fnserial\@ne
+    \if at filesw
+      \xdef\FN at pp@writetemp{%
+        \noexpand\protected at writeaux\relax{%
+          \string\FN at pp@footnote at aux
+            {\the\c@@fnserial}{\noexpand\thepage}%
+        }%
+      }%
+      \FN at pp@towritetrue
+    \fi
+    \ifnum\c at pp@next at reset>\c@@fnserial
+    \else
+      \global\expandafter\csname c@\@mpfn\endcsname\@ne
+      \protected at xdef\@thefnmark{\thempfn}%
+      \expandafter\let\expandafter\@tempa
+        \csname FN at pp@next-\number\c at pp@next at reset\endcsname
+      \ifx\@tempa\relax
+        \global\c at pp@next at reset\@MM
+      \else
+        \global\c at pp@next at reset\@tempa
+      \fi
+    \fi
+  \fi
+}
+\fi
+\ifFN at para
+\else
+  \long\def\@makefntext#1{%
+    \ifFN at hangfoot
+      \bgroup
+      \setbox\@tempboxa\hbox{%
+        \ifdim\footnotemargin>0pt
+          \hb at xt@\footnotemargin{\@makefnmark\hss}%
+        \else
+          \@makefnmark
+        \fi
+      }%
+      \leftmargin\wd\@tempboxa
+      \rightmargin\z@
+      \linewidth \columnwidth
+      \advance \linewidth -\leftmargin
+      \parshape \@ne \leftmargin \linewidth
+      \footnotesize
+      \@setpar{{\@@par}}%
+      \leavevmode
+      \llap{\box\@tempboxa}%
+      \parskip\hangfootparskip\relax
+      \parindent\hangfootparindent\relax
+    \else
+      \parindent1em
+      \noindent
+      \ifdim\footnotemargin>\z@
+        \hb at xt@ \footnotemargin{\hss\@makefnmark}%
+      \else
+        \ifdim\footnotemargin=\z@
+          \llap{\@makefnmark}%
+        \else
+          \llap{\hb at xt@ -\footnotemargin{\@makefnmark\hss}}%
+        \fi
+      \fi
+    \fi
+    \footnotelayout#1%
+    \ifFN at hangfoot
+      \par\egroup
+    \fi
+  }
+\fi
+\ifFN at multiplefootnote
+  \providecommand*{\multiplefootnotemarker}{3sp}
+  \providecommand*{\multfootsep}{,}
+  \CheckCommand*\@footnotemark{%
+    \leavevmode
+    \ifhmode\edef\@x at sf{\the\spacefactor}\nobreak\fi
+    \@makefnmark
+    \ifhmode\spacefactor\@x at sf\fi
+    \relax
+  }
+  \renewcommand*\@footnotemark{%
+    \leavevmode
+    \ifhmode
+      \edef\@x at sf{\the\spacefactor}%
+      \FN at mf@check
+      \nobreak
+    \fi
+    \@makefnmark
+    \ifFN at pp@towrite
+      \FN at pp@writetemp
+      \FN at pp@towritefalse
+    \fi
+    \FN at mf@prepare
+    \ifhmode\spacefactor\@x at sf\fi
+    \relax
+  }
+  \def\FN at mf@prepare{%
+    \kern-\multiplefootnotemarker
+    \kern\multiplefootnotemarker\relax
+  }
+  \def\FN at mf@check{%
+    \ifdim\lastkern=\multiplefootnotemarker\relax
+      \edef\@x at sf{\the\spacefactor}%
+      \unkern
+      \textsuperscript{\multfootsep}%
+      \spacefactor\@x at sf\relax
+    \fi
+  }
+\else
+  \let\FN at mf@prepare\relax
+\fi
+\ifFN at stablefootnote
+\let\FN at sf@@footnote\footnote
+\def\footnote{\ifx\protect\@typeset at protect
+    \expandafter\FN at sf@@footnote
+  \else
+    \expandafter\FN at sf@gobble at opt
+  \fi
+}
+\edef\FN at sf@gobble at opt{\noexpand\protect
+  \expandafter\noexpand\csname FN at sf@gobble at opt \endcsname}
+\expandafter\def\csname FN at sf@gobble at opt \endcsname{%
+  \@ifnextchar[%]
+    \FN at sf@gobble at twobracket
+    \@gobble
+}
+\def\FN at sf@gobble at twobracket[#1]#2{}
+\let\FN at sf@@footnotemark\footnotemark
+\def\footnotemark{\ifx\protect\@typeset at protect
+    \expandafter\FN at sf@@footnotemark
+  \else
+    \expandafter\FN at sf@gobble at optonly
+  \fi
+}
+\edef\FN at sf@gobble at optonly{\noexpand\protect
+  \expandafter\noexpand\csname FN at sf@gobble at optonly \endcsname}
+\expandafter\def\csname FN at sf@gobble at optonly \endcsname{%
+  \@ifnextchar[%]
+    \FN at sf@gobble at bracket
+    {}%
+}
+\def\FN at sf@gobble at bracket[#1]{}
+\fi
+\newcommand\setfnsymbol[1]{%
+  \@bsphack
+  \@ifundefined{FN at fnsymbol@#1}%
+  {%
+    \PackageError{footmisc}{Symbol style "#1" not known}%
+    \@eha
+  }{%
+    \expandafter\let\expandafter\@fnsymbol\csname
+                        FN at fnsymbol@#1\endcsname
+  }%
+  \@esphack
+}
+\let\FN at fnsymbol@lamport\@fnsymbol
+\newif\if at tempswb
+\newcommand{\DefineFNsymbols}{%
+        \@ifstar{\@tempswbtrue\@DefineFNsymbols}%
+                {\@tempswbfalse\@DefineFNsymbols}%
+}
+\newcommand{\@DefineFNsymbols}[1]{%
+  \@ifnextchar[% ]
+    {\@DefineFNsymbols@{#1}}{\@DefineFNsymbols@{#1}[text]}%
+}
+\def\@DefineFNsymbols@#1[#2]#3{%
+  \expandafter\ifx\csname FN at fnsymbol@#1\endcsname\relax
+    \PackageInfo{footmisc}{Declaring symbol style #1}%
+  \else
+    \PackageWarning{footmisc}{Redeclaring symbol style #1}%
+  \fi
+  \toks@{}%
+  \def\@tempb{\end}%
+  \FN at build@symboldef#3\end
+  \def\@tempc{math}%
+  \def\@tempd{#2}%
+  \expandafter\xdef\csname FN at fnsymbol@#1\endcsname##1{%
+    \ifx\@tempc\@tempd
+      \noexpand\ensuremath
+    \else
+      \noexpand\nfss at text
+    \fi
+    {%
+      \noexpand\ifcase##1%
+      \the\toks@
+      \noexpand\else
+      \if at tempswb
+        \noexpand\@ctrerr
+      \else
+        \noexpand\@arabic##1\noexpand\FN at orange##1%
+      \fi
+      \noexpand\fi
+    }%
+  }%
+}
+\def\FN at build@symboldef#1{%
+  \def\@tempa{#1}%
+  \ifx\@tempa\@tempb
+  \else
+    \toks@\expandafter{\the\toks@\or#1}%
+    \expandafter\FN at build@symboldef
+  \fi
+}
+\newcommand{\DefineFNsymbolsTM}{%
+        \@ifstar{\@tempswbtrue\@DefineFNsymbolsTM}%
+                {\@tempswbfalse\@DefineFNsymbolsTM}}%
+\newcommand{\@DefineFNsymbolsTM}[2]{%
+  \expandafter\ifx\csname FN at fnsymbol@#1\endcsname\relax
+    \PackageInfo{footmisc}{Declaring symbol style #1}%
+  \else
+    \PackageWarning{footmisc}{Redeclaring symbol style #1}%
+  \fi
+  \toks@{}%
+  \def\@tempb{\end}%
+  \FN at build@symboldefTM#2\end\@null
+  \expandafter\xdef\csname FN at fnsymbol@#1\endcsname##1{%
+    \noexpand\ifcase##1%
+      \the\toks@
+    \noexpand\else
+      \if at tempswb
+        \noexpand\@ctrerr
+      \else
+        \noexpand\@arabic##1\noexpand\FN at orange##1%
+      \fi
+    \noexpand\fi
+  }%
+}%
+\def\FN at build@symboldefTM#1#2{%
+  \def\@tempa{#1}%
+  \ifx\@tempa\@tempb
+  \else
+    \toks@\expandafter{\the\toks@\or\TextOrMath{#1}{#2}}%
+    \expandafter\FN at build@symboldefTM
+  \fi
+}
+\@ifundefined{TextOrMath}{%
+  \@ifundefined{eTeXversion}{%
+    \PackageError{footmisc}{Can't define commands for footnote symbol}%
+                           {Use e-LaTeX, or load package fixltx2e before
+                             footmisc}%
+  }{%
+    \protected\expandafter\def\csname TextOrMath\space\endcsname{%
+      \ifmmode \expandafter\@secondoftwo
+      \else    \expandafter\@firstoftwo   \fi
+    }
+    \edef\TextOrMath#1#2{%
+      \expandafter\noexpand\csname TextOrMath\space\endcsname
+{#1}{#2}%
+    }%
+  }%
+}{}
+\def\FN at orange#1{%
+  \@bsphack
+  \PackageInfo{footmisc}{Footnote number \number#1 out of range}%
+  \protect\@fnsymbol at orange
+  \@esphack
+}
+\global\let\@diagnose at fnsymbol@orange\relax
+\AtEndDocument{\@diagnose at fnsymbol@orange}
+\def\@fnsymbol at orange{%
+  \gdef\@diagnose at fnsymbol@orange{%
+    \PackageWarningNoLine{footmisc}{Some footnote number(s)
+      were out of range
+      \MessageBreak
+      see log for details%
+    }%
+  }%
+}
+\@ifundefined{textbardbl}{%
+  \DeclareTextSymbol{\textbardbl}{OMS}{107}%
+  \DeclareTextSymbolDefault{\textbardbl}{TS1}}{}%
+\DefineFNsymbolsTM*{bringhurst}{%
+  \textasteriskcentered *
+  \textdagger    \dagger
+  \textdaggerdbl \ddagger
+  \textsection   \mathsection
+  \textbardbl    \|%
+  \textparagraph \mathparagraph
+}%
+\DefineFNsymbolsTM*{chicago}{%
+  \textasteriskcentered *
+  \textdagger    \dagger
+  \textdaggerdbl \ddagger
+  \textsection   \mathsection
+  \textbardbl    \|%
+  \#\#%
+}%
+\DefineFNsymbolsTM*{wiley}{
+  \textasteriskcentered *
+  {\textasteriskcentered\textasteriskcentered}{**}%
+  \textdagger    \dagger
+  \textdaggerdbl \ddagger
+  \textsection   \mathsection
+  \textparagraph \mathparagraph
+  \textbardbl    \|%
+}%
+\DefineFNsymbolsTM{lamport-robust}{
+  \textasteriskcentered *
+  \textdagger    \dagger
+  \textdaggerdbl \ddagger
+  \textsection   \mathsection
+  \textparagraph \mathparagraph
+  \textbardbl    \|%
+  {\textasteriskcentered\textasteriskcentered}{**}%
+  {\textdagger\textdagger}{\dagger\dagger}%
+  {\textdaggerdbl\textdaggerdbl}{\ddagger\ddagger}%
+}
+\DefineFNsymbolsTM*{lamport*}{%
+  \textasteriskcentered *
+  \textdagger    \dagger
+  \textdaggerdbl \ddagger
+  \textsection   \mathsection
+  \textparagraph \mathparagraph
+  \textbardbl    \|%
+  {\textasteriskcentered\textasteriskcentered}{**}%
+  {\textdagger\textdagger}{\dagger\dagger}%
+  {\textdaggerdbl\textdaggerdbl}{\ddagger\ddagger}%
+  {\textsection\textsection}{\mathsection\mathsection}%
+  {\textparagraph\textparagraph}{\mathparagraph\mathparagraph}%
+  {\textasteriskcentered\textasteriskcentered\textasteriskcentered}{***}%
+  {\textdagger\textdagger\textdagger}{\dagger\dagger\dagger}%
+  {\textdaggerdbl\textdaggerdbl\textdaggerdbl}{\ddagger\ddagger\ddagger}%
+  {\textsection\textsection\textsection}%%
+    {\mathsection\mathsection\mathsection}%
+  {\textparagraph\textparagraph\textparagraph}%%
+    {\mathparagraph\mathparagraph\mathparagraph}%
+}
+\setfnsymbol{lamport*}
+\DefineFNsymbolsTM{lamport*-robust}{%
+  \textasteriskcentered *
+  \textdagger    \dagger
+  \textdaggerdbl \ddagger
+  \textsection   \mathsection
+  \textparagraph \mathparagraph
+  \textbardbl    \|%
+  {\textasteriskcentered\textasteriskcentered}{**}%
+  {\textdagger\textdagger}{\dagger\dagger}%
+  {\textdaggerdbl\textdaggerdbl}{\ddagger\ddagger}%
+  {\textsection\textsection}{\mathsection\mathsection}%
+  {\textparagraph\textparagraph}{\mathparagraph\mathparagraph}%
+  {\textasteriskcentered\textasteriskcentered\textasteriskcentered}{***}%
+  {\textdagger\textdagger\textdagger}{\dagger\dagger\dagger}%
+  {\textdaggerdbl\textdaggerdbl\textdaggerdbl}{\ddagger\ddagger\ddagger}%
+  {\textsection\textsection\textsection}%%
+    {\mathsection\mathsection\mathsection}%
+  {\textparagraph\textparagraph\textparagraph}%%
+    {\mathparagraph\mathparagraph\mathparagraph}%
+}
+\providecommand*{\footref}[1]{%
+  \begingroup
+    \unrestored at protected@xdef\@thefnmark{\ref{#1}}%
+  \endgroup
+  \@footnotemark
+}
+\newcommand\mpfootnotemark{%
+  \@ifnextchar[%
+    \@xmpfootnotemark
+    {%
+      \stepcounter\@mpfn
+      \protected at xdef\@thefnmark{\thempfn}%
+      \@footnotemark
+    }%
+}
+\def\@xmpfootnotemark[#1]{%
+  \begingroup
+    \csname c@\@mpfn\endcsname #1\relax
+    \unrestored at protected@xdef\@thefnmark{\thempfn}%
+  \endgroup
+  \@footnotemark
+}
+\endinput
+%%
+%% End of file `footmisc.sty'.


Property changes on: trunk/Master/texmf-dist/tex/latex/footmisc/footmisc-2011-06-06.sty
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/tex/latex/footmisc/footmisc.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/footmisc/footmisc.sty	2022-02-11 07:44:03 UTC (rev 61978)
+++ trunk/Master/texmf-dist/tex/latex/footmisc/footmisc.sty	2022-02-11 21:53:45 UTC (rev 61979)
@@ -5,33 +5,52 @@
 %% The original source files were:
 %%
 %% footmisc.dtx  (with options: `package')
-%% ----------------------------------------------------------------------
-%% The footmisc package -- variations of footnote typesetting
-%% Copyright (c) 2008 Robin Fairbairns
 %% 
-%% 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. The latest version of this license is in:
-%% http://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.
+%% This is a generated file.
 %% 
-%% This work has the LPPL maintenance status `author-maintained'.
+%% Copyright (c) 1995-2011 Robin Fairbairns
+%% Copyright (c) 2018-2022 Robin Fairbairns, Frank Mittelbach
 %% 
-%% This work consists of the files footmisc.dtx, footmisc.ins, and README
-%% and the derived files footmisc.sty and footmisc.pdf.
-%% -----------------------------------------------------------------------
+%% This file was generated from file(s) of the LaTeX `footmisc Bundle'.
+%% --------------------------------------------------------------------
 %% 
-%% This is footmisc.dtx, and it's -*-LaTeX-*- text
+%% It 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.
+%% 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 2008 or later.
+%% 
+%% This work has the LPPL maintenance status 'maintained'.
+%% 
+%% This file may only be distributed together with a copy of the LaTeX
+%% `footmisc Bundle'. You may however distribute the `footmisc Bundle'
+%% without such generated files.
+%% 
+%% The newest sources can be found below
+%% 
+%%    https://github.com/FrankMittelbach/fmitex-footmisc/
+%% 
+%% where one can also log issues in case there are any.
+%% 
+%% File: footmisc.dtx (C) Copyright 1995-2011 Robin Fairbairns
+%%                    (C) Copyright 2018-2022 Frank Mittelbach
 \NeedsTeXFormat{LaTeX2e}
+\providecommand\DeclareRelease[3]{}
+\providecommand\DeclareCurrentRelease[2]{}
+
+\DeclareRelease{v5}{2011-06-06}{footmisc-2011-06-06.sty}
+\DeclareCurrentRelease{}{2022-02-10}
 \ProvidesPackage{footmisc}%
-        [2011/06/06 v5.5b
+        [2022/02/10 v6.0a
      a miscellany of footnote facilities%
-                   ]% $Id: footmisc.dtx,v 4.25 2011/06/06 14:25:44 rf10 Exp rf10 $
-\NeedsTeXFormat{LaTeX2e}[1994/12/01]
+                   ]
+\NeedsTeXFormat{LaTeX2e}[2020/10/01]
 \newtoks\FN at temptoken
 \providecommand\protected at writeaux{%
   \protected at write\@auxout
-}%    \end{macrocode}
+}
 \def\l at advance@macro{\@@dvance at macro\edef}
 \def\@@dvance at macro#1#2#3{\expandafter\@tempcnta#2\relax
   \advance\@tempcnta#3\relax
@@ -38,17 +57,13 @@
   #1#2{\the\@tempcnta}%
 }
 \let\@advance at macro\l at advance@macro
-\newif\ifFN at etex
-\ifx\dimexpr\undefined
-  \FN at etexfalse
-\else
-  \FN at etextrue
-\fi
 \newdimen\footnotemargin
 \footnotemargin1.8em\relax
 \DeclareOption{symbol}{\renewcommand\thefootnote{\fnsymbol{footnote}}}
+\newif\ifFN at robust \FN at robustfalse
 \DeclareOption{symbol*}{%
   \renewcommand\thefootnote{\@fnsymbol\c at footnote}%
+  \FN at robusttrue
   \AtEndOfPackage{\setfnsymbol{lamport*-robust}}%
 }
 \newif\ifFN at para  \FN at parafalse
@@ -80,10 +95,24 @@
 \DeclareOption{perpage}{%
   \FN at perpagetrue
 }
-\newif\ifFN at bottom  \FN at bottomfalse
+\newif\ifFN at fixskip      \FN at fixskipfalse
+\let\FN at ORspacehandling\thr@@
 \DeclareOption{bottom}{%
-  \FN at bottomtrue
+  \let\FN at ORspacehandling\@ne
+  \FN at abovefloatsfalse
+  \FN at fixskiptrue
 }
+\newif\ifFN at abovefloats  \FN at abovefloatstrue
+\DeclareOption{abovefloats}{\FN at abovefloatstrue  \FN at fixskiptrue}
+\DeclareOption{belowfloats}{\FN at abovefloatsfalse \FN at fixskiptrue}
+\DeclareOption{bottomfloats}{%
+  \let\FN at ORspacehandling\tw@
+  \FN at abovefloatstrue \FN at fixskiptrue
+}
+\DeclareOption{bottomfootnotes}{%
+  \let\FN at ORspacehandling\tw@
+  \FN at abovefloatsfalse \FN at fixskiptrue
+}
 \DeclareOption{marginal}{%
   \footnotemargin-0.8em\relax
 }
@@ -123,200 +152,165 @@
 \newif\ifFN at multiplefootnote  \FN at multiplefootnotefalse
 \DeclareOption{multiple}{\FN at multiplefootnotetrue}
 \ProcessOptions
-\let  \if at tempswa  \ifFN at bottom
-\ifFN at para    \@tempswatrue \fi
-\if at tempswa
-  \@ifl at t@r\fmtversion{2005/12/01}{%
-    \CheckCommand*\@makecol{\ifvoid \footins
-        \setbox\@outputbox \box\@cclv
-      \else
-        \setbox\@outputbox \vbox{%
-          \boxmaxdepth \@maxdepth
-          \unvbox\@cclv
-          \vskip \skip\footins
-          \color at begingroup
-            \normalcolor\footnoterule
-            \unvbox\footins
-          \color at endgroup
-        }%
-      \fi
-      \let \@elt \relax
-      \xdef\@freelist{\@freelist\@midlist}%
-      \global\let\@midlist\@empty
-      \@combinefloats
-      \ifvbox\@kludgeins
-        \@makespecialcolbox
-      \else
-        \setbox\@outputbox \vbox to\@colht{%
-          \@texttop \dimen@\dp\@outputbox
-          \unvbox\@outputbox
-          \vskip -\dimen@\@textbottom
-        }%
-      \fi
-      \global\maxdepth\@maxdepth
-    }
-  }{%
-  \@ifl at t@r\fmtversion{2003/12/01}{%
-    \CheckCommand*\@makecol{\ifvoid \footins
-        \setbox\@outputbox \box\@cclv
-      \else
-        \setbox\@outputbox \vbox{%
-          \boxmaxdepth\@maxdepth
-          \@tempdima\dp\@cclv
-          \unvbox\@cclv
-          \vskip \skip\footins
-          \color at begingroup
-            \normalcolor
-            \footnoterule
-            \unvbox\footins
-          \color at endgroup
-        }%
-      \fi
-      \let \@elt \relax
-      \xdef\@freelist{\@freelist\@midlist}%
-      \global\let\@midlist\@empty
-      \@combinefloats
-      \ifvbox\@kludgeins
-        \@makespecialcolbox
-      \else
-        \setbox\@outputbox \vbox to\@colht{%
-          \@texttop
-          \dimen@\dp\@outputbox
-          \unvbox\@outputbox
-          \vskip -\dimen@
-          \@textbottom
-        }%
-      \fi
-      \global\maxdepth\@maxdepth
-    }%
-  }{%
-    \@ifl at t@r\fmtversion{1999/12/01}{%
-      \CheckCommand*\@makecol{\ifvoid \footins
-          \setbox\@outputbox \box\@cclv
+\def \@makecol {%
+  \@kernel at before@cclv
+  \setbox\@outputbox \box\@cclv
+  \@outputbox at removebskip
+  \let\@elt\relax
+  \xdef\@freelist{\@freelist\@midlist}%
+  \global \let \@midlist \@empty
+  \@makecol at appendblocks
+  \ifvbox\@kludgeins
+     \@makespecialcolbox
+  \else
+     \@makenormalcolbox
+  \fi
+  \global \maxdepth \@maxdepth
+}
+\newdimen\@outputbox at depth
+\def \@makenormalcolbox {%
+   \setbox\@outputbox \vbox to\@colht {%
+       \@texttop
+       \@outputbox at depth \dp\@outputbox
+       \unvbox \@outputbox
+       \vskip -\@outputbox at depth
+       \@textbottom
+      }%
+}
+\def \@makespecialcolbox {%
+   \@outputbox at append {\vskip-\@outputbox at depth}%
+   \@tempdima \@colht
+   \ifdim \wd\@kludgeins>\z@
+     \advance \@tempdima -\ht\@outputbox
+     \advance \@tempdima \pageshrink
+     \setbox\@outputbox \vbox to \@colht {%
+       \unvbox\@outputbox
+       \vskip \@tempdima
+       \@textbottom
+       }%
+   \else
+     \advance \@tempdima -\ht\@kludgeins
+     \setbox \@outputbox \vbox to \@colht {%
+       \vbox to \@tempdima {%
+         \unvbox\@outputbox
+         \@textbottom}%
+       \vss}%
+   \fi
+   {\setbox \@tempboxa \box \@kludgeins}%
+}
+\ifFN at fixskip
+  \def\@outputbox at removebskip{%
+    \ifx\@textbottom\relax \else
+      \@outputbox at append{%
+        \@tempskipa\lastskip
+        \ifnum \gluestretchorder\@tempskipa>\z@
+          \vskip-\@tempskipa
+          \xdef\@outputbox at reinsertbskip
+              {\noexpand\@outputbox at append{\vskip\the\@tempskipa}}%
         \else
-          \setbox\@outputbox \vbox{%
-            \boxmaxdepth\@maxdepth
-            \@tempdima\dp\@cclv
-            \unvbox\@cclv
-            \vskip \skip\footins
-            \color at begingroup
-              \normalcolor\footnoterule
-              \unvbox\footins
-            \color at endgroup
-          }%
+          \global\let\@outputbox at reinsertbskip\relax
         \fi
-        \xdef\@freelist{\@freelist\@midlist}%
-        \global\let\@midlist\@empty
-        \@combinefloats
-        \ifvbox\@kludgeins
-          \@makespecialcolbox
-        \else
-          \setbox\@outputbox \vbox to\@colht{%
-            \@texttop \dimen@\dp\@outputbox
-            \unvbox\@outputbox
-            \vskip -\dimen@\@textbottom
-          }%
-        \fi
-        \global\maxdepth\@maxdepth
       }%
-    }%
-  }{%
-      \CheckCommand*\@makecol{\ifvoid \footins
-        \setbox\@outputbox \box\@cclv
-      \else
-        \setbox\@outputbox \vbox{%
-          \boxmaxdepth\@maxdepth
-          \unvbox\@cclv
-          \vskip \skip\footins
-          \color at begingroup
-            \normalcolor\footnoterule
-            \unvbox\footins
-          \color at endgroup
-        }%
-      \fi
-      \xdef\@freelist{\@freelist\@midlist}%
-      \global\let\@midlist\@empty
-      \@combinefloats
-      \ifvbox\@kludgeins
-        \@makespecialcolbox
-      \else
-        \setbox\@outputbox \vbox to\@colht{%
-          \@texttop \dimen@\dp\@outputbox
-          \unvbox\@outputbox
-          \vskip -\dimen@\@textbottom
-        }%
-      \fi
-      \global\maxdepth\@maxdepth
-    }%
-  }%
+   \fi
+  }
+\let\@outputbox at reinsertbskip\relax
+\else
+  \let\@outputbox at removebskip \relax
+  \let\@outputbox at reinsertbskip\relax
+\fi
+\providecommand\@kernel at before@cclv{}
+\providecommand\@kernel at before@footins{}
+\def\@outputbox at append #1{%
+     \setbox\@outputbox \vbox {%
+       \boxmaxdepth \@maxdepth
+       \@outputbox at depth\dp\@outputbox      % if needed in #1
+       \unvbox \@outputbox
+       #1%
+     }%
 }
-  \ifFN at para
-    \FN at temptoken{%
-      \toks@\expandafter{\the\toks@
-        \vskip\skip\footins
-        \color at begingroup
-          \normalcolor\footnoterule
-          \global\setbox\FN at tempboxc\vbox{\makefootnoteparagraph}%
-          \unvbox\FN at tempboxc
-        \color at endgroup
+\def\@outputbox at appendfootnotes {%
+   \ifvoid\footins \else
+     \@makecol at handlesplitfootnotes
+     \@makecol at preparefootinshook
+     \@outputbox at append{%
+       \vskip \skip\footins
+       \@kernel at before@footins
+       \color at begingroup
+         \normalcolor
+         \footnoterule
+         \csname pdfcolfoot at current\endcsname
+         \unvbox \footins
+       \color at endgroup
       }%
-    }%
-  \else
-    \FN at temptoken{%
-      \toks@\expandafter{\the\toks@
-        \vskip\skip\footins
-        \color at begingroup
-          \normalcolor\footnoterule
-          \unvbox\footins
-        \color at endgroup
-      }%
-    }%
   \fi
-  \ifFN at bottom
-    \toks@{\setbox\@outputbox \box\@cclv
-      \xdef\@freelist{\@freelist\@midlist}%
-      \global\let\@midlist\@empty
-      \@combinefloats
-      \ifvoid\footins
-      \else
-        \setbox\@outputbox \vbox\bgroup
-          \boxmaxdepth\@maxdepth
-          \unvbox\@outputbox
-          \vfill\relax
+}
+\let \@outputbox at attachfloats \@combinefloats
+\def \@outputbox at attachtopfloats {%
+  \ifx \@toplist\@empty \else \@cflt \fi
+}
+\def \@outputbox at attachbottomfloats {%
+    \ifx \@botlist\@empty \else \@cflb \fi
+}
+\def\@makecol at handlesplitfootnotes {%
+  \ifnum\insertpenalties>\z@
+    \@makecol at splitfootnotemessagehook
+  \fi
+}
+\let \@makecol at splitfootnotemessagehook \@empty
+\let \@makecol at preparefootinshook \@empty
+\ifFN at para
+  \def\@makecol at preparefootinshook {%
+     \global\setbox\footins\vbox{\FN at makefootnoteparagraph}%
     }
-    \the\FN at temptoken
-    \toks@\expandafter{\the\toks@\egroup\fi}
+\fi
+\ifcase \FN at ORspacehandling\relax
+\ERROR
+\or
+  \ifFN at abovefloats
+    \def\@makecol at appendblocks {%
+       \@outputbox at append{\vfill}%
+       \@outputbox at appendfootnotes
+       \@outputbox at attachfloats
+      }
   \else
-    \toks@{\ifvoid\footins
-        \setbox\@outputbox\box\@cclv
-      \else
-        \setbox\@outputbox \vbox\bgroup
-        \boxmaxdepth\@maxdepth
-        \unvbox\@cclv
+    \def\@makecol at appendblocks {%
+       \@outputbox at append{\vfill}%
+       \@outputbox at attachfloats
+       \@outputbox at appendfootnotes
     }
-    \the\FN at temptoken
-    \toks@\expandafter{\the\toks@
-      \egroup
-      \fi
-      \xdef\@freelist{\@freelist\@midlist}%
-      \global\let\@midlist\@empty
-      \@combinefloats
-    }%
   \fi
-  \toks@\expandafter{\the\toks@
-    \ifvbox\@kludgeins
-      \@makespecialcolbox
-    \else
-      \setbox\@outputbox \vbox to\@colht{%
-        \@texttop \dimen@\dp\@outputbox
-        \unvbox\@outputbox
-        \vskip -\dimen@\@textbottom
-      }%
-    \fi
-    \global\maxdepth\@maxdepth
-  }
-  \edef\@makecol{\the\toks@}
+\or
+  \ifFN at abovefloats
+     \def\@makecol at appendblocks {%
+        \@outputbox at appendfootnotes
+        \@outputbox at append{\vfill}%
+        \@outputbox at attachfloats
+     }
+  \else
+     \def\@makecol at appendblocks {%
+        \@outputbox at attachfloats
+        \@outputbox at append{\vfill}%
+        \@outputbox at appendfootnotes
+     }
+  \fi
+\or
+  \ifFN at abovefloats
+    \def\@makecol at appendblocks {%
+       \@outputbox at appendfootnotes
+       \@outputbox at attachfloats
+       \@outputbox at reinsertbskip
+    }
+  \else
+    \def\@makecol at appendblocks {%
+       \@outputbox at attachfloats
+       \@outputbox at appendfootnotes
+       \@outputbox at reinsertbskip
+}
+  \fi
+\else
+\ERROR
 \fi
+
 \newif\ifFN at setspace
 \@ifpackageloaded{setspace}{%
   \FN at setspacetrue
@@ -329,7 +323,7 @@
   \FN at setspacefalse
 }
 \ifFN at para
-  \renewcommand\@footnotetext[1]{%
+  \long\def\FN at footnotetext#1{%
     \insert\footins{%
       \ifFN at setspace
         \let\baselinestretch\FN at baselinestretch
@@ -343,19 +337,15 @@
       \@parboxrestore
       \protected at edef\@currentlabel{\csname p at footnote\endcsname\@thefnmark}%
       \color at begingroup
-        \setbox\FN at tempboxa=\hbox{%
+        \setbox\FN at tempboxa\hbox{%
           \@makefntext{\ignorespaces#1\strut
             \penalty-10\relax
             \hskip\footglue
           }% end of \@makefntext parameter
         }% end of \hbox
-        \dp\FN at tempboxa=0pt
-        \ifFN at etex
-          \ht\FN at tempboxa=\dimexpr\wd\FN at tempboxa *
-                          \footnotebaselineskip / \columnwidth\relax
-        \else
-          \ht\FN at tempboxa=\fudgefactor\wd\FN at tempboxa
-        \fi
+        \dp\FN at tempboxa\z@
+        \ht\FN at tempboxa\dimexpr\wd\FN at tempboxa *%
+                        \footnotebaselineskip / \columnwidth\relax
         \box\FN at tempboxa
       \color at endgroup
     }%
@@ -363,7 +353,7 @@
   }
 \else
   \ifFN at sidefn
-    \renewcommand\@footnotetext[1]{%
+    \long\def\FN at footnotetext#1{%
       \marginpar{%
         \ifFN at setspace
           \let\baselinestretch\FN at baselinestretch
@@ -381,7 +371,7 @@
       \FN at mf@prepare
     }%
   \else
-    \renewcommand\@footnotetext[1]{%
+    \long\def\FN at footnotetext#1{%
       \insert\footins{%
         \ifFN at setspace
           \let\baselinestretch\FN at baselinestretch
@@ -423,15 +413,10 @@
     \global
       \footnotebaselineskip=\normalbaselineskip
   }
-  \ifFN at etex
-  \else
-    \@tempdima=\footnotebaselineskip \multiply\@tempdima by 1024
-    \divide \@tempdima by \columnwidth \multiply\@tempdima by 64
-    \xdef\fudgefactor{\strip at pt\@tempdima }%
-  \fi
-  \long\def\makefootnoteparagraph{\unvbox\footins \makehboxofhboxes
-    \setbox\FN at tempboxa=\hbox{\unhbox\FN at tempboxa \removehboxes}
-    \hsize\columnwidth
+
+  \long\def\FN at makefootnoteparagraph{\unvbox\footins \FN at makehboxofhboxes
+    \setbox\FN at tempboxa=\hbox{\unhbox\FN at tempboxa \FN at removehboxes}%
+    \FN at setfootnoteparawidth
     \@parboxrestore
     \baselineskip=\footnotebaselineskip
     \noindent
@@ -438,7 +423,7 @@
     \rule{\z@}{\footnotesep}%
     \unhbox\FN at tempboxa\par
   }
-  \def\makehboxofhboxes{\setbox\FN at tempboxa=\hbox{}%
+  \def\FN at makehboxofhboxes{\setbox\FN at tempboxa=\hbox{}%
     \loop
       \setbox\FN at tempboxb=\lastbox
       \ifhbox\FN at tempboxb
@@ -445,162 +430,22 @@
       \setbox\FN at tempboxa=\hbox{\box\FN at tempboxb\unhbox\FN at tempboxa}%
     \repeat
   }
-  \def\removehboxes{\setbox\FN at tempboxa=\lastbox
+  \def\FN at removehboxes{\setbox\FN at tempboxa=\lastbox
     \ifhbox
-      \FN at tempboxa{\removehboxes}%
+      \FN at tempboxa{\FN at removehboxes}%
       \unhbox\FN at tempboxa
     \fi
   }
 \fi
-\newif\ifFN at pp@footnotehint
-\newcounter{pp at next@reset}%
-\newif\ifFN at pp@towrite
-\FN at pp@towritefalse
+\@ifpackageloaded{multicol}
+  {\def\FN at setfootnoteparawidth
+    {\hsize\ifnum\doublecol at number>\@ne
+                  \textwidth
+            \else \columnwidth \fi}}
+  {\def\FN at setfootnoteparawidth{\hsize\columnwidth}}
 \ifFN at perpage
-  \CheckCommand*\footnote{\@ifnextchar [%]
-    \@xfootnote
-    {%
-      \stepcounter\@mpfn \protected at xdef\@thefnmark{\thempfn}%
-      \@footnotemark \@footnotetext
-    }%
-  }
-  \renewcommand*\footnote{\@ifnextchar [%]
-    \@xfootnote
-    {%
-      \stepcounter\@mpfn \protected at xdef\@thefnmark{\thempfn}%
-      \FN at pp@footnote\@footnotemark
-      \ifFN at pp@towrite
-        \FN at pp@writetemp
-        \FN at pp@towritefalse
-      \fi
-      \@footnotetext
-    }%
-  }
-  \CheckCommand*\footnotemark{%
-    \@ifnextchar [%]
-    \@xfootnotemark
-    {%
-      \stepcounter{footnote}%
-      \protected at xdef\@thefnmark{\thefootnote}%
-      \@footnotemark
-    }%
-  }
-  \renewcommand*\footnotemark{%
-    \@ifnextchar [%]
-    \@xfootnotemark
-    {%
-      \stepcounter{footnote}%
-      \protected at xdef\@thefnmark{\thefootnote}%
-      \FN at pp@footnote\@footnotemark
-      \ifFN at pp@towrite
-        \FN at pp@writetemp
-        \FN at pp@towritefalse
-      \fi
-    }%
-  }
-  \gdef\FN at pp@initial at stab{\@addtoreset{footnote}{page}}
-  \AtBeginDocument{\FN at pp@initial at stab}
-  \newcounter{@fnserial}
-  \def\FN at pp@cpage{0}
-  \FN at pp@footnotehinttrue
-  \newcommand{\footnotehint}{%
-    \setcounter{footnote}{0}%
-    \protected at writeaux\relax{\protect\FN at pp@footnotehinttrue}%
-    \@tempcnta\c@@fnserial
-    \advance\@tempcnta\@ne
-    \global\c at pp@next at reset\@tempcnta
-  }
-  \AtBeginDocument{\protected at writeaux\relax{%
-      \protect\providecommand{\protect\FN at pp@footnotehinttrue}{}%
-    }%
-  }
-\def\FN at pp@lastfoot{-1}
-  \newcommand{\FN at pp@footnote at aux}[2]{%
-    \ifnum\FN at pp@lastfoot<#1
-      \ifFN at pp@footnotehint
-        \FN at pp@resetfn{#1}{#2}%
-        \FN at pp@footnotehintfalse
-      \else
-        \gdef\@tempa{#2}%
-        \ifx\@tempa\FN at pp@cpage
-        \else
-          \FN at pp@resetfn{#1}{#2}%
-        \fi
-      \fi
-      \def\FN at pp@lastfoot{#1}%
-    \fi
-    \global\let\FN at pp@initial at stab\relax
-  }
-  \newcommand{\FN at pp@resetfn}[2]{%
-    \gdef\FN at pp@cpage{#2}%
-    \expandafter\gdef
-      \csname FN at pp@next-\FN at pp@prev at foot\endcsname{#1}%
-    \def\FN at pp@prev at foot{#1}%
-    \expandafter\xdef
-      \csname FN at pp@next-\FN at pp@prev at foot\endcsname{\the\@MM}%
-  }
-  \newcommand{\FN at pp@prev at foot}{root}
-  \AtBeginDocument{\protected at writeaux\relax{%
-      \protect\providecommand{\protect\FN at pp@footnote at aux}[2]{}}%
-    \c at pp@next at reset\@ne
-  }
-  \AtEndDocument{\let\FN at pp@footnote at aux\FN at pp@footnote at endaux
-    \def\FN at pp@lastfoot{-1}%
-    \FN at pp@footnotehintfalse
-    \renewcommand{\FN at pp@prev at foot}{root}
-  }
-  \newcommand{\FN at pp@footnote at endaux}[2]{%
-    \ifnum\FN at pp@lastfoot<#1
-      \ifFN at pp@footnotehint
-        \FN at pp@resetfn at end{#1}{#2}%
-        \FN at pp@footnotehintfalse
-      \else
-        \gdef\@tempa{#2}%
-        \ifx\@tempa\FN at pp@cpage
-        \else
-          \FN at pp@resetfn at end{#1}{#2}%
-        \fi
-      \fi
-      \def\FN at pp@lastfoot{#1}%
-    \fi
-  }
-  \newcommand{\FN at pp@resetfn at end}[2]{%
-    \def\@tempa{#1}%
-    \expandafter\ifx\csname FN at pp@next-\FN at pp@prev at foot\endcsname\@tempa%
-    \else
-      \@tempswatrue
-    \fi
-    \gdef\FN at pp@prev at foot{#1}%
-    \gdef\FN at pp@cpage{#2}%
-  }
-\let\FN at pp@@clearpage\clearpage
-\renewcommand{\clearpage}{\footnotehint\FN at pp@@clearpage}
-\def\FN at pp@footnote{%
-  \if at minipage\else
-    \global\advance\c@@fnserial\@ne
-    \if at filesw
-      \xdef\FN at pp@writetemp{%
-        \noexpand\protected at writeaux\relax{%
-          \string\FN at pp@footnote at aux
-            {\the\c@@fnserial}{\noexpand\thepage}%
-        }%
-      }%
-      \FN at pp@towritetrue
-    \fi
-    \ifnum\c at pp@next at reset>\c@@fnserial
-    \else
-      \global\expandafter\csname c@\@mpfn\endcsname\@ne
-      \protected at xdef\@thefnmark{\thempfn}%
-      \expandafter\let\expandafter\@tempa
-        \csname FN at pp@next-\number\c at pp@next at reset\endcsname
-      \ifx\@tempa\relax
-        \global\c at pp@next at reset\@MM
-      \else
-        \global\c at pp@next at reset\@tempa
-      \fi
-    \fi
-  \fi
-}
+  \RequirePackage{perpage}
+  \MakePerPage{footnote}
 \fi
 \ifFN at para
 \else
@@ -647,15 +492,8 @@
 \ifFN at multiplefootnote
   \providecommand*{\multiplefootnotemarker}{3sp}
   \providecommand*{\multfootsep}{,}
-  \CheckCommand*\@footnotemark{%
+  \newcommand*\FN at footnotemark{%
     \leavevmode
-    \ifhmode\edef\@x at sf{\the\spacefactor}\nobreak\fi
-    \@makefnmark
-    \ifhmode\spacefactor\@x at sf\fi
-    \relax
-  }
-  \renewcommand*\@footnotemark{%
-    \leavevmode
     \ifhmode
       \edef\@x at sf{\the\spacefactor}%
       \FN at mf@check
@@ -662,10 +500,6 @@
       \nobreak
     \fi
     \@makefnmark
-    \ifFN at pp@towrite
-      \FN at pp@writetemp
-      \FN at pp@towritefalse
-    \fi
     \FN at mf@prepare
     \ifhmode\spacefactor\@x at sf\fi
     \relax
@@ -684,6 +518,7 @@
   }
 \else
   \let\FN at mf@prepare\relax
+  \let\FN at footnotemark\@footnotemark
 \fi
 \ifFN at stablefootnote
 \let\FN at sf@@footnote\footnote
@@ -731,26 +566,18 @@
 }
 \let\FN at fnsymbol@lamport\@fnsymbol
 \newif\if at tempswb
-\newcommand{\DefineFNsymbols}{%
-        \@ifstar{\@tempswbtrue\@DefineFNsymbols}%
-                {\@tempswbfalse\@DefineFNsymbols}%
-}
-\newcommand{\@DefineFNsymbols}[1]{%
-  \@ifnextchar[% ]
-    {\@DefineFNsymbols@{#1}}{\@DefineFNsymbols@{#1}[text]}%
-}
-\def\@DefineFNsymbols@#1[#2]#3{%
-  \expandafter\ifx\csname FN at fnsymbol@#1\endcsname\relax
-    \PackageInfo{footmisc}{Declaring symbol style #1}%
+\DeclareDocumentCommand\DefineFNsymbols {smO{text}m}{%
+  \expandafter\ifx\csname FN at fnsymbol@#2\endcsname\relax
+    \PackageInfo{footmisc}{Declaring symbol style #2}%
   \else
-    \PackageWarning{footmisc}{Redeclaring symbol style #1}%
+    \PackageWarning{footmisc}{Redeclaring symbol style #2}%
   \fi
   \toks@{}%
   \def\@tempb{\end}%
-  \FN at build@symboldef#3\end
+  \FN at build@symboldef#4\end
   \def\@tempc{math}%
-  \def\@tempd{#2}%
-  \expandafter\xdef\csname FN at fnsymbol@#1\endcsname##1{%
+  \def\@tempd{#3}%
+  \expandafter\xdef\csname FN at fnsymbol@#2\endcsname##1{%
     \ifx\@tempc\@tempd
       \noexpand\ensuremath
     \else
@@ -760,11 +587,8 @@
       \noexpand\ifcase##1%
       \the\toks@
       \noexpand\else
-      \if at tempswb
-        \noexpand\@ctrerr
-      \else
-        \noexpand\@arabic##1\noexpand\FN at orange##1%
-      \fi
+      \IfBooleanTF#1{\noexpand\@ctrerr}%
+        {\noexpand\FN at orange##1}%
       \noexpand\fi
     }%
   }%
@@ -777,30 +601,24 @@
     \expandafter\FN at build@symboldef
   \fi
 }
-\newcommand{\DefineFNsymbolsTM}{%
-        \@ifstar{\@tempswbtrue\@DefineFNsymbolsTM}%
-                {\@tempswbfalse\@DefineFNsymbolsTM}}%
-\newcommand{\@DefineFNsymbolsTM}[2]{%
-  \expandafter\ifx\csname FN at fnsymbol@#1\endcsname\relax
-    \PackageInfo{footmisc}{Declaring symbol style #1}%
+\DeclareDocumentCommand\DefineFNsymbolsTM {smm}{%
+  \expandafter\ifx\csname FN at fnsymbol@#2\endcsname\relax
+    \PackageInfo{footmisc}{Declaring symbol style #2}%
   \else
-    \PackageWarning{footmisc}{Redeclaring symbol style #1}%
+    \PackageWarning{footmisc}{Redeclaring symbol style #2}%
   \fi
   \toks@{}%
   \def\@tempb{\end}%
-  \FN at build@symboldefTM#2\end\@null
-  \expandafter\xdef\csname FN at fnsymbol@#1\endcsname##1{%
+  \FN at build@symboldefTM#3\end\@null
+  \expandafter\xdef\csname FN at fnsymbol@#2\endcsname##1{%
     \noexpand\ifcase##1%
       \the\toks@
     \noexpand\else
-      \if at tempswb
-        \noexpand\@ctrerr
-      \else
-        \noexpand\@arabic##1\noexpand\FN at orange##1%
-      \fi
-    \noexpand\fi
+      \IfBooleanTF#1{\noexpand\@ctrerr}%
+        {\noexpand\FN at orange##1}%
+      \noexpand\fi
   }%
-}%
+}
 \def\FN at build@symboldefTM#1#2{%
   \def\@tempa{#1}%
   \ifx\@tempa\@tempb
@@ -809,27 +627,14 @@
     \expandafter\FN at build@symboldefTM
   \fi
 }
-\@ifundefined{TextOrMath}{%
-  \@ifundefined{eTeXversion}{%
-    \PackageError{footmisc}{Can't define commands for footnote symbol}%
-                           {Use e-LaTeX, or load package fixltx2e before
-                             footmisc}%
-  }{%
-    \protected\expandafter\def\csname TextOrMath\space\endcsname{%
-      \ifmmode \expandafter\@secondoftwo
-      \else    \expandafter\@firstoftwo   \fi
-    }
-    \edef\TextOrMath#1#2{%
-      \expandafter\noexpand\csname TextOrMath\space\endcsname
-{#1}{#2}%
-    }%
-  }%
-}{}
 \def\FN at orange#1{%
-  \@bsphack
-  \PackageInfo{footmisc}{Footnote number \number#1 out of range}%
-  \protect\@fnsymbol at orange
-  \@esphack
+  \ifFN at robust
+    \@arabic#1%
+    \@bsphack
+    \PackageInfo{footmisc}{Footnote number \number#1 out of range}%
+    \protect\@fnsymbol at orange
+    \@esphack
+  \else \@ctrerr \fi
 }
 \global\let\@diagnose at fnsymbol@orange\relax
 \AtEndDocument{\@diagnose at fnsymbol@orange}
@@ -842,11 +647,8 @@
     }%
   }%
 }
-\@ifundefined{textbardbl}{%
-  \DeclareTextSymbol{\textbardbl}{OMS}{107}%
-  \DeclareTextSymbolDefault{\textbardbl}{TS1}}{}%
-\DefineFNsymbolsTM*{bringhurst}{%
-  \textasteriskcentered *
+\DefineFNsymbolsTM{bringhurst}{%
+  \textasteriskcentered *%
   \textdagger    \dagger
   \textdaggerdbl \ddagger
   \textsection   \mathsection
@@ -853,8 +655,8 @@
   \textbardbl    \|%
   \textparagraph \mathparagraph
 }%
-\DefineFNsymbolsTM*{chicago}{%
-  \textasteriskcentered *
+\DefineFNsymbolsTM{chicago}{%
+  \textasteriskcentered *%
   \textdagger    \dagger
   \textdaggerdbl \ddagger
   \textsection   \mathsection
@@ -861,8 +663,8 @@
   \textbardbl    \|%
   \#\#%
 }%
-\DefineFNsymbolsTM*{wiley}{
-  \textasteriskcentered *
+\DefineFNsymbolsTM{wiley}{%
+  \textasteriskcentered *%
   {\textasteriskcentered\textasteriskcentered}{**}%
   \textdagger    \dagger
   \textdaggerdbl \ddagger
@@ -870,8 +672,8 @@
   \textparagraph \mathparagraph
   \textbardbl    \|%
 }%
-\DefineFNsymbolsTM{lamport-robust}{
-  \textasteriskcentered *
+\DefineFNsymbolsTM{lamport-robust}{%
+  \textasteriskcentered *%
   \textdagger    \dagger
   \textdaggerdbl \ddagger
   \textsection   \mathsection
@@ -882,7 +684,7 @@
   {\textdaggerdbl\textdaggerdbl}{\ddagger\ddagger}%
 }
 \DefineFNsymbolsTM*{lamport*}{%
-  \textasteriskcentered *
+  \textasteriskcentered *%
   \textdagger    \dagger
   \textdaggerdbl \ddagger
   \textsection   \mathsection
@@ -903,7 +705,7 @@
 }
 \setfnsymbol{lamport*}
 \DefineFNsymbolsTM{lamport*-robust}{%
-  \textasteriskcentered *
+  \textasteriskcentered *%
   \textdagger    \dagger
   \textdaggerdbl \ddagger
   \textsection   \mathsection
@@ -922,12 +724,6 @@
   {\textparagraph\textparagraph\textparagraph}%%
     {\mathparagraph\mathparagraph\mathparagraph}%
 }
-\providecommand*{\footref}[1]{%
-  \begingroup
-    \unrestored at protected@xdef\@thefnmark{\ref{#1}}%
-  \endgroup
-  \@footnotemark
-}
 \newcommand\mpfootnotemark{%
   \@ifnextchar[%
     \@xmpfootnotemark
@@ -944,6 +740,13 @@
   \endgroup
   \@footnotemark
 }
+\@ifpackageloaded{hyperref}{%
+  \let\H@@footnotetext\FN at footnotetext
+  \let\H@@footnotemark\FN at footnotemark
+}{%
+  \let \@footnotetext \FN at footnotetext
+  \let\@footnotemark  \FN at footnotemark
+}
 \endinput
 %%
 %% End of file `footmisc.sty'.



More information about the tex-live-commits mailing list.