-
Notifications
You must be signed in to change notification settings - Fork 3
/
footnoteref.sty
44 lines (37 loc) · 1.35 KB
/
footnoteref.sty
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
\makeatletter
\DeclareCiteCommand{\superfootcite}[\cbx@superscript]
{\usebibmacro{cite:init}%
\let\multicitedelim=\supercitedelim
\iffieldundef{prenote}
{}
{\BibliographyWarning{Ignoring prenote argument}}%
\iffieldundef{postnote}
{}
{\BibliographyWarning{Ignoring postnote argument}}}
{\usebibmacro{citeindex}%
\usebibmacro{cite:superfoot}%
\usebibmacro{cite:comp}}
{}
{\usebibmacro{cite:dump}}
\AtDataInput{%
\csnumgdef{cbx@instcount@curr@\thefield{entrykey}}{0}}
\AtEveryCitekey{%
\csnumgdef{cbx@instcount@last@\thefield{entrykey}}{%
\csuse{cbx@instcount@curr@\thefield{entrykey}}}%
\csnumgdef{cbx@instcount@curr@\thefield{entrykey}}{\value{instcount}}}
\def\iflastciteonsamepage{%
\ifsamepage
{\number\csuse{cbx@instcount@curr@\thefield{entrykey}}}
{\number\csuse{cbx@instcount@last@\thefield{entrykey}}}}
\newbibmacro*{cite:superfoot}{%
\iflastciteonsamepage
{}
{\xappto\cbx@citehook{%
\noexpand\footnotetext[\thefield{labelnumber}]{%
\fullcite{\thefield{entrykey}}\addperiod}}}}
\newrobustcmd{\cbx@superscript}[1]{%
\mkbibsuperscript{#1}%
\cbx@citehook
\global\let\cbx@citehook=\empty}
\let\cbx@citehook=\empty
\makeatother