-
Notifications
You must be signed in to change notification settings - Fork 5
/
baarticle.bbx
172 lines (162 loc) · 5.06 KB
/
baarticle.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
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
% Blibliography style implementing the BA Dresden Styleguide
\ProvidesFile{baarticle.bbx}[2021/09/24 v1.0.0 BA Dresden bibliography style]
% The style is based on authoryear-ibid
\RequireBibliographyStyle{authoryear-ibid}
% use the BA localization
\DeclareLanguageMapping{ngerman}{ngerman-ba}
% put family name for the first name
\DeclareNameAlias{labelname}{family-given}
\DeclareNameAlias{sortname}{family-given}
\DeclareNameAlias{publisher}{family-given}
% formatting for certain fields
\DeclareFieldFormat{url}{in:\space\linebreak[0]\url{#1}}
\DeclareFieldFormat{urldate}{\newunitpunct\space\linebreak[0](#1)}
\DeclareFieldFormat{year}{#1}
\DeclareFieldFormat{edition}{#1 Auflage}
\DeclareFieldFormat[article]{citetitle}{#1}
\DeclareFieldFormat[article]{title}{\textit{#1}}
\DeclareFieldFormat[incollection]{title}{\textit{#1}}
\DeclareFieldFormat[incollection]{citetitle}{#1}
\DeclareFieldFormat[unpublished]{citetitle}{#1}
\DeclareFieldFormat[unpublished]{title}{\textit{#1}}
% allow linebreaks in long urls
\setcounter{biburllcpenalty}{7000}
\setcounter{biburlucpenalty}{8000}
% Sourcemapping, which copies the content of publisher to bapublisher
\DeclareStyleSourcemap{
\maps[datatype=bibtex]{
\map{
\pertype{collection}
\step[fieldsource=publisher]
\step[fieldset=bapublisher, origfieldval]
}
}
}
% change certain delimiters
\renewcommand*{\newunitpunct}{\addcomma\space}
\renewcommand*{\labelnamepunct}{\addcolon\space}
\renewcommand*{\subtitlepunct}{\addperiod\space}
\renewcommand*{\multinamedelim}{/}
\renewcommand*{\finalnamedelim}{/}
% set length regarding formatting of the bibliography
\setlength{\bibhang}{0pt}
\setlength{\bibitemsep}{1.5\itemsep}
% check if setspace is loaded
\@ifpackageloaded{setspace}{\newcommand{\@bibsetspace}{yes}}{}
\InitializeBibliographyStyle{%
\ifdefvoid{\@bibsetspace}{
\linespread{1.0}
}{
\singlespacing
}
}
% fix messed up incollection ordering
\DeclareBibliographyDriver{incollection}{%
\usebibmacro{bibindex}%
\usebibmacro{begentry}%
\usebibmacro{author/translator+others}%
\setunit{\printdelim{nametitledelim}}\newblock
\usebibmacro{title}%
\newunit
\printlist{language}%
\newunit\newblock
\usebibmacro{byauthor}%
\newunit\newblock
\usebibmacro{in:}%
\iflistundef{publisher}
{\setunit*{\addcomma\space}}
{\setunit*{\addcolon\space}}%iflistundef
\printnames{bapublisher}\space\bibopenparen Hrsg.\bibcloseparen%
\setunit*{\addcomma\space}%
\usebibmacro{maintitle+booktitle}%
\newunit\newblock
\usebibmacro{byeditor+others}%
\newunit\newblock
\printfield{edition}%
\newunit
\iffieldundef{maintitle}
{\printfield{volume}%
\printfield{part}}
{}%iffieldundef
\newunit
\printfield{volumes}%
\newunit\newblock
\usebibmacro{series+number}%
\newunit\newblock
\printfield{note}%
\newunit\newblock
\printlist{location}%
\newunit\newblock
\usebibmacro{chapter+pages}%
\newunit\newblock
\iftoggle{bbx:isbn}
{\printfield{isbn}}
{}%
\newunit\newblock
\usebibmacro{doi+eprint+url}%
\newunit\newblock
\usebibmacro{addendum+pubstate}%
\setunit{\bibpagerefpunct}\newblock
\usebibmacro{pageref}%
\newunit\newblock
\iftoggle{bbx:related}
{\usebibmacro{related:init}%
\usebibmacro{related}}
{}%
\usebibmacro{finentry}}
% add internal document notice to unpublished
% (loosly copied from the standard.bbx definition of book)
\DeclareBibliographyDriver{unpublished}{%
\usebibmacro{bibindex}%
\usebibmacro{begentry}%
\usebibmacro{author/editor+others/translator+others}%
\setunit{\printdelim{nametitledelim}}\newblock
\usebibmacro{maintitle+title}%
\newunit
\printlist{language}%
\newunit\newblock
\usebibmacro{byauthor}%
\newunit\newblock
\usebibmacro{byeditor+others}%
\newunit\newblock
\printfield{edition}%
\newunit
\iffieldundef{maintitle}
{\printfield{volume}%
\printfield{part}}
{}%
\newunit
\printfield{volumes}%
\newunit\newblock
\usebibmacro{series+number}%
\newunit\newblock
\printfield{note}%
\newunit\newblock
\usebibmacro{publisher+location+date}%
\newunit\newblock
\usebibmacro{chapter+pages}%
\newunit
\printfield{pagetotal}%
\newunit\newblock
\iftoggle{bbx:isbn}
{\printfield{isbn}}
{}%
\newunit\newblock
\usebibmacro{doi+eprint+url}%
\newunit\newblock
\usebibmacro{addendum+pubstate}, internes Dokument%
\setunit{\bibpagerefpunct}\newblock
\usebibmacro{pageref}%
\newunit\newblock
\iftoggle{bbx:related}
{\usebibmacro{related:init}%
\usebibmacro{related}}
{}%
\usebibmacro{finentry}}
% fix publisher formatting
\DeclareNameFormat{bapublisher}{%
\namepartfamily\addcomma\space\namepartgiveni%
\ifthenelse{\value{listcount}<\value{liststop}}%
{\slash}%
{}%
}