-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbiblatex.cfg
70 lines (57 loc) · 2.32 KB
/
biblatex.cfg
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
% -- formatting hell for biblatex --
% ----------------------------------
% preamble options
\ExecuteBibliographyOptions{
maxcitenames=2, % max number of authors shown when citing
uniquename=init, % use inits instead of full first names in bibliography
giveninits=true, % use inits instead of full first names in bibliography
dashed=false, % in case same author show full name
url=false} % % don't show urls on bibliography (except online sources)
% -- set author name format: Last name, I.
\DeclareNameAlias{sortname}{last-first}
\DeclareNameAlias{default}{last-first}
%-- remove 'and' before next to last author
\DefineBibliographyExtras{english}{\renewcommand*{\finalnamedelim}{\addcomma\addspace}}
%-- remove quotes around titles
\DeclareFieldFormat[article, inbook, incollection, inproceedings, misc, thesis, unpublished]{title}{#1}
%-- remove "In:"
\renewbibmacro{in:}{}
%-- Add 'Vol.' before volume
\DeclareFieldFormat[article, inbook, incollection, inproceedings, misc, thesis, unpublished]{volume}{{Vol.#1}}
%-- set parenthesis around number
\DeclareFieldFormat[article, inbook, incollection, inproceedings, misc, thesis, unpublished]{number}{\mkbibparens{{#1}}}
%-- remove formatting between journal and number
\renewbibmacro*{volume+number+eid}{
\printfield{volume}\printfield{number}
\setunit{\addcomma\space}
\printfield{eid}
}
% -- Fix overall format for online source citing
\renewbibmacro*{url+urldate}{
\printtext{Available}
\mkbibparens{\printtext{accessed on }\printurldate}
\addcolon\addspace
\printfield{url}
}
% -- fix referencing for books
% -- add 'accessed on' string to online citations
\DefineBibliographyStrings{english}{
urlseen = {accessed on }
}
% -- access date in correct form
\DeclareFieldFormat[online]{urldate}{\stripzeros{\thefield{urlday}}\addperiod
\stripzeros{\thefield{urlmonth}}\addperiod
\printfield{urlyear}}
% -- remove formatting for url
\urlstyle{same}
\DeclareFieldFormat[online]{url}{\url{#1}}
% -- remove square brackets from same author and year references
\DeclareFieldFormat{extrayear}{%
\iffieldundef{\thefield{labeldatesource}}
{\iffieldnums{\thefield{labeldatesource}year}
{\mknumalph{#1}}
{\mknumalph{#1}}}
{\iffieldnums{\thefield{labeldatesource}}
{\mknumalph{#1}}
{\mknumalph{#1}}}}%
% -- formatting hell for biblatex ends --