summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/biblatex/cbx/verbose-note.cbx
blob: 8744c605da3d77e7c1f421774a75af28ae76b059 (plain)
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
% $Id: verbose-note.cbx,v 0.9 2010/02/14 15:42:33 lehman beta $

\ProvidesFile{verbose-note.cbx}
[\abx@cbxid $Id: verbose-note.cbx,v 0.9 2010/02/14 15:42:33 lehman beta $]

\ExecuteBibliographyOptions{citetracker=context,singletitle,autocite=footnote}
\newbool{cbx:pageref}

\DeclareFieldFormat{bibhyperlink}{%
  \bibhyperlink{\thefield{entrykey}:\csuse{cbx@\iffootnote{f}{t}@\thefield{entrykey}}}{#1}}
\DeclareFieldFormat{bibhypertarget}{%
  \bibhypertarget{\thefield{entrykey}:\the\value{instcount}}{#1}}

\DeclareBibliographyOption{pageref}[true]{%
  \setbool{cbx:pageref}{#1}%
  \ifbool{cbx:pageref}
    {\ExecuteBibliographyOptions{pagetracker}}
    {}}

\newbibmacro*{cite}{%
  \ifciteseen
    {\iffieldundef{shorthand}
       {\usebibmacro{cite:short}}
       {\usebibmacro{cite:shorthand}}}
    {\usebibmacro{cite:full}%
     \usebibmacro{cite:save}}}

\newbibmacro*{cite:save}{%
  \csxdef{cbx@t@\thefield{entrykey}}{\the\value{instcount}}}

\newbibmacro*{cite:full}{%
  \printtext[bibhypertarget]{%
    \usedriver
      {\DeclareNameAlias{sortname}{default}}
      {\thefield{entrytype}}}%
  \usebibmacro{shorthandintro}}

\newbibmacro*{cite:short}{%
  \printnames{labelname}%
  \setunit*{\addcomma\space}%
  \printtext[bibhyperlink]{%
    \printfield[citetitle]{labeltitle}}}

\newbibmacro*{cite:shorthand}{%
  \printtext[bibhyperlink]{\printfield{shorthand}}}

\newbibmacro*{footcite}{%
  \ifciteseen
    {\iffieldundef{shorthand}
       {\usebibmacro{footcite:note}}
       {\usebibmacro{footcite:shorthand}}}
    {\usebibmacro{footcite:full}%
     \usebibmacro{footcite:save}}}

\newbibmacro*{footcite:save}{%
  \csxdef{cbx@f@\thefield{entrykey}}{\the\value{instcount}}%
  \label{cbx@\the\value{instcount}}}

\newbibmacro*{footcite:full}{%
  \printtext[bibhypertarget]{%
    \usedriver
      {\DeclareNameAlias{sortname}{default}}
      {\thefield{entrytype}}}%
  \usebibmacro{shorthandintro}}

\newbibmacro*{footcite:note}{%
  \ifnameundef{labelname}
    {\printfield{label}}
    {\printnames{labelname}}%
  \ifsingletitle
    {}
    {\setunit*{\addcomma\space}%
     \printfield[title]{labeltitle}}%
  \setunit*{\addcomma\space}%
  \printtext{%
    \bibstring{seenote}\addnbspace
    \ref{cbx@\csuse{cbx@f@\thefield{entrykey}}}%
    \ifbool{cbx:pageref}
      {\ifsamepage{\the\value{instcount}}
                  {\csuse{cbx@f@\thefield{entrykey}}}
         {}
	 {\addcomma\space\bibstring{page}\addnbspace
	  \pageref{cbx@\csuse{cbx@f@\thefield{entrykey}}}}}
      {}}}

\newbibmacro*{footcite:shorthand}{%
  \printtext[bibhyperlink]{\printfield{shorthand}}}

\DeclareCiteCommand{\cite}
  {\usebibmacro{prenote}}
  {\usebibmacro{citeindex}%
   \iffootnote
     {\usebibmacro{footcite}}
     {\usebibmacro{cite}}}
  {\multicitedelim}
  {\usebibmacro{postnote}}

\DeclareCiteCommand{\parencite}[\mkbibparens]
  {\usebibmacro{prenote}}
  {\usebibmacro{citeindex}%
   \iffootnote
     {\usebibmacro{footcite}}
     {\usebibmacro{cite}}}
  {\multicitedelim}
  {\usebibmacro{postnote}}

\DeclareCiteCommand{\footcite}[\mkbibfootnote]
  {\usebibmacro{prenote}}
  {\usebibmacro{citeindex}%
   \usebibmacro{footcite}}
  {\multicitedelim}
  {\usebibmacro{postnote}}

\DeclareCiteCommand{\footcitetext}[\mkbibfootnotetext]
  {\usebibmacro{prenote}}
  {\usebibmacro{citeindex}%
   \usebibmacro{footcite}}
  {\multicitedelim}
  {\usebibmacro{postnote}}

\endinput