summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/biblatex-archaeology/verbose-trad2note-archaeology.cbx
blob: c6e86995b05649e74c054c273c955337854071ea (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
122
123
124
125
126
127
128
129
130
131
132
%%
%% This is file `verbose-trad2note-archaeology.cbx',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% biblatex-archaeology.dtx  (with options: `verbosetrad2noteCBX')
%% 
\ProvidesFile{verbose-trad2note-archaeology.cbx}
[2017/06/06 v1.2 biblatex-archaeology citation style (IB)]
\def\archaeocitestyletitle{\blxarch@style@vttwo}
\RequireCitationStyle{verbose-trad2}
\newbibmacro*{cite:short}{%
  \printnames{labelname}%
  \setunit*{\printdelim{labelnamepunct}}%
  \printtext[bibhyperlink]{%
    \printfield[citetitle]{labeltitle}}}

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

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

\newbibmacro*{footcite:note}{%
  \ifnameundef{labelname}
    {\printfield{label}}
    {\printnames{labelname}}%
  \ifsingletitle
    {}
    {\iftoggle{archbool:uselabeltitle}{%
        \setunit*{\printdelim{labelnamepunct}}%
        \printfield[title]{labeltitle}}%
        {}}%
  \setunit*{\seenotedelim}%
  \printtext[seenote]{%
    \bibstring{seenote}\addnbspace
    \ref{cbx@\csuse{cbx@f@\thefield{entrykey}}}%
    \iftoggle{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}%
   \ifseenote
     {\usebibmacro{footcite}}
     {\usebibmacro{cite}}}
  {\multicitedelim}
  {\usebibmacro{cite:postnote}}

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

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

\DeclareCiteCommand{\smartcite}[\iffootnote\mkbibparens\mkbibfootnote]
  {\usebibmacro{prenote}}
  {\usebibmacro{citeindex}%
   \ifseenote
     {\usebibmacro{footcite}}
     {\usebibmacro{cite}}}
  {\multicitedelim}
  {\usebibmacro{cite:postnote}}

\newtoggle{cbx:pageref}
\DeclareBibliographyOption[boolean]{pageref}[true]{%
  \settoggle{cbx:pageref}{#1}%
  \iftoggle{cbx:pageref}
    {\ExecuteBibliographyOptions{pagetracker}}
    {}}
\newbibmacro*{footcite:save}{%
    \ifltxcounter{blxarch:\thefield{entrykey}}
        {\ifnumequal{0}{\value{blxarch:\thefield{entrykey}}}
            {\setcounter{blxarch:\thefield{entrykey}}{\value{footnote}}}
            {}}
        {\newcounter{blxarch:\thefield{entrykey}}%
        \setcounter{blxarch:\thefield{entrykey}}{\value{footnote}}}%
    \csxdef{cbx@f@\thefield{entrykey}}{\the\value{instcount}}%
    \label{cbx@\the\value{instcount}}}
\renewcommand{\ifseenote}[2]{%
    \ifboolexpr{
        test {\iffootnote}
        and
        not test {\ifciteibid}
    }
        {\ifltxcounter{blxarch:\thefield{entrykey}}
            {\ifciteseen
                {\ifnumgreater{\value{footnote}}{\value{blxarch:\thefield{entrykey}}}
                    {#1}
                    {#2}%
                }
                {\setcounter{blxarch:\thefield{entrykey}}{0}#1}%
            }
            {#1}%
        }
        {#2}%
}
\endinput
%%
%% End of file `verbose-trad2note-archaeology.cbx'.