summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/biblatex-archaeology/verbose-trad2note-archaeology.cbx
blob: c04c7861912a516b25849ee0e3bb65747d6abd2a (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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
%%
%% This is file `verbose-trad2note-archaeology.cbx',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% biblatex-archaeology.dtx  (with options: `verbosetrad2noteCBX,verbosesharedCBX')
%% 

\ProvidesFile{verbose-trad2note-archaeology.cbx}
[2019/12/30 v2.2 biblatex-archaeology citation style (IB)]
\def\archaeocitestyletitle{\blxarch@style@vttwo}
\RequireCitationStyle{verbose-trad2}

\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
    {}
    {\ifuselabeltitle{%
        \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}}
   \edef\blxarch@ult@key@count{blxarch:ult:\therefsection:\thefield{namehash}:\the\value{footnote}}%
   \ifltxcounter{\blxarch@ult@key@count}%
        {\stepcounter{\blxarch@ult@key@count}}
        {\newcounter{\blxarch@ult@key@count}%
         \setcounter{\blxarch@ult@key@count}{1}}%
   \edef\blxarch@ult@hash@count{blxarch:ult:\thefield{entrykey}:\the\value{footnote}:\therefsection}%
   \ifltxcounter{\blxarch@ult@hash@count}%
        {\stepcounter{\blxarch@ult@hash@count}}
        {\newcounter{\blxarch@ult@hash@count}%
         \setcounter{\blxarch@ult@hash@count}{1}}%
}
\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}%
}
\newcommand{\ifuselabeltitle}[2]{%
    \edef\blxarch@ult@key@if{blxarch:ult:\thefield{entrykey}:\the\value{blxarch:\thefield{entrykey}}:\therefsection}%
    \edef\blxarch@ult@hash@if{blxarch:ult:\therefsection:\thefield{namehash}:\the\value{blxarch:\thefield{entrykey}}}%
    \ifltxcounter{\blxarch@ult@key@if}
        {\ifnumgreater{\value{\blxarch@ult@hash@if}}{\value{\blxarch@ult@key@if}}
            {#1}
            {\iftoggle{archbool:uselabeltitle}{#1}{#2}}%
        }
        {\iftoggle{archbool:uselabeltitle}{#1}{#2}}%
}
\providebibmacro*{cite:short}{}
\renewbibmacro*{cite:short}{%
    \printnames{labelname}%
    \setunit*{\printdelim{nametitledelim}}%
    \printtext[bibhyperlink]{%
    \iftoggle{archbool:citeshortin}
        {\ifboolexpr{
            not test {\iffieldundef{journaltitle}}
            or
            ( not test {\ifshortform{false}}
              and
              not test {\iffieldundef{shortform}}
            )
         }
         {\usebibmacro{cite:short:in}}
         {\printfield[citetitle]{labeltitle}}%
        }
        {\printfield[citetitle]{labeltitle}}}%
}
\newbibmacro*{cite:short:in}{%
    \savebibmacro{extendeddate}%
    \renewbibmacro*{extendeddate}[2]{}%
    \iffieldundef{journaltitle}
        {\iffieldundef{shortform}
            {\printfield[citetitle]{labeltitle}}
            {\usebibmacro{in:}%
             \printfield{shortform}%
             \setunit{\addspace}%
             \printfield[shortformvolume]{volume}%
             \setunit{\addspace}%
             \usebibmacro{bibliographydate}%
            }
        }
        {\usebibmacro{journal+issuetitle}}%
    \restorebibmacro{extendeddate}%
}
\endinput
%%
%% End of file `verbose-trad2note-archaeology.cbx'.