texlive[43260] Master/texmf-dist: footnotehyper (17feb17)

commits+karl at tug.org commits+karl at tug.org
Fri Feb 17 23:27:22 CET 2017


Revision: 43260
          http://tug.org/svn/texlive?view=revision&revision=43260
Author:   karl
Date:     2017-02-17 23:27:22 +0100 (Fri, 17 Feb 2017)
Log Message:
-----------
footnotehyper (17feb17)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/footnotehyper/README.md
    trunk/Master/texmf-dist/doc/latex/footnotehyper/footnotehyper.pdf
    trunk/Master/texmf-dist/doc/latex/footnotehyper/footnotehyper.tex
    trunk/Master/texmf-dist/source/latex/footnotehyper/footnotehyper.dtx
    trunk/Master/texmf-dist/source/latex/footnotehyper/footnotehyper.ins
    trunk/Master/texmf-dist/tex/latex/footnotehyper/footnotehyper.sty

Modified: trunk/Master/texmf-dist/doc/latex/footnotehyper/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/footnotehyper/README.md	2017-02-17 22:27:03 UTC (rev 43259)
+++ trunk/Master/texmf-dist/doc/latex/footnotehyper/README.md	2017-02-17 22:27:22 UTC (rev 43260)
@@ -1,32 +1,36 @@
 <!-- -->
 
-    Source:  footnotehyper.dtx (v0.9f 2016/10/03)
+    Source:  footnotehyper.dtx (v0.99 2017/02/16)
     Author:  Jean-Francois Burnol
     Info:    hyperref aware footnote.sty
     License: LPPL 1.3c
-    Copyright (C) 2016 Jean-Francois Burnol <jfbu at free dot fr>.
+    Copyright (C) 2016-2017 Jean-Francois Burnol <jfbu at free dot fr>.
 
 ABSTRACT
 ========
 
-The `footnote` package by Mark Wooding (which dates back to 1997)
-allows to gather footnotes (`\savenotes`) and later insert them
-(`\spewnotes`) at the bottom of the page, even if the intervening
-material consists of tabulars, minipages or framed contents for
-example. There is a command to patch any given environment to do
-the `\savenotes/\spewnotes` commands automatically. Also there is
-a `footnote` environment which allows to insert verbatim material.
+The `footnote` package by Mark Wooding (`1997/01/28` `1.13`)
+allows to gather footnotes (`\begin{savenotes}`) and later insert
+them (after `\end{savenotes}`) at the bottom of the page, even
+if the intervening material consists of tabulars, minipages or
+framed contents for example. One can also use the
+`\savenotes/\spewnotes` syntax.
 
-The `footnotehyper` package loads `footnote.sty` and rewrites a
-number of its commands to add `hyperref` awareness and to fix some
-issues, particularly the one of incompatibility with
-`color/xcolor`. The incompatibility with `babel-frenchb` is
-addressed, too. In case of absence of `hyperref`, `footnotehyper`
-limits itself to partially fix some of these issues.
+Also, `footnote.sty` provides a `footnote` environment which
+allows to insert verbatim material.
 
-This package provides no facility dedicated to footnotes from
-floating environments.
+Earlier releases of the present `footnotehyper` package added
+patches for `hyperref` compatibility and some bugfixes, addressing
+in particular the incompatibility with `color/xcolor`, and with
+`babel-frenchb`, and also fixing the `footnote` environment with
+optional argument `[NUM]`. Since `v0.99` all macros are defined
+internally and the `footnote` package is not loaded at all.
 
+The same user interface is kept. In case `hyperref` is absent, or
+is loaded with `hyperfootnotes=false` option, `footnotehyper`
+deactivates itself. The order of loading of `footnotehyper`
+and `hyperref` is inconsequential.
+
 INSTALLATION
 ============
 

Modified: trunk/Master/texmf-dist/doc/latex/footnotehyper/footnotehyper.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/footnotehyper/footnotehyper.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/footnotehyper/footnotehyper.tex	2017-02-17 22:27:03 UTC (rev 43259)
+++ trunk/Master/texmf-dist/doc/latex/footnotehyper/footnotehyper.tex	2017-02-17 22:27:22 UTC (rev 43260)
@@ -1,13 +1,13 @@
 %%
 %% Package: footnotehyper
-%% Version: 0.9f (2016/10/03)
+%% Version: 0.99 (2017/02/16)
 %% License: LPPL 1.3c
-%% Copyright (C) 2016 Jean-Francois Burnol <jfbu at free dot fr>.
+%% Copyright (C) 2016-2017 Jean-Francois Burnol <jfbu at free dot fr>.
 %%
 \def\pkgname        {footnotehyper}
-\def\pkgdate        {2016/10/03}
-\def\docdate        {2016/10/03}
-\def\pkgversion     {v0.9f}
+\def\pkgdate        {2017/02/16}
+\def\docdate        {2017/02/16}
+\def\pkgversion     {v0.99}
 \def\pkgdescription {hyperref aware footnote.sty (JFB)}
 %%
 %% run latex twice on this file footnotehyper.tex then dvipdfmx on

Modified: trunk/Master/texmf-dist/source/latex/footnotehyper/footnotehyper.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/footnotehyper/footnotehyper.dtx	2017-02-17 22:27:03 UTC (rev 43259)
+++ trunk/Master/texmf-dist/source/latex/footnotehyper/footnotehyper.dtx	2017-02-17 22:27:22 UTC (rev 43260)
@@ -1,20 +1,20 @@
 % -*- coding: utf-8; time-stamp-format: "%02d-%02m-%:y at %02H:%02M:%02S %Z" -*-
 %<*none>
-\def\dtxtimestamp {Time-stamp: <03-10-2016 at 23:00:16 CEST>}
+\def\dtxtimestamp {Time-stamp: <16-02-2017 at 20:01:27 CET>}
 %</none>
 %<*!readme>
 %%
 %% Package: footnotehyper
-%% Version: 0.9f (2016/10/03)
+%% Version: 0.99 (2017/02/16)
 %% License: LPPL 1.3c
-%% Copyright (C) 2016 Jean-Francois Burnol <jfbu at free dot fr>.
+%% Copyright (C) 2016-2017 Jean-Francois Burnol <jfbu at free dot fr>.
 %%
 %</!readme>
 %<*insfile|tex>
 \def\pkgname        {footnotehyper}
-\def\pkgdate        {2016/10/03}
-\def\docdate        {2016/10/03}
-\def\pkgversion     {v0.9f}
+\def\pkgdate        {2017/02/16}
+\def\docdate        {2017/02/16}
+\def\pkgversion     {v0.99}
 \def\pkgdescription {hyperref aware footnote.sty (JFB)}
 %</insfile|tex>
 %<*none>
