summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2021-02-04 21:27:47 +0000
committerKarl Berry <karl@freefriends.org>2021-02-04 21:27:47 +0000
commit691ec7ec279cdcdc58986a1bed83b247aba17324 (patch)
tree99ba47a46bebfe0a9444f40268dd75a79c42bdde /Master/texmf-dist/tex/latex
parentd3473beebd0211ee7bdf5f1c6daed0796f64cf2e (diff)
footnotehyper (4feb21)
git-svn-id: svn://tug.org/texlive/trunk@57618 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex')
-rw-r--r--Master/texmf-dist/tex/latex/footnotehyper/footnotehyper.sty106
1 files changed, 83 insertions, 23 deletions
diff --git a/Master/texmf-dist/tex/latex/footnotehyper/footnotehyper.sty b/Master/texmf-dist/tex/latex/footnotehyper/footnotehyper.sty
index 822686446e8..e8f7db28b48 100644
--- a/Master/texmf-dist/tex/latex/footnotehyper/footnotehyper.sty
+++ b/Master/texmf-dist/tex/latex/footnotehyper/footnotehyper.sty
@@ -23,13 +23,15 @@
%%
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{footnotehyper}%
- [2021/01/29 v1.1c hyperref aware footnote.sty (JFB)]
+ [2021/02/04 v1.1d hyperref aware footnote.sty (JFB)]
%%
%% Package: footnotehyper
-%% Version: 1.1c (2021/01/29)
+%% Version: 1.1d (2021/02/04)
%% License: LPPL 1.3c
%% Copyright (C) 2016-2021 Jean-Francois Burnol <jfbu at free dot fr>.
%%
+\newif\iffootnotehyperparse\footnotehyperparsetrue
+\newif\iffootnotehyperwarn \footnotehyperwarntrue
\DeclareOption*%
{\PackageWarning{footnotehyper}{Option `\CurrentOption' is unknown}}%
\ProcessOptions\relax
@@ -230,44 +232,102 @@
\FNH@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@check@a\FNH@@makefntext{1.2!3?4,}%
- \FNH@@@1.2!3?4,\FNH@@@\relax
+\let\FNH@prefntext\@empty
+\let\FNH@postfntext\@empty
+\AtBeginDocument{\iffootnotehyperparse\expandafter\FNH@check\fi}%
+\def\FNH@safeif#1{%
+ \iftrue\csname if#1\endcsname\csname fi\endcsname\expandafter\@firstoftwo
+ \else\csname fi\endcsname\expandafter\@secondoftwo
+ \fi
+}%
+\def\FNH@check{%
+ \ifx\@makefntextFB\@undefined\expandafter\FNH@check@
+ \else\expandafter\FNH@frenchb@
+ \fi
+}%
+\def\FNH@frenchb@{%
+ \def\FNH@prefntext{%
+ \localleftbox{}%
+ \let\FBeverypar@save\FBeverypar@quote
+ \let\FBeverypar@quote\relax
+ \FNH@safeif{FB@koma}%
+ {\FNH@safeif{FBFrenchFootnotes}%
+ {\ifx\footnote\thanks
+ \let\@@makefnmark\@@makefnmarkTH
+ \@makefntextTH{} % space as in french.ldf
+ \else
+ \let\@@makefnmark\@@makefnmarkFB
+ \@makefntextFB{} % space as in french.ldf
+ \fi
+ }{\let\@@makefnmark\@@makefnmarkORI
+ \@makefntextORI{}% no space as in french.ldf
+ }%
+ }%
+ {\FNH@safeif{FBFrenchFootnotes}%
+ {\@makefntextFB{}}%
+ {\@makefntextORI{}}%
+ }%
+ }%
+ \def\FNH@postfntext{%
+ \let\FBeverypar@quote\FBeverypar@save
+ \localleftbox{\FBeveryline@quote}%
+ }%
+ \iffootnotehyperwarn
+ \PackageInfo{footnotehyper}%
+ {frenchb compatibility patch activated.^^J It will not work in
+ all circumstances.^^J In case of problems with the `footnote' or
+ `footnotetext' environments,^^J please send to the author a small
+ file demonstrating the problem.^^J To turn off this message, add
+ \string\footnotehyperwarnfalse\space to the preamble.^^J}%
+ \fi
+}%
+\def\FNH@check@{%
+ \expandafter\FNH@check@a\@makefntext{1.2!3?4,}%
+ \FNH@@@1.2!3?4,\FNH@@@\relax
}%
\long\def\FNH@check@a #11.2!3?4,#2\FNH@@@#3{%
- \ifx\relax#3\FNH@bad@makefntext@alert
+ \ifx\relax#3\expandafter\FNH@checkagain@
\else
- \edef\FNH@restore@{\catcode`\noexpand\@\the\catcode`\@\relax}%
- \makeatletter
- \ifx\@makefntextFB\undefined
- \expandafter\@gobble\else\expandafter\@firstofone\fi
- {\@ifclassloaded{memoir}%
- {\ifFBFrenchFootnotes\expandafter\@gobble\fi}%
- {}}%
- \@secondoftwo
- \scantokens{\def\FNH@prefntext{#1}\def\FNH@postfntext{#2}}%
- \FNH@restore@
+ \def\FNH@prefntext{#1}\def\FNH@postfntext{#2}%
\expandafter\FNH@check@b
\fi
}%
+\def\FNH@checkagain@{%
+ \expandafter\FNH@checkagain@a
+ \detokenize\expandafter{\@makefntext{1.2!3?4,}}\relax\FNH@@@
+}%
+\edef\FNH@temp{\noexpand\FNH@checkagain@a ##1\string{1.2!3?4,\string}}%
+\expandafter\def\FNH@temp#2#3\FNH@@@{%
+ \ifx\relax#2%
+ \def\FNH@prefntext{\@makefntext{}}%
+ \iffootnotehyperwarn
+ \PackageInfo{footnotehyper}%
+ {using \string\@makefntext{} approach.^^J
+ In case of problems with the footnote environments, please send^^J
+ to the author a small document source illustrating them. To turn^^J
+ off this message, add
+ \string\footnotehyperwarnfalse\space to preamble.^^J}%
+ \fi
+ \else\FNH@bad@makefntext@alert
+ \fi
+}%
\def\FNH@check@b #1\relax{%
\expandafter\expandafter\expandafter\FNH@check@c
\expandafter\meaning\expandafter\FNH@prefntext
\meaning\FNH@postfntext1.2!3?4,\FNH@check@c\relax
}%
\def\FNH@check@c #11.2!3?4,#2#3\relax{%
- \ifx\FNH@check@c#2\expandafter\@gobble\fi\FNH@bad@makefntext@alert
+ \ifx\FNH@check@c#2\else\FNH@bad@makefntext@alert\fi
}%
\def\FNH@bad@makefntext@alert{%
+ \iffootnotehyperwarn
\PackageWarningNoLine{footnotehyper}%
- {^^J The footnote environment will not be fully functional, sorry.^^J
+ {^^J The footnote environments will probably lack footnote numbers at^^J
+ bottom of pages, sorry.^^J
You may try to email the author this meaning of \string\@makefntext:^^J
\meaning\@makefntext^^J
- together with the used preamble}%
+ together with the document preamble}%
+ \fi
\let\FNH@prefntext\@empty\let\FNH@postfntext\@empty
}%
\def\makesavenoteenv{\@ifnextchar[\FNH@msne@ii\FNH@msne@i}%]