-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathoxref.dtx
16494 lines (15594 loc) · 521 KB
/
oxref.dtx
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
% \iffalse
%<*internal|bbx|cbx|dbx|lbx|doc>
\def\Version{2024/08/26 v3.3}
%</internal|bbx|cbx|dbx|lbx|doc>
%<*internal>
\iffalse
%</internal>
%<*bbx|cbx|dbx|lbx>
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
%</bbx|cbx|dbx|lbx>
%<*bbx&o>
\ProvidesFile{oxref.bbx}
[\Version\space Base settings for bibliography styles inspired by the Oxford Guide to Style]
%</bbx&o>
%<*bbx&n>
%<default>\ProvidesFile{oxnotes.bbx}
%<ibid>\ProvidesFile{oxnotes-ibid.bbx}
%<note>\ProvidesFile{oxnotes-note.bbx}
%<inote>\ProvidesFile{oxnotes-inote.bbx}
%<trad1>\ProvidesFile{oxnotes-trad1.bbx}
%<trad2>\ProvidesFile{oxnotes-trad2.bbx}
%<trad3>\ProvidesFile{oxnotes-trad3.bbx}
[\Version\space Footnote-based bibliography style inspired by the Oxford Guide to Style]
%</bbx&n>
%<*bbx&m>
\ProvidesFile{oxnum.bbx}
[\Version\space Numeric bibliography style inspired by the Oxford Guide to Style]
%</bbx&m>
%<*bbx&a>
\ProvidesFile{oxalph.bbx}
[\Version\space Alphabetic bibliography style inspired by the Oxford Guide to Style]
%</bbx&a>
%<*bbx&y>
\ProvidesFile{oxyear.bbx}
[\Version\space Author-year bibliography style inspired by the Oxford Guide to Style]
%</bbx&y>
%<*cbx&n>
%<default>\ProvidesFile{oxnotes.cbx}
%<ibid>\ProvidesFile{oxnotes-ibid.cbx}
%<note>\ProvidesFile{oxnotes-note.cbx}
%<inote>\ProvidesFile{oxnotes-inote.cbx}
%<trad1>\ProvidesFile{oxnotes-trad1.cbx}
%<trad2>\ProvidesFile{oxnotes-trad2.cbx}
%<trad3>\ProvidesFile{oxnotes-trad3.cbx}
[\Version\space Footnote-based citation style inspired by the Oxford Guide to Style]
%</cbx&n>
%<*cbx&m>
\ProvidesFile{oxnum.cbx}
[\Version\space Numeric citation style inspired by the Oxford Guide to Style]
%</cbx&m>
%<*cbx&a>
\ProvidesFile{oxalph.cbx}
[\Version\space Alphabetic citation style inspired by the Oxford Guide to Style]
%</cbx&a>
%<*cbx&y>
\ProvidesFile{oxyear.cbx}
[\Version\space Author-year citation style inspired by the Oxford Guide to Style]
%</cbx&y>
%<*dbx>
%<*n>
%<default>\ProvidesFile{oxnotes.dbx}
%<ibid>\ProvidesFile{oxnotes-ibid.dbx}
%<note>\ProvidesFile{oxnotes-note.dbx}
%<inote>\ProvidesFile{oxnotes-inote.dbx}
%<trad1>\ProvidesFile{oxnotes-trad1.dbx}
%<trad2>\ProvidesFile{oxnotes-trad2.dbx}
%<trad3>\ProvidesFile{oxnotes-trad3.dbx}
%</n>
%<m>\ProvidesFile{oxnum.dbx}
%<a>\ProvidesFile{oxalph.dbx}
%<y>\ProvidesFile{oxyear.dbx}
[\Version\space Data model for the Oxref family of styles]
%</dbx>
%<*lbx&en>
\ProvidesFile{english-oxref.lbx}
[\Version\space Generic English conventions required by the biblatex-oxref styles]
%</lbx&en>
%<*lbx&gb>
\ProvidesFile{british-oxref.lbx}
[\Version\space British English conventions required by the biblatex-oxref styles]
%</lbx&gb>
%<*lbx&us>
\ProvidesFile{american-oxref.lbx}
[\Version\space American English conventions required by the biblatex-oxref styles]
%</lbx&us>
%<*lbx&es>
\ProvidesFile{spanish-oxref.lbx}
[\Version\space Spanish conventions required by the biblatex-oxref styles]
%</lbx&es>
%<*lbx&pl>
\ProvidesFile{polish-oxref.lbx}
[\Version\space Polish conventions required by the biblatex-oxref styles]
%</lbx&pl>
%<*doc&n>
\ProvidesFile{oxnotes-doc.tex}
[\Version\space Footnote-based biblatex style inspired by the Oxford Guide to Style]
%</doc&n>
%<*doc&m>
\ProvidesFile{oxnum-doc.tex}
[\Version\space Numeric biblatex style inspired by the Oxford Guide to Style]
%</doc&m>
%<*doc&a>
\ProvidesFile{oxalph-doc.tex}
[\Version\space Alphabetic biblatex style inspired by the Oxford Guide to Style]
%</doc&a>
%<*doc&y>
\ProvidesFile{oxyear-doc.tex}
[\Version\space Author-year biblatex style inspired by the Oxford Guide to Style]
%</doc&y>
%<*readme>
# biblatex-oxref: Biblatex styles inspired by the *Oxford Guide to Style*
This bundle provides four [biblatex] styles that implement (some of) the
stipulations and examples provided by the 2014 *New Hart's Rules* and the 2002
*Oxford Guide to Style*:
* `oxnotes` is a style similar to the standard `verbose`,
intended for use with footnotes;
* `oxnum` is a style similar to the standard `numeric`,
intended for use with numeric in-text citations.
* `oxalph` is a style similar to the standard `alphabetic`,
intended for use with alphabetic in-text citations.
* `oxyear` is a style similar to the standard `authoryear`,
intended for use with parenthetical in-text citations.
[biblatex]: http://ctan.org/pkg/biblatex
%</readme>
%<*bib>
@reference{ritter2002ogs,
editor = {R. M. Ritter},
editortype= {editorcm},
title = {The {Oxford} Guide to Style},
date = {2002},
publisher = {Oxford University Press},
location = {Oxford, UK}}
@reference{waddingham2014nhr,
editor = {Anne Waddingham},
title = {New {Hart's} Rules},
subtitle = {The {Oxford} Guide to Style},
date = {2014},
edition = {2},
publisher = {Oxford University Press},
location = {Oxford, UK}}
@book{law.oxford2012oscola,
author = {{Faculty of Law, University of Oxford}},
editor = {Donal Nolan and Sandra Meredith},
title = {{OSCOLA}},
subtitle = {The {Oxford} {University} Standard for Citation of Legal Authorities},
date = {2012},
edition = {4},
publisher = {Hart},
location = {Oxford, UK},
url = {https://www.law.ox.ac.uk/oscola}}
%</bib>
%<*internal>
\fi
\def\nameofplainTeX{plain}
\ifx\fmtname\nameofplainTeX\else
\expandafter\begingroup
\fi
%</internal>
%<*install>
\input docstrip.tex
\keepsilent
\askforoverwritefalse
\nopreamble\nopostamble
\usedir{doc/latex/\jobname}
\generate{
\file{README.md}{\from{\jobname.dtx}{readme}}
\file{\jobname.bib}{\from{\jobname.dtx}{bib}}
}
\preamble
----------------------------------------------------------------
biblatex-oxref --- Biblatex styles inspired by the Oxford Guide to Style
Author: Alex Ball
E-mail: a.j.ball@bath.ac.uk
License: Released under the LaTeX Project Public License v1.3c or later
See: http://www.latex-project.org/lppl.txt
----------------------------------------------------------------
\endpreamble
\postamble
Copyright (C) 2016–2023 Alex Ball
\endpostamble
\usedir{tex/latex/\jobname}
\generate{
\file{\jobname.bbx}{\from{\jobname.dtx}{bbx,o}}
\file{oxnotes.bbx}{\from{\jobname.dtx}{bbx,n,default}}
\file{oxnotes-ibid.bbx}{\from{\jobname.dtx}{bbx,n,ibid}}
\file{oxnotes-note.bbx}{\from{\jobname.dtx}{bbx,n,note}}
\file{oxnotes-inote.bbx}{\from{\jobname.dtx}{bbx,n,inote}}
\file{oxnotes-trad1.bbx}{\from{\jobname.dtx}{bbx,n,trad1}}
\file{oxnotes-trad2.bbx}{\from{\jobname.dtx}{bbx,n,trad2}}
\file{oxnotes-trad3.bbx}{\from{\jobname.dtx}{bbx,n,trad3}}
\file{oxnum.bbx}{\from{\jobname.dtx}{bbx,m}}
\file{oxalph.bbx}{\from{\jobname.dtx}{bbx,a}}
\file{oxyear.bbx}{\from{\jobname.dtx}{bbx,y}}
\file{oxnotes.cbx}{\from{\jobname.dtx}{cbx,n,default}}
\file{oxnotes-ibid.cbx}{\from{\jobname.dtx}{cbx,n,ibid}}
\file{oxnotes-note.cbx}{\from{\jobname.dtx}{cbx,n,note}}
\file{oxnotes-inote.cbx}{\from{\jobname.dtx}{cbx,n,inote}}
\file{oxnotes-trad1.cbx}{\from{\jobname.dtx}{cbx,n,trad1}}
\file{oxnotes-trad2.cbx}{\from{\jobname.dtx}{cbx,n,trad2}}
\file{oxnotes-trad3.cbx}{\from{\jobname.dtx}{cbx,n,trad3}}
\file{oxnum.cbx}{\from{\jobname.dtx}{cbx,m}}
\file{oxalph.cbx}{\from{\jobname.dtx}{cbx,a}}
\file{oxyear.cbx}{\from{\jobname.dtx}{cbx,y}}
\file{oxnotes.dbx}{\from{\jobname.dtx}{dbx,n,default}}
\file{oxnotes-ibid.dbx}{\from{\jobname.dtx}{dbx,n,ibid}}
\file{oxnotes-note.dbx}{\from{\jobname.dtx}{dbx,n,note}}
\file{oxnotes-inote.dbx}{\from{\jobname.dtx}{dbx,n,inote}}
\file{oxnotes-trad1.dbx}{\from{\jobname.dtx}{dbx,n,trad1}}
\file{oxnotes-trad2.dbx}{\from{\jobname.dtx}{dbx,n,trad2}}
\file{oxnotes-trad3.dbx}{\from{\jobname.dtx}{dbx,n,trad3}}
\file{oxnum.dbx}{\from{\jobname.dtx}{dbx,m}}
\file{oxalph.dbx}{\from{\jobname.dtx}{dbx,a}}
\file{oxyear.dbx}{\from{\jobname.dtx}{dbx,y}}
\file{american-\jobname.lbx}{\from{\jobname.dtx}{lbx,us}}
\file{british-\jobname.lbx}{\from{\jobname.dtx}{lbx,gb}}
\file{english-\jobname.lbx}{\from{\jobname.dtx}{lbx,en}}
\file{spanish-\jobname.lbx}{\from{\jobname.dtx}{lbx,es}}
\file{polish-\jobname.lbx}{\from{\jobname.dtx}{lbx,pl}}
\file{oxnotes-doc.tex}{\from{\jobname.dtx}{doc,n}}
\file{oxnum-doc.tex}{\from{\jobname.dtx}{doc,m}}
\file{oxalph-doc.tex}{\from{\jobname.dtx}{doc,a}}
\file{oxyear-doc.tex}{\from{\jobname.dtx}{doc,y}}
}
%</install>
%<install>\endbatchfile
%<*internal>
\usedir{source/latex/\jobname}
\generate{
\file{\jobname.ins}{\from{\jobname.dtx}{install}}
}
\ifx\fmtname\nameofplainTeX
\expandafter\endbatchfile
\else
\expandafter\endgroup
\fi
%</internal>
%<*driver>
\ProvidesFile{oxref.dtx}
[\Version\space Biblatex styles inspired by the Oxford Guide to Style]
\PassOptionsToPackage{style=oxnotes}{biblatex}
%</driver>
%<doc&n>\PassOptionsToPackage{style=oxnotes,scnames,varissuedate,anon}{biblatex}
%<doc&m>\PassOptionsToPackage{style=oxnum,scnames,varissuedate,anon,backref=true}{biblatex}
%<doc&a>\PassOptionsToPackage{style=oxalph,varissuedate,anon}{biblatex}
%<doc&y>\PassOptionsToPackage{style=oxyear,varissuedate,anon}{biblatex}
%<*driver|doc>
\documentclass[extrafontsizes,11pt,a4paper,oneside]{memoir}
\setlrmarginsandblock{3cm}{3cm}{*}
\setulmarginsandblock{2.5cm}{2.5cm}{*}
\checkandfixthelayout
% Document divisions
\chapterstyle{ell}
\renewcommand{\prechapterprecis}{%
\vspace*{\prechapterprecisshift}%
\begin{flushright}\precisfont
}
\renewcommand{\postchapterprecis}{\end{flushright}}
\hangsecnum
\setsecheadstyle{\Large\bfseries\raggedright}
\setsubsecheadstyle{\large\bfseries\scshape\raggedright}
\setsecnumdepth{subsection}
% Pagination and headers
\nouppercaseheads
\makeoddhead{myheadings}{\textsc{\leftmark}}{}{\thepage}
\makepsmarks{myheadings}{%
\def\chaptermark##1{\markboth{##1}{##1}}%
\def\sectionmark##1{\markright{##1}}%
}
\pagestyle{myheadings}
\aliaspagestyle{title}{empty}
% Paragraphs and lists
\setlength{\parindent}{0pt}\nonzeroparskip
\firmlists
\usepackage[british]{babel}
\usepackage[mono=false,defaultfeatures={SmallCapsFeatures={Letters=SmallCaps,Renderer=Basic,Ligatures=NoCommon}}]{libertine}
\usepackage{fontawesome}[2015/07/07]
\newcommand{\booksym}{\makebox[1em][c]{\faicon{book}}}
\newcommand{\cogsym}{\makebox[1em][c]{\faicon{cog}}}
\makeatletter
\@ifpackageloaded{fontspec}{%
\setmonofont[Scale=MatchLowercase,StylisticSet=1,AutoFakeSlant]{Inconsolatazi4}
}{%
\usepackage[utf8]{inputenc}
\usepackage[varl]{zi4}
}
\makeatother
\usepackage{xcolor,xparse}
\definecolor{Green}{rgb}{0,.5,0}
\colorlet{ok}{Green}
\colorlet{todo}{red}
\colorlet{hacked}{orange}
\colorlet{manual}{purple}
\usepackage{iftex}
\ifluatex
% Fix spacing in tcolorbox
\usepackage{luacolor}
\fi
\usepackage{tcolorbox}
\tcbuselibrary{skins,xparse,documentation,breakable,minted}
\colorlet{Option}{violet}
\colorlet{Command}{red!75!black}
\colorlet{Environment}{blue!75!black}
\colorlet{Value}{olive!75!black}
\colorlet{Color}{cyan!75!black}
\tcbset
{ enhanced
, listing engine=minted
, minted options=
{ breaklines
, fontsize=\footnotesize
%<*!doc>
, linenos
, numbersep=20pt
, firstnumber=last
%</!doc>
}
, index format=pgf
, color command=Command
, color environment=Environment
, color key=Option
, color value=Value
, color color=Color
}
\renewcommand{\theFancyVerbLine}{\footnotesize\itshape\color{gray}\arabic{FancyVerbLine}}
\let\tcbcs=\cs
\renewcommand*{\cs}[1]{\textcolor{Command}{\tcbcs{#1}}}
\def\sqbrackets#1{%
\texttt{\textcolor{Option}{[}#1\textcolor{Option}{]}}}
\def\brackets#1{%
\texttt{\textcolor{Environment}{\char`\{}#1\textcolor{Environment}{\char`\}}}}
\def\marg#1{%
\textcolor{Environment}{\ttfamily\char`\{}\meta{#1}\textcolor{Environment}{\ttfamily\char`\}}}
\newcommand*{\env}[1]{\textcolor{Environment}{\ttfamily #1}}
\newcommand*{\key}[1]{\textcolor{Option}{\ttfamily #1}}
\newcommand*{\val}[1]{\textcolor{Value}{\ttfamily #1}}
\makeatletter
\newcommand{\resetmintedformat}{%
% Comments
\expandafter\def\csname PYGdefault@tok@c\endcsname{\let\PYGdefault@it=\textit\def\PYGdefault@tc####1{\textcolor{gray}{####1}}}
% Command sequences
\expandafter\def\csname PYGdefault@tok@k\endcsname{\def\PYGdefault@tc####1{\textcolor{Command}{####1}}}
% Optional arguments
\expandafter\def\csname PYGdefault@tok@na\endcsname{\def\PYGdefault@tc####1{\textcolor{Option}{####1}}}
% Braces
\expandafter\def\csname PYGdefault@tok@nb\endcsname{\def\PYGdefault@tc####1{\textcolor{Environment}{####1}}}
}
\apptocmd{\minted@checkstyle}{\resetmintedformat}{}{}
\makeatother
\RecustomVerbatimEnvironment
{Verbatim}{Verbatim}
{commentchar=\%}
\usepackage{xpatch,csquotes,multicol}
\usepackage
[backend=biber%
,hyperref=false%
%,isbn=false%
]{biblatex}
\addbibresource{oxref.bib}
\setcounter{biburllcpenalty}{900}
\setcounter{biburlucpenalty}{800}
\setcounter{biburlnumpenalty}{700}
\DeclareBibliographyCategory{hidden}
\makeatletter
\DeclareCiteCommand{\fullcite}
{\usebibmacro{prenote}}
{\usedriver
{\defcounter{maxnames}{\blx@maxbibnames}}
{\thefield{entrytype}}}
{\multicitedelim}
{\usebibmacro{postnote}\finentrypunct}
\makeatother
% \xpretobibmacro{finentry}{%
% \ifboolexpr{ test {\ifcitation} and }{%
% \finentrypunct
% }{}%
% }{}{}
%<*doc>
% Shorthands useful for oxyear make overlong labels for oxnum/oxalph,
% so we remove them.
\DeclareSourcemap{%
\maps[datatype=bibtex]{%
\map[overwrite=true]{%
%<a> \pertype{legislation}
%<a> \pertype{legal}
%<n|y> \pernottype{legslation}
%<n|y> \pernottype{legal}
\step[fieldset=shorthand, null=true]
}%
}%
}
%</doc>
%<*!doc>
\usepackage[tightLists=false]{markdown}
\markdownSetup{rendererPrototypes={%
link = {\href{#3}{#1}},%
}}
%</!doc>
\hypersetup{pdfborder={0 0 0},pdfencoding=unicode}
\usepackage[noabbrev,capitalize,nameinlink]{cleveref}
\crefname{page}{page}{pages}
\NewDocumentCommand{\pkg}{om}{%
\IfNoValueTF{#1}
{\lowercase{\href{http://www.ctan.org/pkg/#2}}{\textsf{#2}}}
{\lowercase{\href{http://www.ctan.org/pkg/#1-#2}}{\textsf{#2}}}%
}
\newcommand*{\lit}[1]{\textsf{#1}}
\newcommand*{\code}[1]{\texttt{#1}}
\newcommand*{\aside}[1]{\textcolor{violet}{[\textsc{tip:} #1]}}
\newcommand{\tip}[1]{\hangfrom{\makebox[2em][c]{\faLightbulbO}}#1\par}
\newcommand{\info}[1]{\hangfrom{\makebox[2em][c]{\faInfoCircle}}#1\par}
\newcommand{\hack}[1]{\hangfrom{\makebox[2em][c]{\faWrench}}#1\par}
% For debugging; userd is either ‘todo’, ‘hacked’, ‘manual’
\makeatletter
\def\CiteStatus{todo}
\newcommand{\dbgcolor}[2]{%
\bgroup
\blx@citecmdinit
\blx@citeinit
\def\blx@precode{}%
\def\blx@postcode{}%
\def\blx@loopcode{%
\iffieldundef{userd}
{\xdef\CiteStatus{ok}}
{\xdef\CiteStatus{\abx@field@userd}}}%
\blx@citeloop{#1}%
\textcolor{\CiteStatus}{#2}%
\egroup
}
\makeatother
% bibexbox displays a sample reference:
% (colour)<source reference>[citation postnote]{bib key}[additional TCB options]
% Put hand-coded reference in the environment upper part.
% Put a bib entry (wrapped in a Verbatim environment) in the environment lower part.
\NewTColorBox{bibexbox}{D(){ok}d<>omo}%
{bicolor
,colframe = #1
,colback = #1!5!white
,colbacklower = white
,fontlower = \footnotesize
,before upper = {\hangfrom{\booksym\space}\biburlsetup}
,IfNoValueTF={#3}%
{after upper = {\par\hangfrom{\cogsym\space}\fullcite{#4}}
}%
{after upper = {\par\hangfrom{\cogsym\space}\fullcite[#3]{#4}}
,title = {\texttt{\string\fullcite[#3]\{#4\}}}
}
,IfNoValueTF={#2}{}%
{overlay = {
\node[anchor=south east,text=teal] at (frame.south east) {#2};
}
}
,phantomlabel={ex:#4}
,IfNoValueTF={#5}{}{#5}
}
\NewTotalTColorBox{\spec}{m}%
{enhanced
,sharp corners = west
,colframe = teal
,colback = teal!5!white
,toprule = 0pt
,bottomrule = 0pt
,rightrule = 0pt
}{#1}
% egcite displays a sample citation:
% (colour)[title]{hand-coded citation text}[additional TCB options]
% Put the citation command in the environment.
\NewTCBListing{egcite}{D(){ok} o m !o}%
{colframe = #1
,colback = #1!5!white
,listing side text
,lefthand width = 14em
,IfNoValueTF={#2}{}{title = #2}
,before lower = {\raggedright\ifblank{#3}{}{\hangfrom{\booksym\space}#3\par}\hangfrom{\cogsym\space}}
,IfNoValueTF={#4}{}{#4}}
% egcite* uses upper and lower portions
\NewTCBListing{egcite*}{D(){ok} o m !o}%
{colframe = #1
,colback = #1!5!white
,IfNoValueTF={#2}{}{title = #2}
,before lower = {\raggedright\ifblank{#3}{}{\hangfrom{\booksym\space}#3\par}\hangfrom{\cogsym\space}}
,IfNoValueTF={#4}{}{#4}}
\frenchspacing
\usepackage[british]{isodate}
%</driver|doc>
%<*doc>
\usepackage{readprov}
\GetFileInfo{\jobname.tex}
%</doc>
%<*driver>
% For typesetting the implementation
\makeatletter
\let\docdate\@undefined
\let\theglossary\@undefined
\let\endtheglossary\@undefined
\makeatother
\usepackage{doc}
\makeatletter
\renewenvironment{theglossary}{%
\bgroup
\glossary@prologue
\GlossaryParms \let\item\@idxitem \ignorespaces
}{%
\egroup
}
\renewenvironment{macro}[1]{%
\def\MyName{#1}%
\index{\MyName@\tcbIndexPrintComC {\MyName}|(emph}%
}{%
\ifdef{\MyName}{}{%
\errmessage{You have closed a macro environment you have not opened on \the\inputlineno.}%
}
\index{\MyName@\tcbIndexPrintComC {\MyName}|)}%
}
\renewenvironment{environment}[1]{%
\def\MyName{#1}%
\index{\MyName@\tcbIndexPrintEnvCA {\MyName}|(emph}%
\index{Environments!\MyName@\tcbIndexPrintEnvC {\MyName}|(emph}%
}{%
\ifdef{\MyName}{}{%
\errmessage{You have closed an environment environment you have not opened on \the\inputlineno.}%
}
\index{Environments!\MyName@\tcbIndexPrintEnvC {\MyName}|)}%
\index{\MyName@\tcbIndexPrintEnvCA {\MyName}|)}%
}
\newenvironment{optionkey}[1]{%
\def\MyName{#1}%
\index{\MyName@\tcbIndexPrintKeyCA {\MyName}|(emph}%
\index{Keys!\MyName@\tcbIndexPrintKeyC {\MyName}|(emph}%
}{%
\ifdef{\MyName}{}{%
\errmessage{You have closed an optionkey environment you have not opened on \the\inputlineno.}%
}
\index{Keys!\MyName@\tcbIndexPrintKeyC {\MyName}|)}%
\index{\MyName@\tcbIndexPrintKeyCA {\MyName}|)}%
}
\newenvironment{optionvalue}[1]{%
\def\MyName{#1}%
\index{\MyName@\tcbIndexPrintValCA {\MyName}|(emph}%
\index{Values!\MyName@\tcbIndexPrintValC {\MyName}|(emph}%
}{%
\ifdef{\MyName}{}{%
\errmessage{You have closed an optionvalue environment you have not opened on \the\inputlineno.}%
}
\index{Values!\MyName@\tcbIndexPrintValC {\MyName}|)}%
\index{\MyName@\tcbIndexPrintValCA {\MyName}|)}%
}
\let\PrintMacroName\@gobble
\let\PrintEnvName\@gobble
\renewenvironment{tcb@manual@entry}{\begin{list}{}{%
\setlength{\topsep}{0pt}
\setlength{\partopsep}{0pt}
\setlength{\leftmargin}{\kvtcb@doc@left}%
\setlength{\itemindent}{0pt}%
\setlength{\itemsep}{0pt}%
\setlength{\parsep}{0pt}%
\setlength{\rightmargin}{\kvtcb@doc@right}%
}\item}{\end{list}}
\makeatother
\MakeShortVerb{\|}
% This bit inspired by ydoc
\makeatletter
\newwrite\ydocwrite
\def\ydocfname{\jobname.listing}
\def\ydoc@catcodes{%
\let\do\@makeother
\dospecials
\catcode`\\=\active
\catcode`\^^M=\active
\catcode`\ =\active
}
\def\macrocode{%
\begingroup
\ydoc@catcodes
\macro@code
}
\def\endmacrocode{}
\begingroup
\endlinechar\m@ne
\@firstofone{%
\catcode`\|=0\relax
\catcode`\(=1\relax
\catcode`\)=2\relax
\catcode`\*=14\relax
\catcode`\{=12\relax
\catcode`\}=12\relax
\catcode`\ =12\relax
\catcode`\%=12\relax
\catcode`\\=\active
\catcode`\^^M=\active
\catcode`\ =\active
}*
|gdef|macro@code#1^^M% \end{macrocode}(*
|endgroup|expandafter|macro@@code|expandafter(|ydoc@removeline#1|noexpand|lastlinemacro)*
)*
|gdef|ydoc@removeline#1^^M(|noexpand|firstlinemacro)*
|gdef|ydoc@defspecialmacros(*
|def^^M(|noexpand|newlinemacro)*
|def (|noexpand|spacemacro)*
|def\(|noexpand|bslashmacro)*
)*
|gdef|ydoc@defrevspecialmacros(*
|def|newlinemacro(|noexpand^^M)*
|def|spacemacro(|noexpand )*
|def|bslashmacro(|noexpand\)*
)*
|endgroup
\def\macro@@code#1{%
{\ydoc@defspecialmacros
\xdef\themacrocode{#1}}%
\PrintMacroCode
\end{macrocode}%
}
\def\PrintMacroCode{%
\begingroup
\let\firstlinemacro\empty
\let\lastlinemacro\empty
\def\newlinemacro{^^J}%
\let\bslashmacro\bslash
\let\spacemacro\space
\immediate\openout\ydocwrite=\ydocfname\relax
\immediate\write\ydocwrite{\themacrocode}%
\immediate\closeout\ydocwrite
\let\input\@input
\tcbinputlisting{breakable,listing only,docexample,listing file=\ydocfname}%
\endgroup
}
\makeatother
\AtBeginDocument{%
\hypersetup{linkcolor=black}%
}
\GetFileInfo{\jobname.dtx}
\title{OXREF -- Biblatex styles inspired by the \emph{Oxford Guide to Style}}
%</driver>
%<doc&n>\title{OXNOTES -- A notes-based style for Biblatex}
%<doc&m>\title{OXNUM -- A numeric style for Biblatex}
%<doc&a>\title{OXALPH -- An alphabetic style for Biblatex}
%<doc&y>\title{OXYEAR -- An author–year style for Biblatex}
%<*driver|doc>
\newcounter{elementcount}
\newcommand{\commaorandlist}[1]{%
% Counting up
\renewcommand*{\do}[1]{\stepcounter{elementcount}}%
\dolistloop{#1}%
\ifnumgreater{\value{elementcount}}{2}{%
\def\thisfinaland{,\space and\space}%
}{%
\def\thisfinaland{\space and\space}%
}%
% Counting back down
\renewcommand*{\do}[1]{%
\ifnumgreater{\value{elementcount}}{2}{% antipenultimate or earlier
##1,\space
}{%
\ifnumequal{\value{elementcount}}{2}{% penultimate
##1\thisfinaland
}{% last
##1%
}%
}%
\addtocounter{elementcount}{-1}%
}%
\dolistloop{#1}}
\author{Alex Ball}
\listadd\thetranslators{Bruno Maltras}
\listadd\thetranslators{Sebastian Wasiuta}
\date{\printdateTeX{\filedate}}
\begin{document}
\thispagestyle{empty}
\begin{adjustwidth}{.2\textwidth}{0pt}
\sffamily\setlength{\parindent}{0pt}%
\LARGE\textsc{oxref bundle}
\vspace{\stretch{1}}
\LARGE\thetitle
\bigskip
\Large\theauthor\par
\normalsize with translations by \commaorandlist\thetranslators
\bigskip
\Large\thedate
\bigskip
\Large\fileversion
\end{adjustwidth}
\vspace{\stretch{3}}
\noindent
\hspace*{.1\textwidth}\raisebox{0pt}[0pt][0pt]{\rule{\normalrulethickness}{\textheight}}
\newpage
\begin{KeepFromToc}
\tableofcontents
\end{KeepFromToc}
%</driver|doc>
%<*driver>
\chapter{Introduction}
This document provides the documented sources for the \pkg[biblatex]{oxref}
biblography styles:
\begin{itemize}
\item
\textsf{oxnotes}: a style similar to the standard \textsf{verbose}
and its variants, intended for use with footnotes;
\item
\textsf{oxnum}: a style similar to the standard \textsf{numeric},
intended for use with numeric in-text citation labels;
\item
\textsf{oxalph}: a style similar to the standard \textsf{alphabetic},
intended for use with alphabetic in-text citation labels;
\item
\textsf{oxyear}: a style similar to the standard \textsf{authoryear},
intended for use with parenthetical in-text citations.
\end{itemize}
\section{Quick start}
The styles are self-contained, so you can load them with \pkg{biblatex}:
\begin{multicols}{2}
\begin{tcblisting}{listing only}
\usepackage[style=oxnotes]{biblatex}
\end{tcblisting}
\addtocounter{FancyVerbLine}{-1}%
\begin{tcblisting}{listing only}
\usepackage[style=oxnum]{biblatex}
\end{tcblisting}
\addtocounter{FancyVerbLine}{-1}%
\begin{tcblisting}{listing only}
\usepackage[style=oxalph]{biblatex}
\end{tcblisting}
\addtocounter{FancyVerbLine}{-1}%
\begin{tcblisting}{listing only}
\usepackage[style=oxyear]{biblatex}
\end{tcblisting}
\end{multicols}
For further information, including some additional options you can set,
please refer to the separate documentation files
\href{./oxnotes-doc.pdf}{\texttt{oxnotes-doc.pdf}},
\href{./oxnum-doc.pdf}{\texttt{oxnum-doc.pdf}},
\href{./oxalph-doc.pdf}{\texttt{oxalph-doc.pdf}},
and
\href{./oxyear-doc.pdf}{\texttt{oxyear-doc.pdf}}
respectively.
\sloppy
\begin{markdown*}{hybrid=true}
%</driver>
%<*driver|readme>
## Installation
### Dependencies
To compile the documentation you will need to have the [minted] package working,
which in turn relies on Python 2.6+ and Pygments. See the documentation of that
package for details.
### Managed way
The latest stable release of the biblatex-oxref bundle has been packaged for
TeX Live and MiKTeX. If you are running TeX Live and have `tlmgr` installed, you
can install the bundle simply by running `tlmgr install biblatex-oxref`. If you
are running MiKTeX, you can install the bundle by running
`mpm --install=biblatex-oxref`. Both `tlmgr` and `mpm` have GUI versions that
you might find friendlier.
### Automated way
A makefile is provided which you can use with the Make utility on
UNIX-like systems:
* Running `make source` generates the derived files
- README.md
- oxref.bbx, oxnotes.bbx, oxnotes-ibid.bbx, oxnotes-note.bbx,
oxnotes-inote.bbx, oxnotes-trad1.bbx, oxnotes-trad2.bbx,
oxnotes-trad3.bbx, oxyear.bbx, oxnum.bbx, oxalph.bbx
- oxnotes.cbx, oxnotes-ibid.cbx, oxnotes-note.cbx, oxnotes-inote.cbx,
oxnotes-trad1.cbx, oxnotes-trad2.cbx, oxnotes-trad3.cbx, oxyear.cbx,
oxnum.cbx, oxalph.cbx
- american-oxref.lbx, british-oxref.lbx, english-oxref.lbx,
spanish-oxref.lbx, polish.lbx
- oxnotes.dbx, oxnotes-ibid.dbx, oxnotes-note.dbx, oxnotes-inote.dbx,
oxnotes-trad1.dbx, oxnotes-trad2.dbx, oxnotes-trad3.dbx, oxyear.dbx,
oxnum.dbx, oxalph.dbx
- oxref.bib
- oxref.ins
- oxnotes-doc.tex, oxyear-doc.tex, oxnum-doc.tex, oxalph-doc.tex
* Running `make` generates the above files and also oxref.pdf,
oxnotes-doc.pdf, oxyear-doc.pdf, oxnum-doc.pdf and oxalph-doc.pdf.
* Running `make inst` installs the files in the user's TeX tree.
You can undo this with `make uninst`.
* Running `make install` installs the files in the local TeX tree.
You can undo this with `make uninstall`.
* Running `make clean` removes auxiliary files from the working directory.
* Running `make distclean` removes the generated files from the working
directory as well.
### Manual way
To install the bundle from scratch, follow these instructions. If you have
downloaded the zip file from the [Releases] page on GitHub, you can skip the
first two steps.
1. Run `luatex oxref.dtx` to generate the source files. (You can safely skip
this step if you are confident about step 2.)
2. Compile oxref.dtx, oxnotes-doc.tex, oxyear-doc.tex, and oxnum-doc.tex with
LuaLaTeX and Biber to generate the documentation. You will need to enable
shell escape so that [minted] can typeset the listings.
3. Move the files to your TeX tree as follows:
- `source/latex/biblatex-oxref`:
oxref.dtx,
(oxref.ins)
- `tex/latex/biblatex-oxref`:
american-oxref.lbx,
british-oxref.lbx,
english-oxref.lbx,
spanish-oxref.lbx,
polish-oxref.lbx,
oxalph.bbx,
oxalph.cbx,
oxalph.dbx,
oxnotes.bbx,
oxnotes.cbx,
oxnotes.dbx,
oxnotes-ibid.bbx,
oxnotes-ibid.cbx,
oxnotes-ibid.dbx,
oxnotes-inote.bbx,
oxnotes-inote.cbx,
oxnotes-inote.dbx,
oxnotes-note.bbx,
oxnotes-note.cbx,
oxnotes-note.dbx,
oxnotes-trad1.bbx,
oxnotes-trad1.cbx,
oxnotes-trad1.dbx,
oxnotes-trad2.bbx,
oxnotes-trad2.cbx,
oxnotes-trad2.dbx,
oxnotes-trad3.bbx,
oxnotes-trad3.cbx,
oxnotes-trad3.dbx,
oxnum.bbx,
oxnum.cbx,
oxnum.dbx,
oxref.bbx,
oxyear.bbx,
oxyear.cbx,
oxyear.dbx
- `doc/latex/biblatex-oxref`:
README.md,
oxalph-doc.pdf,
oxalph-doc.tex,
oxnotes-doc.pdf,
oxnotes-doc.tex,
oxnum-doc.pdf,
oxnum-doc.tex,
oxref.bib,
oxref.pdf,
oxyear-doc.pdf,
oxyear-doc.tex
4. You may then have to update your installation's file name database
before TeX and friends can see the files.
[Releases]: https://github.com/alex-ball/biblatex-oxref/releases
[minted]: http://ctan.org/pkg/minted
## Licence
Copyright 2016–2023 Alex Ball.
This work consists of the documented LaTeX file oxref.dtx and a Makefile.
The text files contained in this work may be distributed and/or modified
under the conditions of the [LaTeX Project Public License (LPPL)][lppl],
either version 1.3c of this license or (at your option) any later
version.
This work is ‘maintained’ (as per LPPL maintenance status) by [Alex Ball][me].
[lppl]: http://www.latex-project.org/lppl.txt "LaTeX Project Public License (LPPL)"
[me]: https://alexball.me.uk/ "Alex Ball"
%</driver|readme>
%<*driver>
\end{markdown*}
\fussy
\iffalse % syntax highlighting \fix
%</driver>
%<*doc|bib>
%<*n|m|a|y>
\chapter{Introduction}
\section{Loading the style}\label{sec:loading}
The style is self-contained, so you can load it with \pkg{biblatex}:
\begin{tcblisting}{listing only}
%<n>\usepackage[style=oxnotes]{biblatex}
%<m>\usepackage[style=oxnum]{biblatex}
%<a>\usepackage[style=oxalph]{biblatex}
%<y>\usepackage[style=oxyear]{biblatex}
\end{tcblisting}
The style has some options additional to the regular \pkg{biblatex} ones:
\begin{docKey}{anon}{=\val{literal}|\val{long}|\val{short}}{default \val{short}, initially \val{literal}}
Affects what happens if the author name matches the value of \cs{oxrefanon}.
By default, this is \enquote{Anonymous}, but you could change it a different word (such as \enquote{Anonimo}) instead.
\begin{itemize}
\item\docValue{literal}
means no special handling is used.
\item\docValue{long}
will print the unabbreviated localization string \code{anon} (\enquote{Anonymous}) instead of the author name
%<y> in citations and the bibliography.
%<m|a> in the bibliography.
%<n> in the bibliography, but neither are printed in citations.
\item\docValue{short}
will print the abbreviated localization string \code{anon} (\enquote{Anon.\@}) instead of the author name
%<y> in citations and the bibliography.
%<m|a> in the bibliography.
%<n> in the bibliography, but neither are printed in citations.
\end{itemize}
\end{docKey}
\begin{docKey}{bookseries}{=\val{in}|\val{out}}{default \val{in}, initially \val{in}}
Puts the series information for a book \docValue{in}side or \docValue{out}side the parenthetical publication block.
\end{docKey}
\begin{docKey}{court-plain}{=\val{true}|\val{false}}{default \val{true}, initially \val{false}}
Prints courts of decision without parentheses.
\end{docKey}
\begin{docKey}{dashed}{=\val{true}|\val{false}}{default \val{true}, initially \val{false}}
In the biblography, replaces recurring author\slash editor names with a dash.
\end{docKey}
\begin{docKey}{ecli}{=\val{yes}|\val{only}|\val{no}}{default \val{yes}, initially \val{yes}}
Determines when ECLI numbers for EU legal cases are printed (if provided).
\begin{itemize}
\item\docValue{yes}
prints the ECLI number in addition to the official report.
\item\docValue{only}
prints the ECLI number instead of the official report.
\item\docValue{no}
only prints the ECLI number if the case is otherwise unreported.
\end{itemize}
\end{docKey}
\begin{docKey}{isourls}{=\val{true}|\val{false}}{default \val{true}, initially \val{false}}
Surrounds URLs with angle brackets.
\end{docKey}
\begin{docKey}{issuedate-plain}{=\val{true}|\val{false}}{default \val{true}, initially \val{false}}
Removes the parentheses around the date of a periodical without a volume number.
This can also be set on a per-type and per-entry basis.
(This option was previously called \key{varissuedate}.)
\end{docKey}