-
Notifications
You must be signed in to change notification settings - Fork 0
/
biblatex-cse.sty
103 lines (91 loc) · 2.48 KB
/
biblatex-cse.sty
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
\usepackage[
backend=biber,
style=authoryear,
maxcitenames=2,
minbibnames=10,
maxbibnames=10,
dashed=false,
uniquelist=false,
giveninits=true,
urldate=iso,
date=year,
seconds=true,
]{biblatex}
\usepackage{xpatch}
% Remove commas between family and given names
\DeclareNameAlias{sortname}{family-given}
\renewrobustcmd*{\revsdnamepunct}{}
\renewrobustcmd*{\bibinitdelim}{}
% Remove commas between family and given names
\renewrobustcmd*{\revsdnamepunct}{}
\renewrobustcmd*{\bibinitdelim}{}
% Remove dot after initials
\renewrobustcmd*{\bibinitperiod}{}
% Remove quotation marks from title
\DeclareFieldFormat*{title}{#1}
% Remove emphasized from titles
\DeclareFieldFormat*{journaltitle}{#1\isdot}
\DeclareFieldFormat{postnote}{#1}
\DeclareFieldFormat{multipostnote}{#1}
\renewcommand*{\bibpagespunct}{\addcolon}
\renewcommand{\postnotedelim}{%
\iffieldpages{postnote}
{\addcolon\space}
{\addspace}}
% Remove "and" before last author
\DefineBibliographyExtras{english}{%
\DeclareFieldFormat{pages}{#1}
\DeclareDelimFormat{finalnamedelim}{%
\ifnumgreater{\value{liststop}}{2}{%
\printdelim{multinamedelim}}{\addspace\bibstring{and}\space}}}
% Add dot after list of authors (and before year) and remove parentheses in date
\xpatchbibmacro{date+extradate}{%
\printtext[parens]%
}{%
\setunit*{\addperiod\space}%
\printtext%
}{}{}
% Remove "in:" prefix in journal title
\renewbibmacro{in:}{}
% Cite as "family initials"
\DeclareNameFormat{labelname}{%
\ifcase\value{uniquename}%
\usebibmacro{name:family}
{\namepartfamily}
{\namepartgiven}
{\namepartprefix}
{\namepartsuffix}%
\or
\ifuseprefix
{\usebibmacro{name:family-given}
{\namepartfamily}
{\namepartgiveni}
{\namepartprefix}
{\namepartsuffixi}}
{\usebibmacro{name:family-given}
{\namepartfamily}
{\namepartgiveni}
{\namepartprefixi}
{\namepartsuffixi}}%
\or
\usebibmacro{name:family-given}
{\namepartfamily}
{\namepartgiven}
{\namepartprefix}
{\namepartsuffix}%
\fi
\usebibmacro{name:andothers}}
% Always remove "and" before last author
\ifdefined\prebibhook%
\DeclareDelimFormat{finalnamedelim}{%
\printdelim{multinamedelim}%
}%
\else\ifdefined\bibliography%
\let\origbibliography=\bibliography%
\renewcommand{\bibliography}{%
\DeclareDelimFormat{finalnamedelim}{%
\printdelim{multinamedelim}%
}%
\origbibliography%
}%
\fi\fi