-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbibliography.tex
243 lines (214 loc) · 6.18 KB
/
bibliography.tex
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
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Some adjustments to make the bibliography more clean
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% The subsequent commands do the following:
% - Removing the month field from the bibliography
% - Fixing the Oxford commma
% - Suppress the "in" for journal articles
% - Remove the parentheses of the year in an article
% - Delimit volume and issue of an article by a colon ":" instead of
% a dot ""
% - Use commas to separate the location of publishers from their name
% - Remove the abbreviation for technical reports
% - Display the label of bibliographic entries without brackets in the
% bibliography
% - Ensure that DOIs are followed by a non-breakable space
% - Use hair spaces between initials of authors
% - Make the font size of citations smaller
% - Fixing ordinal numbers (1st, 2nd, 3rd, and so) on by using
% superscripts
% Remove the month field from the bibliography. It does not serve a good
% purpose, I guess. And often, it cannot be used because the journals
% have some crazy issue policies.
\AtEveryBibitem{\clearfield{month}}
\AtEveryCitekey{\clearfield{month}}
\renewcommand*\finentrypunct{}
\DeclareSourcemap{
\maps[datatype=bibtex]{
\map{
\step[fieldsource=doi,final]
\step[fieldset=isbn,null]
}
}
}
\DeclareSourcemap{
\maps[datatype=bibtex]{
\map{
\step[fieldsource=note, final]
\step[fieldset=addendum, origfieldval, final]
\step[fieldset=note, null]
}
}
}
\DeclareSourcemap{
\maps[datatype=bibtex,overwrite=true]{
\map{
\step[fieldsource=Collaboration, final=true]
\step[fieldset=usera, origfieldval, final=true]
}
}
}
\renewbibmacro*{author}{%
\iffieldundef{usera}{%
\printnames{author}%
}{%
\printnames{author} (\printfield{usera} Collaboration)%
}%
}%
% Fixing the Oxford comma. Not sure whether this is the proper solution.
% More information is available under [1] and [2].
%
% [1] http://tex.stackexchange.com/questions/97712/biblatex-apa-style-is-missing-a-comma-in-the-references-why
% [2] http://tex.stackexchange.com/questions/44048/use-et-al-in-biblatex-custom-style
%
\AtBeginBibliography{%
\renewcommand*{\finalnamedelim}{%
\ifthenelse{\value{listcount} > 2}{%
\addcomma
\addspace
\bibstring{and}%
}{%
\addspace
\bibstring{and}%
}
}
}
% Suppress "in" for journal articles. This is unnecessary in my opinion
% because the journal title is typeset in italics anyway.
\renewbibmacro{in:}{%
\ifentrytype{article}
{%
}%
% else
{%
\printtext{\bibstring{in}\intitlepunct}%
}%
}
% Remove the parentheses for the year in an article. This removes a lot
% of undesired parentheses in the bibliography, thereby improving the
% readability. Moreover, it makes the look of the bibliography more
% consistent.
\renewbibmacro*{issue+date}{%
\setunit{\addcomma\space}
\iffieldundef{issue}
{\usebibmacro{date}}
{\printfield{issue}%
\setunit*{\addspace}%
\usebibmacro{date}}%
\newunit}
% Delimit the volume and the number of an article by a colon instead of
% by a dot, which I consider to be more readable.
\renewbibmacro*{volume+number+eid}{%
\printfield{volume}%
\setunit*{\addcolon}%
\printfield{number}%
\setunit{\addcomma\space}%
\printfield{eid}%
}
% Do not use a colon for the publisher location. Instead, connect
% publisher, location, and date via commas.
\renewbibmacro*{publisher+location+date}{%
\printlist{publisher}%
\setunit*{\addcomma\space}%
\printlist{location}%
\setunit*{\addcomma\space}%
\usebibmacro{date}%
\newunit%
}
% Ditto for other entry types.
\renewbibmacro*{organization+location+date}{%
\printlist{location}%
\setunit*{\addcomma\space}%
\printlist{organization}%
\setunit*{\addcomma\space}%
\usebibmacro{date}%
\newunit%
}
% Do not abbreviate "technical report".
\DefineBibliographyStrings{english}{%
techreport = {technical report},
}
% Display the label of a bibliographic entry in bare style, without any
% brackets. I like this more than the default.
%
% Note that this is *really* the proper and official way of doing this.
\DeclareFieldFormat{labelnumberwidth}{#1\adddot}
% \renewbibmacro*{doi+eprint+url}{%
% \setunit{\addspace}\newblock
% \scriptsize%
% \iftoggle{bbx:doi}
% {\printfield{doi}}
% {}%
% \setunit{\addspace}\newblock
% \iftoggle{bbx:eprint}
% {\usebibmacro{eprint}}
% {}%
% \setunit{\addspace}\newblock
% \iftoggle{bbx:url}
% {\usebibmacro{url+urldate}}
% {}
% }
% Ensure that DOIs are followed by a non-breakable space.
\DeclareFieldFormat{doi}{%
\newline
\scriptsize%
\mkbibacro{DOI}\addcolon\addnbspace
{\href{http://dx.doi.org/#1}{\nolinkurl{#1}}}
}
\DeclareFieldFormat{addendum}{%
\newline
\scriptsize%
{\color{gray}{Note\addcolon\addnbspace#1}}
}
\DeclareFieldFormat{urldate}{%
\scriptsize%
{\color{gray}{visited on #1}}
}
% \DeclareFieldFormat{eprint}{%
% \newline
% \scriptsize%
% \mkbibacro{DOI}\addcolon\addnbspace
% \ifhyperref
% {\href{http://dx.doi.org/#1}{\nolinkurl{#1}}}
% %
% {\nolinkurl{#1}}
% }
\DeclareFieldFormat{eprint:arxiv}{%
\scriptsize%
\iffieldundef{doi}
{\newline}
{}
\mkbibacro{arXiv}\addcolon\addnbspace%
\ifhyperref
{\href{https://arxiv.org/abs/#1}{\nolinkurl{#1}}
\iffieldundef{eprintclass}
{}
{\href{https://arxiv.org/abs/#1}{[{\nolinkurl{\thefield{eprintclass}}}]}}
}
{\nolinkurl{#1}}
}
% Ensure that URLS appear on a newline
\DeclareFieldFormat{url}{%
\newline
\scriptsize%
{\url{#1}}
}
\DefineBibliographyStrings{english}{%
pages = {pages},
page = {page},
}
% Use proper hair spaces between initials as suggested by Bringhurst and
% others.
\renewcommand*\bibinitdelim{\addnbthinspace}
\renewcommand*\bibnamedelima{\addnbthinspace}
\renewcommand*\bibnamedelimb{\addnbthinspace}
\renewcommand*\bibnamedelimi{\addnbthinspace}
% Make the font size of citations smaller. Depending on your selected
% font, you might not need this.
\renewcommand*{\citesetup}{%
\biburlsetup
\small
}
% \DeclareLanguageMapping{british}{bibliography-correct-ordinals}
% \DeclareLanguageMapping{english}{bibliography-correct-ordinals}