summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/biblatex-contrib/ecobiblatex/ecobiblatex.bbx
blob: 4862c6ed93617998cb70e6f43c150ec869be78c4 (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
\ProvidesFile{ecobiblatex.bbx}[biblatex style for Global Ecology and Biogeography]

%% We build on the original author-year comp
\RequireBibliographyStyle{standard}
\RequireBibliographyStyle{authoryear-comp}

%% General options to match the ELE requirements
\ExecuteBibliographyOptions
  {
    doi          = false , 
    eprint       = false ,
    firstinits   = true  ,
    isbn         = false ,
    maxcitenames = 2     ,
    mincitenames = 1     ,
    url          = false ,
    dashed       = false ,
    sorting      = nyt
  }

%% Only the year is important
\AtEveryBibitem{%
  \clearfield{day}%
  \clearfield{month}%
  \clearfield{endday}%
  \clearfield{endmonth}%
}

%% Titles are in upright, no quotes
\DeclareFieldFormat[article,inbook,incollection,inproceedings,patent,thesis,unpublished]{title}{#1\isdot}

%% Articles have no page number indication
\DeclareFieldFormat[article]{pages}{#1}
\DeclareFieldFormat[article]{volume}{\textbf{#1}}

%% Last author is separated by an ampersand
\renewcommand*{\finalnamedelim}{\addspace\&\space}

%% Authors are Name, F.S.
\DeclareNameAlias{sortname}{last-first}

%% The initials are separated by a thin space, as per Bringhurst
\renewcommand*{\mkbibnamefirst}[1]{{\let~\,#1}}


\DeclareNameFormat{default}{%
  \renewcommand*{\multinamedelim}{\addsemicolon\addspace}%
  \usebibmacro{name:last-first}{#1}{#4}{#5}{#7}%
  \usebibmacro{name:andothers}%
}

\DeclareBibliographyDriver{article}{%
  \usebibmacro{bibindex}%
  \usebibmacro{begentry}%
  \usebibmacro{author/translator+others}%
  \addspace
  \usebibmacro{title}%
  \newunit
  \printlist{language}%
  \newunit\newblock
  \usebibmacro{byauthor}%
  \newunit\newblock
  \usebibmacro{bytranslator+others}%
  \newunit\newblock
  \printfield{version}%
  \newunit\newblock%
  \usebibmacro{journal+issuetitle}%
  \newunit
  \usebibmacro{byeditor+others}%
  \newunit
  \usebibmacro{note+pages}%
  \newunit\newblock
  \usebibmacro{addendum+pubstate}%
  \setunit{\bibpagerefpunct}\newblock
  \usebibmacro{pageref}%
  \usebibmacro{finentry}}

\renewbibmacro*{journal+issuetitle}{%
  \usebibmacro{journal},%
  \setunit*{\addspace}%
  \usebibmacro{volume+number+eid}%
  \newunit
}

\renewbibmacro*{volume+number+eid}{%
  \printfield{volume}%
  \setunit*{\addspace}%
  \printfield{eid}%
}

\DeclareFieldFormat[book,inbook,incollection]{booktitle}{\emph{#1}}

\renewbibmacro*{publisher+location+date}{%
  \printfield{edition}%
  \setunit{\addcomma\space}%
  \printlist{publisher}%
  \setunit{\addcomma\space}%
  \printlist{location}%
}

\DeclareBibliographyDriver{book}{%
  \usebibmacro{bibindex}%
  \usebibmacro{begentry}%
  \usebibmacro{author/translator+others}%
  \addspace
  \printfield{title}%
  \newunit\newblock%
  \usebibmacro{publisher+location+date}%
  \setunit{\bibpagerefpunct}\newblock
  \usebibmacro{pageref}%
  \usebibmacro{finentry}%
}

\DeclareBibliographyDriver{incollection}{%
  \usebibmacro{bibindex}%
  \usebibmacro{begentry}%
  \usebibmacro{author/translator+others}%
  \setunit{\labelnamepunct}\newblock
  \printlist{language}%
  \newunit\newblock
  \usebibmacro{byauthor}%
  \newunit
  \usebibmacro{title}
  \newunit\newblock
  \usebibmacro{bybookauthor}%
  \newunit\newblock
  \printfield{booktitle}\addspace%
  \printtext[parens]{%
   ed.~by%
   \addspace%
   \printnames[byeditor]{editor}%
   \clearname{editor}%
  }%
  \newunit\newblock
  \printfield{volumes}%
  \newunit\newblock
  \usebibmacro{series+number}%
  \newunit\newblock
  \printfield{note}%
  \newunit\newblock
  \usebibmacro{chapter+pages}%
  .\newblock
  \usebibmacro{publisher+location+date}%
  \newunit\newblock
  \usebibmacro{addendum+pubstate}%
  \setunit{\bibpagerefpunct}\newblock
  \usebibmacro{pageref}%
  \usebibmacro{finentry}%
}

\endinput