summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/biblatex-ms/latex/cbx/alphabetic-verb-ms.cbx
blob: da506fa47424ddece97401b6c6943a3725ca9778 (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
\ProvidesFile{alphabetic-verb-ms.cbx}
[\abx@cbxid]

\ExecuteBibliographyOptions{labelalpha,autocite=inline}

\renewcommand*{\iffinalcitedelim}{\iflastcitekey}

\providebool{bbx:subentry}

\DeclareFieldFormat{entrysetcount}{\mkbibparens{\mknumalph{#1}}}

\newbibmacro*{cite}{%
  \printtext[bibhyperref]{%
    \printfield{labelprefix}%
    \printfield{labelalpha}%
    \printfield{extraalpha}%
    \ifbool{bbx:subentry}
      {\printfield{entrysetcount}}
      {}}}

\newbibmacro*{textcite}{%
  \ifnameundef{labelname}
    {\printfield[citetitle]{labeltitle}}
    {\printnames{labelname}}%
  \printdelim{namelabeldelim}\bibopenbracket
  \ifnumequal{\value{citecount}}{1}
    {\usebibmacro{prenote}}
    {}%
  \usebibmacro{cite}}

\DeclareCiteCommand{\cite}
  {\bibopenbracket
   \usebibmacro{prenote}}
  {\usebibmacro{citeindex}%
   \ifnumgreater{\value{citecount}}{1}
     {\bibopenbracket}
     {}%
   \usebibmacro{cite}}
  {\bibclosebracket\multicitedelim}
  {\usebibmacro{postnote}%
   \bibclosebracket}

\DeclareCiteCommand{\parencite}[\mkbibbrackets]
  {\usebibmacro{prenote}}
  {\usebibmacro{citeindex}%
   \usebibmacro{cite}}
  {\multicitedelim}
  {\usebibmacro{postnote}}

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

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

\DeclareCiteCommand{\smartcite}[\iffootnote\mkbibbrackets\mkbibfootnote]
  {\usebibmacro{prenote}}
  {\usebibmacro{citeindex}%
   \usebibmacro{cite}}
  {\multicitedelim}
  {\usebibmacro{postnote}}

\DeclareCiteCommand{\textcite}
  {}
  {\usebibmacro{citeindex}%
   \iffirstcitekey
     {\setcounter{textcitetotal}{1}}
     {\stepcounter{textcitetotal}%
      \textcitedelim}%
   \usebibmacro{textcite}}
  {\bibclosebracket}
  {\usebibmacro{postnote}%
   \bibclosebracket}

\DeclareMultiCiteCommand{\parencites}[\mkbibbrackets]{\parencite}{\multicitedelim}
\DeclareMultiCiteCommand{\smartcites}[\iffootnote\mkbibbrackets\mkbibfootnote]
  {\smartcite}{\multicitedelim}
\DeclareMultiCiteCommand{\textcites}{\textcite}{}

\endinput