-
Notifications
You must be signed in to change notification settings - Fork 1
/
imperialharvard.bbx
68 lines (60 loc) · 2.4 KB
/
imperialharvard.bbx
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
\ProvidesFile{imperialharvard.bbx}
[\abx@bbxid]
\RequireBibliographyStyle{authoryear}
\ExecuteBibliographyOptions
{
giveninits =true ,
isbn =false ,
maxbibnames =99 ,
sorting =nty ,
urldate =long ,
dateabbrev =false ,
}
%%%%%%%%INDENTATION OF BIBLIOGRAPHY%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\setlength{\bibhang}{0pt}
\setlength\bibitemsep{1.5\itemsep}
%%%%%%%%URL/DOI FIELD ADJUSTMENTS%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\NewBibliographyString{available}
\DefineBibliographyStrings{english}{available = {Available from},}
\DefineBibliographyStrings{english}{urlseen = {Accessed},}
%%%%%%%%BIBLIOGRAPHY SORTING%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\DeclareNameAlias{sortname}{last-first}
%%%%%%%%FIELD FORMATS%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\DeclareFieldFormat{pages}{#1} %removes pp
\DeclareFieldFormat*{title}{#1} %Article titles without italics, journal name with
\DeclareFieldFormat{url}{\bibstring{available}\addcolon\space\url{#1}\nopunct} %changes url to to newly defined Available from
\DeclareFieldFormat{urldate}{[\bibstring{urlseen}\space#1]} %changes urldate to Accessed
\DeclareFieldFormat[article]{number}{\mkbibparens{#1}} %Issue number in parentheses
\DeclareFieldFormat{doi}{%
\bibstring{urlfrom}\addcolon\space\mkbibacro{DOI}\addcolon \ifhyperref {\href{https://doi.org/#1}{\nolinkurl{#1}}} {\nolinkurl{#1}}
} %Formats URL display
\renewbibmacro*{journal+issuetitle}{%
\usebibmacro{journal}%
\setunit*{\addperiod\space}%
\iffieldundef{series}
{}
{\newunit
\printfield{series}%
\setunit{\addspace}}%
\usebibmacro{volume+number+eid}%
\setunit{\addspace}%
\usebibmacro{issue+date}%
\setunit{\addcolon\space}%
\usebibmacro{issue}%
\newunit} %Inserts appropriate period between fields
\renewbibmacro*{doi+eprint+url}{%
\iftoggle{bbx:url} {\iffieldundef{doi}{\usebibmacro{url+urldate}}{}} {}%
\newunit\newblock \iftoggle{bbx:eprint} {\usebibmacro{eprint}} {}%
\newunit\newblock \iftoggle{bbx:doi} {\printfield{doi}\printtext[abrufurl]{\printurldate}} {}
} %Displays only DOI if both DOI and URL are available
\renewbibmacro*{url+urldate}{%
\printtext[formaturl]{%
\printfield{url}}%
} %Prints date accessed
\renewbibmacro*{in:}{} %Removes In:
\renewbibmacro*{volume+number+eid}{
\printfield{volume}%
\setunit*{\addnbthinspace}
\printfield{number}%
\setunit{\addcomma\space}%
\printfield{eid}} %Formats Volume and Issue fields