mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Merge pull request #8821 from jfbu/latex_sync_with_footnotehyper
Sync with footnotehyper 1.1d
This commit is contained in:
commit
ec5b169312
@ -1,9 +1,9 @@
|
|||||||
\NeedsTeXFormat{LaTeX2e}
|
\NeedsTeXFormat{LaTeX2e}
|
||||||
\ProvidesPackage{footnotehyper-sphinx}%
|
\ProvidesPackage{footnotehyper-sphinx}%
|
||||||
[2021/01/29 v1.1c hyperref aware footnote.sty for sphinx (JFB)]
|
[2021/02/04 v1.1d hyperref aware footnote.sty for sphinx (JFB)]
|
||||||
%%
|
%%
|
||||||
%% Package: footnotehyper-sphinx
|
%% Package: footnotehyper-sphinx
|
||||||
%% Version: based on footnotehyper.sty 2021/01/29 v1.1c
|
%% Version: based on footnotehyper.sty 2021/02/04 v1.1d
|
||||||
%% as available at https://www.ctan.org/pkg/footnotehyper
|
%% as available at https://www.ctan.org/pkg/footnotehyper
|
||||||
%% License: the one applying to Sphinx
|
%% License: the one applying to Sphinx
|
||||||
%%
|
%%
|
||||||
@ -17,6 +17,7 @@
|
|||||||
%% 4. macro definition \sphinxfootnotemark,
|
%% 4. macro definition \sphinxfootnotemark,
|
||||||
%% 5. macro definition \sphinxlongtablepatch
|
%% 5. macro definition \sphinxlongtablepatch
|
||||||
%% 6. replaced some \undefined by \@undefined
|
%% 6. replaced some \undefined by \@undefined
|
||||||
|
\newif\iffootnotehyperparse\footnotehyperparsetrue
|
||||||
\DeclareOption*{\PackageWarning{footnotehyper-sphinx}{Option `\CurrentOption' is unknown}}%
|
\DeclareOption*{\PackageWarning{footnotehyper-sphinx}{Option `\CurrentOption' is unknown}}%
|
||||||
\ProcessOptions\relax
|
\ProcessOptions\relax
|
||||||
\newbox\FNH@notes
|
\newbox\FNH@notes
|
||||||
@ -218,38 +219,76 @@
|
|||||||
\FNH@endfntext@fntext {\unvbox\z@}%
|
\FNH@endfntext@fntext {\unvbox\z@}%
|
||||||
\endgroup
|
\endgroup
|
||||||
}%
|
}%
|
||||||
\AtBeginDocument{%
|
\let\FNH@prefntext\@empty
|
||||||
\let\FNH@@makefntext\@makefntext
|
\let\FNH@postfntext\@empty
|
||||||
\ifx\@makefntextFB\@undefined
|
\AtBeginDocument{\iffootnotehyperparse\expandafter\FNH@check\fi}%
|
||||||
\expandafter\@gobble\else\expandafter\@firstofone\fi
|
\def\FNH@safeif#1{%
|
||||||
{\ifFBFrenchFootnotes \let\FNH@@makefntext\@makefntextFB \else
|
\iftrue\csname if#1\endcsname\csname fi\endcsname\expandafter\@firstoftwo
|
||||||
\let\FNH@@makefntext\@makefntextORI\fi}%
|
\else\csname fi\endcsname\expandafter\@secondoftwo
|
||||||
\expandafter\FNH@check@a\FNH@@makefntext{1.2!3?4,}%
|
\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}%
|
||||||
|
}%
|
||||||
|
}%
|
||||||
|
\def\FNH@check@{%
|
||||||
|
\expandafter\FNH@check@a\@makefntext{1.2!3?4,}%
|
||||||
\FNH@@@1.2!3?4,\FNH@@@\relax
|
\FNH@@@1.2!3?4,\FNH@@@\relax
|
||||||
}%
|
}%
|
||||||
\long\def\FNH@check@a #11.2!3?4,#2\FNH@@@#3{%
|
\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
|
\else
|
||||||
\edef\FNH@restore@{\catcode`\noexpand\@\the\catcode`\@\relax}%
|
\def\FNH@prefntext{#1}\def\FNH@postfntext{#2}%
|
||||||
\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@
|
|
||||||
\expandafter\FNH@check@b
|
\expandafter\FNH@check@b
|
||||||
\fi
|
\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{}}%
|
||||||
|
\else\FNH@bad@makefntext@alert
|
||||||
|
\fi
|
||||||
|
}%
|
||||||
\def\FNH@check@b #1\relax{%
|
\def\FNH@check@b #1\relax{%
|
||||||
\expandafter\expandafter\expandafter\FNH@check@c
|
\expandafter\expandafter\expandafter\FNH@check@c
|
||||||
\expandafter\meaning\expandafter\FNH@prefntext
|
\expandafter\meaning\expandafter\FNH@prefntext
|
||||||
\meaning\FNH@postfntext1.2!3?4,\FNH@check@c\relax
|
\meaning\FNH@postfntext1.2!3?4,\FNH@check@c\relax
|
||||||
}%
|
}%
|
||||||
\def\FNH@check@c #11.2!3?4,#2#3\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
|
||||||
}%
|
}%
|
||||||
% slight reformulation for Sphinx
|
% slight reformulation for Sphinx
|
||||||
\def\FNH@bad@makefntext@alert{%
|
\def\FNH@bad@makefntext@alert{%
|
||||||
@ -283,7 +322,6 @@
|
|||||||
\noexpand\if@endpe\noexpand\@endpetrue\noexpand\fi
|
\noexpand\if@endpe\noexpand\@endpetrue\noexpand\fi
|
||||||
}%
|
}%
|
||||||
}%
|
}%
|
||||||
% end of footnotehyper 2017/02/16 v0.99
|
|
||||||
% some extras for Sphinx :
|
% some extras for Sphinx :
|
||||||
% \sphinxfootnotemark: usable in section titles and silently removed from TOCs.
|
% \sphinxfootnotemark: usable in section titles and silently removed from TOCs.
|
||||||
\def\sphinxfootnotemark [#1]%
|
\def\sphinxfootnotemark [#1]%
|
||||||
|
Loading…
Reference in New Issue
Block a user