-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjapuzkbib.bbx
277 lines (277 loc) · 9.46 KB
/
japuzkbib.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
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
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
\ProvidesFile{japuzkbib.bbx}%
[2020/08/15 v0.1 japuzkbib -- %
biblatex für Japanologen, bbx-Datei]
\RequireBibliographyStyle{standard}
\ExecuteBibliographyOptions{%
pagetracker=true,%
bibencoding=utf8,%
sortlocale=de%
}%
\newbool{bbx:editorders}
\DeclareBibliographyOption{editorders}[true]{\csuse{bool#1}%
{bbx:editorders}}
\newbool{bbx:maintitleebd}%
\DeclareBibliographyOption{maintitleebd}[true]{\csuse{bool#1}%
{bbx:maintitleebd}}
\newbool{bbx:nurinit}%
\DeclareBibliographyOption{nurinit}[true]{\csuse{bool#1}%
{bbx:nurinit}}%
\newbool{bbx:editionen}%
\DeclareEntryOption{editionen}[true]{\csuse{bool#1}{bbx:editionen}}%
\newbool{cbx:nurshorthand}%
\DeclareEntryOption{nurshorthand}[true]{\csuse{bool#1}%
{cbx:nurshorthand}}%
\newbibmacro{savestuff}{%
\savename{editor}{\bbx@lasteditor}%
\savefield{namehash}{\bbx@lasthash}%
\savefield{maintitle}{\bbx@lastmaintitle}%
\savefield{shorthand}{\bbx@lastshorthand}%
}%
\AtBeginBibliography{%
\def\bbx@lasteditor{xxxxx}
\def\bbx@lasthash{xxxxx}
\def\bbx@lastmaintitle{xxxxx}
\def\bbx@lastshorthand{xxxxx}
\usebibmacro{savestuff}
}%
\DeclareFieldFormat*{title}{#1}%
\DeclareFieldFormat*{subtitle}{#1}%
\DeclareFieldFormat*{booktitle}{#1}%
\DeclareFieldFormat*{booksubtitle}{#1}%
\DeclareFieldFormat*{titlecase}{\textit{#1}}%
\DeclareFieldFormat*{maintitle}{#1}%
\DeclareFieldFormat*{journaltitle}{#1}%
\DeclareFieldFormat*{pages}{#1}%
\DeclareFieldFormat*{edition}{#1}%
\DeclareFieldFormat*{volumes}{#1}%
\DeclareFieldFormat*{volume}{#1}%
\DeclareFieldFormat{parens}{\mkbibparens{#1}}%
\DeclareFieldFormat{brackets}{\mkbibbrackets{#1}}%
\DeclareFieldFormat{quotes}{\mkbibquote{#1}}%
\renewcommand*{\subtitlepunct}{\addperiod\addspace}%
\renewcommand*{\intitlepunct}{\addcolon\addspace}%
\renewcommand*{\newunitpunct}{\addperiod\addspace}%
\newcommand*{\autorenschriftart}{\scshape}%
\newcommand*{\autorentrennzeichen}{\addcomma\addspace}%
\DefineBibliographyStrings{german}{%
and = {u.},%
}%
\DeclareNameFormat{author}{%
\nameparts{#1}%
{\autorenschriftart%
\ifdefvoid{\namepartprefix}{}{\namepartprefix\addspace}%
\namepartfamily}%
\ifdefvoid{\namepartgiven}{}{\addcomma\space%
\ifbool{bbx:nurinit}{\namepartgiveni}{\namepartgiven}}%
\isdot%
\ifnumcomp{\value{listcount}}{<}{\value{liststop}-1}%
{\autorentrennzeichen\addspace}%
{\ifnumcomp{\value{listcount}}{=}{\value{liststop}}%
{\usebibmacro{name:andothers}}{\addspace\bibstring{and}\addspace}}%
}%
\newcommand*{\orttrennzeichen}{\addnbspace\slash}%
\DeclareListFormat{location}{%
#1\ifthenelse{\value{listcount}<\value{liststop}}%
{\orttrennzeichen\addspace}{}%
}%
\let\bibnamedashOrig\bibnamedash%
\renewcommand*{\bibnamedash}{%
\bibsentence\bibstring{idem\thefield{gender}}}%
\renewbibmacro*{in:}{%
\printtext{\bibstring{in}\intitlepunct}%
}%
\renewbibmacro*{author}{%
\ifnameundef{author}{}%
{\ifboolexpr{test {\iffieldequals{namehash}{\bbx@lasthash}}%
and not test {\iffirstonpage}%
and not test{\ifcitation}}%
{\bibnamedash}%
{\printnames{author}\iffieldundef{nameaddon}{}{\addspace\printfield{nameaddon}}\isdot}}}%
\renewbibmacro*{editor}{%
\ifnameundef{editor}{}%
{\ifboolexpr{test {\iffieldequals{namehash}{\bbx@lasthash}}%
and not test {\iffirstonpage}%
and not test{\ifcitation}}%
{\bibnamedash}%
{\printnames[author]{editor}}}\isdot% (Hrsg.)
\addspace\printtext[parens]{\bibstring{editor}}}%
\renewbibmacro*{author/editor}{%
\ifnameundef{author}{%
\ifnameundef{editor}{%
\BibliographyWarning{Fehlender Autor *und* Herausgeber!}%
}{\usebibmacro{editor}%
}}{\usebibmacro{author}}%
}%
\renewbibmacro*{series+number}{%
\iffieldundef{series}{}{%
\printtext[parens]{%
\printfield{series}%
\setunit*{\addspace}%
\printfield{number}%
\newunit%
}%
}%
}%
\renewbibmacro*{journal}{%
\iffieldundef{journaltitle}%
{}%
{\printtext[journaltitle]{%
\printfield[titlecase]{journaltitle}%
\setunit{\subtitlepunct}%
\printfield[titlecase]{journalsubtitle}}}}%
\newbibmacro{year}{%
\iffieldundef{year}{}{\printfield[parens]{year}}}%
\newbibmacro{volume}{%
\iffieldundef{volume}{}{\printtext{\bibstring{volume}}\addspace\printfield{volume}}}%
\newbibmacro{number}{%
\iffieldundef{number}{}{\printtext{\bibstring{number}}\addspace\printfield{number}}}%
\newbibmacro*{journal+volume+number+year}{%
\usebibmacro{journal}%
\setunit*{\addcomma\addspace}%
\usebibmacro{volume}%
\setunit*{\addcomma\addspace}%
\usebibmacro{number}%
\setunit*{\addspace}%
\usebibmacro{year}%
}%
\newbibmacro*{pages}{%
\printtext{S\adddot\addspace}%
\printfield{pages}\isdot}%
\newbibmacro*{maintitle+title+volumes}{%
\iffieldsequal{maintitle}{title}%
{\clearfield{maintitle}%
\clearfield{mainsubtitle}%
\clearfield{maintitleaddon}}%
{\iffieldundef{maintitle}{}%
{%
{\usebibmacro{maintitle}%
\newunit\newblock%
\iffieldundef{volume}%
{\iffieldundef{volumes}{}{%
\printfield{volumes}%
\addspace\printtext{\bibstring{volumes}}\newunit}}%
{\printtext{\bibstring{volume}}\addspace%
\printfield{volume}\setunit*{\addcolon\addspace}}%
}}}%
\iffieldundef{volumes}{\usebibmacro{title}}{}%
\newunit}%
\renewbibmacro*{maintitle}{%
\ifboolexpr{test {\iffieldundef{maintitle}}%
and test {\iffieldundef{mainsubtitle}}}{}%
{\ifboolexpr{bool{bbx:maintitleebd} and%
test {\iffieldequals{maintitle}{\bbx@lastmaintitle}} and%
not (bool{cbx:neueseitevollzitat} and test {\iffirstonpage})}%
{\bibstring{ibidem}}%
{\printtext[maintitle]{%
\printfield[titlecase]{maintitle}%
\setunit*{\subtitlepunct}%
\printfield[titlecase]{mainsubtitle}}%
\setunit*{\subtitlepunct}}%
\printfield{maintitleaddon}\isdot}}%
\renewbibmacro*{title}{%
\ifboolexpr{test {\iffieldundef{title}} and%
test {\iffieldundef{subtitle}}}{}%
{\printtext[title]{%
\printfield[titlecase]{title}%
\setunit*{\subtitlepunct}%
\printfield[titlecase]{subtitle}}%
\setunit*{\subtitlepunct}}%
\printfield{titleaddon}\isdot}%
\newbibmacro*{articletitle}{%
\ifboolexpr{test {\iffieldundef{title}} and%
test {\iffieldundef{subtitle}}}{}%
{\printtext[title]{%
\printfield[quotes]{title}%
\setunit*{\subtitlepunct}%
\printfield[quotes]{subtitle}}%
\setunit*{\subtitlepunct}}%
\printfield{titleaddon}\isdot}%
\newbibmacro*{location+publisher+year}{%
\printlist{location}%
\iflistundef{publisher}{\setunit{\addspace}}{%
\setunit{\addcolon\addspace}%
\printlist{publisher}\addspace}%
\printfield{year}}%
\newbibmacro*{editor+booktitle+volume}{%
\ifnameundef{editor}{%
\usebibmacro{maintitle}%
\newunit%
\iffieldundef{volume}{}%
{\bibstring{volume}\addspace\printfield{volume}\newunit}%
}{%
\ifboolexpr{bool{bbx:editorders} and%
(test {\ifnameequals{editor}{\bbx@lasteditor}} or%
test {\ifnamesequal{editor}{author}}) and%
not (bool{cbx:neueseitevollzitat} and test {\iffirstonpage})}%
{\bibstring{idem\thefield{gender}}\addspace}%
{\printnames[author]{editor}\addspace}%
\printtext[parens]{\bibstring{editor}}\addcolon\addspace%
\usebibmacro{maintitle}%
\iffieldundef{volume}{}%
{\newunit\bibstring{volume}\addspace\printfield{volume}}%
\newunit%
}%
}%
\DeclareBibliographyDriver{book}{%
\usebibmacro{bibindex}%
\usebibmacro{begentry}%
\ifbool{bbx:editionen}{%
\iffieldequals{shorthand}{\bbx@lastshorthand}{\hspace*{\bibhang}}%
{\printfield{shorthand}\addcolon\newline}}{}%
\usebibmacro{author/editor}%
\setunit*{\addcolon\addspace}\newblock%
\usebibmacro{maintitle+title+volumes}%
\setunit{\addspace}%
\usebibmacro{series+number}%
\newunit\newblock%
\usebibmacro{location+publisher+year}%
\ifcitation{}{%
\setunit{\addspace}%
\usebibmacro{url+urldate}}%
\setunit{\addperiod\addspace}%
\usebibmacro{savestuff}%
\usebibmacro{finentry}%
}%
\DeclareBibliographyDriver{inbook}{%
\usebibmacro{bibindex}%
\usebibmacro{begentry}%
\usebibmacro{author}%
\ifnameundef{author}{}%
{\setunit*{\addcolon\addspace}\newblock}%
\usebibmacro{articletitle}%
\newunit\newblock
\usebibmacro{in:}%
\usebibmacro{editor+booktitle+volume}%
\setunit{\addspace}%
\usebibmacro{series+number}%
\newunit\newblock%
\usebibmacro{location+publisher+year}%
\setunit{\addcomma\addspace}%
\usebibmacro{pages}%
\ifcitation{}{%
\newunit\newblock%
\usebibmacro{url+urldate}}%
\setunit{\addperiod\addspace}%
\usebibmacro{savestuff}%
\usebibmacro{finentry}%
}%
\DeclareBibliographyAlias{collection}{book}%
\DeclareBibliographyAlias{incollection}{inbook}%
\DeclareBibliographyDriver{article}{%
\usebibmacro{bibindex}%
\usebibmacro{begentry}%
\usebibmacro{author}%
\setunit{\addcolon\addspace}\newblock%
\usebibmacro{articletitle}%
\newunit\newblock%
\usebibmacro{in:}%
\usebibmacro{journal+volume+number+year}%
\setunit{\addcomma\addspace}%
\usebibmacro{pages}%
\ifcitation{}{%
\newunit\newblock%
\usebibmacro{url+urldate}}%
\usebibmacro{savestuff}%
\usebibmacro{finentry}%
}%
\endinput