summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/biblatex-oxref/oxyear.cbx
blob: 2f807628edb79fe11d00261a38d4c6d785b0850a (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
%%
%% This is file `oxyear.cbx',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% oxref.dtx  (with options: `cbx,y')
%% ----------------------------------------------------------------
%% biblatex-oxref --- Biblatex styles inspired by the Oxford Guide to Style
%% Author:  Alex Ball
%% E-mail:  a.j.ball@bath.ac.uk
%% License: Released under the LaTeX Project Public License v1.3c or later
%% See:     http://www.latex-project.org/lppl.txt
%% ----------------------------------------------------------------
%% 
\def\Version{2018/02/09 v0.11.3}
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
\ProvidesFile{oxyear.cbx}
    [\Version\space Author-year citation style inspired by the Oxford Guide to Style]
\RequireCitationStyle{authoryear-comp}
\ExecuteBibliographyOptions{uniquename=init}
\xpatchbibmacro{cite:labeldate+extradate}{%
  \printfield{labelendyear}%
}{%
  \iffieldundef{extradate}{%
    \blx@ox@compyear
      {\thefield{labelyear}}%
      {\thefield{labelendyear}}%
  }{%
    \printfield{labelendyear}}%
}{}{}
\xpatchbibmacro{cite}{%
  \printnames{labelname}%
}{%
  \ifboolexpr{
    test {\iffieldequalstr{labelnamesource}{author}}
    and
    togl {blx@ox@autoanon}
    and
    test {\iffieldequals{rawauthor}{\oxrefanon}}
  }{%
    \iftoggle{blx@ox@abbranon}{\bibcpsstring{anon}}{\bibcplstring{anon}}%
  }{%
    \printnames{labelname}%
  }%
}{}{}
\DeclareDelimFormat{nameyeardelim}{%
  \iflabeldateisanydate
    {\addspace}%
    {\addcomma\space}}
\DeclareDelimFormat{nonameyeardelim}{%
  \iflabeldateisanydate
    {\addspace}%
    {\addcomma\space}}
\renewcommand*{\compcitedelim}{\addsemicolon\space}
\renewcommand*{\postnotedelim}{\addcolon\space}
\xpatchbibmacro{textcite}{%
  \printnames{labelname}%
}{%
  \ifboolexpr{
    test {\iffieldequalstr{labelnamesource}{author}}
    and
    togl {blx@ox@autoanon}
    and
    test {\iffieldequals{rawauthor}{\oxrefanon}}
  }{%
    \iftoggle{blx@ox@abbranon}{\bibcpsstring{anon}}{\bibcplstring{anon}}%
  }{%
    \printnames{labelname}%
  }%
}{}{}
%% 
%% Copyright (C) 2016–2018 Alex Ball
%%
%% End of file `oxyear.cbx'.