@@ -25,9 +25,9 @@
     \catcode32=13\catcode`\\=12^^Brelax^^A
 ^^Bfirstofone{^^Bendgroup^^Bdef^^BpkgLicense^^A
 {% Package: footnotehyper
-% Version: 0.9f (2016/10/03)
+% Version: 0.99 (2017/02/16)
 % License: LPPL 1.3c
-% Copyright (C) 2016 Jean-Francois Burnol <jfbu at free dot fr>.
+% Copyright (C) 2016-2017 Jean-Francois Burnol <jfbu at free dot fr>.
 %
 % This Work may be distributed and/or modified under the conditions
 % of the LaTeX Project Public License, version 1.3c. This version of
@@ -54,35 +54,39 @@
 %<*readme>
 <!-- -->
 
-    Source:  footnotehyper.dtx (v0.9f 2016/10/03)
+    Source:  footnotehyper.dtx (v0.99 2017/02/16)
     Author:  Jean-Francois Burnol
     Info:    hyperref aware footnote.sty
     License: LPPL 1.3c
-    Copyright (C) 2016 Jean-Francois Burnol <jfbu at free dot fr>.
+    Copyright (C) 2016-2017 Jean-Francois Burnol <jfbu at free dot fr>.
 
 
 ABSTRACT
 ========
 
-The `footnote` package by Mark Wooding (which dates back to 1997)
-allows to gather footnotes (`\savenotes`) and later insert them
-(`\spewnotes`) at the bottom of the page, even if the intervening
-material consists of tabulars, minipages or framed contents for
-example. There is a command to patch any given environment to do
-the `\savenotes/\spewnotes` commands automatically. Also there is
-a `footnote` environment which allows to insert verbatim material.
+The `footnote` package by Mark Wooding (`1997/01/28` `1.13`)
+allows to gather footnotes (`\begin{savenotes}`) and later insert
+them (after `\end{savenotes}`) at the bottom of the page, even
+if the intervening material consists of tabulars, minipages or
+framed contents for example. One can also use the
+`\savenotes/\spewnotes` syntax.
 
-The `footnotehyper` package loads `footnote.sty` and rewrites a
-number of its commands to add `hyperref` awareness and to fix some
-issues, particularly the one of incompatibility with
-`color/xcolor`. The incompatibility with `babel-frenchb` is
-addressed, too. In case of absence of `hyperref`, `footnotehyper`
-limits itself to partially fix some of these issues.
+Also, `footnote.sty` provides a `footnote` environment which
+allows to insert verbatim material.
 
-This package provides no facility dedicated to footnotes from
-floating environments.
+Earlier releases of the present `footnotehyper` package added
+patches for `hyperref` compatibility and some bugfixes, addressing
+in particular the incompatibility with `color/xcolor`, and with
+`babel-frenchb`, and also fixing the `footnote` environment with
+optional argument `[NUM]`. Since `v0.99` all macros are defined
+internally and the `footnote` package is not loaded at all.
 
+The same user interface is kept. In case `hyperref` is absent, or
+is loaded with `hyperfootnotes=false` option, `footnotehyper`
+deactivates itself. The order of loading of `footnotehyper`
+and `hyperref` is inconsequential.
 
+
 INSTALLATION
 ============
 
@@ -184,7 +188,7 @@
 \Msg{* To finish the installation you have to move the following}
 \Msg{* file into a directory searched by TeX:}
 \Msg{*}
-\Msg{*     \pkgname.sty} 
+\Msg{*     \pkgname.sty}
 \Msg{*}
 \Msg{* To produce the documentation run latex twice on file \pkgname.tex}
 \Msg{* and then run dvipdfmx on file \pkgname.dvi.}
@@ -210,7 +214,7 @@
         \chardef\Withdvipdfmx 0 % 0 = pdflatex or latex+dvips, 1 = dvipdfmx
         \chardef\NoSourceCode 0 % 0 =  include source code, 1 = do not
         \NeedsTeXFormat {LaTeX2e}%
-        \PassOptionsToClass   {a4paper,fontsize=11pt,oneside}{scrdoc}% 
+        \PassOptionsToClass   {a4paper,fontsize=11pt,oneside}{scrdoc}%
         \PassOptionsToPackage {english}{babel}%
       \else % latex run is on \pkgname.tex
         \chardef\extractfiles 2 % do not extract files, only typeset
@@ -307,7 +311,7 @@
 \hypersetup{%
 linktoc=all,%
 breaklinks=true,%
-colorlinks,%   
+colorlinks,%
 linkcolor=RoyalBlue,%
 urlcolor=OliveGreen,%
 pdfauthor={Jean-Fran\c cois Burnol},%
@@ -317,8 +321,8 @@
 pdfstartview=FitH,%
 pdfpagemode=UseNone}
 % added usage of package bookmark 2013/10/10
-\usepackage{bookmark} 
-
+\usepackage{bookmark}
+\usepackage{enumitem}
 \usepackage{\pkgname}
 
 \newcommand\fnh{%
@@ -339,7 +343,7 @@
 \begin{center}
   {\normalfont\LARGE The \fnh  package}\\
 \textsc{\small Jean-François Burnol}\par
-  \footnotesize \ttfamily 
+  \footnotesize \ttfamily
   jfbu (at) free (dot) fr\par
   Package version: \pkgversion\ (\pkgdate)\par
   From source file \texttt{\pkgname.dtx} of \dtxtimestamp.\par
@@ -347,23 +351,27 @@
 
 \MakeShortVerb{\`}%
 \begin{abstract}
-The `footnote` package by Mark \textsc{Wooding} (which dates back to 1997)
-allows to gather footnotes (`\savenotes`) and later insert them
-(`\spewnotes`) at the bottom of the page, even if the intervening
-material consists of tabulars, minipages or framed contents for
-example. There is a command to patch any given environment to do
-the `\savenotes/\spewnotes` commands automatically. Also there is
-a `footnote` environment which allows to insert verbatim material.
+The `footnote` package by \textsc{Mark~Wooding} (`1997/01/28` `1.13`)
+allows to gather footnotes (`\begin{savenotes}`) and later insert
+them (after `\end{savenotes}`) at the bottom of the page, even
+if the intervening material consists of tabulars, minipages or
+framed contents for example. One can also use the
+`\savenotes/\spewnotes` syntax.
 
-The \fnh package loads `footnote.sty` and rewrites a number of its
-commands to add `hyperref` awareness and to fix some issues,
-particularly the one of incompatibility with `color/xcolor`. The
-incompatibility with `babel-frenchb` is addressed, too. In case of
-absence of `hyperref`, \fnh limits itself to partially fix some of
-these issues.
+Also, `footnote.sty` provides a `footnote` environment which
+allows to insert verbatim material.
 
-This package provides no facility dedicated to footnotes from
-floating environments.
+Earlier releases of the present \fnh package added
+patches for `hyperref` compatibility and some bugfixes, addressing
+in particular the incompatibility with `color/xcolor`, and with
+`babel-frenchb`, and also fixing the `footnote` environment with
+optional argument `[NUM]`. Since `v0.99` all macros are defined
+internally and the `footnote` package is not loaded at all.
+
+The same user interface is kept. In case `hyperref` is absent, or
+is loaded with `hyperfootnotes=false` option, \fnh
+deactivates itself. The order of loading of \fnh
+and `hyperref` is inconsequential.
 \end{abstract}
 \DeleteShortVerb{\`}
 
@@ -376,155 +384,223 @@
 
 \section{Usage}
 
-DON'T load |footnote|, leave that job to \fnh. You \emph{must} load
-|hyperref|.\footnote{Since |v0.9e| \fnh deactivates itself
-  gracefully if |hyperref| is not loaded, or under |hyperref| option
-  |hyperfootnotes=false|.}
+You \emph{must} load |hyperref|\footnote{Since |v0.9e| \fnh
+  deactivates itself gracefully if |hyperref| is not loaded, or
+  under |hyperref| option |hyperfootnotes=false|.}, but it does
+not matter if before or after \fnh. Since |v0.99|, \fnh does not
+load package
+|footnote.sty|\footnote{\url{http://ctan.org/pkg/footnote}}
+anymore, and is even incompatible with it at it uses the same user
+interface.
 
-Then you can use |\savenotes/\spewnotes| or the equivalent |savenotes|
-environment; there is also a |footnote| environment, but its set-up during
-\fnh loading is more delicate and it could well fail depending on how
-|\@makefntext| has been customized by the class or other packages; a warning
-is issued in that case. A functional |footnote| environment allows footnotes
-with verbatim material.
+The package thus provides:
+\begin{itemize}
+\item a |savenotes| environment which re-routes footnotes and delivers them at
+  the end (there is also the |\savenotes/\spewnotes| syntax; it does create a
+  group like the environment),
+\item |footnote| and |footnotetext| environments to allow footnotes
+  with verbatim material.
+\end{itemize}
 
-\savenotes
-\begin{framed}
-Please refer to the documentation of the |footnote| package.%
-\footnote{\url{http://ctan.org/pkg/footnote}}
+But the constructability of the |footnote/footnotetext| environments depends
+on how |\@makefntext| has been customized by the class or other packages; a
+warning is issued if the situation appears to be desperate.\footnote{original
+  |footnote.sty| could end up in a low level \TeX\ error.}
 
-Particularly you may check its |\makesavenoteenv| command.%
-\footnote{This won't handle floating environments, though.}
-\end{framed}
-\spewnotes
+It should be recalled that in case of |\footnotemark[N]| and
+|\footnotetext[N]{...}| mark-up |hyperref| creates no hyperlink. This is not
+changed by \fnh and applies also to the |\begin{footnotetext}[N]| case.
+Without optional argument the link is created, and the link is created also
+for |\footnote[N]| or |\begin{footnote}[N]|.
 
-We can try some normal footnote.\footnote{Here it is.}
+This package does not handle especially floating environments, except that one
+can always surround them in the source in a |savenotes| environment and one
+knows that the footnotes will be delivered at the |\end{savenotes}|\dots which
+may well be one page earlier than the actual location of the floating material
+in the produced document !
 
+Environments typesetting multiple times their contents are the most hostile to
+footnotes. Currently, \fnh only handles especially the |amsmath|
+environments (as in |footnote.sty|.)
+
+Finally there is a |\makesavenoteenv| command which takes as
+argument an environment name and patches it to do the
+|\savenotes/\spewnotes| automatically.%
+\begin{footnote}
+  For the
+record the syntax is either |\makesavenoteenv{foo}| which patches
+environment |foo| or |\makesavenoteenv[bar]{foo}| which defines
+environment |bar| as this patched version of |foo|.
+\end{footnote}
+It is safer to avoid it, as
+one never knows what happens with such patches: for example the |[H]|
+specifier provided by the |float| package overwrites the |\end{table}|
+definition during the execution of |\begin{table}|\dots !
+
 \begin{savenotes}
 \begin{framed}
 \DeleteShortVerb{\|}\MakeShortVerb{\*}%
 {\centering
   \begin{tabular}{|c|c|}
-\hline
-  \strut The above\footnote{Notice that if the present frame
-    extended to next page,
-    the end of the *savenotes* environment would then (try to) deliver its
-    footnotes to that
-    page.} was & coded\footnote{Alternatively a savenotes environment
-    could have been used.} as:\\\hline
+    \hline
+    \strut Inside\footnote{Notice that as  frame
+      extended to the next page,
+      the end of the *savenotes* environment delivered its
+      footnotes only here.} a & tabular\begin{footnote}Alternatively a
+      *\savenotes/\spewnotes* pair
+      could have been used.\end{footnote}\\\hline
 \end{tabular}\par}
 \DeleteShortVerb{\*}\MakeShortVerb{\|}%
+An example:
 \begin{verbatim}
-\savenotes
+\begin{savenotes}
 \begin{framed}
   Please refer to the documentation of the |footnote| package.%
   \footnote{\url{http://ctan.org/pkg/footnote}}
 
-  Particularly you may check its |\makesavenoteenv| command.%
-  \footnote{This won't handle floating environments, though.}
+  Particularly you may check its |savenotes| environment.%
+  \footnote{It doesn't bring any
+  feature to especially handle the issues related to footnotes in floating
+  environments, though.}
 \end{framed}
-\spewnotes
+\end{savenotes}
 \end{verbatim}
 and the present frame has \cs{footnote}'s from inside a |tabular| and is
-inside a |savenotes| environment.% 
-%
-% plus maintenant, \small pour le \MacroFont utilisé par verbatim
-%\footnote{Well, I end up on next page. Not
-% much I can do about this, ask why to |framed.sty| and the output routine I
-% guess.}
-%
-\footnote{Here is an issue which has nothing (as I finally figured out) to do
-  with |footnote|, and only indirectly with \LaTeX: if you embed a
-  \emph{full-width} minipage (with initial \cs{noindent}) in any environment
-  not doing \cs{ignorespacesafterend}, be careful to add a \% after the
-  minipage (or after the surrounding environment; or a \cs{par} immediately),
-  else the output will have an extra blank line if the source has itself a
-  blank line there. I hesitated adding that to
-  \cs{spewnotes}/\cs{endsavenotes}. Finally I left as is.} Let's test an
+inside a |savenotes| environment.%
+\begin{footnote}
+  Here is an issue which has nothing (as I finally figured out) to
+  do with |footnote|, and only indirectly with \LaTeX: if you embed
+  a \emph{full-width} minipage (with initial \cs{noindent}) in any
+  environment not doing \cs{ignorespacesafterend}, be careful to add
+  a \% either immediately after the |\end{minipage}| (or a |\relax|
+  or a |\par|) or after the surrounding environment |\end{foo}| or
+  use |\end{minipage}\end{foo}| else the output may have an extra
+  blank line if the source has a blank line after the |foo| environment.
+  Here is a typical example, with a |tabular| rather:
+  \makeatletter
+
+  \medskip\noindent\hspace{1cm}\begin{minipage}{\dimexpr\linewidth-1cm}%
+  \def\MacroFont{\baselineskip10pt\relax}%
+\begin{verbatim}
+\newenvironment{foo}{}{}
+
+\noindent\begin{tabular}{p{\dimexpr\linewidth-2\tabcolsep\relax}}
+  A\dotfill B
+\end{tabular}
+
+C
+
+\begin{foo}
+\noindent\begin{tabular}{p{\dimexpr\linewidth-2\tabcolsep\relax}}
+  A\dotfill B
+\end{tabular}
+\end{foo}
+
+C
+\end{verbatim}\end{minipage}\par\medskip
+
+  If you try it out you will see an extra blank line in PDF output above the
+  second C. Starting with |v0.99| the |\end{savenotes}| emits an
+  \cs{ignorespacesafterend} which avoids this generic \TeX/\LaTeX\
+  problem. For good measure there is now an \cs{ignorespaces} in
+  |\begin{savenotes}|.
+\end{footnote}
+Let's test an
 |amsmath| environment with |\intertext|. As
 \begin{align}
   E&=mc^2\;,
-\intertext{was too easy,\footnote{There is also $E=h\nu$.}, let's
+\intertext{was too easy\footnote{There is also $E=h\nu$.}, let's
   try:}
-  F&=nd^3\;.
+  a^n + b^n &=c^n\;.
 \end{align}
+And a footnote with some verbatim material%
+\begin{footnote}
+  \verb|&$^%\[}$|
+\end{footnote}.
 \end{framed}
 \end{savenotes}
 
-Use of the \texttt{footnote} \emph{environment} with some verbatim material%
-\begin{footnote}
-  \verb|&$^%\[}$|
-\end{footnote}
-which was coded as:
+The last one was coded as:
 \begin{verbatim}
-Use of the \texttt{footnote} \emph{environment} with some verbatim material%
+And a footnote with some verbatim material%
 \begin{footnote}
   \verb|&$^%\[}$|
-\end{footnote}
-which was coded as:
-<let's avoid infinite recursion ;-) >
+\end{footnote}.
 \end{verbatim}
-And here a use of |\footnotemark|\footnotemark\ 
-followed by a |footnotetext| environment.
+Now some use of |\footnotemark|\footnotemark\ followed by a |footnotetext|
+environment.
 \begin{footnotetext}
   This one uses the normal footnote counter and the hyperlink works.
 \end{footnotetext}
-Now a use of |\footnotemark[N]|\footnotemark[99] followed with a
-|footnotetext| environment using the same optional argument |[N]|.
-No hyperfootnote link is then inserted by |hyperref|.%
+And use of |\footnotemark[99]|\footnotemark[99] in association with a
+|footnotetext| environment using the same optional argument |[99]|.
+No hyperfootnote link was inserted.%
 \begin{footnotetext}[99]
-  |hyperref| puts no hyperlink in this case, which is similar to
-  the |\footnotemark[N]/\footnotetext[N]{<foo>}| context (there is
-  no such problem with using the |[N]| with a |\footnote| or with
-  a |footnote| environment.) 
+  |hyperref| creates no hyperlink in this case, or in the
+  |\footnotemark[N]/\footnotetext[N]{<foo>}| case. It does when
+  the |[N]| is absent or when it is used with a |\footnote| command
+  (or a |footnote| environment.)
+
+  By the way, \fnh |v0.9f|'s |\footnotetext[N]| and |\begin{footnotetext}[N]|
+  each had a bug and they were unusable \emph{inside} the |savenotes|
+  environment. There was no issue \emph{outside}.
 \end{footnotetext}
-And a final footnote, with a |footnote| environment using an
-optional argument |[N]|.%
-\begin{footnote}[100]\csname @minipagetrue\endcsname % to reduce
+And a final footnote, done with |\begin{footnote}[57]|%
+\begin{footnote}[57]\csname @minipagetrue\endcsname % to reduce
                                 % framed inserted vertical spacing
   \begin{framed}
     \noindent\fnh deactivates itself if |hyperfootnotes=false| option to
     |hyperref| is detected, or if |hyperref| is not loaded at all.
-    Essentially, it only then fixes some of the incompatibilities
-    between |footnote.sty| and |color/xcolor/babel-frenchb|
-    packages. But the bug making the |footnote| environment
-    optional argument unusable remains unfixed by \fnh if
-    |hyperref| has not been detected.
   \end{framed}
-\end{footnote}
-No problem with the hyperlink, then.
+\end{footnote}.
+There is no problem with the hyperlink, then.
 
 \section{Notes}
 
-The |footnote| environment of |footnote.sty| had various issues
-but as \fnh initially focused only on |\savenotes/\spewnotes| I
-became aware only at the time of |v0.9f| of the error when this
-environment is used with the optional |[N]| parameter; this is a
-different bug than the one of incompatibility with |color/xcolor|.
-The |v0.9f| release fixes this new problem (no extensive
-tests were done.)
+A few items worth of mention:
+\begin{itemize}[nosep]
+\item the |footnote| package patches the \LaTeX\ kernel |\parbox|.
+  \fnh doesn't (but the code can be found commented-out at the
+  end of the present file).
+\item the |footnote| package defines a |minipage*| environment
+  which is |minipage| patched by |\makesavenoteenv|, \fnh doesn't.
+\item the |footnote| environment from |footnote.sty| does a
+  |\leavevmode\unskip| which \fnh doesn't: hence if one locates
+  |\begin{footnote}| at start of a line in the \LaTeX\ source, one will
+    typically need a \% at end of text on previous line to avoid the
+    end-of-line space.
+\item the |hyperref| package inserts no hyperlink in case of
+  |\footnotemark[N]/\footnotetext[N]|. This is not modified by \fnh.
+\item side-note: there is an interference between |hyperref| and |frenchb|
+  regarding the footnote marker when using the syntax |\footnotemark[NUM]|.
+  For the record here is a patch (last tested briefly with
+% PUTAIN BORDEL ! LaTeX Error: Text for \verb command ended by end of
+% line. À CHAQUE FOIS ÇA M'AGAÇE. Bon, je n'ai pas mon patch habituel ici.
+  |hyperref 2016/06/24 v6.83q| and |frenchb 2017/01/30 v3.2g|):
+% pour le cas où mis dans commentaires de code
+% \begingroup\makeatletter\let\check at percent\@gobble
+\begin{verbatim}
+  \AtBeginDocument{%
+   \let\@xfootnotemarkORIFB \@xfootnotemark
+   \def\@xfootnotemarkFB {\leavevmode\unskip\unkern\,\@xfootnotemarkORIFB }%
+   \ifHy at hyperfootnotes\ifFBAutoSpaceFootnotes
+       \let\@xfootnotemark\@xfootnotemarkFB
+   \fi\fi
+  }%
+\end{verbatim}
+% \endgroup
+\item some environments typeset multiple times their contents,
+  which causes issues; \fnh takes provisions only to handle the
+  |amsmath| measuring step.
+\end{itemize}
 
-During this I realized (this is unrelated to |footnote| package or
-\fnh) that there is a typesetting interference of |hyperref| with
-|babel+frenchb| in the case of the |\footnotemark[N]| syntax. \fnh
-does not fix that. I reported the problem and perhaps an upstream
-fix will come at a later date (tested with |hyperref 6.83q| and
-|frenchb 3.2c|).
+% During this I realized (this is unrelated to |footnote| package or
+% \fnh) that there is a typesetting interference of |hyperref| with
+% |babel+frenchb| in the case of the |\footnotemark[N]| syntax. \fnh
+% does not fix that. I reported the problem and perhaps an upstream
+% fix will come at a later date (tested with |hyperref 6.83q| and
+% |frenchb 3.2c|).
 
-The |hyperref| package inserts no hyperlink in case of
-|\footnotemark[N]/\footnotetext[N]|. This is not modified by \fnh.
-
-The |footnote.sty| package patches the \LaTeX\ kernel |\parbox|. I had not
-realized that earlier, and starting with \fnh |v0.9f| the patch is undone.
-But the re-defined macro is made available as |\fnparbox|.
-
-\medskip
-
-At this stage, \fnh rewrites large parts of the original
-|footnote.sty| code. Perhaps a later release will not load at all
-the original package (but it will keep the |\savenotes/\spewnotes|
-interface.)
-
 \StopEventually{\end{document}\endinput}
 \makeatletter
     \let\check at percent\original at check@percent
@@ -570,162 +646,184 @@
 %
 %</none>
 %<*package>
-% It is surely difficult to understand the code here as its expansion depends on
-% some macros whose definitions are still in |footnote.sty| and used with no
-% modification here: the most important are |\savenotes|, |\fn at startnote|, and
-% |\fn at startfntext| (which is used only for the environment form.) Obviously the
-% macros here depend on what these three do. 
-%
-% Surely, next release of \fnh will drop entirely the idea of patching
-% |footnote.sty| and will contain all definitions.
 % \begin{macro}{no options}
+% The package has no options.
 %    \begin{macrocode}
-\DeclareOption*{\PackageWarning{footnotehyper}{Option `\CurrentOption' is unknown}}%
+\DeclareOption*%
+    {\PackageWarning{footnotehyper}{Option `\CurrentOption' is unknown}}%
 \ProcessOptions\relax
 %    \end{macrocode}
 % \end{macro}
-% \begin{macro}{\@makefntext}
-% \begin{macro}{\footnote}
-% \begin{macro}{\footnotetext}
-% \begin{macro}{\parbox}
-% \begin{macro}{\fn at endnote}
-% We load |footnote| but leave to the user to take care of |hyperref|.
-%
-% As we need to intercept some re-definitions done by
-% |footnote.sty| we will first check if it is already loaded.
-%
-% If \cs{@makefntext} has been customized and its argument is not visible at
-% top level in its meaning, then loading |footnote.sty| will fail with a low
-% level \TeX\ error. We save its meaning and replace it by an innocuous one
-% for the time being. We will come back to this at begin document.
-%
-% |footnote.sty| modifies |\parbox|. We (|v0.9f|) undo the patch, because
-% modifying |\parbox| in any way for no good reason is BAD.
-%
-% The |\fn at endnote| was |\let| to |\color at endgroup| which is bad as it fails if
-% |color/xcolor| is not yet loaded. Besides its presence was missing from some
-% needed place (see later).
-% 
-% We postpone to at begin document the redefinitions of \cs{footnote} and
-% \cs{footnotetext}.
+% Versions up to |v0.9f| loaded |footnote.sty|, with lots of patching
+% afterwards. Starting with |v0.99|, \fnh does everything by itself with |FNH@|
+% prefix. Brief overview of some of the fixed issues:
+% \begin{itemize}[nosep]
+% \item there was incompatibility with |hyperref|,
+% \item and with |color|,
+% \item if the \cs{@makefntext} at the time of loading of |footnote.sty|
+%   does not have its argument visible at top level in its meaning, or
+%   is used multiple times there, then the footnote environment will lead to low
+%   level \TeX\ error,
+% \item |footnote.sty| modifies |\parbox|,
+% \item |footnote.sty| does some too early |\let|,
+% \item the footnote environment from |footnote.sty| does not work if used with
+% optional argument |[N]|.
+% \end{itemize}
 %    \begin{macrocode}
-\@ifpackageloaded{footnote}
- {\PackageWarningNoLine{footnotehyper}%
-  {Please next time do not load package footnote,^^J
- but leave that to me. For the time being, I will start by undoing the^^J
- modifications it did to \string\parbox. Use \string\fnparbox\space if needed.}%
- }
- {\let\FNH@@makefntext\@makefntext\let\@makefntext\@firstofone
-  \RequirePackage{footnote}
-  \let\@makefntext\FNH@@makefntext
- }%
-\let\fnparbox\parbox\let\parbox\fn at parbox
-\let\FNH at fn@footnote    \footnote     % footnote.sty's \footnote will get
-\let\FNH at fn@footnotetext\footnotetext % redefined later. We preserve also
-\let\footnote    \fn at latex@@footnote  % the meaning of \footnote from prior
-\let\footnotetext\fn at latex@@footnotetext % to the loading of footnote.sty
-\def\fn at endnote  {\color at endgroup}%
+\newbox\FNH at notes
+\newdimen\FNH at width
+\let\FNH at colwidth\columnwidth
+\newif\ifFNH at savingnotes
+\AtBeginDocument {%
+  \@ifpackageloaded{hyperref}
+  {\ifHy at hyperfootnotes
+    \let\FNH at latex@footnote    \footnote
+    \let\FNH at latex@footnotetext\footnotetext
+    \newenvironment{savenotes}
+        {\FNH at savenotes\ignorespaces}{\FNH at spewnotes\ignorespacesafterend}%
+    \let\spewnotes      \FNH at spewnotes
+    \let\footnote       \FNH at footnote
+    \let\footnotetext   \FNH at footnotetext
+    \let\endfootnote    \FNH at endfntext
+    \let\endfootnotetext\FNH at endfntext
+   \else
+    \PackageInfo{footnotehyper}%
+     {inactive due to hyperfootnotes=false option}%
+   \fi}%
+ {\PackageWarning{footnotehyper}{^^J\@spaces\@spaces*************^^J%
+  \space deactivating myself as hyperref is not detected !^^J}}%
+}%
 %    \end{macrocode}
-% \end{macro}\end{macro}\end{macro}\end{macro}\end{macro}
-% There are some |\let|'s done by |footnote.sty| in what appears to be
-% premature ways.
+% \begin{macro}{\FNH at hyper@fntext}
+% \begin{macro}{\FNH at nohyp@fntext}
+% \begin{macro}{\FNH at fntext}
+% These are the \fnh replacement for |\@footnotetext| inside the
+% |savenotes| environment. There is a version creating an hyperlink
+% and another one not creating an hyperlink. The \cs{FNH at fntext}
+% macro serves as general dispatch. This may be a place to customize if one
+% wants to handle environments doing multiple passes: but the footnote counter
+% must have been taken care of elsewhere. The code currently handles only
+% the case of |amsmath| environments.
 %    \begin{macrocode}
-\AtBeginDocument {%
-    \let\fn at latex@@footnote    \footnote % meaning of \footnote at end of preamble
-    \let\fn at latex@@footnotetext\footnotetext
+\def\FNH at hyper@fntext{\FNH at fntext\FNH at hyper@fntext at i}%
+\def\FNH at nohyp@fntext{\FNH at fntext\FNH at nohyp@fntext at i}%
+\def\FNH at fntext #1{\ifx\ifmeasuring@\@undefined
+    \expandafter\@secondoftwo\else\expandafter\@firstofone\fi
+    {\ifmeasuring@\expandafter\@gobbletwo\fi}#1%
 }%
 %    \end{macrocode}
-% \begin{macro}{\FNH at inactive}
-% Apart from fixing some of the bugs with |footnote.sty|'s footnote
-% environment, we intervene only if |hyperfootnotes| option of |hyperref|
-% applies.
+% \end{macro}\end{macro}\end{macro}
+% \begin{macro}{\FNH at hyper@fntext at i}
+% We do the \cs{ifHy at nesting} test although hyperref's manual
+% says ``Allows links to be nested; no drivers currently support this.''
 %    \begin{macrocode}
-\AtBeginDocument{\@ifpackageloaded{hyperref}
-  {\ifHy at hyperfootnotes
-    \let\fn at fntext \FNH at hyper@fntext
-    \let\spewnotes \FNH at hyper@spewnotes
-    \let\endsavenotes\spewnotes
-    \let\fn at endfntext\FNH at fixed@endfntext
-    \let\footnote    \FNH at fixed@footnote
-    \let\footnotetext\FNH at fixed@footnotetext
-   \else
-     \FNH at inactive
-   \fi }{\FNH at inactive}% 
-    \let\endfootnote\fn at endfntext
-    \let\endfootnotetext\endfootnote
+\long\def\FNH at hyper@fntext at i#1{%
+  \global\setbox\FNH at notes\vbox
+  {\unvbox\FNH at notes
+   \FNH at startnote
+   \@makefntext
+    {\rule\z@\footnotesep\ignorespaces
+     \ifHy at nesting\expandafter\ltx at firstoftwo
+             \else\expandafter\ltx at secondoftwo
+     \fi
+     {\expandafter\hyper@@anchor\expandafter{\Hy at footnote@currentHref}{#1}}%
+     {\Hy at raisedlink
+       {\expandafter\hyper@@anchor\expandafter{\Hy at footnote@currentHref}%
+       {\relax}}%
+      \let\@currentHref\Hy at footnote@currentHref
+      \let\@currentlabelname\@empty
+      #1}%
+     \@finalstrut\strutbox
+    }%
+   \FNH at endnote
+  }%
 }%
 %    \end{macrocode}
-% |v0.9e| did a partial fix of the |footnote| environment from |footnote.sty|,
-% |v0.9f| fix is more complete but is applied only if |hyperref| is present with
-% option |hyperfootnotes=true|.
+% \end{macro}
+% \begin{macro}{\FNH at nohyp@fntext at i}
+% The original \cs{fn at fntext} had no \cs{long}.
 %    \begin{macrocode}
-\def\FNH at fix@endfntext\@finalstrut\strutbox\fn at postfntext
-    {\@finalstrut\strutbox\fn at postfntext\fn at endnote}%
-\def\FNH at inactive {%
-    \let\footnote    \FNH at fn@footnote
-    \let\footnotetext\FNH at fn@footnotetext
-    \expandafter\expandafter\expandafter\def
-    \expandafter\expandafter\expandafter\fn at endfntext
-    \expandafter\expandafter\expandafter
-       {\expandafter\FNH at fix@endfntext\fn at endfntext}%
-    \PackageInfo{footnotehyper}%
-     {hyperref package not loaded or hyperfootnotes^^J
-  =false option; I did not activate myself and only patched footnote.sty^^J
-  for color/xcolor compatibility, leaving some other issues unfixed.}}%
+\long\def\FNH at nohyp@fntext at i#1{%
+  \global\setbox\FNH at notes\vbox
+  {\unvbox\FNH at notes
+   \FNH at startnote
+   \@makefntext{\rule\z@\footnotesep\ignorespaces#1\@finalstrut\strutbox}%
+   \FNH at endnote
+  }%
+}%
 %    \end{macrocode}
 % \end{macro}
-% \begin{macro}{\FNH at hyper@fntext}
-% Some |amsmath| complications. I change the coding, but same effect as
-% in original |\fn at fntext|.
+% \begin{macro}{\FNH at startnote}
+% Same as original (the code comment is kept from original.)
 %    \begin{macrocode}
-\def\FNH at hyper@fntext {\ifx\ifmeasuring@\undefined\expandafter\@secondoftwo
-                                      \else\expandafter\@firstofone\fi
-    {\ifmeasuring@\expandafter\@gobbletwo\fi}%
-    \FNH at hyper@fntext at i }%
+\def\FNH at startnote{%
+  \hsize\FNH at colwidth
+  \interlinepenalty\interfootnotelinepenalty
+  \reset at font\footnotesize
+  \floatingpenalty\@MM% Is this right???
+  \@parboxrestore
+  \protected at edef\@currentlabel{\csname p@\@mpfn\endcsname\@thefnmark}%
+  \color at begingroup
+}%
 %    \end{macrocode}
 % \end{macro}
-% \begin{macro}{\FNH at hyper@fntext at i}
-% Note: original \cs{fn at fntext} had no \cs{long}, which looks wrong.
-%
-% We do the \cs{ifHy at nesting} test although hyperref's manual
-% says ``Allows links to be nested; no drivers currently support this.''
+% \begin{macro}{\FNH at endnote}
+% Fixed from original.
 %    \begin{macrocode}
-\long\def\FNH at hyper@fntext at i #1{\global\setbox\fn at notes\vbox
-     {\unvbox\fn at notes
-      \fn at startnote
-      \@makefntext
-       {\rule\z@\footnotesep\ignorespaces
-        \ifHy at nesting\expandafter\ltx at firstoftwo
-                \else\expandafter\ltx at secondoftwo
-        \fi
-        {\expandafter\hyper@@anchor\expandafter{\Hy at footnote@currentHref}{#1}}%
-        {\Hy at raisedlink
-          {\expandafter\hyper@@anchor\expandafter{\Hy at footnote@currentHref}%
-          {\relax}}%
-         \let\@currentHref\Hy at footnote@currentHref
-         \let\@currentlabelname\@empty
-         #1}%
-      \@finalstrut\strutbox }%
-      \fn at endnote }%
+\def\FNH at endnote{\color at endgroup}%
+%    \end{macrocode}
+% \end{macro}
+% \begin{macro}{\FNH at savenotes}
+% Same as original apart from using |hyperref|-aware \cs{FNH at hyper@fntext},
+% and taking into account |hyperref|'s custom \cs{@xfootnotetext}. This was
+% missed by |v0.9f| hence |\footnotetext[N]{..}| did not work
+% inside |savenotes| environment. Fixed for |v0.99|.
+% 
+% Maybe I should change the way \cs{@minipagerestore} is handled.
+%    \begin{macrocode}
+\def\FNH at savenotes{%
+  \begingroup
+  \ifFNH at savingnotes\else
+    \FNH at savingnotestrue
+    \let\@footnotetext    \FNH at hyper@fntext
+    \let\@mpfootnotetext  \FNH at hyper@fntext
+    \let\H@@mpfootnotetext\FNH at nohyp@fntext % fool hyperref's \@xfootnotetext
+    \FNH at width\columnwidth
+    \let\FNH at colwidth\FNH at width
+    \global\setbox\FNH at notes\box\voidb at x
+    \let\FNH at thempfn\thempfn
+    \let\FNH at mpfn\@mpfn
+    \ifx\@minipagerestore\relax\let\@minipagerestore\@empty\fi
+    \expandafter\def\expandafter\@minipagerestore\expandafter{%
+      \@minipagerestore
+      \let\thempfn\FNH at thempfn
+      \let\@mpfn\FNH at mpfn
+    }%
+  \fi
 }%
 %    \end{macrocode}
 % \end{macro}
-% \begin{macro}{\FNH at hyper@spewnotes}
-%   The final touch in our hack is to patch the original \cs{spewnotes} for it
-%   to use the original, non-hyperref modified, version of \cs{@footnotetext}.
-%   And let's not forget \cs{endsavenotes} (done at begin document).
+% \begin{macro}{\FNH at spewnotes}
+% This uses \cs{H@@footnotetext} which is the preserved original
+% meaning of \cs{@footnotetext} not creating a link target.
 %    \begin{macrocode}
-\def\FNH at hyper@spewnotes {\endgroup
-    \if at savingnotes\else\ifvoid\fn at notes\else
-    \begingroup\let\@makefntext\@empty
-               \let\@finalstrut\@gobble
-               \let\rule\@gobbletwo
-               \H@@footnotetext{\unvbox\fn at notes}%
-    \endgroup\fi\fi
+\def\FNH at spewnotes {%
+  \endgroup
+  \ifFNH at savingnotes\else
+   \ifvoid\FNH at notes\else
+    \begingroup
+     \let\@makefntext\@empty
+     \let\@finalstrut\@gobble
+     \let\rule\@gobbletwo
+     \H@@footnotetext{\unvbox\FNH at notes}%
+    \endgroup
+   \fi
+  \fi
 }%
 %    \end{macrocode}
 % \end{macro}
-% \begin{macro}{\FNH at fixed@endfntext}
+% \begin{macro}{\FNH at footnote}
+% \begin{macro}{\FNH at footnotetext}
 %   We now take care of |footnote.sty|'s |footnote| environment. The original
 %   \cs{fn at endfntext} is lacking a \cs{fn at endnote}, and this meant that
 %   |footnote.sty| was incompatible with |color/xcolor| packages. Also this
@@ -737,113 +835,186 @@
 %
 %   The |footnotetext| environment adds a complication, in case of optional
 %   argument we should not try to set up a link due to the fact that |hyperref|
-%   does not support them for |\footnotemark[N]/\footnotetext[N]| syntax.
+%   does not support it for the |\footnotemark[N]/\footnotetext[N]| syntax.
 %   And we need to make sure that the |footnote| and |footnotetext| environments
 %   obey the |\savenotes/\spewnotes| mechanism.
 %
 %   To handle all of this we code things completely differently from
-%   |footnote.sty|, its |\fn at getmark| isn't used at all.
+%   |footnote.sty|.
+% 
+%   The |v0.9f| |\begin{footnotetext}[N]| inside |savenotes| tried to create
+%   an hyperref target. Fixed for |v0.99|.
+%
+%   Note: the |footnote.sty| code did a |\leavevmode\unskip| at entrance of
+%   |footnote| environment, which \fnh has not kept.
 %    \begin{macrocode}
-\def\FNH at fixed@endfntext {%
-    \@finalstrut\strutbox
-    \fn at postfntext
-    \fn at endnote
-    \egroup\FNH at endfntext@next % will decide if link or no link
+\def\FNH at footnote@envname    {footnote}%
+\def\FNH at footnotetext@envname{footnotetext}%
+\def\FNH at footnote{%
+    \ifx\@currenvir\FNH at footnote@envname
+        \expandafter\FNH at footnoteenv
+    \else
+        \expandafter\FNH at latex@footnote
+    \fi
 }%
-\def\FNH at endfntext@link {\begingroup
-    \let\@makefntext\@empty\let\@finalstrut\@gobble\let\rule\@gobbletwo
-    \@footnotetext {\unvbox\z@}%
-    \endgroup
+\def\FNH at footnoteenv{%
+    \@ifnextchar[%
+      \FNH at footnoteenv@i %]
+      {\stepcounter\@mpfn
+       \protected at xdef\@thefnmark{\thempfn}%
+       \@footnotemark
+       \def\FNH at endfntext@fntext{\@footnotetext}%
+       \FNH at startfntext}%
 }%
-\def\FNH at endfntext@nolink {\begingroup
-    \let\@makefntext\@empty\let\@finalstrut\@gobble
-    \let\rule\@gobbletwo
-    \if at savingnotes\expandafter\fn at fntext\else\expandafter\H@@footnotetext\fi
-    {\unvbox\z@}\endgroup
-}%
-%    \end{macrocode}
-% \end{macro}
-% \begin{macro}{\FNH at fixed@footnote}
-% \begin{macro}{\FNH at fixed@footnotetext}
-%    \begin{macrocode}
-\def\FNH at fixed@footnote {\ifx\@currenvir\fn at footnote
-    \expandafter\FNH at footnoteenv\else\expandafter\fn at latex@@footnote\fi }%
-\def\FNH at footnoteenv {\@ifnextchar[\FNH at xfootnoteenv%]
-    {\stepcounter\@mpfn
-     \protected at xdef\@thefnmark{\thempfn}\@footnotemark
-     \def\FNH at endfntext@next{\FNH at endfntext@link}\fn at startfntext}}%
-\def\FNH at xfootnoteenv [#1]{%
+\def\FNH at footnoteenv@i[#1]{%
     \begingroup
      \csname c@\@mpfn\endcsname #1\relax
      \unrestored at protected@xdef\@thefnmark{\thempfn}%
-    \endgroup\@footnotemark\def\FNH at endfntext@next{\FNH at endfntext@link}%
-    \fn at startfntext}%
-\def\FNH at fixed@footnotetext {\ifx\@currenvir\fn at footnotetext
-  \expandafter\FNH at footnotetextenv\else\expandafter\fn at latex@@footnotetext\fi}%
-\def\FNH at footnotetextenv {\@ifnextchar[\FNH at xfootnotetextenv%]
-    {\protected at xdef\@thefnmark{\thempfn}%
-     \def\FNH at endfntext@next{\FNH at endfntext@link}\fn at startfntext}}%
-\def\FNH at xfootnotetextenv [#1]{%
+    \endgroup
+    \@footnotemark
+    \def\FNH at endfntext@fntext{\@footnotetext}%
+    \FNH at startfntext
+}%
+\def\FNH at footnotetext{%
+    \ifx\@currenvir\FNH at footnotetext@envname
+        \expandafter\FNH at footnotetextenv
+    \else
+        \expandafter\FNH at latex@footnotetext
+    \fi
+}%
+\def\FNH at footnotetextenv{%
+    \@ifnextchar[%
+      \FNH at footnotetextenv@i %]
+      {\protected at xdef\@thefnmark{\thempfn}%
+       \def\FNH at endfntext@fntext{\@footnotetext}%
+       \FNH at startfntext}%
+}%
+\def\FNH at footnotetextenv@i[#1]{%
     \begingroup
      \csname c@\@mpfn\endcsname #1\relax
      \unrestored at protected@xdef\@thefnmark{\thempfn}%
-    \endgroup\def\FNH at endfntext@next{\FNH at endfntext@nolink}%
-    \fn at startfntext }%
+    \endgroup
+    \ifFNH at savingnotes
+      \def\FNH at endfntext@fntext{\FNH at nohyp@fntext}%
+    \else
+      \def\FNH at endfntext@fntext{\H@@footnotetext}%
+    \fi
+    \FNH at startfntext
+}%
 %    \end{macrocode}
 % \end{macro}\end{macro}
-% \begin{macro}{\@makefntext}
-% \begin{macro}{\fn at prefntext}
-% \begin{macro}{\fn at postfntext}
-%   The definitions of |\fn at prefntext| and |\fn at prefntext| (which are needed for
-%   the |footnote| environment, within |\fn at startfntext| and |\fn at endfntext|)
-%   are from a daring analysis done inside |footnote.sty| of |\@makefntext|. It
-%   may very easily fail to give a sensible result. \fnh does a check of its own
-%   to determine if that was the case but can't salvage the situation, except
-%   for hard-coded rescues like done here with |frenchb|. In particular the
-%   mechanism is doomed to failure if the parameter in |\@makefntext| is not
-%   visible at top level in its meaning. It is also wrong if the parameter is
-%   used multiple times. These checks will fail (rather, they are skipped) if
-%   |footnote|'s loading was done by the user and not by |footnotehyper|.
+% \begin{macro}{\FNH at startfntext}
+% \begin{macro}{\FNH at endfntext}
+% \begin{macro}{\FNH at endfntext@fntext}
+% This is used for the environmental form of the footnote environments.
+% The use of |\box\z@| originates in |footnote.sty|, should I change that ?
 %
-%   Note: there is an interference which I could fix here between |hyperref|
-%   and |frenchb| regarding |\footnotemark[NUM]|, but it is better to wait it
-%   is fixed on |frenchb| side (or |hyperref|'s side !), else my own fix might
-%   badly interfere with the ``official'' one |;-)|.
+% Both of \cs{endfootnote} and \cs{endfootnotetext} are aliases for
+% \cs{FNH at endfntext}.
+%
+% The \cs{FNH at endfntext@fntext} may be \cs{@footnotetext} (which will be
+% \cs{FNH at hyper@fntext} in |savingnotes| environment), or
+% \cs{H@@footnotetext}, or \cs{FNH at nohyp@fntext} if in |savingnotes| scope.
 %    \begin{macrocode}
-\ifx\FNH@@makefntext\undefined\expandafter\@gobble
-   \else\expandafter\AtBeginDocument\fi
-{%
- \ifx\@makefntextFB\undefined
-                   \expandafter\@gobble\else\expandafter\@firstofone\fi
- {\ifFBFrenchFootnotes \let\FNH@@makefntext\@makefntextFB \else 
-                       \let\FNH@@makefntext\@makefntextORI\fi}% 
- \expandafter\FNH at check@a\FNH@@makefntext{1.2!3?4,}\FNH@@@1.2!3?4,\FNH@@@\relax
+\def\FNH at startfntext{%
+  \setbox\z@\vbox\bgroup
+    \FNH at startnote
+    \FNH at prefntext
+    \rule\z@\footnotesep\ignorespaces
 }%
-\long\def\FNH at check@a #11.2!3?4,#2\FNH@@@#3%
-{%
-     \ifx\relax#3\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi
-     \FNH at bad@footnote at env
-     {\def\fn at prefntext{#1}\def\fn at postfntext{#2}\FNH at check@b}%
+\def\FNH at endfntext {%
+    \@finalstrut\strutbox
+    \FNH at postfntext
+    \FNH at endnote
+    \egroup
+  \begingroup
+    \let\@makefntext\@empty\let\@finalstrut\@gobble\let\rule\@gobbletwo
+    \FNH at endfntext@fntext {\unvbox\z@}%
+  \endgroup
 }%
-\def\FNH at check@b #1\relax
-{%
+%    \end{macrocode}
+% \end{macro}\end{macro}\end{macro}
+% \begin{macro}{\@makefntext}
+% \begin{macro}{\FNH at prefntext}
+% \begin{macro}{\FNH at postfntext}
+%   The definitions of |\FNH at prefntext| and |\FNH at prefntext| (which are needed
+%   for the |footnote| environment, |\FNH at startfntext| and |\FNH at endfntext|)
+%   are extracted from a somewhat daring analysis of |\@makefntext|.
+%   Contrarily to |footnote.sty|'s original code (which may cause low level
+%   \TeX\
+%   errors in bad cases) the method here will alert the user if the argument
+%   of |\@makefntext| is not visible at top level in its meaning or is used
+%   there multiple times. We also insert here some code to handle especially
+%   the case of |babel-frenchb|.
+%    \begin{macrocode}
+\AtBeginDocument{\let\FNH@@makefntext\@makefntext
+   \ifx\@makefntextFB\undefined
+   \expandafter\@gobble\else\expandafter\@firstofone\fi
+   {\ifFBFrenchFootnotes \let\FNH@@makefntext\@makefntextFB \else
+                         \let\FNH@@makefntext\@makefntextORI\fi}%
+   \expandafter\FNH at check@a\FNH@@makefntext{1.2!3?4,}%
+               \FNH@@@1.2!3?4,\FNH@@@\relax
+}%
+\long\def\FNH at check@a #11.2!3?4,#2\FNH@@@#3{%
+    \ifx\relax#3\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi
+    \FNH at bad@makefntext at alert
+    {\def\FNH at prefntext{#1}\def\FNH at postfntext{#2}\FNH at check@b}%
+}%
+\def\FNH at check@b #1\relax{%
     \expandafter\expandafter\expandafter\FNH at check@c
-    \expandafter\meaning\expandafter\fn at prefntext
-                            \meaning\fn at postfntext1.2!3?4,\FNH at check@c\relax
+    \expandafter\meaning\expandafter\FNH at prefntext
+    \meaning\FNH at postfntext1.2!3?4,\FNH at check@c\relax
 }%
-\def\FNH at check@c #11.2!3?4,#2#3\relax 
-   {\ifx\FNH at check@c#2\expandafter\@gobble\fi\FNH at bad@footnote at env}%
-\def\FNH at bad@footnote at env 
-{\PackageWarningNoLine{footnotehyper}%
- {The footnote environment from package footnote^^J
-  will be dysfunctional, sorry (not my fault...). You may try to mail me the^^J
-  preamble and/or only the next lines:}%
+\def\FNH at check@c #11.2!3?4,#2#3\relax{%
+    \ifx\FNH at check@c#2\expandafter\@gobble\fi\FNH at bad@makefntext at alert
+}%
+\def\FNH at bad@makefntext at alert{%
+    \PackageWarningNoLine{footnotehyper}%
+      {^^J The footnote environment will not be fully functional, sorry.^^J
+       You may try to email the author with the following information:}%
     \typeout{\meaning\@makefntext}%
-    \let\fn at prefntext\@empty\let\fn at postfntext\@empty  
+    \let\FNH at prefntext\@empty\let\FNH at postfntext\@empty
 }%
+%    \end{macrocode}
+% \end{macro}\end{macro}\end{macro}
+% \begin{macro}{\makesavenoteenv}
+% Same as original. Not recommended. Safer to use explicitely
+% |savenotes| environment.
+%    \begin{macrocode}
+\def\makesavenoteenv{\@ifnextchar[\FNH at msne@ii\FNH at msne@i}%]
+\def\FNH at msne@i #1{%
+  \expandafter\let\csname FNH$#1\expandafter\endcsname %$
+                  \csname #1\endcsname
+  \expandafter\let\csname endFNH$#1\expandafter\endcsname %$
+                  \csname end#1\endcsname
+  \FNH at msne@ii[#1]{FNH$#1}%$
+}%
+\def\FNH at msne@ii[#1]#2{%
+  \expandafter\edef\csname#1\endcsname{%
+    \noexpand\savenotes
+    \expandafter\noexpand\csname#2\endcsname
+  }%
+  \expandafter\edef\csname end#1\endcsname{%
+    \expandafter\noexpand\csname end#2\endcsname
+    \noexpand\expandafter
+    \noexpand\spewnotes
+    \noexpand\if at endpe\noexpand\@endpetrue\noexpand\fi
+  }%
+}%
+%    \end{macrocode}
+% \end{macro}
+% Original footnote.sty patches |\parbox|, we don't touch it. Also it defines a
+% |minipage*|  environment, we don't do it.
+%    \begin{macrocode}
+% \makesavenoteenv[minipage*]{minipage}
+% \let\fn at parbox\parbox
+% \def\parbox{\@ifnextchar[{\fn at parbox@i{}}{\fn at parbox@ii{}}}
+% \def\fn at parbox@i#1[#2]{%
+%   \@ifnextchar[{\fn at parbox@i{#1[#2]}}{\fn at parbox@ii{#1[#2]}}%
+% }
+% \long\def\fn at parbox@ii#1#2#3{\savenotes\fn at parbox#1{#2}{#3}\spewnotes}
 \endinput
 %    \end{macrocode}
-% \end{macro}\end{macro}\end{macro}
 % \MakePercentComment
 \Finale
 %%

Modified: trunk/Master/texmf-dist/source/latex/footnotehyper/footnotehyper.ins
===================================================================
--- trunk/Master/texmf-dist/source/latex/footnotehyper/footnotehyper.ins	2017-02-17 22:27:03 UTC (rev 43259)
+++ trunk/Master/texmf-dist/source/latex/footnotehyper/footnotehyper.ins	2017-02-17 22:27:22 UTC (rev 43260)
@@ -1,13 +1,13 @@
 %%
 %% Package: footnotehyper
-%% Version: 0.9f (2016/10/03)
+%% Version: 0.99 (2017/02/16)
 %% License: LPPL 1.3c
-%% Copyright (C) 2016 Jean-Francois Burnol <jfbu at free dot fr>.
+%% Copyright (C) 2016-2017 Jean-Francois Burnol <jfbu at free dot fr>.
 %%
 \def\pkgname        {footnotehyper}
-\def\pkgdate        {2016/10/03}
-\def\docdate        {2016/10/03}
-\def\pkgversion     {v0.9f}
+\def\pkgdate        {2017/02/16}
+\def\docdate        {2017/02/16}
+\def\pkgversion     {v0.99}
 \def\pkgdescription {hyperref aware footnote.sty (JFB)}
 %%
 %% Run tex on this file to extract from footnotehyper.dtx:

Modified: trunk/Master/texmf-dist/tex/latex/footnotehyper/footnotehyper.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/footnotehyper/footnotehyper.sty	2017-02-17 22:27:03 UTC (rev 43259)
+++ trunk/Master/texmf-dist/tex/latex/footnotehyper/footnotehyper.sty	2017-02-17 22:27:22 UTC (rev 43260)
@@ -23,163 +23,234 @@
 %%
 \NeedsTeXFormat{LaTeX2e}
 \ProvidesPackage{footnotehyper}%
- [2016/10/03 v0.9f hyperref aware footnote.sty (JFB)]
+ [2017/02/16 v0.99 hyperref aware footnote.sty (JFB)]
 %%
 %% Package: footnotehyper
-%% Version: 0.9f (2016/10/03)
+%% Version: 0.99 (2017/02/16)
 %% License: LPPL 1.3c
-%% Copyright (C) 2016 Jean-Francois Burnol <jfbu at free dot fr>.
+%% Copyright (C) 2016-2017 Jean-Francois Burnol <jfbu at free dot fr>.
 %%
-\DeclareOption*{\PackageWarning{footnotehyper}{Option `\CurrentOption' is unknown}}%
+\DeclareOption*%
+    {\PackageWarning{footnotehyper}{Option `\CurrentOption' is unknown}}%
 \ProcessOptions\relax
-\@ifpackageloaded{footnote}
- {\PackageWarningNoLine{footnotehyper}%
-  {Please next time do not load package footnote,^^J
- but leave that to me. For the time being, I will start by undoing the^^J
- modifications it did to \string\parbox. Use \string\fnparbox\space if needed.}%
- }
- {\let\FNH@@makefntext\@makefntext\let\@makefntext\@firstofone
-  \RequirePackage{footnote}
-  \let\@makefntext\FNH@@makefntext
- }%
-\let\fnparbox\parbox\let\parbox\fn at parbox
-\let\FNH at fn@footnote    \footnote     % footnote.sty's \footnote will get
-\let\FNH at fn@footnotetext\footnotetext % redefined later. We preserve also
-\let\footnote    \fn at latex@@footnote  % the meaning of \footnote from prior
-\let\footnotetext\fn at latex@@footnotetext % to the loading of footnote.sty
-\def\fn at endnote  {\color at endgroup}%
+\newbox\FNH at notes
+\newdimen\FNH at width
+\let\FNH at colwidth\columnwidth
+\newif\ifFNH at savingnotes
 \AtBeginDocument {%
-    \let\fn at latex@@footnote    \footnote % meaning of \footnote at end of preamble
-    \let\fn at latex@@footnotetext\footnotetext
-}%
-\AtBeginDocument{\@ifpackageloaded{hyperref}
+  \@ifpackageloaded{hyperref}
   {\ifHy at hyperfootnotes
-    \let\fn at fntext \FNH at hyper@fntext
-    \let\spewnotes \FNH at hyper@spewnotes
-    \let\endsavenotes\spewnotes
-    \let\fn at endfntext\FNH at fixed@endfntext
-    \let\footnote    \FNH at fixed@footnote
-    \let\footnotetext\FNH at fixed@footnotetext
+    \let\FNH at latex@footnote    \footnote
+    \let\FNH at latex@footnotetext\footnotetext
+    \newenvironment{savenotes}
+        {\FNH at savenotes\ignorespaces}{\FNH at spewnotes\ignorespacesafterend}%
+    \let\spewnotes      \FNH at spewnotes
+    \let\footnote       \FNH at footnote
+    \let\footnotetext   \FNH at footnotetext
+    \let\endfootnote    \FNH at endfntext
+    \let\endfootnotetext\FNH at endfntext
    \else
-     \FNH at inactive
-   \fi }{\FNH at inactive}%
-    \let\endfootnote\fn at endfntext
-    \let\endfootnotetext\endfootnote
-}%
-\def\FNH at fix@endfntext\@finalstrut\strutbox\fn at postfntext
-    {\@finalstrut\strutbox\fn at postfntext\fn at endnote}%
-\def\FNH at inactive {%
-    \let\footnote    \FNH at fn@footnote
-    \let\footnotetext\FNH at fn@footnotetext
-    \expandafter\expandafter\expandafter\def
-    \expandafter\expandafter\expandafter\fn at endfntext
-    \expandafter\expandafter\expandafter
-       {\expandafter\FNH at fix@endfntext\fn at endfntext}%
     \PackageInfo{footnotehyper}%
-     {hyperref package not loaded or hyperfootnotes^^J
-  =false option; I did not activate myself and only patched footnote.sty^^J
-  for color/xcolor compatibility, leaving some other issues unfixed.}}%
-\def\FNH at hyper@fntext {\ifx\ifmeasuring@\undefined\expandafter\@secondoftwo
-                                      \else\expandafter\@firstofone\fi
-    {\ifmeasuring@\expandafter\@gobbletwo\fi}%
-    \FNH at hyper@fntext at i }%
-\long\def\FNH at hyper@fntext at i #1{\global\setbox\fn at notes\vbox
-     {\unvbox\fn at notes
-      \fn at startnote
-      \@makefntext
-       {\rule\z@\footnotesep\ignorespaces
-        \ifHy at nesting\expandafter\ltx at firstoftwo
-                \else\expandafter\ltx at secondoftwo
-        \fi
-        {\expandafter\hyper@@anchor\expandafter{\Hy at footnote@currentHref}{#1}}%
-        {\Hy at raisedlink
-          {\expandafter\hyper@@anchor\expandafter{\Hy at footnote@currentHref}%
-          {\relax}}%
-         \let\@currentHref\Hy at footnote@currentHref
-         \let\@currentlabelname\@empty
-         #1}%
-      \@finalstrut\strutbox }%
-      \fn at endnote }%
+     {inactive due to hyperfootnotes=false option}%
+   \fi}%
+ {\PackageWarning{footnotehyper}{^^J\@spaces\@spaces*************^^J%
+  \space deactivating myself as hyperref is not detected !^^J}}%
 }%
-\def\FNH at hyper@spewnotes {\endgroup
-    \if at savingnotes\else\ifvoid\fn at notes\else
-    \begingroup\let\@makefntext\@empty
-               \let\@finalstrut\@gobble
-               \let\rule\@gobbletwo
-               \H@@footnotetext{\unvbox\fn at notes}%
-    \endgroup\fi\fi
+\def\FNH at hyper@fntext{\FNH at fntext\FNH at hyper@fntext at i}%
+\def\FNH at nohyp@fntext{\FNH at fntext\FNH at nohyp@fntext at i}%
+\def\FNH at fntext #1{\ifx\ifmeasuring@\@undefined
+    \expandafter\@secondoftwo\else\expandafter\@firstofone\fi
+    {\ifmeasuring@\expandafter\@gobbletwo\fi}#1%
 }%
-\def\FNH at fixed@endfntext {%
-    \@finalstrut\strutbox
-    \fn at postfntext
-    \fn at endnote
-    \egroup\FNH at endfntext@next % will decide if link or no link
+\long\def\FNH at hyper@fntext at i#1{%
+  \global\setbox\FNH at notes\vbox
+  {\unvbox\FNH at notes
+   \FNH at startnote
+   \@makefntext
+    {\rule\z@\footnotesep\ignorespaces
+     \ifHy at nesting\expandafter\ltx at firstoftwo
+             \else\expandafter\ltx at secondoftwo
+     \fi
+     {\expandafter\hyper@@anchor\expandafter{\Hy at footnote@currentHref}{#1}}%
+     {\Hy at raisedlink
+       {\expandafter\hyper@@anchor\expandafter{\Hy at footnote@currentHref}%
+       {\relax}}%
+      \let\@currentHref\Hy at footnote@currentHref
+      \let\@currentlabelname\@empty
+      #1}%
+     \@finalstrut\strutbox
+    }%
+   \FNH at endnote
+  }%
 }%
-\def\FNH at endfntext@link {\begingroup
-    \let\@makefntext\@empty\let\@finalstrut\@gobble\let\rule\@gobbletwo
-    \@footnotetext {\unvbox\z@}%
+\long\def\FNH at nohyp@fntext at i#1{%
+  \global\setbox\FNH at notes\vbox
+  {\unvbox\FNH at notes
+   \FNH at startnote
+   \@makefntext{\rule\z@\footnotesep\ignorespaces#1\@finalstrut\strutbox}%
+   \FNH at endnote
+  }%
+}%
+\def\FNH at startnote{%
+  \hsize\FNH at colwidth
+  \interlinepenalty\interfootnotelinepenalty
+  \reset at font\footnotesize
+  \floatingpenalty\@MM% Is this right???
+  \@parboxrestore
+  \protected at edef\@currentlabel{\csname p@\@mpfn\endcsname\@thefnmark}%
+  \color at begingroup
+}%
+\def\FNH at endnote{\color at endgroup}%
+\def\FNH at savenotes{%
+  \begingroup
+  \ifFNH at savingnotes\else
+    \FNH at savingnotestrue
+    \let\@footnotetext    \FNH at hyper@fntext
+    \let\@mpfootnotetext  \FNH at hyper@fntext
+    \let\H@@mpfootnotetext\FNH at nohyp@fntext % fool hyperref's \@xfootnotetext
+    \FNH at width\columnwidth
+    \let\FNH at colwidth\FNH at width
+    \global\setbox\FNH at notes\box\voidb at x
+    \let\FNH at thempfn\thempfn
+    \let\FNH at mpfn\@mpfn
+    \ifx\@minipagerestore\relax\let\@minipagerestore\@empty\fi
+    \expandafter\def\expandafter\@minipagerestore\expandafter{%
+      \@minipagerestore
+      \let\thempfn\FNH at thempfn
+      \let\@mpfn\FNH at mpfn
+    }%
+  \fi
+}%
+\def\FNH at spewnotes {%
+  \endgroup
+  \ifFNH at savingnotes\else
+   \ifvoid\FNH at notes\else
+    \begingroup
+     \let\@makefntext\@empty
+     \let\@finalstrut\@gobble
+     \let\rule\@gobbletwo
+     \H@@footnotetext{\unvbox\FNH at notes}%
     \endgroup
+   \fi
+  \fi
 }%
-\def\FNH at endfntext@nolink {\begingroup
-    \let\@makefntext\@empty\let\@finalstrut\@gobble
-    \let\rule\@gobbletwo
-    \if at savingnotes\expandafter\fn at fntext\else\expandafter\H@@footnotetext\fi
-    {\unvbox\z@}\endgroup
+\def\FNH at footnote@envname    {footnote}%
+\def\FNH at footnotetext@envname{footnotetext}%
+\def\FNH at footnote{%
+    \ifx\@currenvir\FNH at footnote@envname
+        \expandafter\FNH at footnoteenv
+    \else
+        \expandafter\FNH at latex@footnote
+    \fi
 }%
-\def\FNH at fixed@footnote {\ifx\@currenvir\fn at footnote
-    \expandafter\FNH at footnoteenv\else\expandafter\fn at latex@@footnote\fi }%
-\def\FNH at footnoteenv {\@ifnextchar[\FNH at xfootnoteenv%]
-    {\stepcounter\@mpfn
-     \protected at xdef\@thefnmark{\thempfn}\@footnotemark
-     \def\FNH at endfntext@next{\FNH at endfntext@link}\fn at startfntext}}%
-\def\FNH at xfootnoteenv [#1]{%
+\def\FNH at footnoteenv{%
+    \@ifnextchar[%
+      \FNH at footnoteenv@i %]
+      {\stepcounter\@mpfn
+       \protected at xdef\@thefnmark{\thempfn}%
+       \@footnotemark
+       \def\FNH at endfntext@fntext{\@footnotetext}%
+       \FNH at startfntext}%
+}%
+\def\FNH at footnoteenv@i[#1]{%
     \begingroup
      \csname c@\@mpfn\endcsname #1\relax
      \unrestored at protected@xdef\@thefnmark{\thempfn}%
-    \endgroup\@footnotemark\def\FNH at endfntext@next{\FNH at endfntext@link}%
-    \fn at startfntext}%
-\def\FNH at fixed@footnotetext {\ifx\@currenvir\fn at footnotetext
-  \expandafter\FNH at footnotetextenv\else\expandafter\fn at latex@@footnotetext\fi}%
-\def\FNH at footnotetextenv {\@ifnextchar[\FNH at xfootnotetextenv%]
-    {\protected at xdef\@thefnmark{\thempfn}%
-     \def\FNH at endfntext@next{\FNH at endfntext@link}\fn at startfntext}}%
-\def\FNH at xfootnotetextenv [#1]{%
+    \endgroup
+    \@footnotemark
+    \def\FNH at endfntext@fntext{\@footnotetext}%
+    \FNH at startfntext
+}%
+\def\FNH at footnotetext{%
+    \ifx\@currenvir\FNH at footnotetext@envname
+        \expandafter\FNH at footnotetextenv
+    \else
+        \expandafter\FNH at latex@footnotetext
+    \fi
+}%
+\def\FNH at footnotetextenv{%
+    \@ifnextchar[%
+      \FNH at footnotetextenv@i %]
+      {\protected at xdef\@thefnmark{\thempfn}%
+       \def\FNH at endfntext@fntext{\@footnotetext}%
+       \FNH at startfntext}%
+}%
+\def\FNH at footnotetextenv@i[#1]{%
     \begingroup
      \csname c@\@mpfn\endcsname #1\relax
      \unrestored at protected@xdef\@thefnmark{\thempfn}%
-    \endgroup\def\FNH at endfntext@next{\FNH at endfntext@nolink}%
-    \fn at startfntext }%
-\ifx\FNH@@makefntext\undefined\expandafter\@gobble
-   \else\expandafter\AtBeginDocument\fi
-{%
- \ifx\@makefntextFB\undefined
-                   \expandafter\@gobble\else\expandafter\@firstofone\fi
- {\ifFBFrenchFootnotes \let\FNH@@makefntext\@makefntextFB \else
-                       \let\FNH@@makefntext\@makefntextORI\fi}%
- \expandafter\FNH at check@a\FNH@@makefntext{1.2!3?4,}\FNH@@@1.2!3?4,\FNH@@@\relax
+    \endgroup
+    \ifFNH at savingnotes
+      \def\FNH at endfntext@fntext{\FNH at nohyp@fntext}%
+    \else
+      \def\FNH at endfntext@fntext{\H@@footnotetext}%
+    \fi
+    \FNH at startfntext
 }%
-\long\def\FNH at check@a #11.2!3?4,#2\FNH@@@#3%
-{%
-     \ifx\relax#3\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi
-     \FNH at bad@footnote at env
-     {\def\fn at prefntext{#1}\def\fn at postfntext{#2}\FNH at check@b}%
+\def\FNH at startfntext{%
+  \setbox\z@\vbox\bgroup
+    \FNH at startnote
+    \FNH at prefntext
+    \rule\z@\footnotesep\ignorespaces
 }%
-\def\FNH at check@b #1\relax
-{%
+\def\FNH at endfntext {%
+    \@finalstrut\strutbox
+    \FNH at postfntext
+    \FNH at endnote
+    \egroup
+  \begingroup
+    \let\@makefntext\@empty\let\@finalstrut\@gobble\let\rule\@gobbletwo
+    \FNH at endfntext@fntext {\unvbox\z@}%
+  \endgroup
+}%
+\AtBeginDocument{\let\FNH@@makefntext\@makefntext
+   \ifx\@makefntextFB\undefined
+   \expandafter\@gobble\else\expandafter\@firstofone\fi
+   {\ifFBFrenchFootnotes \let\FNH@@makefntext\@makefntextFB \else
+                         \let\FNH@@makefntext\@makefntextORI\fi}%
+   \expandafter\FNH at check@a\FNH@@makefntext{1.2!3?4,}%
+               \FNH@@@1.2!3?4,\FNH@@@\relax
+}%
+\long\def\FNH at check@a #11.2!3?4,#2\FNH@@@#3{%
+    \ifx\relax#3\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi
+    \FNH at bad@makefntext at alert
+    {\def\FNH at prefntext{#1}\def\FNH at postfntext{#2}\FNH at check@b}%
+}%
+\def\FNH at check@b #1\relax{%
     \expandafter\expandafter\expandafter\FNH at check@c
-    \expandafter\meaning\expandafter\fn at prefntext
-                            \meaning\fn at postfntext1.2!3?4,\FNH at check@c\relax
+    \expandafter\meaning\expandafter\FNH at prefntext
+    \meaning\FNH at postfntext1.2!3?4,\FNH at check@c\relax
 }%
-\def\FNH at check@c #11.2!3?4,#2#3\relax
-   {\ifx\FNH at check@c#2\expandafter\@gobble\fi\FNH at bad@footnote at env}%
-\def\FNH at bad@footnote at env
-{\PackageWarningNoLine{footnotehyper}%
- {The footnote environment from package footnote^^J
-  will be dysfunctional, sorry (not my fault...). You may try to mail me the^^J
-  preamble and/or only the next lines:}%
+\def\FNH at check@c #11.2!3?4,#2#3\relax{%
+    \ifx\FNH at check@c#2\expandafter\@gobble\fi\FNH at bad@makefntext at alert
+}%
+\def\FNH at bad@makefntext at alert{%
+    \PackageWarningNoLine{footnotehyper}%
+      {^^J The footnote environment will not be fully functional, sorry.^^J
+       You may try to email the author with the following information:}%
     \typeout{\meaning\@makefntext}%
-    \let\fn at prefntext\@empty\let\fn at postfntext\@empty
+    \let\FNH at prefntext\@empty\let\FNH at postfntext\@empty
 }%
+\def\makesavenoteenv{\@ifnextchar[\FNH at msne@ii\FNH at msne@i}%]
+\def\FNH at msne@i #1{%
+  \expandafter\let\csname FNH$#1\expandafter\endcsname %$
+                  \csname #1\endcsname
+  \expandafter\let\csname endFNH$#1\expandafter\endcsname %$
+                  \csname end#1\endcsname
+  \FNH at msne@ii[#1]{FNH$#1}%$
+}%
+\def\FNH at msne@ii[#1]#2{%
+  \expandafter\edef\csname#1\endcsname{%
+    \noexpand\savenotes
+    \expandafter\noexpand\csname#2\endcsname
+  }%
+  \expandafter\edef\csname end#1\endcsname{%
+    \expandafter\noexpand\csname end#2\endcsname
+    \noexpand\expandafter
+    \noexpand\spewnotes
+    \noexpand\if at endpe\noexpand\@endpetrue\noexpand\fi
+  }%
+}%
 \endinput
 %%
 %% End of file `footnotehyper.sty'.



More information about the tex-live-commits mailing list