-
Notifications
You must be signed in to change notification settings - Fork 9
/
unified.bbx
733 lines (654 loc) · 22.8 KB
/
unified.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
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
%% ---------------------------------------------------------------
%% biblatex-unified --- A biblatex implementation of the Unified Style
%% Sheet for Linguistics Journals. This is the house style of the
%% journal "Semantics & Pragmatics" (A journal of the Linguistic
%% Society of America).
%% Maintained by Kai von Fintel ([email protected])
%% Released under the LaTeX Project Public License v1.3c or later
%% See http://www.latex-project.org/lppl.txt
%% ---------------------------------------------------------------
%%
\ProvidesFile{unified.bbx}[2020/05/25 v1.00 biblatex bibliography style]
% biblatex by default calls biblatex.def, we add to this authoryear.bbx, which
% in turn loads standard.bbx. So, unified.bbx is built on top of those styles;
% once authoryear.bbx is loaded, we tell it not to put in dashes for repeated
% authors (in accordance with the Unified Stylesheet)
\RequireBibliographyStyle{authoryear}
\ExecuteBibliographyOptions{dashed=false,isbn=false,eprint=false}
% NB: The Unified Style Sheet wants abbreviated "ed(s)", "edn". But using the
% abbreviate option also abbreviates the names of months. But then
% dateabbrev=false restores the long names of months
% biblatex has a "useprefix" option, which makes "von" count for
% alphabetization; the Unified Stylesheet does not want that, so it is important
% that this option be disabled (even if an author tries to set it to true)
\ExecuteBibliographyOptions{%
sorting=nyt,abbreviate,dateabbrev=false,useprefix=false}
% For backward compatibility: choose labeldate or labeldateparts
% depending on the biblatex version
\@ifpackagelater{biblatex}{2016/09/09} {%
\ExecuteBibliographyOptions{labeldateparts}} {%
\ExecuteBibliographyOptions{labeldate}
\def\printlabeldateextra{\printdateextralabel} }%
% If an @article entry contains Issuetitle and Editor information, we
% might not want to print it. The Unified Style Sheet does not offer
% explicit guidelines on this, but they don't have any examples where
% either of these pieces of information are actually printed.
% Therefore, we can offer an option for the user to decide whether to
% print it. The default will be not to print it since the Unified
% Style Sheet does not have examples where this information is
% printed. The user can print it by setting `issueandeditor=true` as a
% package option when biblatex is called.
\newtoggle{issueandeditor}
\DeclareBibliographyOption{issueandeditor}[false]{%
\settoggle{issueandeditor}{#1}}
% Formatting directives for name lists
% ------------------------------------------------------------------
%
% In biblatex.def, there are name formats defined: first-last, last-first,
% last-first/first-last. They could be simplified (we don't need provisions for
% using initials only, since the Unified Style doesn't do that), but since
% biblatex.def is loaded automatically, there's no point. The name formats call
% bibmacros that figure out how to order the internal of name components. These
% are re-defined here to make sure that "von" is treated as part of the last
% name (it still doesn't count for sorting -- which is controlled by the
% \useprefix package option) name:last is used to produce citation labels
% name:last-first is used to produce the first author's name listing in the
% alphabetical bibliography
% Also moved the Jr part to after the first name and inserted another comma,
% because the Unified Stylesheet disagrees with standard.bbx: it wants "Jr." not
% to be treated as part of the last name.
% The macros here get 4 arguments passed to them. They are: #1 last name, #2
% first name, #3 von, #4 Jr.
% In biblatex v3.3 and onwards, the name formatting has changed in a big way.
% See for example:
% http://tex.stackexchange.com/questions/299036/biblatex-3-3-name-formatting,
% https://github.com/plk/biblatex/issues/372, and
% http://www.texdev.net/2016/03/13/biblatex-a-new-syntax-for-declarenameformat/.
% The name formats in biblatex.def are not called first-last etc. anymore but
% given-family etc. And while there are safeguard legacy aliases
% (\DeclareNameAlias{first-last}{given-family}, for example), the new formats
% then use macros like \usebibmacro{name:family-given}, which of course our old
% redefinitions didn't adjust. So, for newer biblatex, we need to do new
% versions of \renewbibmacro{name:...}.
%% Redefinitions of name:last and name:last-first for biblatex versions before
%% v3.3
\renewbibmacro*{name:last}[4]{%
\usebibmacro{name:delim}{#3#1}%
\usebibmacro{name:hook}{#3#1}%
\ifblank{#3}
{}
{\ifcapital
{\mkbibnameprefix{\MakeCapital{#3}}\isdot}
{\mkbibnameprefix{#3}\isdot}%
\ifpunctmark{'}{}{\bibnamedelimc}}%
\mkbibnamelast{#1}}%
\renewbibmacro*{name:last-first}[4]{%
\usebibmacro{name:delim}{#3#1}%
\usebibmacro{name:hook}{#3#1}%
\ifblank{#3}{}{%
\mkbibnameprefix{#3}\isdot%
\ifpunctmark{'}{}{\bibnamedelimc}}%
\mkbibnamelast{#1}\isdot
\ifblank{#2}{}{\addcomma\bibnamedelimd\mkbibnamefirst{#2}\isdot}%
\ifblank{#4}{}{\addcomma\bibnamedelimd\mkbibnameaffix{#4}\isdot}}
%% Redefinitions of name:family and name:family-given for biblatex ever since
%% v3.3
\renewbibmacro*{name:family}[4]{%
\usebibmacro{name:delim}{#3#1}%
\usebibmacro{name:hook}{#3#1}%
\ifdefvoid{#3}
{}
{\ifcapital
{\mkbibnameprefix{\MakeCapital{#3}}\isdot}
{\mkbibnameprefix{#3}\isdot}%
\ifprefchar{}{\bibnamedelimc}}%
\mkbibnamefamily{#1}\isdot}%
\renewbibmacro*{name:family-given}[4]{%
\usebibmacro{name:delim}{#3#1}%
\usebibmacro{name:hook}{#3#1}%
\ifdefvoid{#3}
{}
{\mkbibnameprefix{#3}\isdot%
\ifprefchar{}{\bibnamedelimc}}%
\mkbibnamefamily{#1}\isdot
\ifdefvoid{#2}
{}
{\revsdnamepunct\bibnamedelimd\mkbibnamegiven{#2}\isdot}%
\ifdefvoid{#4}
{}
{\addcomma\bibnamedelimd\mkbibnamesuffix{#4}\isdot}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Various bibmacros used in producing the bibliography
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% We use `date+extradate` but biblatex versions before 3.8 didn't have that
% macro. Older versions were smart enough to complain about `\renewmacro` and
% use `\newmacro` instead. But the following construction works for both cases
\providebibmacro{date+extradate}{}
\renewbibmacro*{date+extradate}{%
\iffieldundef{labelyear} {}
{\printtext{\printlabeldateextra}}}% Took out parentheses around the year
\renewbibmacro*{author}{%
\ifboolexpr{
test \ifuseauthor
and
not test {\ifnameundef{author}}
}
{\usebibmacro{bbx:dashcheck}
{\bibnamedash}
{\usebibmacro{bbx:savehash}%
\printnames{author}%
\iffieldundef{authortype}
{\newunit}% period instead of space
{\setunit{\addcomma\space}}}%
\iffieldundef{authortype}
{}
{\usebibmacro{authorstrg}%
\newunit}}% period instead of space
{\global\undef\bbx@lasthash
\usebibmacro{labeltitle}%
\newunit}% period instead of space
\usebibmacro{date+extradate}}
\renewbibmacro*{editor}{%
\usebibmacro{bbx:editor}{editorstrg}}
\renewbibmacro*{editor+others}{%
\usebibmacro{bbx:editor}{editor+othersstrg}}
\renewbibmacro*{bbx:editor}[1]{%
\ifboolexpr{
test \ifuseeditor
and
not test {\ifnameundef{editor}}
}
{\usebibmacro{bbx:dashcheck}
{\bibnamedash}
{\printnames{editor}%
\setunit{\addspace}%
\usebibmacro{bbx:savehash}}%
\printtext[parens]{\usebibmacro{#1}}%
\clearname{editor}%
\newunit}% period instead of space
{\global\undef\bbx@lasthash
\usebibmacro{labeltitle}%
\newunit}% period instead of space
\usebibmacro{date+extradate}}
\renewbibmacro*{translator}{%
\usebibmacro{bbx:translator}{translatorstrg}}
\renewbibmacro*{translator+others}{%
\usebibmacro{bbx:translator}{translator+othersstrg}}
\renewbibmacro*{bbx:translator}[1]{%
\ifboolexpr{
test \ifusetranslator
and
not test {\ifnameundef{translator}}
}
{\usebibmacro{bbx:dashcheck}
{\bibnamedash}
{\printnames{translator}%
\setunit{\addcomma\space}%
\usebibmacro{bbx:savehash}}%
\usebibmacro{translator+othersstrg}%
\clearname{translator}%
\newunit}% period instead of space
{\global\undef\bbx@lasthash
\usebibmacro{labeltitle}%
\newunit}% period instead of space
\usebibmacro{date+extradate}}
\renewbibmacro*{journal}{%
\iffieldundef{journaltitle}
{}
{\printtext{%
\printfield{journaltitle}%
\setunit{\subtitlepunct}%
\printfield{journalsubtitle}}}}
\newbibmacro*{journal+issuetitle+editor}{%
\usebibmacro{journal}%
\setunit*{\addspace}%
\iffieldundef{series}
{}
{\newunit
\printfield{series}%
\setunit{\addspace}}%
\usebibmacro{volume+number+eid}%
\iftoggle{issueandeditor}
{\setunit{\addspace}%
\usebibmacro{issue+date}%
\setunit{\addcolon\space}%
\usebibmacro{issue}
% The following three lines were originally not included inside of
% the journal+issuetitle bibmacro. They have been moved inside of
% this macro in order to allow them to be controlled by the toggle
% `issuetitle` that is defined at the top of this style file.
\newunit
\usebibmacro{byeditor+others}%
\newunit}
{}%
\newunit}
% The next three bib macros are for printing the maintitle and
% booktitle fields of an @inproceedings entry with an ISSN as an
% article in accordance with the unified style sheet guidelines.
% 1. maintitle
\newbibmacro*{unified:proc-as-article:maintitle}{%
\ifboolexpr{
test {\iffieldundef{maintitle}}
and
test {\iffieldundef{mainsubtitle}}
}
{}
{\printtext{%
\printfield[maintitle]{maintitle}%
\setunit{\subtitlepunct}%
\printfield[maintitle]{mainsubtitle}}%
\newunit}%
\printfield{maintitleaddon}}
% 2. booktitle
\newbibmacro*{unified:proc-as-article:booktitle}{%
\ifboolexpr{
test {\iffieldundef{booktitle}}
and
test {\iffieldundef{booksubtitle}}
}
{}
{\printtext{%
\printfield[booktitle]{booktitle}%
\setunit{\subtitlepunct}%
\printfield[booktitle]{booksubtitle}}%
\newunit}%
\printfield{booktitleaddon}}
% 3. maintitle+booktitle
\newbibmacro*{unified:proc-as-article:maintitle+booktitle}{%
\iffieldundef{maintitle}
{}
{\usebibmacro{unified:proc-as-article:maintitle}%
\newunit\newblock}
\usebibmacro{unified:proc-as-article:booktitle}%
\setunit{\addspace}}
\renewbibmacro*{volume+number+eid}{%
\printfield{volume}%
% \setunit*{\adddot}%
\printfield[parens]{number}% parentheses instead of dot before issue number
\setunit{\addcomma\space}%
\printfield{eid}}
% This is for printing the volume field of a proceedings with an ISSN
% as an article in accordance with the unified style sheet guidelines.
% It depends on the declared field format below.
\newbibmacro*{unified:proc-as-article:volume+number+eid}{%
\printfield[volume:unified:proc-as-article]{volume}%
\printfield[parens]{number}%
\setunit{\addcomma\space}%
\printfield{eid}}
% Because of the weird format "3 May, 2007" specified in the Unified
% Stylesheet for URL access dates, we need a special way to format the
% urldate
\newcommand{\mkbibdateunified}[3]{% Year-Month-Day as input --> xx Month, Year
\iffieldundef{#3}
{}
{\stripzeros{\thefield{#3}}%
\nobreakspace}%
\iffieldundef{#2}
{\iffieldundef{#1}%
{}%
{\stripzeros{\thefield{#1}}}}%
{\mkbibmonth{\thefield{#2}}%
\iffieldundef{#1}%
{}%
{\iffieldundef{#3}%
{}%
{,}%
\space\stripzeros{\thefield{#1}}}%
}%
}%
\renewbibmacro*{url+urldate}{%
\printfield{url}%
\iffieldundef{urlyear}%
{}%
{\setunit*{\addspace}%
\printtext[parens]{\mkbibdateunified{urlyear}{urlmonth}{urlday}}}%
}
\renewbibmacro*{series+number}{%
\iffieldundef{series}
{}
{\printtext[parens]{%
\printfield{series}%
\setunit*{\addspace}%
\printfield{number}}%
}}
\renewbibmacro*{byeditor+others}{%
\ifnameundef{editor}
{}
{\printnames[byeditor]{editor}%
\setunit{\addspace}%
\printtext[parens]{\usebibmacro{editor+othersstrg}}%
\clearname{editor}%
\newunit}%
\usebibmacro{byeditorx}%
\usebibmacro{bytranslator+others}}
\renewbibmacro*{chapter+pages}{%
\iffieldundef{chapter}%
{}%
{\printfield{chapter}%
\setunit{\addcomma\space}}%
\printfield{pages}%
\newunit}
\renewbibmacro*{note+pages}{%
\iffieldundef{note}%
{}%
{\printfield{note}%
\setunit{\addcomma\space}}%
\printfield{pages}%
\newunit}
\newbibmacro*{institution+location+type+date}{%
\printlist{location}%
\iflistundef{institution}
{}
{\setunit*{\addcolon\space}}%
\printlist{institution}%
\setunit{\addspace}%
\printfield{type}%
\setunit*{\addcomma\space}%
\usebibmacro{date}%
\newunit}
% The following is a hack to satisfy the Unified Stylesheet's decision
% to give the edition right after the OED as used as a sortlabel.
\renewbibmacro*{labeltitle}{%
\iffieldundef{label}
{\iffieldundef{shorttitle}
{\printfield{title}%
\setunit{\addcomma\space}% Here it comes, preparing for the edition
\printfield{edition}% Here's the edition
\clearfield{title}%
\clearfield{edition}}% Clearing the edition field
{\printfield[title]{shorttitle}}}
{\printfield{label}}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Punctuation & formatting
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% This gets rid of the Oxford comma in name lists and uses the
% ampersand rather than "and":
\renewcommand*{\finalnamedelim}{\addspace\&\addspace}
\renewcommand*{\finallistdelim}{\addspace\&\addspace}
% no colon after "In" in incollection entries (overriding
% biblatex.def):
\renewcommand{\intitlepunct}{\addspace}
\renewcommand{\subtitlepunct}{\addcolon\space}
% No comma before pages, just the usual new unit period
\renewcommand*{\bibpagespunct}{\newunitpunct}
\DefineBibliographyStrings{english}{%
edition = {edn\adddot},
phdthesis = {dissertation},
}
% basically everything is in sentence case, other than journals and
% book series (recurring titles)
\DeclareFieldFormat[%
article,book,collection,incollection,inproceedings,thesis,unpublished]%
{titlecase}{\MakeSentenceCase*{#1}}%
% No quotes around titles
\DeclareFieldFormat[%
article,inbook,incollection,inproceedings,patent,thesis,unpublished]%
{title}{#1}
% Just like book titles, thesis titles are in italics
\DeclareFieldFormat[thesis]{title}{\mkbibemph{#1}}
\DeclareFieldFormat{pages}{#1} % no pp. prefix, took \mkpageprefix out [kvf]
\DeclareFieldFormat{doi}{%
\ifhyperref
{\href{https://doi.org/#1}{\nolinkurl{https://doi.org/#1}}}
{\nolinkurl{https://doi.org/#1}}}
\DeclareFieldFormat{url}{\url{#1}}
% This is for printing the volume field of a proceedings with an ISSN
% as an article in accordance with the unified style sheet guidelines
\DeclareFieldFormat{volume:unified:proc-as-article}{#1}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% The bibliography drivers, specifying the formats of each type of
% entry in the bibliography
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% First, the entry types used in the Unified Test Bibliography.
%%% Could rely on standard.bbx for all others as a fallback.
% For the article type, the only departure from standard.bbx is that
% we don't use a literal "In: " before the journal title; other
% formatting departures are done in the format specs and bibmacros
\DeclareBibliographyDriver{article}{%
\usebibmacro{bibindex}%
\usebibmacro{begentry}%
\usebibmacro{author/translator+others}%
\setunit{\labelnamepunct}\newblock
\usebibmacro{title}%
\newunit
\printlist{language}%
\newunit\newblock
\usebibmacro{byauthor}%
\newunit\newblock
\usebibmacro{bytranslator+others}%
\newunit\newblock
\printfield{version}%
\newunit\newblock
\usebibmacro{journal+issuetitle+editor}%
\newblock% \newblock ensures period before pages
\usebibmacro{note+pages}%
\newunit\newblock
\iftoggle{bbx:isbn}
{\printfield{issn}}
{}%
\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}}
\DeclareBibliographyDriver{book}{%
\usebibmacro{bibindex}%
\usebibmacro{begentry}%
\usebibmacro{author/editor+others/translator+others}%
\setunit{\labelnamepunct}\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}%
\setunit{\addspace}%
\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}%
\setunit{\bibpagerefpunct}\newblock
\usebibmacro{pageref}%
\newunit\newblock
\iftoggle{bbx:related}
{\usebibmacro{related:init}%
\usebibmacro{related}}
{}%
\usebibmacro{finentry}}
% Aliased to ensure no period between the title and the series.
\DeclareBibliographyAlias{collection}{book}
% @inbook entries look terrible as-is, and have fields very similar to
% @incollection anyway
\DeclareBibliographyAlias{inbook}{incollection}
\DeclareBibliographyAlias{incollection}{inproceedings}
% Given the guidelines in the unified style sheet, we should print
% conference proceedings and working papers as @article's just in case
% the publication has an ISSN. So, rather than have users handle this
% in the database by changing the entry type, we can implement this by
% checking if the inproceedings entry has an ISSN. If the field is
% undefined, the driver will do what driver did for @inproceedings
% entries as of 512f11657199a6044f7663da454f3eac338bdbd5 except that
% \printlist{organization} and \newunit have been removed. On the
% other hand, if the ISSN field is not undefined, then we will do
% largely the exact same thing that we do in the @article driver,
% except that we use the two macros
% \usebibmacro{unified:proc-as-article:maintitle+booktitle} and
% \usebibmacro{unified:proc-as-article:volume+number+eid} instead of
% \usebibmacro{journal+issuetitle} and except that
% \usebibmacro{byeditor+others} has been removed so as to ensure that
% the editors are not listed even if they are present in the database.
\DeclareBibliographyDriver{inproceedings}{%
\usebibmacro{bibindex}%
\usebibmacro{begentry}%
\iffieldundef{issn}
{\usebibmacro{author/translator+others}%
\setunit{\labelnamepunct}\newblock
\usebibmacro{title}%
\newunit
\printlist{language}%
\newunit\newblock
\usebibmacro{byauthor}%
\newunit\newblock
\usebibmacro{in:}%
\ifnameundef{editor}
{\setunit{\addspace}}
{\usebibmacro{byeditor+others}\setunit{\addcomma\space}}
\usebibmacro{maintitle+booktitle}%
\setunit{\addcomma\space}
\printfield{edition}%
\setunit{\addcomma\space}
\iffieldundef{maintitle}
{\printfield{volume}%
\printfield{part}}
{}%
\setunit{\addcomma\space}
\printfield{volumes}%
\setunit{\addspace}%
\usebibmacro{series+number}%
\setunit{\addcomma\space}
\usebibmacro{chapter+pages}%
\newunit\newblock
\printfield{note}%
\newunit\newblock
\usebibmacro{publisher+location+date}%
\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{author/translator+others}%
\setunit{\labelnamepunct}\newblock
\usebibmacro{title}%
\newunit
\printlist{language}%
\newunit\newblock
\usebibmacro{byauthor}%
\newunit\newblock
\usebibmacro{bytranslator+others}%
\newunit\newblock
\printfield{version}%
\newunit\newblock
\usebibmacro{unified:proc-as-article:maintitle+booktitle}%
\usebibmacro{unified:proc-as-article:volume+number+eid}
\newunit\newblock%
\usebibmacro{note+pages}%
\newunit\newblock
\iftoggle{bbx:isbn}
{\printfield{issn}}
{}%
\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}}
\DeclareBibliographyDriver{thesis}{%
\usebibmacro{bibindex}%
\usebibmacro{begentry}%
\usebibmacro{author}%
\setunit{\labelnamepunct}\newblock
\usebibmacro{title}%
\newunit
\printlist{language}%
\newunit\newblock
\usebibmacro{byauthor}%
\newunit\newblock
\printfield{note}%
\newunit\newblock
\usebibmacro{institution+location+type+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}%
\setunit{\bibpagerefpunct}\newblock
\usebibmacro{pageref}%
\newunit\newblock
\iftoggle{bbx:related}
{\usebibmacro{related:init}%
\usebibmacro{related}}
{}%
\usebibmacro{finentry}}
\DeclareBibliographyDriver{unpublished}{%
\usebibmacro{bibindex}%
\usebibmacro{begentry}%
\usebibmacro{author}%
\setunit{\labelnamepunct}\newblock
\usebibmacro{title}%
\newunit
\printlist{language}%
\newunit\newblock
\usebibmacro{byauthor}%
\newunit\newblock
\printfield{howpublished}%
\newunit\newblock
\printfield{note}%
\newunit\newblock
\usebibmacro{location+date}%
\newunit\newblock
\iftoggle{bbx:url}
{\usebibmacro{url+urldate}}
{}%
\newunit\newblock
\usebibmacro{addendum+pubstate}%
\setunit{\bibpagerefpunct}\newblock
\usebibmacro{pageref}%
\newunit\newblock
\iftoggle{bbx:related}
{\usebibmacro{related:init}%
\usebibmacro{related}}
{}%
\usebibmacro{finentry}}