-
Notifications
You must be signed in to change notification settings - Fork 3
/
biblatex-ext.tex
4371 lines (3901 loc) · 163 KB
/
biblatex-ext.tex
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
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
\documentclass[11pt,a4paper]{article}
\usepackage{iftex}
\iftutex
\usepackage{fontspec}
\else
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\input glyphtounicode
\pdfgentounicode=1
\fi
\usepackage[french,ngerman,british]{babel}
\usepackage{csquotes}
\usepackage[useregional]{datetime2}
\iftutex\else
\usepackage{lmodern}
\fi
\usepackage[mono=false]{libertinus}
\iftutex
\setmonofont[Scale=0.78]{Bitstream Vera Sans Mono}
\usepackage{unicode-math}
\setmathfont[Scale=MatchUppercase]{libertinusmath-regular.otf}
\else
\usepackage[libertinus]{newtxmath}
\usepackage[scaled=0.78]{beramono}
\usepackage{bm}
\fi
\usepackage[verbose,
top=33mm,
left=3.5cm, right=3.5cm,
marginparwidth=2.5cm,
height=21cm,
footskip=47.6pt,
headheight=17pt,
headsep=20.40001pt,
]{geometry}
\setlength\parindent{1em}
\usepackage{microtype}
\usepackage{ragged2e}
\usepackage{hyphenat}
\usepackage{booktabs}
\usepackage{multicol}
\usepackage[svgnames]{xcolor}
\usepackage{longtable}
\usepackage{array}
\newcolumntype{L}[1]{%
>{\raggedright\let\newline\\\arraybackslash\hspace{0pt}}p{#1}}
\usepackage[listings, breakable, skins]{tcolorbox}%
\usetikzlibrary{arrows.meta}
\usetikzlibrary{shapes.geometric}
\usetikzlibrary{fit}
\usetikzlibrary{positioning}
\usepackage[style=ext-authoryear-iecomp, backend=biber, labelnumber]{biblatex}
\addbibresource{biblatex-examples.bib}
\addbibresource{biblatex-ext-examples.bib}
\usepackage{biblatex-ext-tabular}
\usepackage{biblatex-ext-oa}
% Normally, the following packages should not be loaded explicitly.
% Instead, one of them (and *only* one) should be loaded via
% biblatex-ext-oa's options.
\usepackage{biblatex-ext-oasymb-tikz}
% We need to undefine \oasymbol to be able to load the other packages as well.
\undef\oasymbol
\undef\DefineOASymbol
\usepackage{biblatex-ext-oasymb-l3draw}
% We need to undefine \oasymbol to be able to load the other packages as well.
\undef\oasymbol
\undef\DefineOASymbol
\usepackage{biblatex-ext-oasymb-pict2e}
\DeclareFieldFormat{bibentrysetcount}{\mkbibparens{\mknumalph{#1}}}
\DeclareFieldFormat{labelnumberwidth}{\mkbibbrackets{#1}}
\DeclareFieldFormat{shorthandwidth}{\mkbibbrackets{#1}}
\defbibenvironment{bibliographyNUM}
{\list
{\printtext[labelnumberwidth]{%
\printfield{labelprefix}%
\printfield{labelnumber}}}
{\setlength{\labelwidth}{\labelnumberwidth}%
\setlength{\leftmargin}{\labelwidth}%
\setlength{\labelsep}{\biblabelsep}%
\addtolength{\leftmargin}{\labelsep}%
\setlength{\itemsep}{\bibitemsep}%
\setlength{\parsep}{\bibparsep}}%
\renewcommand*{\makelabel}[1]{\hss##1}}
{\endlist}
{\item}
\newcounter{extblxdoc@examplebib}
\makeatletter
\defbibcheck{examplebib}{%
\xifinlist{\thefield{entrykey}}{\extblxdoc@examplebib@list}
{}
{\skipentry}}
\newcommand*{\extblxdoc@fixexamplelinks}{%
\protected\def\blx@anchor{%
\xifinlist{\the\c@refsection @\the\c@extblxdoc@examplebib
@\abx@field@entrykey}{\blx@anchors}
{}
{\listxadd\blx@anchors{\the\c@refsection @\the\c@extblxdoc@examplebib
@\abx@field@entrykey}%
\hyper@natanchorstart{\the\c@refsection @\the\c@extblxdoc@examplebib
@\abx@field@entrykey}%
\hyper@natanchorend}}%
\long\def\blx@bibhyperref[##1]##2{%
\blx@sfsave\hyper@natlinkstart{\the\c@refsection
@\the\c@extblxdoc@examplebib @##1}\blx@sfrest
##2%
\blx@sfsave\hyper@natlinkend\blx@sfrest}%
}
\newcommand*{\exampleprintbib}[2][]{%
\nocite{#2}%
\let\extblxdoc@examplebib@list\empty
\def\do##1{\listeadd\extblxdoc@examplebib@list{\detokenize{##1}}}%
\docsvlist{#2}%
\AtNextBibliography{%
\stepcounter{extblxdoc@examplebib}%
\extblxdoc@fixexamplelinks}%
\printbibliography[check=examplebib, heading=none, #1]}
\newcommand*{\exampleprintbibtab}[1]{%
\nocite{#1}%
\let\extblxdoc@examplebib@list\empty
\def\do##1{\listeadd\extblxdoc@examplebib@list{\detokenize{##1}}}%
\docsvlist{#1}%
\AtNextBibliography{%
\stepcounter{extblxdoc@examplebib}%
\extblxdoc@fixexamplelinks}%
\printbibtabular[check=examplebib, heading=none]}
\usepackage{ltxdockit}
\usepackage{btxdockit}
\usepackage{cleveref}
\hypersetup{%
colorlinks=true,
allcolors=spot,
bookmarksopen=false,
bookmarksnumbered=false,
plainpages=false}
\definecolor{highlight1}{RGB}{240, 0, 0}
\definecolor{highlight2}{RGB}{0,153, 153}
\definecolor{spot}{rgb}{0,0.2,0.6}
\lstdefinestyle{extblxstylegeneral}{%
aboveskip = {0\p@ \@plus 6\p@},
belowskip = {0\p@ \@plus 6\p@},
tabsize = 2,
breaklines = true,
breakatwhitespace = true,
keepspaces = true,
escapeinside = {(*@}{@*)},
moredelim = {[is][\ttfamily\bfseries\color{highlight1}]{|}{|}},
moredelim = {[is][\ttfamily\bfseries\color{highlight1}]{|1}{1|}},
moredelim = {[is][\ttfamily\bfseries\color{highlight2}]{|2}{2|}},
}
\lstdefinelanguage{extBibTeX}{%
morekeywords=[1]{%
@article,@artwork,@audio,@bibnote,@book,@bookinbook,@booklet,%
@collection,@commentary,@customa,@customb,@customc,@customd,%
@custome,@customf,@inbook,@incollection,@inproceedings,%
@inreference,@image,@jurisdiction,@legal,@legislation,@letter,%
@dataset,
@manual,@misc,@movie,@music,@mvcollection,@mvreference,%
@mvproceedings,@mvbook,@online,@patent,@performance,@periodical,%
@proceedings,@reference,@report,@review,@set,@software,@standard,%
@suppbook,@suppcollection,@suppperiodical,@thesis,@unpublished,@video%
},
morekeywords=[2]{author,title,date,journal,volume,number,pages,doi,
eprint,eprinttype,eprintclass},
keywordstyle=[1]{\bfseries\spotcolor},
keywordstyle=[2]{\spotcolor},
sensitive=false,
}
\lstdefinestyle{extblxstylelatex}{%
language = {[LaTeX]TeX},
style = {extblxstylegeneral},
moretexcs = {
dimexpr,arraybackslash,newcolumntype,anchor,driver,plain,plainlang,
anchorlang,
thefield,bibstring,
addbibresource,
setlength,bibhang,addcomma,adddot,addperiod,addcolon,addspace,
addnbspace,
mkbibbold,mkbibemph,mkbibbrackets,mkbibparens,
usebibmacro,newbibmacro,renewbibmacro,setunit,newunit,printfield,printlist,
bibopenparen,bibcloseparen,bibopenbracket,bibclosebracket,
iflistundef,iffieldundef,ifnameundef,iffieldnums,
ExecuteBibliographyOptions,
defbibtabular,defbibtabulartwocolumn,defbibenvironment,
printbibliography,printbibtabular,
autocite,
DeclareFieldFormat,DeclareDelimFormat,
DeclareDelimcontextAlias,UndeclareDelimcontextAlias,
DeclareInnerCiteDelims,UndeclareInnerCiteDelims,DeclareInnerCiteDelimsAlias,
DeclareOuterCiteDelims,UndeclareOuterCiteDelims,DeclareOuterCiteDelimsAlias,
UndeclareCiteDelims,
introcitepunct,volnumdelim,maintitletitledelim,voltitledelim,sernumdelim,
jourvoldelim,
volnumdatedelim,locdatedelim,locpubdelim,publocdelim,pubdatedelim,
extradateonlycompcitedelim,introcitesep,introcitewidth,introcitebreak,
DeclareOpenAccessFieldUrl,DeclareOpenAccessEprintUrl,
DeclareOpenAccessEprintAlias,DeclareOpenAccessUrlFieldPriority},
}
\lstdefinestyle{extblxstylebibtex}{%
language = {extBibTeX},
style = {extblxstylegeneral},
}
\newcommand*{\highlight}[2][1]{\textcolor{highlight#1}{#2}}
\newcommand*{\highlightbf}[2][1]{\textcolor{highlight#1}{\textbf{#2}}}
\DeclareFieldFormat{highlight1}{\textcolor{highlight1}{#1}}
\DeclareFieldFormat{highlight2}{\textcolor{highlight2}{#1}}
\newtcolorbox{bibexample}[1][]{enhanced,
colframe=spot!75!black, colback=spot!5!white,
before title=\raggedright,
#1}
\newtcblisting{biblatexcode}{enhanced,
colframe=black!75!white, colback=black!5!white,
listing only,
frame hidden,
breakable,
listing style=extblxstylelatex}
\newtcblisting{bibtexfile}{enhanced,
colframe=black!75!white, colback=black!5!white,
listing only,
frame hidden,
breakable,
listing style = extblxstylebibtex}
\newtcbinputlisting{\inputexamplebibfile}[2][]{%
listing file={#2},
enhanced,
colframe=black!75!white, colback=black!5!white,
listing only,
frame hidden,
breakable,
listing style = extblxstylebibtex,
#1}
\newtcolorbox{warnbox}[1][]{%
enhanced,
before upper={
\parskip=0.5\baselineskip
\advance\parskip by 0pt plus 2pt
},
colframe=red, colback=red!5!white,
underlay={%
\path[draw=none] (interior.south east)
rectangle node {\warnsymbol}
([xshift=15mm,yshift=.1cm]interior.north east);},
#1}
\newtcolorbox{remindbox}[1][]{%
enhanced,
before upper={
\parskip=0.5\baselineskip
\advance\parskip by 0pt plus 2pt
},
colframe=yellow, colback=yellow!5!white,
underlay={%
\path[draw=none] (interior.south east)
rectangle node {\dbendsymbol}
([xshift=15mm,yshift=.1cm]interior.north east);},
#1}
\tikzset{
MWEcommentbox/.style={font=\sffamily\footnotesize, gray!60!darkgray},
}
\AtUsedriver*{%
\delimcontext{bib}%
\let\newblock\relax
\let\abx@macro@bibindex\@empty
\let\abx@macro@pageref\@empty}
% this is taken from ltxdockit.cls, which is not loaded
\newrobustcmd*{\fnurl}[1][]{\hyper@normalise\ltd@fnurl{#1}}
\def\ltd@fnurl#1#2{\footnote{#1\hyper@linkurl{\Hurl{#2}}{#2}}}
\newrobustcmd*{\email}{\hyper@normalise\ltd@email}
\def\ltd@email#1{\href{mailto:#1}{#1}}
% title
\providecommand*{\titlepage}{}
\providecommand*{\titlefont}{}
\renewrobustcmd*{\titlepage}[1]{\setkeys{ltd@ttp}{#1}}
\renewcommand*{\titlefont}{\bfseries}
\define@key{ltd@ttp}{title}{\def\ltd@title@title{#1}}
\define@key{ltd@ttp}{subtitle}{\def\ltd@title@subtitle{#1}}
\define@key{ltd@ttp}{url}{\def\ltd@title@url{#1}}
\define@key{ltd@ttp}{author}{\def\ltd@title@author{#1}}
\define@key{ltd@ttp}{email}{\def\ltd@title@email{#1}}
\define@key{ltd@ttp}{revision}{\def\ltd@title@revision{#1}}
\define@key{ltd@ttp}{date}{\def\ltd@title@date{#1}}
\providecommand*{\printtitlepage}{}
\renewrobustcmd*{\printtitlepage}{%
\begingroup
\centering\titlefont
\begingroup\LARGE
\ifundef\ltd@title@url
{\ltd@title@title}
{\href{\ltd@title@url}{\ltd@title@title}}%
\par
\endgroup
\vspace{0.25\baselineskip}
\begingroup\large
\ltd@title@subtitle\par
\endgroup
\expandafter\url\expandafter{\ltd@title@url}\par
\begin{multicols}{2}
\raggedleft
\ltd@title@author\par
\expandafter\email\expandafter{\ltd@title@email}\par
\raggedright
Version \ltd@title@revision\par\ltd@title@date
\end{multicols}
\endgroup}
\renewcommand\tableofcontents{%
\pdfbookmark[1]{\contentsname}{contents}%
\section*{\contentsname
\@mkboth{%
\MakeUppercase\contentsname}{\MakeUppercase\contentsname}}%
\@starttoc{toc}%
}
\def\@starttoc#1{%
\begingroup
\begin{multicols}{2}
\makeatletter
\RaggedRight
\@input{\jobname.#1}%
\if@filesw
\expandafter\newwrite\csname tf@#1\endcsname
\immediate\openout \csname tf@#1\endcsname \jobname.#1\relax
\fi
\end{multicols}
\@nobreakfalse
\endgroup}
\newrobustcmd*{\tex}{\TeX}
\newrobustcmd*{\etex}{\mbox{e-TeX}}
\newrobustcmd*{\pdftex}{pdf\-\tex}
\newrobustcmd*{\xetex}{Xe\-\tex}
\newrobustcmd*{\luatex}{Lua\-\tex}
\newrobustcmd*{\latex}{\LaTeX}%{La\kern-0.07em TeX}
\newrobustcmd*{\pdflatex}{pdf\-\latex}
\newrobustcmd*{\xelatex}{Xe\-\latex}
\newrobustcmd*{\lualatex}{Lua\-\latex}
\newrobustcmd*{\miktex}{Mik\-\tex}
\newrobustcmd*{\texlive}{\tex~live}
\newrobustcmd*{\bibtex}{Bib\kern-0.07em TeX}
\newrobustcmd*{\lppl}{\latex{} Project Public License}
\newrobustcmd*{\pdf}{\acr{PDF}}
\newrobustcmd*{\utf}{\mbox{\acr{UTF}-8}}
\newrobustcmd*{\pgftikz}{PGF/Ti\emph{k}Z}
\pdfstringdefDisableCommands{%
\def\tex{TeX}%
\def\etex{e-TeX}%
\def\xetex{XeTeX}%
\def\latex{LaTeX}%
\def\xelatex{XeLaTeX}%
\def\bibtex{BibTeX}%
\def\lppl{LaTeX Project Public License}%
\def\pdf{PDF}%
\def\utf{UTF-8}%
}
\let\accentcolour\spotcolor
\newcommand*{\allsectionsfont}{\sffamily\accentcolour}
\renewcommand\section{\@startsection {section}{1}{\z@}%
{-3.5ex \@plus -1ex \@minus -.2ex}%
{2.3ex \@plus.2ex}%
{\normalfont\Large\bfseries\allsectionsfont}}
\renewcommand\subsection{\@startsection{subsection}{2}{\z@}%
{-3.25ex\@plus -1ex \@minus -.2ex}%
{1.5ex \@plus .2ex}%
{\normalfont\large\bfseries\allsectionsfont}}
\renewcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}%
{-3.25ex\@plus -1ex \@minus -.2ex}%
{1.5ex \@plus .2ex}%
{\normalfont\normalsize\bfseries\allsectionsfont}}
\renewcommand\paragraph{\@startsection{paragraph}{4}{\z@}%
{3.25ex \@plus1ex \@minus.2ex}%
{-1em}%
{\normalfont\normalsize\bfseries\allsectionsfont}}
\renewcommand\subparagraph{\@startsection{subparagraph}{5}{\parindent}%
{3.25ex \@plus1ex \@minus .2ex}%
{-1em}%
{\normalfont\normalsize\bfseries\allsectionsfont}}
% from KOMA-Script
\newcommand*{\@list@extra}{%
\ifdim\parskip>\z@
\topsep\z@
\parsep\parskip
\itemsep\z@
\fi
}
\appto\@listi{\@list@extra}
\appto\@listii{\@list@extra}
\appto\@listiii{\@list@extra}
\appto\@listiv{\@list@extra}
\appto\@listv{\@list@extra}
\appto\@listvi{\@list@extra}
\renewcommand*{\verbatimfont}{\ttfamily}
\renewcommand*{\displayverbfont}{\ttfamily}
\renewcommand*{\marglistfont}{\accentcolour\sffamily\small}
\renewcommand*{\margnotefont}{\sffamily\small}
\renewcommand*{\optionlistfont}{\accentcolour\sffamily\displayverbfont}
\renewcommand*{\ltxsyntaxfont}{\ttfamily}
\renewcommand*{\ltxsyntaxlabelfont}{\accentcolour\displayverbfont}
\renewcommand*{\changelogfont}{\normalfont}
\renewcommand*{\changeloglabelfont}{\accentcolour\sffamily\bfseries}
\newcommand*{\stylelistlabelfont}{\accentcolour\sffamily\small}
\newcommand*{\bibfieldformatfont}{\sffamily}
\newcommand*{\bibfieldformatlabelfont}{\accentcolour\bibfieldformatfont\small}
\newenvironment*{stylelist}
{\list{}{%
\setlength{\labelwidth}{\marglistwidth}%
\setlength{\labelsep}{\marglistsep}%
\setlength{\leftmargin}{0pt}%
\renewcommand*{\makelabel}[1]{\hss\stylelistlabelfont##1}}%
\def\styleitem##1{%
\item[{##1}]%
\ltd@pdfbookmark{##1}{##1}}}
{\endlist}
\newenvironment*{bibfieldformatlist}
{\list{}{%
\setlength{\labelwidth}{\marglistwidth}%
\setlength{\labelsep}{\marglistsep}%
\setlength{\leftmargin}{0pt}%
\renewcommand*{\makelabel}[1]{\hss\bibfieldformatlabelfont##1}}%
\def\bibfieldformatitem##1{%
\item[{##1}]%
\ltd@pdfbookmark{##1}{##1}}}
{\endlist}
\newenvironment*{keymarglistbook}
{\marglist
\setlength{\itemsep}{0pt}%
\raggedright
\let\@@item\item
\def\keyitem[##1]{%
\@@item[{##1}]%
\ltd@pdfbookmark{##1}{##1}}}
{\endmarglist}
% modified for correct measurements
\def\ltd@option@i#1#2#3#4[#5]{%
\item[#2]%
\ltd@pdfbookmark{#1}{#1}%
\begingroup\raggedright
\ltd@textverb{=}%
\settowidth\@tempdimb{\ltd@textverb{=}}%
\settowidth\@tempdimc{\optionlistfont#2}%
\ifdim\@tempdimc>\marglistwidth
\@tempdimc=\dimexpr\@tempdimc-\marglistwidth\relax
\else
\@tempdimc=0pt
\fi
\@tempdima=\dimexpr\linewidth-\@tempdimb-\@tempdimc\relax
\ifblank{#4}
{}
{\settowidth\@tempdimb{default: #4}%
\@tempdima=\dimexpr\@tempdima-\@tempdimb-2em\relax}%
\parbox[t]{\@tempdima}{\raggedright #3}%
\ifblank{#4}
{}
{\hfill default:~#4}%
\ifblank{#5}
{}
{\marginpar{\margnotefont #5}}%
\par\endgroup
\nobreak\vspace{\itemsep}}
% inject a label additional to the bookmark so we can link stuff
\let\exltd@pdfbookmark\ltd@pdfbookmark
\def\ltd@pdfbookmark#1#2{%
\phantomsection\label{exltd@itm@#1}%
\exltd@pdfbookmark{#1}{#2}}
\blx@inputonce{ext-biblatex-aux.def}{auxiliary code for ext-biblatex}
{}{}{}{}
\newcommand*{\biblatexversion}{\extblx@requiredbiblatexversion}
\def\exltd@isofydate#1/#2/#3{#1-#2-#3}
\newcommand*{\biblatexdate}{\extblx@requiredbiblatexdate}
\expandafter\def\expandafter\biblatexdate\expandafter{%
\expandafter\exltd@isofydate\extblx@requiredbiblatexdate}
\AtEndPreamble{%
\deflength{\marglistwidth}{(\oddsidemargin+2cm)*85/100}}
\newcommand{\tikzmark}[2][]{\tikz[overlay,remember picture] \node (#2) {#1};}
\newcommand*{\tikztextmark}[2]{%
\tikz[remember picture,baseline,inner sep=0pt]\node [anchor=base] (#1) {#2};}
% *{<cmd>}{<x-shift>}{<y-shift>}
% unstarred version for commands defined by biblatex-ext
% starred version for standard biblatex commands
\def\punctarrow{%
\@ifstar\punctarrow@ii\punctarrow@i}
\def\punctarrow@i{%
\def\punctarrow@cmdfont{\bfseries}%
\def\punctarrow@hyperref##1##2{%
\hyperref[exltd@itm@##1]{##2}%
}%
\punctarrow@iii
}
\def\punctarrow@ii{
\def\punctarrow@cmdfont{\itshape}%
\let\punctarrow@hyperref\@secondoftwo
\punctarrow@iii
}
\def\punctarrow@iii#1#2#3{%
\ifdimcomp{#2}{<}{0pt}
{\def\punctarrow@nodeanchor{east}}
{\def\punctarrow@nodeanchor{west}}%
\draw[spot,thick,latex-,rounded corners] (#1) |- ++ (#2,#3)
node[anchor=\punctarrow@nodeanchor,text = black]
{\punctarrow@hyperref{#1}{\punctarrow@cmdfont\cmd{#1}}};%
}
% By Stefan Kottwitz, see https://tex.stackexchange.com/a/799/35864
\newcommand*\ttjustify{%
\fontdimen2\font=0.4em% interword space
\fontdimen3\font=0.2em% interword stretch
\fontdimen4\font=0.1em% interword shrink
\fontdimen7\font=0.1em% extra space
\hyphenchar\font=`\-% allowing hyphenation
}
% no \mbox here, we may have to break things
\renewrobustcmd*{\sty}[1]{{\verbatimfont\ttjustify #1}}
\newrobustcmd*{\blxstyle}[1]{{\verbatimfont\ttjustify #1}}
\newrobustcmd*{\filename}[1]{{\verbatimfont\ttjustify #1}}
\renewrobustcmd*{\bibfield}[1]{\sty{#1}}
\renewrobustcmd*{\opt}[1]{\sty{#1}}
\newrobustcmd*{\optval}[1]{\sty{#1}}
\newrobustcmd*{\bibmacro}[1]{\sty{#1}}
\renewrobustcmd*{\bibtype}[1]{\sty{@#1}}
\renewrobustcmd*{\cmd}[1]{\sty{\textbackslash #1}}
\let\cs\cmd
\newrobustcmd*{\bibfieldformat}[1]{{\bibfieldformatfont #1}}
\newrobustcmd*{\gencode}[1]{{\verbatimfont\ttjustify #1}}
\def\exltd@buildhypercmd@i#1{%
\expandafter\newrobustcmd\expandafter*\expandafter
{\csname hyper#1@i\endcsname}[2][]{%
\hyperref[exltd@itm@##1]{\csname #1\endcsname{##2}}}
\csdef{hyper#1}{\@dblarg{\csname hyper#1@i\endcsname}}}
\def\exltd@buildhypercmd{\forcsvlist{\exltd@buildhypercmd@i}}
\exltd@buildhypercmd{cmd,opt,bibmacro,len,blxstyle,sty,bibfield,bibfieldformat,
filename}
\newrobustcmd*{\hyperkvopt}[2]{{%
\verbatimfont\hyperref[exltd@itm@#1]{#1}\penalty\@M
\hskip 0em plus 0.15em\relax
=\penalty\hyphenpenalty
\hskip 0em plus 0.15em\relax #2}}
\newcommand*{\ctan}{\mkbibacro{CTAN}}
\newcommand*{\gitbaseurl}{https://github.com/moewew/biblatex-ext}
\newcommand*{\extblxversion}{0.18}
\newcommand*{\biber}{Biber}
\newcommand*{\gitissuelink}[1]{%
\href{\gitbaseurl/issues/#1}{issue \##1 on github}}
\newrobustcmd*{\CSdelim}{%
\textcolor{spot}{\margnotefont\footnotesize context sensitive}}
\newrobustcmd*{\CSdelimMark}{%
\leavevmode\marginpar{\CSdelim}}
\newcommand*{\mpdl}{$\langle$}
\newcommand*{\mpdr}{$\rangle$}
\iftutex
\newcommand*{\hmpdl}{$\langle$}
\newcommand*{\hmpdr}{$\rangle$}
\else
\newcommand*{\hmpdl}{$\bm{\langle}$}
\newcommand*{\hmpdr}{$\bm{\rangle}$}
\fi
\def\textvisiblespace{%
\raisebox{-2.2pt}{%
\mbox{\kern.04em\vrule \@height.5ex \@width.12ex}%
\vbox{\hrule \@width.2em \@height.12ex}%
\hbox{\vrule \@height.5ex \@width.12ex}%
\kern.04em}}
% Bourbaki dangerous bend symbol by Heiko Oberdiek
% https://tex.stackexchange.com/users/16967/heiko-oberdiek
% https://tex.stackexchange.com/a/262510/35864
\newcommand*{\dbendsymbol@tikz}{%
\begin{tikzpicture}[
line cap=but,
line join=round,
x=1.2em,
line width=2pt,
y=2*(height("Z")-\pgflinewidth)*(1-sin(10)),
rotate=-10,
rounded corners=1.5pt,]
\draw (.5,.5) node[scale=2,draw,diamond,fill=yellow,color=yellow] {};
\draw (1, 0) -- (0, 0) -- (1, 1) -- (0, 1);
\end{tikzpicture}}
\newsavebox{\dbendsymbol@box}
\sbox{\dbendsymbol@box}{\dbendsymbol@tikz}
\newcommand*{\dbendsymbol}{\usebox{\dbendsymbol@box}}
\newcommand*{\warnsymbol@tikz}{%
\begin{tikzpicture}[
line cap=but,
line join=round,
line width=2pt,
rounded corners=1.5pt,]
\node[regular polygon, regular polygon sides=3,
scale=1.2, inner sep=-.22em,
draw=red]
{\raisebox{.26em}{\LARGE\bfseries !}};
\end{tikzpicture}}
\newsavebox{\warnsymbol@box}
\sbox{\warnsymbol@box}{\warnsymbol@tikz}
\newcommand*{\warnsymbol}{\usebox{\warnsymbol@box}}
\makeatother
\titlepage{%
title = {The \sty{biblatex-ext} Bundle},
subtitle = {Extensions for the \sty{biblatex} standard styles},
url = {\gitbaseurl},
author = {Moritz Wemheuer},
email = {mwemheu@posteo.de},%
revision = {\extblxversion},
date = {\DTMDate{2024-03-24}},
}
\hypersetup{%
pdftitle = {The biblatex-ext Bundle},
pdfsubject = {Extensions for the \sty{biblatex} standard styles},
pdfauthor = {Moritz Wemheuer},
pdfkeywords = {latex, biblatex, bibtex, bibliography, references, citation},
}
\hyphenation{%
star-red
un-star-red
bib-lio-gra-phy
white-space
bib-open-paren
bib-close-paren
bib-open-bracket
bib-close-bracket
main-title-after-title
jour-vol-delim
in-name-before-title
tikz-picture
Define-OA-Symbol
}
\begin{document}
\printtitlepage
\tableofcontents
\section{Introduction}\label{sec:int}
\subsection{About}
The \sty{biblatex-ext} bundle provides an extended version of the standard
styles that come with \sty{biblatex}.
For each standard style this bundle provides a style with the same name
prefixed with \blxstyle{ext-} which can be used as a drop-in replacement for the
standard style~-- for example, the replacement for \blxstyle{authoryear-icomp}
is called \hyperblxstyle{ext-authoryear-icomp}.
The aim of the styles of this bundle is to offer a simple interface to change
some of the stylistic decisions made for the standard styles that would
otherwise need cumbersome and tedious redefinitions.
Additionally, some customisation features that were not deemed appropriate
for inclusion in the \sty{biblatex} kernel are provided.
Other than that the styles are as close to the standard styles as possible.
They do not attempt to offer options or commands for customisations that
are already fairly simple to achieve with the tools provided by the standard
styles.\footnote{Please be gentle and allow for a lot of wiggle room for what
exactly \enquote{simple} means. And don't get mad if the principle is not
followed at all times and the occasional solution for things that already are
\enquote{simple enough} pop up here and there.}
The initial motivation for this bundle was what has now become the option
\hyperopt{innamebeforetitle}.
It is fairly straighforward to print the name of the editor of an
\bibtype{incollection} before the \bibfield{booktitle}.
But if one does not want to resort to clever tricks,%
\footnote{See \url{https://tex.stackexchange.com/q/122218/} and
\url{https://tex.stackexchange.com/q/173638/} for example.}
the modifications needed to do this in a stable, safe and clean manner by
redefining the bibliography drivers can easily amass hundred lines of code~--
code you may not want to see in your preamble.
Some contributed \sty{biblatex} styles already place the editor in the
desired position, but you may not want to commit to the other changes implied
by switching to one of those styles.
Especially styles written for the sole purpose of implementing the requirements
of a particular style guide may have to go to great lengths to do so and are
therefore not as easily modified as the standard styles.
The styles of this bundle, on the other hand, try to stay as close to the
standard styles as possible both in output and implementation to allow you
to customise the styles with minimum additional effort over the standard styles.
A few words of warning:
The styles of this bundle are only really useful if you want to use one of their
features to avoid having to go through the lengthy and tedious redefinitions the
standard styles would require.
Before you get involved in modifying the standard styles or one of the styles
of this bundle, you may want to have a look at the host of other styles
available for \sty{biblatex},\fnurl{https://www.ctan.org/topic/biblatex}
maybe you are lucky and the style you are looking for has already been
implemented by someone else.
As was the intention, most methods to modify the standard styles are also
applicable to the styles of this bundle, but you may break some of their
features if you happen to modify something that the \blxstyle{ext-} styles
redefine themselves.
While many contributed \sty{biblatex} styles are examples of good \sty{biblatex}
style coding, this cannot be said of all of the files included in this bundle.
Especially the citation styles for compact citations have to work harder
to implement the citation delimiter feature properly.
So if you want to get inspired for your \sty{biblatex} coding, be warned that
terrible things lurk in the \filename{.cbx} files.
The standard \filename{.cbx} files will give you a much better impression of how
things should be done.
\subsection{Requirements}\label{sec:req}
The use of the styles requires a current version of the \sty{biblatex} package.
At the time of writing the latest version of \sty{biblatex} is
\biblatexversion{} (dated \biblatexdate),
that version is required for the styles to work properly.
A warning will be issued if you use an older version.
You may choose to ignore that warning, but the styles cannot be guaranteed to
work properly in that case:
you might get other warnings or errors, and some features of the style might
just fail silently.
Use of the \biber{} backend is strongly encouraged.
Most of the new features of this bundle do not require \biber{} explicitly in
their implementation, but many \sty{biblatex} standard features only work
properly with \biber{}.
\subsection{Compatibility with earlier versions}\label{sec:backw}
In an ideal world all changes to the styles in this bundle would be fully
backwards compatible. Unfortunately we do not live in this ideal world.
Most changes to this bundle should introduce new features that have little
relevant impact on existing functionality. But the occasional change
may have more lasting consequences and may cause existing customisations to
fail.
In fact all changes have the potential to break someone's code, since
\sty{biblatex} styles have little to no distinction between public and internal
code.
Still, some changes are more likely to be problematic than others and those
should be kept to a minimum. They can, however, be required to move development
forward.
If possible, backwards compatiblity measures that allow old code to
continue to work are in place. Sometimes that is not feasible and in those
cases the next best solution is to warn if old code is used, so please check
the log file for warnings~-- especially after an update.
But at times not even that is possible, so it is always a good idea to consult
the change history after an update and to examine the output with extra
scrutiny.
Higher-level changes are found in the revision history in \cref{sec:log},
more technical changes and commentary can be found in \filename{CHANGES.md},
the full set of changes can be investigated by comparing the tagged and
publicly available source code.
\subsection{Installation}\label{sec:install}
This style bundle is available on \ctan.%
\fnurl{https://ctan.org/pkg/biblatex-ext}
The current release is also available in \miktex{} and \texlive{} 2018 or
newer.
If at all possible you should install this bundle via your \tex{} distribution
(using \miktex{} Console\fnurl{https://miktex.org/howto/miktex-console} or
\gencode{tlmgr} for \texlive
\fnurl{https://www.tug.org/texlive/pkginstall.html}).
If you must install this package manually, get the files from \ctan{}
and install the \filename{.bbx}, \filename{.cbx}, \filename{.def},
\filename{.sty} and \filename{.lua} files preferably to
\path{tex/latex/biblatex-ext} of your local or home \TeX{} tree%
\fnurl{https://texfaq.org/FAQ-inst-wlcf}, the other
files (\path{CHANGES.md}, \path{README.md}, \path{biblatex-ext.tex},
\path{biblatex-ext.pdf} and \path{biblatex-ext-examples.bib}) go into
\path{doc/latex/biblatex-ext}. You may have to refresh your file name database
afterwards, so \tex{} can find the files.
\subsection{License}\label{sec:license}
Permission is granted to copy, distribute and\slash or modify this software
under the terms of the \lppl, version 1.3c%
\fnurl{https://www.latex-project.org/lppl/lppl-1-3c.txt}
or (at your option) any later version%
\fnurl{https://www.latex-project.org/lppl.txt}.
This bundle is maintained by Moritz Wemheuer (\textcopyright 2017--2024).
\subsection{Feedback}\label{sec:feedback}
You can use the \sty{biblatex-ext} project page on GitHub%
\footnote{\url{\gitbaseurl}} to report bugs and
submit suggestions and feature requests, or you can do so via email.
If you do not want to report a bug or request a feature, but are simply in need
of assistance, you might want to consider posting your question on the
\texttt{comp.text.tex} newsgroup or \tex{}~--~\latex{} Stack Exchange.%
\fnurl{https://tex.stackexchange.com/questions/tagged/biblatex}
If after a consultation on one of these sites it turns out you have happened
upon a bug or that you can formulate a request for a new feature that could be
useful, please head over to GitHub or send me an email.
\section{Use}\label{sec:use}
The \sty{biblatex-ext} bundle is a collection of \sty{biblatex} style files.
You can load the styles exactly as you would load the standard styles:
\begin{biblatexcode}
\usepackage[style=(*@\prm{style}@*)]{biblatex}
\end{biblatexcode}
The naming of the styles follows the scheme
\mbox{\blxstyle{ext-}\prm{standard style}}, e.g.,
the style corresponding to \blxstyle{authoryear-icomp} is called
\hyperblxstyle{ext-authoryear-icomp}.
This manual assumes familiarity with the concepts of \sty{biblatex} and does
not attempt to explain any of the standard \sty{biblatex} features, so you may
want to have the \sty{biblatex} documentation%
\fnurl{http://mirrors.ctan.org/macros/latex/contrib/biblatex/doc/biblatex.pdf}
at hand to fully appreciate what is going on.
If you are new to \sty{biblatex} the three hundred odd pages of the manual
can be hard to stomach at first, so you may want to have a look at a more
gentle introduction.
Of the many introductory texts and tutorials available on the internet%
\fnurl{https://tex.stackexchange.com/q/13509/35864}
the author particularly likes
Knut Hegna and Dag Langmyhr's \emph{Local Guide to \sty{biblatex}}%
\fnurl{https://www.mn.uio.no/ifi/tjenester/it/hjelp/latex/biblatex-guide.pdf}
and Paul Stanley's \emph{\sty{biblatex}~-- An Easier Read}%
\fnurl{https://github.com/PaulStanley/biblatex-tutorial/releases}.
French speakers may want to consider Maïeul Rouquette's
\foreignlanguage{french}{\emph{(Xe)\LaTeX{} Appliqué aux sciences humaines}}
available on \ctan\fnurl{https://ctan.org/pkg/latex-sciences-humaines}.
If you read German you may be interested in Dominik Waßenhoven's two-part
series \foreignlanguage{ngerman}{\emph{Bibliographien erstellen mit
\sty{biblatex}}} in \foreignlanguage{ngerman}{\emph{Die \TeX nische Komödie}}
2/2008\fnurl{https://archiv.dante.de/DTK/PDF/komoedie_2008_2.pdf} (pp.~53--75)
and 4/2008\fnurl{https://archiv.dante.de/DTK/PDF/komoedie_2008_4.pdf} (pp.~31--51).
Please keep in mind that some of these texts were written a while ago and
that \sty{biblatex} is actively developed: technical details may have changed
and new features make some things easier.
\clearpage
\section{Styles}\label{sec:styles}
This bundle provides an extended version of each standard style as well as a
few new styles.
\subsection{Standard styles}\label{sec:styles:standard}
Please refer to the \sty{biblatex} documentation%
\fnurl{http://mirrors.ctan.org/macros/latex/contrib/biblatex/doc/biblatex.pdf}
and the style examples%
\fnurl{http://mirrors.ctan.org/macros/latex/contrib/biblatex/doc/examples/}
for a more detailed description of each standard style.
The relations between the styles are exactly as in their standard counterparts.
The \blxstyle{ext-} styles only build on top of the standard files.
\begin{stylelist}
\styleitem{ext-numeric}
An extended version of the standard \blxstyle{numeric} style for citations with
numeric labels.
\begin{bibexample}
\begin{lstlisting}[style=extblxstylelatex]
\usepackage[style=ext-numeric]{biblatex}
\end{lstlisting}
\tcblower
[1, 2, 5, 6, 7]
\end{bibexample}
\styleitem{ext-numeric-comp}
An extended version of the standard \blxstyle{numeric-comp} style.
Similar to \blxstyle{ext-numeric}, but citation labels are
compressed to give \enquote{[1--3]} instead of \enquote{[1, 2, 3]}.
\begin{bibexample}
\begin{lstlisting}[style=extblxstylelatex]
\usepackage[style=ext-numeric-comp]{biblatex}
\end{lstlisting}
\tcblower
[1, 2, 5--7]
\end{bibexample}
\styleitem{ext-numeric-verb}
An extended version of the standard \blxstyle{numeric-verb} style.
This style is similar to the \blxstyle{numeric} style, but each citation label
is in its own set of brackets: \enquote{[1], [2], [3]}.
\begin{bibexample}
\begin{lstlisting}[style=extblxstylelatex]
\usepackage[style=ext-numeric-verb]{biblatex}
\end{lstlisting}
\tcblower
[1], [3], [5], [6], [7]
\end{bibexample}
\styleitem{ext-alphabetic}
An extended version of the standard \blxstyle{alphabetic} style for citations
with alphabetic labels derived from author name and year.
\begin{bibexample}
\begin{lstlisting}[style=extblxstylelatex]
\usepackage[style=ext-alphabetic]{biblatex}
\end{lstlisting}
\tcblower
[SR98, Knu86c]
\end{bibexample}
\styleitem{ext-alphabetic-verb}
An extended version of the standard \blxstyle{alphabetic-verb} style.
This style is based on \blxstyle{ext-alphabetic}, but like
\blxstyle{ext-numeric-verb} places each citation label in its own pair of
brackets: \enquote{[SR98], [Knu86c]}.
\begin{bibexample}
\begin{lstlisting}[style=extblxstylelatex]
\usepackage[style=ext-alphabetic-verb]{biblatex}
\end{lstlisting}
\tcblower
[SR98], [Knu86c]
\end{bibexample}
\styleitem{ext-authoryear}
An extended version of the standard \blxstyle{authoryear} style for citations
using author name and year.
\begin{bibexample}
\begin{lstlisting}[style=extblxstylelatex]
\usepackage[style=ext-authoryear]{biblatex}
\end{lstlisting}
\tcblower
Sigfridsson and Ryde 1998
\end{bibexample}
\styleitem{ext-authoryear-comp}
An extended version of the standard \blxstyle{authoryear-comp} style.
The style is based on the author-year citations of \blxstyle{ext-authoryear},
but several works by the same author are compressed by not displaying the
author multiple times: \enquote{Knuth 1984, 1986} instead of
\enquote{Knuth 1984; Knuth 1986}.
\begin{bibexample}
\begin{lstlisting}[style=extblxstylelatex]
\usepackage[style=ext-authoryear-comp]{biblatex}
\end{lstlisting}
\tcblower
Knuth 1984, 1986
\end{bibexample}
\styleitem{ext-authoryear-ibid}
An extended version of the standard \blxstyle{authoryear-ibid} style.
This style is similar to \blxstyle{ext-authoryear}, but repeated citations are
replaced with \enquote{ibidem}.
\begin{bibexample}
\begin{lstlisting}[style=extblxstylelatex]
\usepackage[style=ext-authoryear-ibid]{biblatex}
\end{lstlisting}
\tcblower
Knuth 1984\quad ibid.
\end{bibexample}
\styleitem{ext-authoryear-icomp}
An extended version of the standard \blxstyle{authoryear-icomp} style.
This style combines the two styles \blxstyle{ext-authoryear-comp} and
\blxstyle{ext-authoryear-ibid}.
\begin{bibexample}
\begin{lstlisting}[style=extblxstylelatex]
\usepackage[style=ext-authoryear-icomp]{biblatex}
\end{lstlisting}
\tcblower
Knuth 1984, 1986 \quad Sigfridsson and Ryde 1998 \quad ibid.
\end{bibexample}