texlive[63401] Master/texmf-dist: biblatex-bath (25may22)

commits+karl at tug.org commits+karl at tug.org
Wed May 25 22:19:25 CEST 2022


Revision: 63401
          http://tug.org/svn/texlive?view=revision&revision=63401
Author:   karl
Date:     2022-05-25 22:19:25 +0200 (Wed, 25 May 2022)
Log Message:
-----------
biblatex-bath (25may22)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/biblatex-bath/biblatex-bath.bib
    trunk/Master/texmf-dist/doc/latex/biblatex-bath/biblatex-bath.pdf
    trunk/Master/texmf-dist/source/latex/biblatex-bath/biblatex-bath.dtx
    trunk/Master/texmf-dist/tex/latex/biblatex-bath/bath.bbx
    trunk/Master/texmf-dist/tex/latex/biblatex-bath/bath.cbx
    trunk/Master/texmf-dist/tex/latex/biblatex-bath/bath.dbx
    trunk/Master/texmf-dist/tex/latex/biblatex-bath/british-bath.lbx
    trunk/Master/texmf-dist/tex/latex/biblatex-bath/english-bath.lbx

Modified: trunk/Master/texmf-dist/doc/latex/biblatex-bath/biblatex-bath.bib
===================================================================
--- trunk/Master/texmf-dist/doc/latex/biblatex-bath/biblatex-bath.bib	2022-05-25 20:19:05 UTC (rev 63400)
+++ trunk/Master/texmf-dist/doc/latex/biblatex-bath/biblatex-bath.bib	2022-05-25 20:19:25 UTC (rev 63401)
@@ -283,15 +283,13 @@
   organization = {Wikimedia Foundation},
   url = {https://commons.wikimedia.org/wiki/File:Royal_Crescent_in_Bath,_England_-_July_2006.jpg},
   urldate = {2016-01-07}}
- at image{anon1946peb,
-  author = {Anon\adddot},
-  year = {1946},
-  title = {Prototype electric bicycle displayed at the \enquote{Britain Can Make It} exhibition
-    organised by the {Council} of {Industrial} {Design} and held at the {Victoria} and {Albert}
-    {Museum}, {London}, 1946. {Designed} by {B.~G.} {Bowden}},
-  titleaddon = {Photograph},
-  address = {London},
-  library = {Design Council Slide Collection}}
+ at image{brbr1965gph,
+  author = {{Bristol Region Building Record}},
+  year = {1965},
+  title = {{Green} {Park} {House} (since demolished), viewed from southwest},
+  entrysubtype = {Photograph},
+  number = {BRBR, D/877/1},
+  library = {Archives \& Research Collections, University of Bath Library}}
 @manual{andrews.dury1773wilts,
   author = {Andrews, J. and Dury, A.},
   year = {1773},
@@ -436,7 +434,7 @@
   author = {@screencasto},
   title = {{Screencast-O-Matic}},
   version = {2},
-  titleaddon = {computer program},
+  entrysubtype = {computer program},
   url = {https://screencast-o-matic.com/},
   urldate = {2016-05-16}}
 @book{aristotle2007ne,
@@ -468,7 +466,7 @@
     {清代以來三峽地區水旱災害的初步硏}},
   titleaddon = {A preliminary study of floods and droughts in the {Three} {Gorges} region since
     the {Qing} dynasty},
-  journal = {Zhongguo shehui kexue \textup{中國社會科學}},
+  journal = {Zhongguo shehui kexue \emph{中國社會科學}},
   volume = {1},
   pages = {168-79}}
 @article{hua1999qys2,

Modified: trunk/Master/texmf-dist/doc/latex/biblatex-bath/biblatex-bath.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/source/latex/biblatex-bath/biblatex-bath.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/biblatex-bath/biblatex-bath.dtx	2022-05-25 20:19:05 UTC (rev 63400)
+++ trunk/Master/texmf-dist/source/latex/biblatex-bath/biblatex-bath.dtx	2022-05-25 20:19:25 UTC (rev 63401)
@@ -1,6 +1,6 @@
 % \iffalse meta-comment
 %<*internal|bbx|cbx|dbx|lbx|lbx-gb>
-\def\Version{2022/03/04 v5.0}
+\def\Version{2022/05/25 v6.0}
 %</internal|bbx|cbx|dbx|lbx|lbx-gb>
 %<*internal>
 \iffalse
@@ -550,6 +550,22 @@
   \lstinline{\parindent} (or 1em).
 \end{itemize}
 
+\subsection{Version 6}
+
+\begin{itemize}
+\item
+  Entry type clarifications such as `Photograph' and `Computer program' are now
+  handled differently from translated titles, in particular as regards their
+  position relative to the version, and how they interact with the `[Online]'
+  tag. As a result, they should now be placed in \texttt{entrysubtype} rather
+  than \texttt{titleaddon}.
+\item
+  All elements of the title block (including \texttt{titleaddon},
+  \texttt{version}, and \texttt{entrysubtype}) now move to the head of the
+  reference in the absence of an author\slash editor.
+\end{itemize}
+
+
 \section{Examples}
 
 The examples below are shown in three parts.
@@ -729,13 +745,6 @@
 \end{Verbatim}
 \end{bibexbox}
 
-\begin{info}\item
-If you use the Bib\TeX\ backend, you will have to repeat the contents of the
-\texttt{booktitle} field in the \texttt{sorttitle} field yourself to ensure the
-entry is placed correctly in the reference list. If you use Biber, this is done
-automatically for you.
-\end{info}
-
 \begin{bibexbox}<RX>{aspirin2019bnf}
   British National Formulary, 2019. \emph{Aspirin} [Online]. London: Pharmaceutical Press. Available from: \url{https://www.medicinescomplete.com/#/content/bnf/_456850132} [Accessed 26 November 2019].
   \tcblower
@@ -755,7 +764,14 @@
 \end{Verbatim}
 \end{bibexbox}
 
-
+\begin{info}\item
+  If you use the Bib\TeX\ backend, you will have to repeat the contents of the
+  \texttt{booktitle} field in the \texttt{sorttitle} field yourself to ensure the
+  entry is placed correctly in the reference list. If you use Biber, this is done
+  automatically for you.
+  \end{info}
+  
+  
 \subsubsection*{Chapter\slash paper from a collection (by different authors) in an edited book}
 
 \begin{bibexbox}<RL>{burchard1965hhl}
@@ -924,13 +940,6 @@
 \end{Verbatim}
 \end{bibexbox}
 
-\begin{tips}\item
-If citing an article yet to be officially published, use the \texttt{pubstate}
-field with the keyword \texttt{inpress} for `in press' and
-\texttt{inpreparation} or \texttt{submitted} (whichever is more accurate)
-for `preprint'.
-\end{tips}
-
 \begin{bibexbox}<RX>{liontou.etal2019dra}
   Liontou, C., Kontopodis, E., Oikonomidis, N., Maniotis, C., Tassopoulos, A., Tsiafoutis, I., Lazaris, E. and Koutouzis, M., 2019. Distal radial access: a review article. \emph{Cardiovascular revascularization medicine} [Online], in press. Available from: \url{https://www.sciencedirect.com/science/article/pii/S1553838919303367} [Accessed 19 June 2019].
   \tcblower
@@ -951,7 +960,14 @@
 \end{Verbatim}
 \end{bibexbox}
 
-
+\begin{tips}\item
+  If citing an article yet to be officially published, use the \texttt{pubstate}
+  field with the keyword \texttt{inpress} for `in press' and
+  \texttt{inpreparation} or \texttt{submitted} (whichever is more accurate)
+  for `preprint'.
+  \end{tips}
+  
+  
 \subsubsection*{Preprint or trial study in a digital repository}
 
 \begin{bibexbox}<RX>{shah.corrick2016hsc}
@@ -1344,11 +1360,6 @@
 \end{Verbatim}
 \end{bibexbox}
 
-\begin{tips}\item
-You can use either the \texttt{publisher} or the \texttt{organization} field to
-record the source of the image.
-\end{tips}
-
 \begin{bibexbox}<RI>{iliff2006rcb}
    Iliff, D., 2006. \emph{Royal Crescent in Bath, England - July 2006} [Online]. San Francisco: Wikimedia Foundation. Available from: \url{https://commons.wikimedia.org/wiki/File:Royal_Crescent_in_Bath,_England_-_July_2006.jpg} [Accessed 7 January 2016].
   \tcblower
@@ -1368,21 +1379,25 @@
 \end{Verbatim}
 \end{bibexbox}
 
-\begin{bibexbox}<RI>{anon1946peb}
-  Anon., 1946. \emph{Prototype electric bicycle displayed at the \enquote{Britain Can Make It} exhibition organised by the Council of Industrial Design and held at the Victoria and Albert Museum, London, 1946. Designed by B.~G. Bowden} [Photograph]. At: London. Design Council Slide Collection.
+\begin{tips}\item
+You can use either the \texttt{publisher} or the \texttt{organization} field to
+record the source of the image.
+\end{tips}
+ 
+  
+\begin{bibexbox}<RI>{brbr1965gph}
+  Bristol Region Building Record, 1965. \emph{Green Park House (since demolished), viewed from southwest} [Photograph]. BRBR, D/877/1. Archives \& Research Collections, University of Bath Library.
   \tcblower
 \begin{Verbatim}
 %</driver>
 %<*driver|bib>
- at image{anon1946peb,
-  author = {Anon\adddot},
-  year = {1946},
-  title = {Prototype electric bicycle displayed at the \enquote{Britain Can Make It} exhibition
-    organised by the {Council} of {Industrial} {Design} and held at the {Victoria} and {Albert}
-    {Museum}, {London}, 1946. {Designed} by {B.~G.} {Bowden}},
-  titleaddon = {Photograph},
-  address = {London},
-  library = {Design Council Slide Collection}}
+ at image{brbr1965gph,
+  author = {{Bristol Region Building Record}},
+  year = {1965},
+  title = {{Green} {Park} {House} (since demolished), viewed from southwest},
+  entrysubtype = {Photograph},
+  number = {BRBR, D/877/1},
+  library = {Archives \& Research Collections, University of Bath Library}}
 %</driver|bib>
 %<*driver>
 \end{Verbatim}
@@ -1389,12 +1404,21 @@
 \end{bibexbox}
 
 \begin{tips}\item
-Use the \texttt{library} field to record the archive and register number.
+Use the \texttt{library} field to record the name of the archive.
 If the image is on display rather than archived,
 use \texttt{institution} instead for the museum, gallery or building.
 If you also wish to provide the name of the organisation that published the image,
 use the \texttt{publisher} field if the location you provide relates to the publisher,
 but the \texttt{organization} field if the location relates to the archive.
+\item
+Put archival locator information (e.g.\@ box or shelf number) in the \texttt{number} field.
+Alternatively, you can split the information across the (non-standard)
+\texttt{collection} (\enquote{BRBR}) and \texttt{shelfmark} (\enquote{D/877/1}) fields.
+\item
+Put the clarification of the resource type in \texttt{entrysubtype}.
+In most cases, you can use \texttt{titleaddon} instead,
+but \texttt{entrysubtype} will correctly suppress \enquote{Online} being shown
+while \texttt{titleaddon} will not.
 \end{tips}
 
 
@@ -1557,13 +1581,6 @@
 
 \subsubsection*{Television or radio broadcast}
 
-\begin{tips}\item
-Use \texttt{type} for the medium and \texttt{publisher} for the channel.
-\item
-If the episode has an individual title, use \texttt{series} for the series and \texttt{number} for the episode number.
-Otherwise, give both series and episode number as the \texttt{title}.
-\end{tips}
-
 \begin{bibexbox}<RX>{inn2021huw}
   Hurry up and wait, 2021. \emph{Inside no.9}, \emph{Episode 6:4}. TV. BBC2, 31 May. 21.30 hrs.
   \tcblower
@@ -1582,6 +1599,13 @@
 \end{Verbatim}
 \end{bibexbox}
 
+\begin{tips}\item
+Use \texttt{type} for the medium and \texttt{publisher} for the channel.
+\item
+If the episode has an individual title, use \texttt{series} for the series and \texttt{number} for the episode number.
+Otherwise, give both series and episode number as the \texttt{title}.
+\end{tips}
+
 \begin{bibexbox}<RX>{rsfo2006ep5}
   Rick Stein's French odyssey: Episode 5, 2006. TV. BBC2, 23 August. 20.30 hrs.
   \tcblower
@@ -1845,7 +1869,7 @@
   author = {@screencasto},
   title = {{Screencast-O-Matic}},
   version = {2},
-  titleaddon = {computer program},
+  entrysubtype = {computer program},
   url = {https://screencast-o-matic.com/},
   urldate = {2016-05-16}}
 %</driver|bib>
@@ -1853,6 +1877,13 @@
 \end{Verbatim}
 \end{bibexbox}
 
+\begin{tips}\item
+Put the clarification of the resource type in \texttt{entrysubtype}. In most
+cases, you can use \texttt{titleaddon} instead, but \texttt{titleaddon} is shown
+immediately after the title and may be shown alongside the \enquote{Online}
+label, whereas \texttt{entrysubtype} is printed after the \texttt{version} and
+supersedes the \enquote{Online} label.
+\end{tips}
 
 \subsection{Works in languages other than English}
 
@@ -1924,7 +1955,7 @@
 \subsubsection*{Work in a non-Roman alphabet}
 
 \begin{bibexbox}<RX>{hua1999qys1}
-  Hua, L. 華林甫, 1999. Qingdai yilai Sanxia diqu shuihan zaihai de chubu yanjiu 清代以來三峽地區水旱災害的初步硏 [A preliminary study of floods and droughts in the Three Gorges region since the Qing dynasty]. \emph{Zhongguo shehui kexue \textup{中國社會科學}}, 1, pp.168--79.
+  Hua, L. 華林甫, 1999. Qingdai yilai Sanxia diqu shuihan zaihai de chubu yanjiu 清代以來三峽地區水旱災害的初步硏 [A preliminary study of floods and droughts in the Three Gorges region since the Qing dynasty]. \emph{Zhongguo shehui kexue \emph{中國社會科學}}, 1, pp.168--79.
   \tcblower
 \begin{Verbatim}
 %</driver>
@@ -1936,7 +1967,7 @@
     {清代以來三峽地區水旱災害的初步硏}},
   titleaddon = {A preliminary study of floods and droughts in the {Three} {Gorges} region since
     the {Qing} dynasty},
-  journal = {Zhongguo shehui kexue \textup{中國社會科學}},
+  journal = {Zhongguo shehui kexue \emph{中國社會科學}},
   volume = {1},
   pages = {168-79}}
 %</driver|bib>
@@ -2437,7 +2468,7 @@
 % instead of writing out our own in full.
 %
 %    \begin{macrocode}
-\RequirePackage{xpatch}
+\RequirePackage{etoolbox,xpatch}
 %    \end{macrocode}
 %
 % Some string analysis is required.
@@ -2450,7 +2481,6 @@
 % American English. Adapted language files have the following suffix:
 %
 %    \begin{macrocode}
-\RequirePackage{etoolbox}
 \ifcsdef{DeclareLanguageMappingSuffix}{%
   \DeclareLanguageMappingSuffix{-bath}
 }{%
@@ -2457,20 +2487,8 @@
   \DeclareLanguageMapping{english}{english-bath}
   \DeclareLanguageMapping{british}{british-bath}
 }
-
 %    \end{macrocode}
 %
-% We begin by loading the default author--year style.
-%
-%    \begin{macrocode}
-\RequireBibliographyStyle{authoryear}
-\ExecuteBibliographyOptions{%
-  maxcitenames=3,maxbibnames=9999,isbn=false,giveninits=true,dashed=false,
-  alldates=comp,labeldate=year,labelalpha=true}
-\ExecuteBibliographyOptions[reference,audio,video,music,movie]{%
-  useeditor=false}
-%    \end{macrocode}
-%
 % We provide some additional bibliography strings.
 %
 %    \begin{macrocode}
@@ -2480,16 +2498,9 @@
   directors, performers, readers, conductors,
   bydirector, byperformer, byreader, byconductor,
 }
+
 %    \end{macrocode}
 %
-% We allow the bibliography look more like the Bib\TeX\ default.
-%
-%    \begin{macrocode}
-\setlength{\bibhang}{0pt}
-\setlength{\bibitemsep}{1em plus 0.2em minus 0.2em}
-\renewcommand*{\bibfont}{\normalfont\normalsize}
-%    \end{macrocode}
-%
 % To maintain compatibility with older versions of \textsf{biblatex},
 % we backport some newer features if necessary.
 %
@@ -2511,6 +2522,18 @@
       (test {\iffieldequalstr{labeldatesource}{}}
       or test {\iffieldequalstr{labeldatesource}{year}})}}%
 }
+\ifcsdef{DeclareBiblatexOption}{}{%
+  \def\DeclareBiblatexOption at II#1[#2]#3[#4]#5{
+    \IfSubStr#1{global}{\DeclareBibliographyOption[#2]{#3}[#4]{#5}}{}%
+    \IfSubStr#1{type}{\DeclareTypeOption[#2]{#3}[#4]{#5}}{}%
+    \IfSubStr#1{entry}{\DeclareEntryOption[#2]{#3}[#4]{#5}}{}}%
+  \def\DeclareBiblatexOption at I#1[#2]#3#4{\@ifnextchar[%
+    {\DeclareBiblatexOption at II#1[#2]#3#4}%
+    {\DeclareBiblatexOption at II#1[#2]#3[]#4}}%
+  \def\DeclareBiblatexOption#1#2{\@ifnextchar[%
+    {\DeclareBiblatexOption at I#1#2}%
+    {\DeclareBiblatexOption at I#1[]#2}}%
+}
 %    \end{macrocode}
 %
 % This makes \textsf{biblatex} take notice of parentheses, brackets
@@ -2536,20 +2559,1485 @@
 
 %    \end{macrocode}
 %
-% \subsection{Name handling}
+% \subsection{Standard common toggle options}
 %
-% Names are usually reversed. There are no spaces between initials.
+% These are options provided by all standard styles.
 %
 %    \begin{macrocode}
-\DeclareNameAlias{author}{family-given}
-\DeclareNameAlias{editor}{family-given}
-\DeclareNameAlias{bookeditor}{given-family}
-\renewcommand*{\bibinitdelim}{}
+\newtoggle{bbx:isbn}
+\newtoggle{bbx:url}
+\newtoggle{bbx:doi}
+\newtoggle{bbx:eprint}
+\newtoggle{bbx:related}
+
+\DeclareBiblatexOption{global,type,entry}[boolean]{isbn}[true]{%
+  \settoggle{bbx:isbn}{#1}}
+\DeclareBiblatexOption{global,type,entry}[boolean]{url}[true]{%
+  \settoggle{bbx:url}{#1}}
+\DeclareBiblatexOption{global,type,entry}[boolean]{doi}[true]{%
+  \settoggle{bbx:doi}{#1}}
+\DeclareBiblatexOption{global,type,entry}[boolean]{eprint}[true]{%
+  \settoggle{bbx:eprint}{#1}}
+\DeclareBiblatexOption{global,type,entry}[boolean]{related}[true]{%
+  \settoggle{bbx:related}{#1}}
+
 %    \end{macrocode}
 %
-% The handling of CJK names is based on code supplied to TeX.sx by user Moewe in
-% answer to \href{http://tex.stackexchange.com/a/320738/16293}{question 320738}.
+% \subsection{Author--year specific options}
 %
+% \subsubsection{Author (label) dashes}
+%
+% The |dashed| option from the standard author--year style controls whether
+% repeated author/editor names are replaced with a dash.
+%
+%    \begin{macrocode}
+\newbibmacro*{bbx:savehash}{%
+  \savefield{fullhash}{\bbx at lasthash}}
+
+\DeclareBibliographyOption[boolean]{dashed}[true]{%
+  \ifstrequal{#1}{true}
+    {\ExecuteBibliographyOptions{pagetracker}%
+     \renewbibmacro*{bbx:savehash}{\savefield{fullhash}{\bbx at lasthash}}}
+    {\renewbibmacro*{bbx:savehash}{}}}
+
+%    \end{macrocode}
+%
+% \subsubsection{Date options}
+%
+% For some resources (ISO standards, Acts of Parliament), the date is part of
+% the label and should not be repeated in the date slot. So that this can be
+% achieved cleanly by omitting the date, we declare a |nonodate| option that can
+% suppress the substitution of the missing date by `n.d.'
+%
+%    \begin{macrocode}
+\newtoggle{bbx:nonodate}
+\DeclareBiblatexOption{global,type,entry}[boolean]{nonodate}[true]{%
+  \settoggle{bbx:nonodate}{#1}}
+
+%    \end{macrocode}
+%
+% The |mergedate| option controls the format of the date at the head of the
+% reference in the |date+extradate| macro, and whether and how the same date is
+% displayed later in the |issue+date| macro.
+%
+%    \begin{macrocode}
+\providebibmacro*{date+extradate}{}
+\newbibmacro*{issue+date}{%
+  \printtext[parens]{%
+    \printfield{issue}%
+    \setunit*{\addspace}%
+    \usebibmacro{date}}%
+  \newunit}
+
+%    \end{macrocode}
+%
+% We allow the date macro to print the time as well.
+%
+%    \begin{macrocode}
+\newbibmacro*{bbx:ifmergeddate}{\@secondoftwo}
+\renewbibmacro*{date}{%
+  \usebibmacro{bbx:ifmergeddate}{}{%
+    \printdate
+    \setunit*{\bibdatetimesep}%
+  }%
+  \printtime}%
+
+%    \end{macrocode}
+%
+% The following are similar to the standard author--year options except they
+% respect the |nonodate| option and allow the field format of the date text
+% to be configured.
+%
+% The |maximum| option merges date/issue with date label.
+%
+%    \begin{macrocode}
+\def\bbx at opt@mergedate at maximum{%
+  \renewbibmacro*{date+extradate}{%
+    \iffieldundef{labelyear}
+      {}
+      {\printtext[datelabel]{%
+         \iflabeldateisdate
+           {\printfield{issue}%
+            \setunit*{\addspace}%
+            \printdateextra}
+           {\printlabeldateextra}}}}%
+  \renewbibmacro*{bbx:ifmergeddate}{\iflabeldateisdate}%
+  \renewbibmacro*{issue+date}{%
+    \usebibmacro{bbx:ifmergeddate}
+      {}
+      {\printtext[parens]{%
+         \printfield{issue}%
+         \setunit*{\addspace}%
+         \printdate}}}}
+
+%    \end{macrocode}
+%
+% The |compact| option merges date with date label.
+%
+%    \begin{macrocode}
+\def\bbx at opt@mergedate at compact{%
+  \renewbibmacro*{date+extradate}{%
+    \ifboolexpr{
+      togl {bbx:nonodate}
+      and not test {\iflabeldateisdate}}
+      {}
+      {\printtext[datelabel]{%
+         \iflabeldateisdate
+           {\printdateextra}
+           {\printlabeldateextra}}}}%
+  \renewbibmacro*{bbx:ifmergeddate}{\iflabeldateisdate}%
+  \renewbibmacro*{issue+date}{%
+    \ifboolexpr{test {\usebibmacro{bbx:ifmergeddate}}
+                and
+                test {\iffieldundef{issue}}}
+      {}
+      {\printtext[parens]{%
+         \printfield{issue}%
+         \setunit*{\addspace}%
+         \usebibmacro{bbx:ifmergeddate}
+           {}
+           {\printdate}}}%
+    \newunit}}
+
+%    \end{macrocode}
+%
+% The |basic| option merges year-only date with date label.
+%
+%    \begin{macrocode}
+\def\bbx at opt@mergedate at basic{%
+  \renewbibmacro*{date+extradate}{%
+    \ifboolexpr{
+      togl {bbx:nonodate}
+      and not test {\iflabeldateisdate}}
+      {}
+      {\printtext[datelabel]{\printlabeldateextra}}}%
+  \renewbibmacro*{bbx:ifmergeddate}{%
+    \ifboolexpr{
+      test {\iflabeldateisdate}
+      and
+      not test {\ifdateshavedifferentprecision{label}{}}
+    }%
+  }%
+  \renewbibmacro*{issue+date}{%
+    \ifboolexpr{
+      test {\usebibmacro{bbx:ifmergeddate}}
+      and
+      test {\iffieldundef{issue}}
+    }
+      {}
+      {\printtext[parens]{%
+         \printfield{issue}%
+         \setunit*{\addspace}%
+         \printdate}}%
+    \newunit}}
+
+%    \end{macrocode}
+%
+% The |minimum| option merges year-only date with year-only date label.
+%
+%    \begin{macrocode}
+\def\bbx at opt@mergedate at minimum{%
+  \renewbibmacro*{date+extradate}{%
+    \ifboolexpr{
+      togl {bbx:nonodate}
+      and not test {\iflabeldateisdate}}
+      {}
+      {\printtext[datelabel]{\printlabeldateextra}}}%
+  \renewbibmacro*{bbx:ifmergeddate}{%
+    \ifboolexpr{
+      test {\iflabeldateisdate}
+      and
+      not test {\ifdateshavedifferentprecision{label}{}}
+      and
+      test {\iffieldundef{extradate}}
+    }%
+  }%
+  \renewbibmacro*{issue+date}{%
+    \ifboolexpr{
+      test {\usebibmacro{bbx:ifmergeddate}}
+      and
+      test {\iffieldundef{issue}}
+    }
+      {}
+      {\printtext[parens]{%
+         \printfield{issue}%
+         \setunit*{\addspace}%
+         \printdate}}%
+    \newunit}}
+
+%    \end{macrocode}
+%
+% The |false| option doesn't merge date/issue with date label
+%
+%    \begin{macrocode}
+\def\bbx at opt@mergedate at false{%
+  \renewbibmacro*{date+extradate}{%
+    \iffieldundef{labelyear}
+      {}
+      {\printtext[parens]{\printlabeldateextra}}}%
+  \renewbibmacro*{bbx:ifmergeddate}{\@secondoftwo}%
+  \renewbibmacro*{issue+date}{%
+    \printtext[parens]{%
+      \printfield{issue}%
+      \setunit*{\addspace}%
+      \usebibmacro{date}}%
+    \newunit}}
+
+%    \end{macrocode}
+%
+% Lastly, here is our new (default) option, which always merges the year, and
+% only the year, with the label date. Other date and time componenents are
+% displayed later in the reference. Therefore we clear the year from the date
+% used for the label, but leave the month and day alone.
+%
+%    \begin{macrocode}
+\def\bbx at opt@mergedate at year{%
+  \renewbibmacro*{date+extradate}{%
+    \iffieldundef{labelyear}{}{%
+      \ifboolexpr{
+        togl {bbx:nonodate}
+        and
+        not test {\iflabeldateisdate}
+      }{}{%
+        \printtext[datelabel]{\printlabeldateextra}%
+      }%
+      \iflabeldateisdate{%
+        \clearfield{year}%
+      }{}}}
+  \ifcsundef{abx at macro@date+extrayear}{}{%
+    \renewbibmacro*{date+extrayear}{\usebibmacro{date+extradate}}%
+  }
+  \renewbibmacro*{issue+date}{%
+    \iffieldundef{issue}{}{%
+      \ifboolexpr{(
+        test {\iffieldundef{volume}}
+        and
+        test {\iffieldundef{number}}
+        ) and
+        test {\iffieldundef{eid}}
+      }{%
+        \newunit
+        \printfield{issue}%
+      }{%
+        \printtext[parens]{%
+          \printfield{issue}%
+        }%
+      }
+    }%
+    \setunit{\addcomma\space}%
+    \printdate
+    \newunit
+  }%
+}%
+
+\def\bbx at opt@mergedate at true{\bbx at opt@mergedate at year}
+
+%    \end{macrocode}
+%
+% We define the option in terms of the above.
+%
+%    \begin{macrocode}
+\DeclareBiblatexOption{global,type,entry}[boolean]{mergedate}[true]{%
+  \ifcsdef{bbx at opt@mergedate@#1}
+    {\csuse{bbx at opt@mergedate@#1}}
+    {\PackageError{biblatex}
+       {Invalid option 'mergedate=#1'}
+       {Valid values are 'maximum', 'compact', 'basic', 'minimum',\MessageBreak
+        'year', 'true' (=year), and 'false'.}}}
+
+%    \end{macrocode}
+%
+% \subsubsection{Default settings}
+%
+% Things to note in particular:
+% \begin{itemize}
+% \item With |@online| entries, the URL is shown even if |url=false|, globally.
+% \item With |@letter| entries, the date is written complete at the start of the
+%   reference.
+% \end{itemize}
+%
+%    \begin{macrocode}
+\ExecuteBibliographyOptions{isbn,url,doi,eprint,related}
+\ExecuteBibliographyOptions{labeldateparts,sorting=nyt,pagetracker,mergedate}
+\ExecuteBibliographyOptions{%
+  maxcitenames=3,maxbibnames=9999,isbn=false,giveninits=true,dashed=false,
+  alldates=comp,labeldate=year,labelalpha=true}
+\ExecuteBibliographyOptions[online]{url=true}
+\ExecuteBibliographyOptions[reference,audio,video,music,movie]{%
+  useeditor=false}
+\ExecuteBibliographyOptions[letter]{mergedate=maximum}
+
+%    \end{macrocode}
+%
+% \subsection{Drivers for formatting specific entry types}
+%
+%    \begin{macrocode}
+\newbibmacro*{begentry}{}
+\newbibmacro*{finentry}{\finentry}
+
+%    \end{macrocode}
+%
+% \subsubsection{Articles}
+%
+% Compared with the standard styles, the main differences in the driver are the
+% omission of `in' and the position of the publication state (which is in the
+% |journal+issuetitle| macro).
+%
+%    \begin{macrocode}
+\DeclareBibliographyDriver{article}{%
+  \usebibmacro{bibindex}%
+  \usebibmacro{begentry}%
+  \usebibmacro{author/translator+others}%
+  \setunit{\printdelim{nametitledelim}}\newblock
+  \usebibmacro{title}%
+%  \newunit
+%  \printlist{language}%
+  \newunit\newblock
+  \usebibmacro{byauthor}%
+  \newunit\newblock
+  \usebibmacro{bytranslator+others}%
+  \newunit\newblock
+  \usebibmacro{journal+issuetitle}%
+  \newunit
+  \usebibmacro{byeditor+others}%
+  \newunit
+  \usebibmacro{note+pages}%
+  \newunit\newblock
+  \iftoggle{bbx:isbn}
+    {\printfield{issn}}
+    {}%
+  \newunit\newblock
+  \usebibmacro{doi+eprint+url}%
+  \newunit\newblock
+  \printfield{addendum}%
+  \setunit{\bibpagerefpunct}\newblock
+  \usebibmacro{pageref}%
+  \newunit\newblock
+  \iftoggle{bbx:related}
+    {\usebibmacro{related:init}%
+     \usebibmacro{related}}
+    {}%
+  \usebibmacro{finentry}}
+
+\DeclareBibliographyDriver{periodical}{%
+  \usebibmacro{bibindex}%
+  \usebibmacro{begentry}%
+  \usebibmacro{editor}%
+  \setunit{\printdelim{nametitledelim}}\newblock
+  \usebibmacro{title+issuetitle}%
+%  \newunit
+%  \printlist{language}%
+  \newunit\newblock
+  \usebibmacro{byeditor}%
+  \newunit\newblock
+  \printfield{note}%
+  \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}}
+
+%    \end{macrocode}
+%
+% \subsubsection{Books}
+%
+% Compared with the standard styles, the main difference is that the series is
+% separated by a comma rather than a period. This also affects proceedings and
+% certain forms of grey literature.
+%
+%    \begin{macrocode}
+\DeclareBibliographyDriver{book}{%
+  \usebibmacro{bibindex}%
+  \usebibmacro{begentry}%
+  \usebibmacro{author/editor+others/translator+others}%
+  \setunit{\printdelim{nametitledelim}}\newblock
+  \usebibmacro{maintitle+title}%
+%  \newunit
+%  \printlist{language}%
+  \newunit\newblock
+  \usebibmacro{byauthor}%
+  \newunit\newblock
+  \usebibmacro{byeditor+others}%
+  \newunit\newblock
+  \printfield{edition}%
+  \newunit
+  \iffieldundef{maintitle}
+    {\printfield{volume}%
+     \printfield{part}}
+    {}%
+  \newunit
+  \printfield{volumes}%
+  \setunit{\addcomma\space}%
+  \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}}
+
+\DeclareBibliographyDriver{collection}{%
+  \usebibmacro{bibindex}%
+  \usebibmacro{begentry}%
+  \usebibmacro{editor+others}%
+  \setunit{\printdelim{nametitledelim}}\newblock
+  \usebibmacro{maintitle+title}%
+%  \newunit
+%  \printlist{language}%
+  \newunit\newblock
+  \usebibmacro{byeditor+others}%
+  \newunit\newblock
+  \printfield{edition}%
+  \newunit
+  \iffieldundef{maintitle}
+    {\printfield{volume}%
+     \printfield{part}}
+    {}%
+  \newunit
+  \printfield{volumes}%
+  \setunit{\addcomma\space}%
+  \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}}
+
+\DeclareBibliographyDriver{proceedings}{%
+  \usebibmacro{bibindex}%
+  \usebibmacro{begentry}%
+  \usebibmacro{editor+others}%
+  \setunit{\printdelim{nametitledelim}}\newblock
+  \usebibmacro{maintitle+title}%
+%  \newunit
+%  \printlist{language}%
+  \newunit\newblock
+  \usebibmacro{event+venue+date}%
+  \newunit\newblock
+  \usebibmacro{byeditor+others}%
+  \newunit\newblock
+  \iffieldundef{maintitle}
+    {\printfield{volume}%
+     \printfield{part}}
+    {}%
+  \newunit
+  \printfield{volumes}%
+  \setunit{\addcomma\space}%
+  \usebibmacro{series+number}%
+  \newunit\newblock
+  \printfield{note}%
+  \newunit\newblock
+  \printlist{organization}%
+  \newunit
+  \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}}
+
+%    \end{macrocode}
+%
+% \subsubsection{Works in collections}
+%
+% Compared with the standard styles, the main difference is that the editors
+% precede the book title.
+%
+%    \begin{macrocode}
+\DeclareBibliographyDriver{inbook}{%
+  \usebibmacro{bibindex}%
+  \usebibmacro{begentry}%
+  \usebibmacro{author/translator+others}%
+  \setunit{\printdelim{nametitledelim}}\newblock
+  \usebibmacro{title}%
+%  \newunit
+%  \printlist{language}%
+  \newunit\newblock
+  \usebibmacro{byauthor}%
+  \newunit\newblock
+  \usebibmacro{in:}%
+  \usebibmacro{bybookauthor}%
+  \newunit\newblock
+  \usebibmacro{maintitle+booktitle}%
+  \newunit\newblock
+  \usebibmacro{byeditor+others}%
+  \newunit\newblock
+  \printfield{edition}%
+  \newunit
+  \iffieldundef{maintitle}
+    {\printfield{volume}%
+     \printfield{part}}
+    {}%
+  \newunit
+  \printfield{volumes}%
+  \setunit{\addcomma\space}%
+  \usebibmacro{series+number}%
+  \newunit\newblock
+  \printfield{note}%
+  \newunit\newblock
+  \usebibmacro{publisher+location+date}%
+  \newunit\newblock
+  \usebibmacro{chapter+pages}%
+  \newunit\newblock
+  \iftoggle{bbx:isbn}
+    {\printfield{isbn}}
+    {}%
+  \newunit\newblock
+  \usebibmacro{doi+eprint+url}%
+  \newunit\newblock
+  \usebibmacro{addendum+pubstate}%
+  \setunit{\bibpagerefpunct}\newblock
+  \usebibmacro{pageref}%
+  \newunit\newblock
+  \iftoggle{bbx:related}
+    {\usebibmacro{related:init}%
+     \usebibmacro{related}}
+    {}%
+  \usebibmacro{finentry}}
+
+\DeclareBibliographyDriver{incollection}{%
+  \usebibmacro{bibindex}%
+  \usebibmacro{begentry}%
+  \usebibmacro{author/translator+others}%
+  \setunit{\printdelim{nametitledelim}}\newblock
+  \usebibmacro{title}%
+%  \newunit
+%  \printlist{language}%
+  \newunit\newblock
+  \usebibmacro{byauthor}%
+  \newunit\newblock
+  \usebibmacro{in:}%
+  \usebibmacro{bookeditor}%
+  \newunit\newblock
+  \usebibmacro{maintitle+booktitle}%
+  \usebibmacro{byeditor+others}%
+  \newunit\newblock
+  \printfield{edition}%
+  \newunit
+  \iffieldundef{maintitle}
+    {\printfield{volume}%
+     \printfield{part}}
+    {}%
+  \newunit
+  \printfield{volumes}%
+  \setunit{\addcomma\space}%
+  \usebibmacro{series+number}%
+  \newunit\newblock
+  \printfield{note}%
+  \newunit\newblock
+  \usebibmacro{publisher+location+date}%
+  \newunit\newblock
+  \usebibmacro{chapter+pages}%
+  \newunit\newblock
+  \iftoggle{bbx:isbn}
+    {\printfield{isbn}}
+    {}%
+  \newunit\newblock
+  \usebibmacro{doi+eprint+url}%
+  \newunit\newblock
+  \usebibmacro{addendum+pubstate}%
+  \setunit{\bibpagerefpunct}\newblock
+  \usebibmacro{pageref}%
+  \newunit\newblock
+  \iftoggle{bbx:related}
+    {\usebibmacro{related:init}%
+     \usebibmacro{related}}
+    {}%
+  \usebibmacro{finentry}}
+
+\DeclareBibliographyDriver{inproceedings}{%
+  \usebibmacro{bibindex}%
+  \usebibmacro{begentry}%
+  \usebibmacro{author/translator+others}%
+  \setunit{\printdelim{nametitledelim}}\newblock
+  \usebibmacro{title}%
+%  \newunit
+%  \printlist{language}%
+  \newunit\newblock
+  \usebibmacro{byauthor}%
+  \newunit\newblock
+  \ifnameundef{editor}{}{\usebibmacro{in:}}%
+  \usebibmacro{bookeditor}%
+  \newunit\newblock
+  \usebibmacro{maintitle+booktitle}%
+  \usebibmacro{byeditor+others}%
+  \newunit
+  \usebibmacro{event+venue+date}%
+  \newunit\newblock
+  \iffieldundef{maintitle}
+    {\printfield{volume}%
+     \printfield{part}}
+    {}%
+  \newunit
+  \printfield{volumes}%
+  \setunit{\addcomma\space}%
+  \usebibmacro{series+number}%
+  \newunit\newblock
+  \printfield{note}%
+  \newunit\newblock
+  \printlist{organization}%
+  \newunit
+  \usebibmacro{publisher+location+date}%
+  \newunit\newblock
+  \usebibmacro{chapter+pages}%
+  \newunit\newblock
+  \iftoggle{bbx:isbn}
+    {\printfield{isbn}}
+    {}%
+  \newunit\newblock
+  \usebibmacro{doi+eprint+url}%
+  \newunit\newblock
+  \usebibmacro{addendum+pubstate}%
+  \setunit{\bibpagerefpunct}\newblock
+  \usebibmacro{pageref}%
+  \newunit\newblock
+  \iftoggle{bbx:related}
+    {\usebibmacro{related:init}%
+     \usebibmacro{related}}
+    {}%
+  \usebibmacro{finentry}}
+
+%    \end{macrocode}
+%
+% \subsubsection{Entries in reference works}
+%
+% In these cases, the title is moved after the edition information.
+%
+%    \begin{macrocode}
+\DeclareBibliographyDriver{inreference}{%
+  \usebibmacro{bibindex}%
+  \usebibmacro{begentry}%
+  \usebibmacro{author/translator+others}%
+  \setunit{\printdelim{nametitledelim}}\newblock
+  \ifnameundef{author}{}{%
+    \usebibmacro{title}%
+    \newunit}%
+  \printlist{language}%
+  \newunit\newblock
+  \usebibmacro{byauthor}%
+  \newunit\newblock
+  \ifboolexpr{
+    test {\iffieldundef{maintitle}}
+    and
+    test {\iffieldundef{booktitle}}
+  }{}{%
+    \ifnameundef{editor}{}{\usebibmacro{in:}}%
+    \usebibmacro{bookeditor}%
+    \newunit\newblock
+    \usebibmacro{maintitle+booktitle}}%
+  \usebibmacro{byeditor+others}%
+  \newunit\newblock
+  \printfield{edition}%
+  \newunit
+  \iffieldundef{maintitle}
+    {\printfield{volume}%
+     \printfield{part}}
+    {}%
+  \newunit
+  \ifnameundef{author}{\usebibmacro{title}%
+  \newunit}{}%
+  \printfield{volumes}%
+  \setunit{\addcomma\space}%
+  \usebibmacro{series+number}%
+  \newunit\newblock
+  \printfield{note}%
+  \newunit\newblock
+  \usebibmacro{publisher+location+date}%
+  \newunit\newblock
+  \usebibmacro{chapter+pages}%
+  \newunit\newblock
+  \iftoggle{bbx:isbn}
+    {\printfield{isbn}}
+    {}%
+  \newunit\newblock
+  \usebibmacro{doi+eprint+url}%
+  \newunit\newblock
+  \usebibmacro{addendum+pubstate}%
+  \setunit{\bibpagerefpunct}\newblock
+  \usebibmacro{pageref}%
+  \newunit\newblock
+  \iftoggle{bbx:related}
+    {\usebibmacro{related:init}%
+     \usebibmacro{related}}
+    {}%
+  \usebibmacro{finentry}}
+
+%    \end{macrocode}
+%
+% \subsubsection{Datasets}
+%
+% The main difference from the standard driver is the use of the |library| macro.
+%
+%    \begin{macrocode}
+\DeclareBibliographyDriver{dataset}{%
+  \usebibmacro{bibindex}%
+  \usebibmacro{begentry}%
+  \usebibmacro{author/editor+others/translator+others}%
+  \setunit{\printdelim{nametitledelim}}\newblock
+  \usebibmacro{title}%
+%  \newunit
+%  \printlist{language}%
+  \newunit\newblock
+  \usebibmacro{byauthor}%
+  \newunit\newblock
+  \usebibmacro{byeditor+others}%
+  \newunit\newblock
+  \printfield{type}%
+  \newunit
+  \printfield{edition}%
+  \setunit{\addcomma\space}%
+  \usebibmacro{series+number}%
+  \newunit\newblock
+  \printfield{note}%
+  \newunit\newblock
+  \usebibmacro{library}%
+  \newunit\newblock
+  \usebibmacro{organization+location+date}%
+  \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}}
+
+%    \end{macrocode}
+%
+% \subsubsection{Software}
+%
+% The driver for software entries is based on |misc|. The main difference is in
+% how the type is printed.
+%
+%    \begin{macrocode}
+\DeclareBibliographyDriver{software}{%
+  \usebibmacro{bibindex}%
+  \usebibmacro{begentry}%
+  \usebibmacro{author/editor+others/translator+others}%
+  \setunit{\printdelim{nametitledelim}}\newblock
+  \usebibmacro{title}%
+  \setunit{\addspace}
+  \printfield{type}%
+%  \newunit
+%  \printlist{language}%
+  \newunit\newblock
+  \usebibmacro{byauthor}%
+  \newunit\newblock
+  \usebibmacro{byeditor+others}%
+  \newunit\newblock
+  \printfield{howpublished}%
+  \newunit\newblock
+  \printfield{note}%
+  \newunit\newblock
+  \usebibmacro{organization+location+date}%
+  \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}}
+
+%    \end{macrocode}
+%
+% \subsubsection{Manuals}
+%
+% The \texttt{manual} driver is useful for a variety of technical publications,
+% such as standards, patents and maps. (Patents have their own driver, in fact,
+% but we set things up so the \texttt{manual} driver can be used instead if
+% needed for compatibility.) We use specialist macros for the type/number and
+% publication block.
+%
+%    \begin{macrocode}
+\DeclareBibliographyDriver{manual}{%
+  \usebibmacro{bibindex}%
+  \usebibmacro{begentry}%
+  \usebibmacro{author/editor}%
+  \setunit{\printdelim{nametitledelim}}\newblock
+  \usebibmacro{title}%
+%  \newunit
+%  \printlist{language}%
+  \newunit\newblock
+  \usebibmacro{byauthor}%
+  \newunit\newblock
+  \usebibmacro{byeditor}%
+  \newunit\newblock
+  \printfield{edition}%
+  \usebibmacro{manual:series+type+number}%
+  \newunit
+  \printfield{note}%
+  \newunit\newblock
+  \usebibmacro{organization+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}}
+
+%    \end{macrocode}
+%
+% \subsubsection{Patents}
+%
+%    \begin{macrocode}
+\DeclareBibliographyDriver{patent}{%
+  \usebibmacro{bibindex}%
+  \usebibmacro{begentry}%
+  \usebibmacro{author}%
+  \setunit{\printdelim{nametitledelim}}\newblock
+  \usebibmacro{title}%
+%  \newunit
+%  \printlist{language}%
+  \newunit\newblock
+  \usebibmacro{byauthor}%
+  \newunit\newblock
+  \printfield{type}%
+  \setunit*{\addspace}%
+  \printfield{number}%
+  \iflistundef{location}
+    {}
+    {\setunit*{\addspace}%
+      \printtext[parens]{%
+        \printlist[][-\value{listtotal}]{location}}}%
+  \newunit\newblock
+  \usebibmacro{byholder}%
+  \newunit\newblock
+  \printfield{note}%
+  \newunit\newblock
+  \usebibmacro{date}%
+  \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}}
+
+
+%    \end{macrocode}
+%
+% \subsubsection{Online works}
+%
+% Compared with the standard styles, the main difference is that the
+% organization's address is printed and we support the |library| macro.
+%
+%    \begin{macrocode}
+\DeclareBibliographyDriver{online}{%
+  \usebibmacro{bibindex}%
+  \usebibmacro{begentry}%
+  \usebibmacro{author/editor+others/translator+others}%
+  \setunit{\printdelim{nametitledelim}}\newblock
+  \usebibmacro{title}%
+%  \newunit
+%  \printlist{language}%
+  \newunit\newblock
+  \usebibmacro{byauthor}%
+  \newunit\newblock
+  \usebibmacro{byeditor+others}%
+  \newunit
+  \printfield{note}%
+  \newunit\newblock
+  \usebibmacro{library}%
+  \newunit\newblock
+  \usebibmacro{organization+location+date}%
+  \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}}
+
+%    \end{macrocode}
+%
+% \subsubsection{Reports}
+%
+% Compared with the standard styles, the main differences are that we use a
+% special macro for printing the |type|, |series| and |number| in parentheses,
+% and we support the |library| field.
+%
+%    \begin{macrocode}
+%t
+\DeclareBibliographyDriver{report}{%
+  \usebibmacro{bibindex}%
+  \usebibmacro{begentry}%
+  \usebibmacro{author}%
+  \setunit{\printdelim{nametitledelim}}\newblock
+  \usebibmacro{title}%
+%  \newunit
+%  \printlist{language}%
+  \newunit\newblock
+  \usebibmacro{byauthor}%
+  \newunit\newblock
+  \usebibmacro{series+type+number}%
+  \newunit\newblock
+  \printfield{note}%
+  \newunit\newblock
+  \usebibmacro{institution+location+date}%
+  \newunit\newblock
+  \usebibmacro{chapter+pages}%
+%  \newunit
+%  \printfield{pagetotal}%
+  \newunit\newblock
+  \iftoggle{bbx:isbn}
+    {\printfield{isrn}}
+    {}%
+  \newunit\newblock
+  \usebibmacro{library}%
+  \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}}
+
+%    \end{macrocode}
+%
+% \subsubsection{Theses}
+%
+%    \begin{macrocode}
+\DeclareBibliographyDriver{thesis}{%
+  \usebibmacro{bibindex}%
+  \usebibmacro{begentry}%
+  \usebibmacro{author}%
+  \setunit{\printdelim{nametitledelim}}\newblock
+  \usebibmacro{title}%
+%  \newunit
+%  \printlist{language}%
+  \newunit\newblock
+  \usebibmacro{byauthor}%
+  \newunit\newblock
+  \printfield{note}%
+  \newunit\newblock
+  \printfield{type}%
+  \newunit
+  \usebibmacro{institution+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}}
+
+%    \end{macrocode}
+%
+% \subsubsection{Audiovisual materials}
+%
+% The \texttt{audio} and \texttt{video} drivers are based on \texttt{misc}.
+%
+%    \begin{macrocode}
+\DeclareBibliographyDriver{audio}{%
+  \usebibmacro{bibindex}%
+  \usebibmacro{begentry}%
+  \usebibmacro{author/editor+others/translator+others}%
+  \setunit{\printdelim{nametitledelim}}\newblock
+  \usebibmacro{title}%
+  \newunit\newblock
+  \usebibmacro{series+number}%
+  \ifboolexpr{
+    test {\iffieldequalstr{type}{TV}}
+    or
+    test {\iffieldequalstr{type}{Radio}}
+  }{%
+    \setunit{\addspace}%
+    \usebibmacro{isonline}}{}%
+%  \newunit
+%  \printlist{language}%
+  \newunit\newblock
+  \printfield{type}%
+  \newunit\newblock
+  \usebibmacro{byauthor}[given-family:full]%
+  \newunit\newblock
+  \usebibmacro{byeditor+others}[given-family:full]%
+  \newunit\newblock
+  \printfield{howpublished}%
+  \newunit\newblock
+  \printfield{note}%
+  \newunit\newblock
+  \usebibmacro{publisher+location+date}%
+  \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}}
+
+%    \end{macrocode}
+%
+% \subsubsection{Images}
+%
+% The driver for image is based on misc. The main difference is the
+% support for the \texttt{library} field.
+%
+%    \begin{macrocode}
+\DeclareBibliographyDriver{image}{%
+  \usebibmacro{bibindex}%
+  \usebibmacro{begentry}%
+  \usebibmacro{author/editor+others/translator+others}%
+  \setunit{\printdelim{nametitledelim}}\newblock
+  \usebibmacro{title}%
+%  \newunit
+%  \printlist{language}%
+  \newunit\newblock
+  \usebibmacro{byauthor}%
+  \newunit\newblock
+  \usebibmacro{byeditor+others}%
+  \newunit\newblock
+  \printfield{howpublished}%
+  \newunit\newblock
+  \printfield{type}%
+  \newunit
+  \printfield{note}%
+  \newunit\newblock
+  \usebibmacro{collection+shelfmark}%
+  \newunit\newblock
+  \usebibmacro{organization+location+date+library}%
+  \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}}
+
+%    \end{macrocode}
+%
+% \subsubsection{Case reports}
+%
+%    \begin{macrocode}
+\DeclareBibliographyDriver{jurisdiction}{%
+  \savebibmacro{title}%
+  \xapptobibmacro{labeltitle}{%
+    \setunit*{\addspace}%
+    \usebibmacro{casenumber}%
+  }{}{}%
+  \usebibmacro{bibindex}%
+  \usebibmacro{begentry}%
+  \usebibmacro{eucheck}%
+  \usebibmacro{author}%
+  \setunit{\printdelim{nametitledelim}}\newblock
+  \usebibmacro{title}%
+%  \newunit
+%  \printlist{language}%
+  \newunit\newblock
+  \usebibmacro{byauthor}%
+  \newunit\newblock
+  \printfield{note}%
+  \setunit{\addspace}%
+  \usebibmacro{reporter}%
+%  \newunit
+%  \printfield{pagetotal}%
+  \newunit\newblock
+  \printfield{institution}%
+  \newunit\newblock
+  \iftoggle{bbx:isbn}
+    {\printfield{isrn}}
+    {}%
+  \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}%
+  \restorebibmacro{title}}
+
+%    \end{macrocode}
+%
+% \subsubsection{Legislation}
+%
+%    \begin{macrocode}
+\DeclareBibliographyDriver{legislation}{%
+  \usebibmacro{bibindex}%
+  \usebibmacro{begentry}%
+  \usebibmacro{eucheck}%
+  \usebibmacro{author}%
+  \setunit{\printdelim{nametitledelim}}\newblock
+  \usebibmacro{title}%
+%  \newunit
+%  \printlist{language}%
+  \newunit\newblock
+  \usebibmacro{byauthor}%
+  \newunit\newblock
+  \usebibmacro{journal+series+volume+number+chapter+pages}
+  \newunit\newblock
+  \printfield{note}%
+  \newunit\newblock
+  \usebibmacro{institution+location+date}%
+  \newunit\newblock
+  \printfield{pagetotal}%
+  \newunit\newblock
+  \iftoggle{bbx:isbn}
+    {\printfield{isrn}}
+    {}%
+  \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}}
+
+%    \end{macrocode}
+%
+% \subsubsection{Unpublished and miscellaneous works}
+%
+%    \begin{macrocode}
+\DeclareBibliographyDriver{booklet}{%
+  \usebibmacro{bibindex}%
+  \usebibmacro{begentry}%
+  \usebibmacro{author/editor+others/translator+others}%
+  \setunit{\printdelim{nametitledelim}}\newblock
+  \usebibmacro{title}%
+%  \newunit
+%  \printlist{language}%
+  \newunit\newblock
+  \usebibmacro{byauthor}%
+  \newunit\newblock
+  \usebibmacro{byeditor+others}%
+  \newunit\newblock
+  \printfield{howpublished}%
+  \newunit\newblock
+  \printfield{type}%
+  \newunit\newblock
+  \printfield{note}%
+  \usebibmacro{collection+shelfmark}%
+  \newunit\newblock
+  \usebibmacro{organization+location+date+library}%
+  \newunit\newblock
+  \usebibmacro{chapter+pages}%
+%  \newunit
+%  \printfield{pagetotal}%
+  \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}}
+
+%    \end{macrocode}
+%
+% The letter driver is used for emails. It is based loosely on the one for
+% articles. The particular foible with this type is that the date must be
+% printed complete at the start.
+%
+%    \begin{macrocode}
+\DeclareBibliographyDriver{letter}{%
+  \usebibmacro{bibindex}%
+  \usebibmacro{begentry}%
+  \usebibmacro{author/translator+others}%
+  \setunit{\printdelim{nametitledelim}}\newblock
+  \usebibmacro{title}%
+%  \newunit
+%  \printlist{language}%
+  \newunit\newblock
+  \usebibmacro{byauthor}%
+  \newunit\newblock
+  \usebibmacro{bytranslator+others}%
+  \newunit\newblock
+  \usebibmacro{journal+issuetitle}%
+  \newunit\newblock
+  \printfield{howpublished}%
+  \newunit
+  \printfield{note}%
+  \newunit\newblock
+  \usebibmacro{collection+shelfmark}%
+  \newunit\newblock
+  \usebibmacro{organization+location+date+library}%
+  \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{misc}{%
+  \usebibmacro{bibindex}%
+  \usebibmacro{begentry}%
+  \usebibmacro{author/editor+others/translator+others}%
+  \setunit{\printdelim{nametitledelim}}\newblock
+  \usebibmacro{title}%
+%  \newunit
+%  \printlist{language}%
+  \newunit\newblock
+  \usebibmacro{byauthor}%
+  \newunit\newblock
+  \usebibmacro{byeditor+others}%
+  \newunit\newblock
+  \printfield{howpublished}%
+  \newunit\newblock
+  \printfield{type}%
+  \newunit
+  \printfield{note}%
+  \newunit\newblock
+  \usebibmacro{collection+shelfmark}%
+  \newunit\newblock
+  \usebibmacro{organization+location+date+library}%
+  \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}}
+
+%    \end{macrocode}
+%
+% The unpublished driver is used for miscellaneous unpublished written
+% material. It differs from the standard version by supporting |maintitle| and
+% |booktitle|, and including a label at the end. The unpublished label is
+% delegated to a macro in case future versions of the style place conditions on
+% whether it is displayed.
+%
+%    \begin{macrocode}
+\DeclareBibliographyDriver{unpublished}{%
+  \usebibmacro{bibindex}%
+  \usebibmacro{begentry}%
+  \usebibmacro{author}%
+  \setunit{\printdelim{nametitledelim}}\newblock
+  \usebibmacro{title}%
+%  \newunit
+%  \printlist{language}%
+  \newunit\newblock
+  \usebibmacro{byauthor}%
+  \newunit\newblock
+  \ifnameundef{editor}{}{\usebibmacro{in:}}%
+  \usebibmacro{bookeditor}%
+  \newunit\newblock
+  \usebibmacro{maintitle+booktitle}%
+  \usebibmacro{byeditor+others}%
+  \newunit\newblock
+  \printfield{howpublished}%
+  \newunit\newblock
+  \printfield{type}%
+  \newunit\newblock
+  \usebibmacro{event+venue+date}%
+  \newunit\newblock
+  \printfield{note}%
+  \newunit\newblock
+  \usebibmacro{collection+shelfmark}%
+  \newunit\newblock
+  \usebibmacro{organization+location+date+library}%
+  \newunit\newblock
+  \usebibmacro{isunpublished}%
+  \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}}
+
+%    \end{macrocode}
+%
+% \subsubsection{Special drivers}
+%
+%    \begin{macrocode}
+\DeclareBibliographyDriver{shorthand}{%
+  \usedriver
+    {\DeclareNameAlias{sortname}{default}}
+    {\thefield{entrytype}}%
+  \finentry}
+
+\newbool{bbx at inset}
+\DeclareBibliographyDriver{set}{%
+  \booltrue{bbx at inset}%
+  \entryset{}{}%
+  \newunit\newblock
+  \usebibmacro{setpageref}%
+  \finentry}
+
+%    \end{macrocode}
+%
+% \subsubsection{Aliases}
+%
+% We define some handy semantic aliases.
+%
+%    \begin{macrocode}
+\DeclareBibliographyAlias{mvbook}{book}
+\DeclareBibliographyAlias{bookinbook}{inbook}
+\DeclareBibliographyAlias{suppbook}{inbook}
+\DeclareBibliographyAlias{mvcollection}{collection}
+\DeclareBibliographyAlias{suppcollection}{incollection}
+\DeclareBibliographyAlias{movie}{audio}
+\DeclareBibliographyAlias{music}{audio}
+\DeclareBibliographyAlias{mvproceedings}{proceedings}
+\DeclareBibliographyAlias{reference}{collection}
+\DeclareBibliographyAlias{mvreference}{reference}
+\DeclareBibliographyAlias{suppperiodical}{article}
+\DeclareBibliographyAlias{review}{article}
+\DeclareBibliographyAlias{standard}{manual}
+\DeclareBibliographyAlias{software}{misc}
+\DeclareBibliographyAlias{video}{audio}
+\DeclareBibliographyAlias{*}{misc}
+
+%    \end{macrocode}
+%
+% \subsection{Name handling}
+%
+% The handling of CJK names is based on code supplied to TeX.sx by Moritz
+% Wemheuer in answer to
+% \href{http://tex.stackexchange.com/a/320738/16293}{question 320738}.
+%
 % The CJK part is printed after the anglicized name. If the name is also
 % annotated as `cjk' (see `Data Annotations' in the \textsf{biblatex} manual),
 % it is always printed in family-given order with no intermediate punctuation.
@@ -2592,6 +4080,12 @@
   }%
 }
 
+%    \end{macrocode}
+%
+% We update the |given-family| and |family-given| name formats to support the
+% above CJK macros.
+%
+%    \begin{macrocode}
 \DeclareNameFormat{given-family}{%
   \ifdefvoid{\namepartcjk}{%
     \ifgiveninits{%
@@ -2656,9 +4150,74 @@
 
 %    \end{macrocode}
 %
-% We support the |nameaddon| field.
+% With videos, names in credits are printed in full.
 %
 %    \begin{macrocode}
+\DeclareNameFormat{given-family:full}{%
+  \ifdefvoid{\namepartcjk}{%
+    \usebibmacro{name:given-family}
+      {\namepartfamily}
+      {\namepartgiven}
+      {\namepartprefix}
+      {\namepartsuffix}%
+  }{%
+    \usebibmacro{name:cjk-given-family}
+      {\namepartfamily}
+      {\namepartgiven}
+      {\namepartcjk}%
+  }%
+  \usebibmacro{name:andothers}%
+}
+
+%    \end{macrocode}
+%
+% Names are usually reversed, but not in the |bookeditor| position.
+%
+%    \begin{macrocode}
+\DeclareNameAlias{author}{family-given}
+\DeclareNameAlias{editor}{family-given}
+\DeclareNameAlias{translator}{family-given}
+
+\DeclareNameWrapperAlias{author}{family-given}
+\DeclareNameWrapperAlias{editor}{family-given}
+\DeclareNameWrapperAlias{translator}{family-given}
+
+\DeclareNameAlias{bookeditor}{given-family}
+
+%    \end{macrocode}
+%
+% There are no spaces between initials.
+%
+%    \begin{macrocode}
+\renewcommand*{\bibinitdelim}{}
+
+%    \end{macrocode}
+%
+% We add support for the standard author--year dash check.
+%
+%    \begin{macrocode}
+\newbibmacro*{bbx:dashcheck}[2]{%
+  \ifboolexpr{
+    test {\iffieldequals{fullhash}{\bbx at lasthash}}
+    and
+    not test \iffirstonpage
+    and
+    (
+       not bool {bbx at inset}
+       or
+       test {\iffieldequalstr{entrysetcount}{1}}
+    )
+  }
+    {#1}
+    {#2}}
+
+%    \end{macrocode}
+%
+% The |author|, |editor| and |translator| macros are mostly the same as the
+% standard author--year definitions, with the exception that we add support for
+% the |nameaddon| field for authors.
+%
+%    \begin{macrocode}
 \DeclareFieldFormat{nameaddon}{\mkbibbrackets{#1}}
 \renewbibmacro*{author}{%
   \ifboolexpr{
@@ -2683,22 +4242,74 @@
         \setunit{\printdelim{nameyeardelim}}}}%
     {\global\undef\bbx at lasthash
      \usebibmacro{labeltitle}%
-     \setunit*{\printdelim{nonameyeardelim}}}%
-  \usebibmacro{date+extradate}%
-  \usebibmacro{labeltitleaddon}}
+     \iftoggle{bbx:labelistitle}{\setunit{\printdelim{nonameyeardelim}}}{}}%
+  \usebibmacro{date+extradate}}
+
+\renewbibmacro*{editor}{%
+  \usebibmacro{bbx:editor}{editorstrg}}
+\renewbibmacro*{editor+others}{%
+  \usebibmacro{bbx:editor}{editor+othersstrg}}
+\newbibmacro*{bbx:editor}[1]{%
+  \ifboolexpr{
+    test \ifuseeditor
+    and
+    not test {\ifnameundef{editor}}
+  }
+    {\usebibmacro{bbx:dashcheck}
+       {\bibnamedash}
+       {\printnames{editor}%
+        \setunit{\printdelim{editortypedelim}}%
+        \usebibmacro{bbx:savehash}}%
+     \usebibmacro{#1}%
+     \clearname{editor}%
+     \setunit{\printdelim{nameyeardelim}}}%
+    {\global\undef\bbx at lasthash
+     \usebibmacro{labeltitle}%
+     \iftoggle{bbx:labelistitle}{\setunit{\printdelim{nonameyeardelim}}}{}}%
+  \usebibmacro{date+extradate}}
+
+\renewbibmacro*{translator}{%
+  \usebibmacro{bbx:translator}{translatorstrg}}
+\renewbibmacro*{translator+others}{%
+  \usebibmacro{bbx:translator}{translator+othersstrg}}
+\newbibmacro*{bbx:translator}[1]{%
+  \ifboolexpr{
+    test \ifusetranslator
+    and
+    not test {\ifnameundef{translator}}
+  }
+    {\usebibmacro{bbx:dashcheck}
+       {\bibnamedash}
+       {\printnames{translator}%
+        \setunit{\printdelim{translatortypedelim}}%
+        \usebibmacro{bbx:savehash}}%
+     \usebibmacro{#1}%
+     \clearname{translator}%
+     \setunit{\printdelim{nameyeardelim}}}%
+    {\global\undef\bbx at lasthash
+     \usebibmacro{labeltitle}%
+     \iftoggle{bbx:labelistitle}{\setunit{\printdelim{nonameyeardelim}}}{}}%
+  \usebibmacro{date+extradate}}
+
 %    \end{macrocode}
 %
-% With videos, names in credits are printed in full.
+% With collections, editors appear in natural order between `In' and the title,
+% followed by `ed.'
 %
 %    \begin{macrocode}
-\DeclareNameFormat{given-family:full}{%
-  \usebibmacro{name:given-family}
-    {\namepartfamily}
-    {\namepartgiven}
-    {\namepartprefix}
-    {\namepartsuffix}%
-  \usebibmacro{name:andothers}}
+\newbibmacro*{bookeditor}{%
+  \ifnameundef{editor}{}{%
+    \printnames[bookeditor]{editor}%
+    \setunit*{\addcomma\space}%
+    \usebibmacro{editor+othersstrg}%
+    \clearname{editor}%
+  }}
 
+%    \end{macrocode}
+%
+% We change the |by|* macros so that the format can be changed with an option.
+%
+%    \begin{macrocode}
 \renewbibmacro*{byauthor}[1][byauthor]{%
   \ifboolexpr{
     test \ifuseauthor
@@ -2747,6 +4358,11 @@
     \printnames[#1]{editorc}%
     \newunit}}
 
+%    \end{macrocode}
+%
+% The style prints translator names (uniquely) in parentheses.
+%
+%    \begin{macrocode}
 \renewbibmacro*{bytranslator}[1][bytranslator]{%
   \ifnameundef{translator}
   {}
@@ -2788,310 +4404,10 @@
 
 %    \end{macrocode}
 %
-% With collections, editors appear in natural order between `In' and the title,
-% followed by `ed.'
-%
-%    \begin{macrocode}
-\newbibmacro*{bookeditor}{%
-  \ifnameundef{editor}{}{%
-    \printnames[bookeditor]{editor}%
-    \setunit*{\addcomma\space}%
-    \usebibmacro{editor+othersstrg}%
-    \clearname{editor}%
-  }}
-
-%    \end{macrocode}
-%
-% \subsection{Titles}
-%
-% Most titles are set in italics, but some are set roman and unquoted.
-%
-%    \begin{macrocode}
-\DeclareFieldFormat{sentencecase}{\MakeSentenceCase*{#1}}
-\DeclareFieldFormat{midsentencecase}{\MakeSentenceCase*{{}#1}}
-\DeclareFieldFormat{title}{\mkbibemph{#1}}
-\DeclareFieldFormat
-  [article,inbook,incollection,inproceedings]%
-  {title}{#1}
-\DeclareFieldFormat
-  [reference,mvreference]%
-  {title}{\ifnameundef{author}{#1}{\mkbibemph{#1}}}
-\DeclareFieldFormat
-  [inreference]%
-  {title}{\ifnameundef{author}{\mkbibemph{#1}}{#1}}
-\DeclareFieldFormat
-  [inreference]%
-  {booktitle}{\ifnameundef{author}{#1}{\mkbibemph{#1}}}
-\DeclareFieldFormat
-  [patent,thesis]%
-  {title}{\mkbibemph{#1}}
-\DeclareFieldFormat
-  [audio,video,music,video]%
-  {title}{\ifboolexpr{
-    test {\iffieldequalstr{type}{TV}}
-    or
-    test {\iffieldequalstr{type}{Radio}}
-  }{#1}{\mkbibemph{#1}}}
-\DeclareFieldFormat
-  [unpublished]%
-  {title}{\iffieldundef{booktitle}{\mkbibemph{#1}}{#1}}
-
-%    \end{macrocode}
-%
-% Online resources are clearly tarred and feathered with an `[Online]' label.
-% The \texttt{isonline} macro prints this label if the resource has a URL and
-% does nothing otherwise. We add a safeguard to stop it being used repeatedly.
-%
-%    \begin{macrocode}
-\newtoggle{bbx:onlineshown}
-\newbibmacro*{isonline}{%
-  \ifboolexpr{(
-      test {\iffieldundef{doi}}
-      and
-      test {\iffieldundef{url}}
-      and
-      test {\iffieldundef{urlyear}}
-      and
-      not test {\ifentrytype{online}}
-    ) or
-    togl {bbx:onlineshown}
-  }{}{%
-    \bibstring[\mkbibbrackets]{online}%
-    \toggletrue{bbx:onlineshown}}}
-
-%    \end{macrocode}
-%
-% The |titleaddon| field follows the title after a space and wrapped in
-% brackets. Version 1 of this style encouraged people to supply the brackets
-% manually, so we strip them off if they have been supplied.
-%
-%    \begin{macrocode}
-\DeclareFieldFormat{titleaddon}{\mkbibbrackets{%
-  \IfBeginWith{#1}{[}{%
-    \IfEndWith{#1}{]}{%
-      \StrBetween{#1}{[}{]}%
-    }{#1}%
-  }{#1}%
-}}
-
-%    \end{macrocode}
-%
-% We need to supply a new |title| macro. The standard version puts default unit
-% punctuation between the |title| and |titleaddon| fields, but we need a space.
-% We also need to add conditional code for printing the automatic `[Online]'
-% label.
-%
-%    \begin{macrocode}
-\renewbibmacro*{title}{%
-  \ifboolexpr{
-    test {\iffieldundef{title}}
-    and
-    test {\iffieldundef{subtitle}}
-  }{}{%
-    \printtext[title]{%
-      \printfield[sentencecase]{title}%
-      \setunit{\subtitlepunct}%
-      \printfield[midsentencecase]{subtitle}%
-      \setunit{\addspace}%
-    }%
-    \printfield{version}%
-    \clearfield{version}%
-    \setunit*{\addspace}%
-    \printfield{titleaddon}%
-    \ifboolexpr{
-      test {\iffieldundef{journaltitle}}
-      and
-      test {\iffieldundef{booktitle}}
-      and (
-        test {\iffieldundef{library}}
-        or
-        test {\ifentrytype{image}}
-        or
-        test {\ifentrytype{audio}}
-        or
-        test {\ifentrytype{video}}
-        or
-        test {\ifentrytype{music}}
-        or
-        test {\ifentrytype{movie}}
-      ) and
-      not test {\ifentrytype{software}}
-      and (
-        not (
-          test {\iffieldequalstr{type}{TV}}
-          or
-          test {\iffieldequalstr{type}{Radio}}
-        )
-        or
-        test {\iffieldundef{series}}
-      )
-    }{%
-      \setunit*{\addspace}%
-      \usebibmacro{isonline}%
-    }{}%
-  }%
-}
-
-%    \end{macrocode}
-%
-% Similar changes are needed for the |booktitle| and |maintitle| macros.
-%
-%    \begin{macrocode}
-\renewbibmacro*{booktitle}{%
-  \ifboolexpr{
-    test {\iffieldundef{booktitle}}
-    and
-    test {\iffieldundef{booksubtitle}}
-  }{}{%
-    \printtext[booktitle]{%
-      \printfield[sentencecase]{booktitle}%
-      \setunit{\subtitlepunct}%
-      \printfield[midsentencecase]{booksubtitle}%
-      \setunit{\addspace}%
-    }%
-    \printfield{booktitleaddon}
-    \setunit*{\addspace}%
-    \usebibmacro{isonline}%
-  }%
-}
-
-\renewbibmacro*{maintitle}{%
-  \ifboolexpr{
-    test {\iffieldundef{maintitle}}
-    and
-    test {\iffieldundef{mainsubtitle}}
-  }{}{
-    \printtext[maintitle]{%
-      \printfield[sentencecase]{maintitle}%
-      \setunit{\subtitlepunct}%
-      \printfield[midsentencecase]{mainsubtitle}%
-      \setunit{\addspace}%
-    }%
-    \printfield{maintitleaddon}%
-  }%
-}
-
-%    \end{macrocode}
-%
-% Subtitles are set off with a colon
-%
-%    \begin{macrocode}
-\renewcommand*{\subtitlepunct}{\addcolon\space}
-
-%    \end{macrocode}
-%
-% In the standard author--year styles, if a title is promoted to the head of
-% a reference (due to missing authors/editors), the subtitle and titleaddon
-% fields are discarded. We want to show the subtitle directly after the title,
-% and show titleaddon after the |date+extradate| macro.
-%
-%    \begin{macrocode}
-\DeclareLabeltitle[inreference]{%
-  \field{shorttitle}
-  \field{booktitle}
-  \field{title}
-}
-\providetoggle{bbx:labelistitle}
-\renewbibmacro*{labeltitle}{%
-  \iffieldundef{label}{%
-    \ifboolexpr{
-      test {\ifentrytype{inreference}}
-      and
-      not test {\iffieldundef{booktitle}}
-    }{%
-      \printtext[booktitle]{%
-        \printfield[sentencecase]{booktitle}%
-        \setunit{\booksubtitlepunct}%
-        \printfield[midsentencecase]{booksubtitle}}%
-      \clearfield{booktitle}\clearfield{booksubtitle}%
-    }{%
-      \ifboolexpr{
-        test {\iffieldundef{title}}
-        and
-        test {\iffieldundef{subtitle}}
-      }{}{%
-        \printtext[title]{%
-          \printfield[sentencecase]{title}%
-          \setunit{\subtitlepunct}%
-          \printfield[midsentencecase]{subtitle}}%
-        \clearfield{title}\clearfield{subtitle}%
-        \toggletrue{bbx:labelistitle}}%
-        \ifboolexpr{
-          test {\iffieldundef{journaltitle}}
-          and
-          test {\iffieldundef{booktitle}}
-          and (
-            test {\iffieldundef{library}}
-            or
-            test {\ifentrytype{image}}
-            or
-            test {\ifentrytype{audio}}
-            or
-            test {\ifentrytype{video}}
-            or
-            test {\ifentrytype{music}}
-            or
-            test {\ifentrytype{movie}}
-          ) and
-          not test {\ifentrytype{software}}
-          and
-          not test {\ifentrytype{legislation}}
-          and
-          not test {\ifentrytype{jurisdiction}}
-          and (
-            not (
-              test {\iffieldequalstr{type}{TV}}
-              or
-              test {\iffieldequalstr{type}{Radio}}
-            )
-            or
-            test {\iffieldundef{series}}
-          )
-        }{%
-          \setunit*{\addspace}%
-          \usebibmacro{isonline}%
-        }{}%
-    }%
-  }{%
-    \printfield{label}%
-  }%
-}
-\DeclareDelimFormat{yearlabeltitleaddondelim}{\addspace}
-\newbibmacro*{labeltitleaddon}{%
-  \iftoggle{bbx:labelistitle}{%
-    \setunit{\printdelim{yearlabeltitleaddondelim}}%
-    \printfield{version}%
-    \clearfield{version}%
-    \setunit*{\addspace}%
-    \printfield{titleaddon}%
-    \clearfield{titleaddon}%
-    \ifboolexpr{(
-        test {\ifentrytype{legislation}}
-        or
-        test {\ifentrytype{jurisdiction}}
-      )
-      and
-      test {\iffieldundef{journaltitle}}
-      and
-      test {\iffieldundef{booktitle}}
-    }{%
-      \setunit*{\addspace}%
-      \usebibmacro{isonline}%
-    }{}%
-  }{}%
-}
-\xapptobibmacro{bbx:editor}{\usebibmacro{labeltitleaddon}}{}{}
-\xapptobibmacro{bbx:translator}{\usebibmacro{labeltitleaddon}}{}{}
-
-%    \end{macrocode}
-%
 % \subsection{Dates}
 %
 % If the main publication date is missing, we fall back immediately to `n.d.\@'
-% rather than use URL date or anything like that. However, for some resources
-% (ISO standards, Acts of Parliament), the date is part of the label and should
-% not be repeated, so we declare an option for removing the `n.d.' Unless
-% already set, the option is inserted if |sortyear| is used.
+% rather than use the access date or anything like that.
 %
 %    \begin{macrocode}
 \DeclareLabeldate{%
@@ -3099,13 +4415,7 @@
   \field{year}
   \literal{nodate}
 }
-\newtoggle{bbx:nonodate}
-\DeclareBibliographyOption[boolean]{nonodate}[true]{%
-  \settoggle{bbx:nonodate}{#1}}
-\DeclareTypeOption[boolean]{nonodate}[true]{%
-  \settoggle{bbx:nonodate}{#1}}
-\DeclareEntryOption[boolean]{nonodate}[true]{%
-  \settoggle{bbx:nonodate}{#1}}
+
 %    \end{macrocode}
 %
 % Unless already set, the \key{nonodate} option is inserted if |sortyear| is
@@ -3131,6 +4441,15 @@
 
 %    \end{macrocode}
 %
+% Dates are usually given bare. Times, when printed, are followed by the
+% |hours| bibstring.
+%
+%    \begin{macrocode}
+\DeclareFieldFormat{datelabel}{#1}
+\DeclareFieldFormat{time}{#1~\bibstring{hours}}
+
+%    \end{macrocode}
+%
 % The punctuation before the label year is controlled by the following
 % commands, and should be a comma. The exceptions to this are |legislation|
 % entries, where there should just be a space, and English/Welsh legal case
@@ -3199,201 +4518,8 @@
     togl {bbx:labelistitle}
   }{\addspace}{\labelnamepunct}}
 
-
 %    \end{macrocode}
 %
-% We allow the date macro to print the time as well.
-%
-%    \begin{macrocode}
-\renewbibmacro*{date}{%
-  \printdate
-  \setunit*{\bibdatetimesep}
-  \printtime
-}
-\DeclareFieldFormat{time}{#1~\bibstring{hours}}
-
-%    \end{macrocode}
-%
-% We provide a new date merging option that moves the year but leaves the
-% month and day in place, and set this as the default. Note that dates are
-% preceded by a comma, and are given bare rather than in parentheses.
-%
-% We start by patching the error message of the existing option code, then
-% add a per-type version of the option.
-%
-%    \begin{macrocode}
-\xpatchcmd{\KV at blx@opt at pre@mergedate}{%
-  'true' (=compact)%
-}{%
-  'year', 'true' (=year)%
-}{}{\wlog{WARNING: biblatex-bath failed to patch KV at blx@opt at pre@datemerge}}
-\ifdefined\KV at blx@opt at typ@mergedate
-  \xpatchcmd{\KV at blx@opt at typ@mergedate}{%
-    'true' (=compact)%
-  }{%
-    'year', 'true' (=year)%
-  }{}{\wlog{WARNING: biblatex-bath failed to patch KV at blx@opt at typ@datemerge}}
-\else
-  \DeclareTypeOption[boolean]{mergedate}[true]{%
-    \ifcsdef{bbx at opt@mergedate@#1}{%
-      \csuse{bbx at opt@mergedate@#1}%
-    }{%
-      \PackageError{biblatex}
-        {Invalid option 'mergedate=#1'}
-        {Valid values are 'maximum', 'compact', 'basic', 'minimum',\MessageBreak
-          'year', 'true' (=year), and 'false'.}}}
-\fi
-\xpatchcmd{\KV at blx@opt at ent@mergedate}{%
-  'true' (=compact)%
-}{%
-  'year', 'true' (=year)%
-}{}{\wlog{WARNING: biblatex-bath failed to patch KV at blx@opt at ent@datemerge}}
-
-%    \end{macrocode}
-%
-% We define a configurable field format for date labels to replace the
-% hard-coded parentheses in the options from the standard author--year style.
-% We also amend the logic for printing the label date so the |nonodate| option
-% is respected.
-%
-%    \begin{macrocode}
-\DeclareFieldFormat{datelabel}{#1}
-\xpatchcmd{\bbx at opt@mergedate at maximum}{%
-  \iffieldundef{labelyear}%
-}{%
-  \ifboolexpr{
-    togl {bbx:nonodate}
-    and
-    not test {\iflabeldateisdate}}%
-}{}{\wlog{WARNING: biblatex-bath failed to patch bbx at opt@mergedate at maximum}}
-\xpatchcmd{\bbx at opt@mergedate at maximum}{%
-  \printtext[parens]%
-}{%
-  \printtext[datelabel]%
-}{}{\wlog{WARNING: biblatex-bath failed to patch bbx at opt@mergedate at maximum}}
-\xpatchcmd{\bbx at opt@mergedate at compact}{%
-  \iffieldundef{labelyear}%
-}{%
-  \ifboolexpr{
-    togl {bbx:nonodate}
-    and
-    not test {\iflabeldateisdate}}%
-}{}{\wlog{WARNING: biblatex-bath failed to patch bbx at opt@mergedate at compact}}
-\xpatchcmd{\bbx at opt@mergedate at compact}{%
-  \printtext[parens]%
-}{%
-  \printtext[datelabel]%
-}{}{\wlog{WARNING: biblatex-bath failed to patch bbx at opt@mergedate at compact}}
-\xpatchcmd{\bbx at opt@mergedate at basic}{%
-  \iffieldundef{labelyear}%
-}{%
-  \ifboolexpr{
-    togl {bbx:nonodate}
-    and
-    not test {\iflabeldateisdate}}%
-}{}{\wlog{WARNING: biblatex-bath failed to patch bbx at opt@mergedate at basic}}
-\xpatchcmd{\bbx at opt@mergedate at basic}{%
-  \printtext[parens]%
-}{%
-  \printtext[datelabel]%
-}{}{\wlog{WARNING: biblatex-bath failed to patch bbx at opt@mergedate at basic}}
-\xpatchcmd{\bbx at opt@mergedate at minimum}{%
-  \iffieldundef{labelyear}%
-}{%
-  \ifboolexpr{
-    togl {bbx:nonodate}
-    and
-    not test {\iflabeldateisdate}}%
-}{}{\wlog{WARNING: biblatex-bath failed to patch bbx at opt@mergedate at minimum}}
-\xpatchcmd{\bbx at opt@mergedate at minimum}{%
-  \printtext[parens]%
-}{%
-  \printtext[datelabel]%
-}{}{\wlog{WARNING: biblatex-bath failed to patch bbx at opt@mergedate at minimum}}
-\xpatchcmd{\bbx at opt@mergedate at false}{%
-  \iffieldundef{labelyear}%
-}{%
-  \ifboolexpr{
-    togl {bbx:nonodate}
-    and
-    not test {\iflabeldateisdate}}%
-}{}{\wlog{WARNING: biblatex-bath failed to patch bbx at opt@mergedate at false}}
-\xpatchcmd{\bbx at opt@mergedate at false}{%
-  \printtext[parens]%
-}{%
-  \printtext[datelabel]%
-}{}{\wlog{WARNING: biblatex-bath failed to patch bbx at opt@mergedate at false}}
-%    \end{macrocode}
-%
-% If an older version of biblatex is used, we update the logic for
-% |\bbx at opt@mergedate at maximum|, which is used by the |letter| driver.
-%
-%    \begin{macrocode}
-\xpatchcmd{\bbx at opt@mergedate at maximum}{%
-  \iffieldsequal{year}{labelyear}
-    {\printlabeldateextra}%
-    {\printfield{labelyear}%
-    \printfield{extrayear}}%
-}{%
-  \iflabeldateisdate
-    {\printfield{issue}%
-    \setunit*{\addspace}%
-    \printdateextra}
-    {\printlabeldateextra}%
-}{}{}
-
-%    \end{macrocode}
-%
-% Lastly, here is our new (default) option, which always merges the year, and
-% only the year, with the label date. Other date and time componenents are
-% displayed later in the reference. Therefore we clear the year from the date
-% used for the label, but leave the month and day alone.
-%
-%    \begin{macrocode}
-\def\bbx at opt@mergedate at year{%
-  \renewbibmacro*{date+extradate}{%
-    \iffieldundef{labelyear}{}{%
-      \ifboolexpr{
-        togl {bbx:nonodate}
-        and
-        not test {\iflabeldateisdate}
-      }{}{%
-        \printtext[datelabel]{\printlabeldateextra}%
-      }%
-      \iflabeldateisdate{%
-        \clearfield{year}%
-      }{}}}
-  \ifcsundef{abx at macro@date+extrayear}{}{%
-    \renewbibmacro*{date+extrayear}{\usebibmacro{date+extradate}}%
-  }
-  \renewbibmacro*{issue+date}{%
-    \iffieldundef{issue}{}{%
-      \ifboolexpr{(
-        test {\iffieldundef{volume}}
-        and
-        test {\iffieldundef{number}}
-        ) and
-        test {\iffieldundef{eid}}
-      }{%
-        \newunit
-        \printfield{issue}%
-      }{%
-        \printtext[parens]{%
-          \printfield{issue}%
-        }%
-      }
-    }%
-    \setunit{\addcomma\space}%
-    \printdate
-    \newunit
-  }%
-}%
-
-\def\bbx at opt@mergedate at true{\bbx at opt@mergedate at year}
-\ExecuteBibliographyOptions{mergedate}
-
-%    \end{macrocode}
-%
 % The problem with moving years but leaving months and days behind is that the
 % regular date range macros in |biblatex.sty| do nothing at all if no year
 % is printed. We therefore need to patch the macros with extra routines for
@@ -3515,9 +4641,12 @@
     \iffieldundef{#2year} {\mknoyeardaterangetrunc{#1}{#2}}%
   }{}{\wlog{WARNING: biblatex-bath failed to patch mkdaterangetruncextra at i}}%
 \fi
+%    \end{macrocode}
 %
-% By default, Title--year combinations are not disambiguated, so we fix that
+% By default, title--year combinations are not disambiguated, so we fix that
 % too.
+%
+%    \begin{macrocode}
 \DeclareFieldFormat{extraalpha}{%
   \iffieldnums{labelyear}
     {\mknumalph{#1}}
@@ -3565,202 +4694,361 @@
 
 %    \end{macrocode}
 %
-% \subsection{Versions}
+% \subsection{Title block}
 %
-% Versions are printed with `v.\@' in parentheses.
+% Most titles are set in italics, but some are set roman and unquoted.
 %
 %    \begin{macrocode}
-\DeclareFieldFormat{version}{\mkbibparens{\biblcsstring{version}#1}}
-%    \end{macrocode}
-%
-% \subsection{Types}
-%
-% Types are always printed longhand.
-%
-%    \begin{macrocode}
-\DeclareFieldFormat{type}{\ifbibstring{#1}{\biblstring{#1}}{#1}}
-\DeclareFieldFormat{series}{\MakeSentenceCase*{#1}}
+\DeclareFieldFormat{sentencecase}{\MakeSentenceCase*{#1}}
+\DeclareFieldFormat{midsentencecase}{\MakeSentenceCase*{{}#1}}
+\DeclareFieldFormat{title}{\mkbibemph{#1}}
 \DeclareFieldFormat
+  [article,inbook,incollection,inproceedings]%
+  {title}{#1}
+\DeclareFieldFormat
+  [reference,mvreference]%
+  {title}{\iftoggle{bbx:labelistitle}{#1}{\mkbibemph{#1}}}
+\DeclareFieldFormat
+  [inreference]%
+  {title}{\iftoggle{bbx:labelistitle}{\mkbibemph{#1}}{#1}}
+\DeclareFieldFormat
+  [inreference]%
+  {booktitle}{\iftoggle{bbx:labelistitle}{#1}{\mkbibemph{#1}}}
+\DeclareFieldFormat
+  [patent,thesis]%
+  {title}{\mkbibemph{#1}}
+\DeclareFieldFormat
   [audio,video,music,video]%
-  {series}{\ifboolexpr{
+  {title}{\ifboolexpr{
     test {\iffieldequalstr{type}{TV}}
     or
     test {\iffieldequalstr{type}{Radio}}
-  }{\mkbibemph{\MakeSentenceCase*{#1}}}{\MakeSentenceCase*{#1}}}
+  }{#1}{\mkbibemph{#1}}}
 \DeclareFieldFormat
-  [audio,video,music,video]%
-  {number}{\ifboolexpr{
-    test {\iffieldequalstr{type}{TV}}
-    or
-    test {\iffieldequalstr{type}{Radio}}
-  }{\mkbibemph{#1}}{#1}}
-\DeclareFieldFormat[legislation,jurisdiction]{series}{#1}
-\renewbibmacro*{series+number}{%
-  \printfield{series}%
-  \setunit*{\addcomma\space}%
-  \printfield{number}%
-  \newunit}
+  [unpublished]%
+  {title}{\iffieldundef{booktitle}{\mkbibemph{#1}}{#1}}
+\DeclareFieldFormat
+  [letter]%
+  {title}{\iffieldundef{journaltitle}{\emph{#1}}{#1}}
+
 %    \end{macrocode}
 %
-% \subsection{Events}
+% Versions are printed with `v.\@' in parentheses.
 %
-% Events are printed as date then venue with no intermediate punctuation.
+%    \begin{macrocode}
+\DeclareFieldFormat{version}{\mkbibparens{\biblcsstring{version}#1}}
+
+%    \end{macrocode}
 %
+% The |titleaddon| field follows the title after a space and wrapped in
+% brackets. Version 1 of this style encouraged people to supply the brackets
+% manually, so we strip them off if they have been supplied.
+%
 %    \begin{macrocode}
-\renewbibmacro*{event+venue+date}{%
-  \printfield{eventtitle}%
-  \setunit*{\addspace}%
-  \printfield{eventtitleaddon}%
-  \ifboolexpr{
-    test {\iffieldundef{venue}}
-    and
-    test {\iffieldundef{eventyear}}
-  }
-    {}
-    {\setunit{\addcomma\space}%
-     \printeventdate
-     \setunit*{\addcomma\space}%
-     \printfield{venue}%
-     \newunit}}
+\DeclareFieldFormat{titleaddon}{\mkbibbrackets{%
+  \IfBeginWith{#1}{[}{%
+    \IfEndWith{#1}{]}{%
+      \StrBetween{#1}{[}{]}%
+    }{#1}%
+  }{#1}%
+}}
 
 %    \end{macrocode}
 %
-% \subsection{Publishers}
+% Subtitles are set off with a colon
 %
-% We patch the secondary publication macros so they will use the
-% publisher list instead, if provided.
-%
 %    \begin{macrocode}
-\letbibmacro{plain:institution+location+date}{institution+location+date}
-\renewbibmacro*{institution+location+date}{%
-  \iflistundef{publisher}{%
-    \usebibmacro{plain:institution+location+date}%
-  }{%
-    \printlist{institution}%
-    \newunit
-    \usebibmacro{publisher+location+date}}}
+\renewcommand*{\subtitlepunct}{\addcolon\space}
+
 %    \end{macrocode}
 %
-% As an additional hack for social media entries where the date is preceded by a
-% comma, we tweak the punctuation logic for \texttt{organization+location+date}.
+% The |maintitle+title| and |title+issuetitle| are intended to be unchanged from
+% the standard definitions.
 %
 %    \begin{macrocode}
-\renewbibmacro*{organization+location+date}{%
-  \iflistundef{publisher}{%
-    \printlist{location}%
-    \iflistundef{organization}
-      {\setunit*{\addcomma\space}}
-      {\setunit*{\addcolon\space}}%
-    \printlist{organization}%
-    \iflistundef{location}
-      {\setunit{\addcomma\space}}%
-      {\setunit*{\addcomma\space}}%
-    \usebibmacro{date}%
-    \newunit
-  }{%
-    \printlist{organization}%
-    \newunit
-    \usebibmacro{publisher+location+date}}}
+\newbibmacro*{maintitle+title}{%
+  \iffieldsequal{maintitle}{title}
+    {\clearfield{maintitle}%
+      \clearfield{mainsubtitle}%
+      \clearfield{maintitleaddon}}
+    {\iffieldundef{maintitle}
+        {}
+        {\usebibmacro{maintitle}%
+        \newunit\newblock
+        \iffieldundef{volume}
+          {}
+          {\printfield{volume}%
+            \printfield{part}%
+            \setunit{\addcolon\space}}}}%
+  \usebibmacro{title}%
+  \newunit}
 
+\newbibmacro*{title+issuetitle}{%
+  \usebibmacro{periodical}%
+  \setunit*{\addspace}%
+  \iffieldundef{series}
+    {}
+    {\newunit
+      \printfield{series}%
+      \setunit{\addspace}}%
+  \usebibmacro{volume+number+eid}%
+  \setunit{\addspace}%
+  \usebibmacro{issue+date}%
+  \setunit{\addcolon\space}%
+  \usebibmacro{issue}%
+  \newunit}
+
 %    \end{macrocode}
 %
-% We use the \texttt{library} field for databases and preprint repositories.
+% We need to supply a new |title| macro. The standard version puts default unit
+% punctuation between the |title| and |titleaddon| fields, but we need a space.
+% We also need to add conditional code for printing the automatic `[Online]'
+% label.
 %
 %    \begin{macrocode}
-\DeclareFieldFormat{library}{\mkbibemph{#1}}
-\newbibmacro*{library}{%
-  \iffieldundef{library}{}{%
-    \printfield{library}\clearfield{library}%
+\renewbibmacro*{title}{%
+  \ifboolexpr{
+    test {\iffieldundef{title}}
+    and
+    test {\iffieldundef{subtitle}}
+  }{%
+    \ifboolexpr{
+      test {\ifentrytype{legislation}}
+      and
+      test {\iffieldundef{journaltitle}}
+    }{%
+      \setunit*{\addspace}%
+      \usebibmacro{isonline}%
+    }{}%
+  }{%
+    \printtext[title]{%
+      \printfield[sentencecase]{title}%
+      \setunit{\subtitlepunct}%
+      \printfield[midsentencecase]{subtitle}%
+      \setunit{\addspace}}%
+    \printfield{titleaddon}%
     \setunit*{\addspace}%
-    \usebibmacro{isonline}%
+    \printfield{version}\clearfield{version}%
+    \ifboolexpr{
+      test {\iffieldundef{entrysubtype}}
+      or (
+        test {\ifentrytype{legislation}}
+        or
+        test {\ifentrytype{jurisdiction}}
+      )
+    }{%
+      \ifboolexpr{
+        test {\iffieldundef{journaltitle}}
+        and
+        test {\iffieldundef{booktitle}}
+        and (
+          test {\iffieldundef{library}}
+          or
+          test {\ifentrytype{image}}
+          or
+          test {\ifentrytype{audio}}
+          or
+          test {\ifentrytype{video}}
+          or
+          test {\ifentrytype{music}}
+          or
+          test {\ifentrytype{movie}}
+        )
+        and (
+          not (
+            test {\iffieldequalstr{type}{TV}}
+            or
+            test {\iffieldequalstr{type}{Radio}}
+          )
+          or
+          test {\iffieldundef{series}}
+        )
+      }{%
+        \setunit*{\addspace}%
+        \usebibmacro{isonline}%
+      }{}%
+    }{%
+      \setunit*{\addspace}%
+      \printfield{entrysubtype}}
   }%
 }
 
 %    \end{macrocode}
 %
-% \subsection{Page numbers}
+% Similar changes are needed for the |booktitle| and |maintitle| macros.
 %
 %    \begin{macrocode}
-\renewcommand*{\ppspace}{}
-\DeclareNumChars{ab}
+\renewbibmacro*{booktitle}{%
+  \ifboolexpr{
+    test {\iffieldundef{booktitle}}
+    and
+    test {\iffieldundef{booksubtitle}}
+  }{}{%
+    \printtext[booktitle]{%
+      \printfield[sentencecase]{booktitle}%
+      \setunit{\subtitlepunct}%
+      \printfield[midsentencecase]{booksubtitle}%
+      \setunit{\addspace}%
+    }%
+    \printfield{booktitleaddon}
+    \setunit*{\addspace}%
+    \usebibmacro{isonline}%
+  }%
+}
+
+\renewbibmacro*{maintitle}{%
+  \ifboolexpr{
+    test {\iffieldundef{maintitle}}
+    and
+    test {\iffieldundef{mainsubtitle}}
+  }{}{
+    \printtext[maintitle]{%
+      \printfield[sentencecase]{maintitle}%
+      \setunit{\subtitlepunct}%
+      \printfield[midsentencecase]{mainsubtitle}%
+      \setunit{\addspace}%
+    }%
+    \printfield{maintitleaddon}%
+  }%
+}
+
 %    \end{macrocode}
 %
-% \subsection{URLs}
+% In the standard author--year styles, if a title is promoted to the head of
+% a reference (due to missing authors/editors), the subtitle and titleaddon
+% fields are discarded. In Harvard (Bath), the whole block is moved (with some
+% cosmetic differences).
 %
-% URLs are prefaced by a `from' statement, and the URL date is enclosed in
-% brackets rather than parentheses.
-%
 %    \begin{macrocode}
-\DeclareFieldFormat{url}{\bibsentence\bibstring{urlfrom}\addcolon\space\url{#1}}
-\DeclareFieldFormat{doi}{\bibsentence\bibstring{urlfrom}\addcolon\space\url{https://doi.org/#1}}
-\DeclareFieldFormat{pseudourl}{\bibsentence\bibstring{urlfrom}\addcolon\space#1}
-\DeclareFieldFormat{urldate}{\mkbibbrackets{\bibstring{urlseen}\space#1}}
-%    \end{macrocode}
-%
-% Since URLs and DOIs are presented in exactly the same way, we combine them
-% such that the DOI overrides the URL. We also allow the \texttt{library} field
-% to be used as a fallback URL.
-%
-%    \begin{macrocode}
-\renewbibmacro*{url}{%
-  \iffieldundef{doi}{%
+\DeclareLabeltitle[inreference]{%
+  \field{shorttitle}
+  \field{booktitle}
+  \field{title}
+}
+\DeclareFieldFormat{entrysubtype}{\mkbibbrackets{#1}}
+\providetoggle{bbx:labelistitle}
+\newbibmacro*{labeltitle}{%
+  \iffieldundef{label}{%
     \ifboolexpr{
-      test {\iffieldundef{url}}
-      and not
-      test {\iffieldundef{urlyear}}
-    }{\printfield[pseudourl]{library}}{\printfield{url}}%
+      test {\ifentrytype{inreference}}
+      and
+      not test {\iffieldundef{booktitle}}
+    }{%
+      \toggletrue{bbx:labelistitle}%
+      \printtext[booktitle]{%
+        \printfield[sentencecase]{booktitle}%
+        \setunit{\booksubtitlepunct}%
+        \printfield[midsentencecase]{booksubtitle}}%
+      \clearfield{booktitle}\clearfield{booksubtitle}%
+    }{%
+      \ifboolexpr{
+        test {\iffieldundef{title}}
+        and
+        test {\iffieldundef{subtitle}}
+      }{}{%
+        \toggletrue{bbx:labelistitle}%
+        \printtext[title]{%
+          \printfield[sentencecase]{title}%
+          \setunit{\subtitlepunct}%
+          \printfield[midsentencecase]{subtitle}%
+          \setunit{\addspace}}%
+        \clearfield{title}\clearfield{subtitle}}%
+      \printfield{titleaddon}%
+      \ifboolexpr{
+        test {\ifentrytype{legislation}}
+        or
+        test {\ifentrytype{jurisdiction}}
+      }{}{%
+        \setunit*{\addspace}%
+        \printfield{version}\clearfield{version}%
+        \iffieldundef{entrysubtype}{%
+          \ifboolexpr{
+            test {\iffieldundef{journaltitle}}
+            and
+            test {\iffieldundef{booktitle}}
+            and (
+              test {\iffieldundef{library}}
+              or
+              test {\ifentrytype{image}}
+              or
+              test {\ifentrytype{audio}}
+              or
+              test {\ifentrytype{video}}
+              or
+              test {\ifentrytype{music}}
+              or
+              test {\ifentrytype{movie}}
+            )
+            and (
+              not (
+                test {\iffieldequalstr{type}{TV}}
+                or
+                test {\iffieldequalstr{type}{Radio}}
+              )
+              or
+              test {\iffieldundef{series}}
+            )
+          }{%
+            \setunit*{\addspace}%
+            \usebibmacro{isonline}%
+          }{}%
+        }{%
+          \setunit*{\addspace}%
+          \printfield{entrysubtype}}}}%
   }{%
-    \printfield{doi}%
+    \printfield{label}%
   }}
-\renewbibmacro*{doi+eprint+url}{%
-  \iftoggle{bbx:eprint}
-    {\usebibmacro{eprint}}
-    {}%
-  \newunit\newblock
-  \iftoggle{bbx:url}
-    {\usebibmacro{url+urldate}}
-    {}}
+
 %    \end{macrocode}
 %
-% This backports changes to the |online| driver in biblatex v3.15 to earlier
-% versions, so the above works as intended.
+% Online resources are clearly tarred and feathered with an `[Online]' label.
+% The \texttt{isonline} macro prints this label if the resource has a URL and
+% does nothing otherwise. We add a safeguard to stop it being used repeatedly.
 %
 %    \begin{macrocode}
-\xpatchbibdriver{online}{%
-  \iftoggle{bbx:doi}
-    {\printfield{doi}}
-    {}%
-  \newunit\newblock
-  \iftoggle{bbx:eprint}
-    {\usebibmacro{eprint}}
-    {}%
-  \newunit\newblock
-  \usebibmacro{url+urldate}%
-}{%
-  \toggletrue{bbx:url}%
-  \usebibmacro{doi+eprint+url}%
-}{}{}
+\newtoggle{bbx:onlineshown}
+\newbibmacro*{isonline}{%
+  \ifboolexpr{(
+      test {\iffieldundef{doi}}
+      and
+      test {\iffieldundef{url}}
+      and
+      test {\iffieldundef{urlyear}}
+      and
+      not test {\ifentrytype{online}}
+    ) or
+    togl {bbx:onlineshown}
+  }{}{%
+    \bibstring[\mkbibbrackets]{online}%
+    \toggletrue{bbx:onlineshown}}}
 
 %    \end{macrocode}
 %
-% \subsection{Articles}
+% \subsection{Events}
 %
-% Compared with the standard styles, the main differences in the driver are the
-% omission of `in' and the position of the publication state.
+% Events are printed as date then venue with no intermediate punctuation.
 %
 %    \begin{macrocode}
-\xpatchbibdriver{article}{%
-  \usebibmacro{in:}\usebibmacro{journal+issuetitle}%
-}{%
-  \usebibmacro{journal+issuetitle}%
-}{}{\wlog{WARNING: biblatex-bath failed to patch article driver}}
-\xpatchbibdriver{article}{%
-  \usebibmacro{addendum+pubstate}%
-}{%
-  \printfield{addendum}%
-}{}{\wlog{WARNING: biblatex-bath failed to patch article driver}}
+\newbibmacro*{event+venue+date}{%
+  \printfield{eventtitle}%
+  \setunit*{\addspace}%
+  \printfield{eventtitleaddon}%
+  \ifboolexpr{
+    test {\iffieldundef{venue}}
+    and
+    test {\iffieldundef{eventyear}}
+  }
+    {}
+    {\setunit{\addcomma\space}%
+     \printeventdate
+     \setunit*{\addcomma\space}%
+     \printfield{venue}%
+     \newunit}}
+
 %    \end{macrocode}
 %
+% \subsection{Journals}
+%
 % The journal title is in sentence case rather than title case.
 %
 %    \begin{macrocode}
@@ -3774,6 +5062,7 @@
 }{%
   \printfield[sentencecase]{journalsubtitle}%
 }{}{\wlog{WARNING: biblatex-bath failed to patch journal macro}}
+
 %    \end{macrocode}
 %
 % The journal title is followed by a comma. The issue number is separated from
@@ -3781,7 +5070,7 @@
 % position.
 %
 %    \begin{macrocode}
-\renewbibmacro*{journal+issuetitle}{%
+\newbibmacro*{journal+issuetitle}{%
   \usebibmacro{journal}%
   \setunit*{\addspace}%
   \usebibmacro{isonline}%
@@ -3799,7 +5088,8 @@
   \setunit{\addcomma\space}%
   \printfield{pubstate}%
   \newunit}
-\renewbibmacro*{volume+number+eid}{%
+
+\newbibmacro*{volume+number+eid}{%
   \printfield{volume}%
   \printfield[parens]{number}%
   \setunit{\addcomma\space}%
@@ -3807,209 +5097,112 @@
 
 %    \end{macrocode}
 %
-% \subsection{Books}
+% \subsection{Monograph containers and entry titles}
 %
-% Compared with the standard styles, the main difference is that the series is
-% separated by a comma rather than a period. This also affects proceedings and
-% certain forms of grey literature.
-%
 %    \begin{macrocode}
-\xpatchbibdriver{book}{%
-  \newunit\newblock
-  \usebibmacro{series+number}%
-}{%
-  \setunit{\addcomma\space}%
-  \usebibmacro{series+number}%
-}{}{\wlog{WARNING: biblatex-bath failed to patch book driver (series+number)}}
+\newbibmacro*{maintitle+booktitle}{%
+  \iffieldundef{maintitle}
+    {}
+    {\usebibmacro{maintitle}%
+      \newunit\newblock
+      \iffieldundef{volume}
+        {}
+        {\printfield{volume}%
+        \printfield{part}%
+        \setunit{\addcolon\space}}}%
+  \usebibmacro{booktitle}%
+  \newunit}
 
-\xpatchbibdriver{collection}{%
-  \newunit\newblock
-  \usebibmacro{series+number}%
-}{%
-  \setunit{\addcomma\space}%
-  \usebibmacro{series+number}%
-}{}{\wlog{WARNING: biblatex-bath failed to patch collection driver (series+number)}}
-
-\xpatchbibdriver{inbook}{%
-  \newunit\newblock
-  \usebibmacro{series+number}%
-}{%
-  \setunit{\addcomma\space}%
-  \usebibmacro{series+number}%
-}{}{\wlog{WARNING: biblatex-bath failed to patch inbook driver (series+number)}}
-
-\xpatchbibdriver{incollection}{%
-  \newunit\newblock
-  \usebibmacro{series+number}%
-}{%
-  \setunit{\addcomma\space}%
-  \usebibmacro{series+number}%
-}{}{\wlog{WARNING: biblatex-bath failed to patch incollection driver (series+number)}}
-
-\xpatchbibdriver{inproceedings}{%
-  \newunit\newblock
-  \usebibmacro{series+number}%
-}{%
-  \setunit{\addcomma\space}%
-  \usebibmacro{series+number}%
-}{}{\wlog{WARNING: biblatex-bath failed to patch inproceedings driver (series+number)}}
-
-\xpatchbibdriver{proceedings}{%
-  \newunit\newblock
-  \usebibmacro{series+number}%
-}{%
-  \setunit{\addcomma\space}%
-  \usebibmacro{series+number}%
-}{}{\wlog{WARNING: biblatex-bath failed to patch proceedings driver (series+number)}}
-
 %    \end{macrocode}
 %
-% \subsection{Works in collections}
+% \subsection{Series, types and numbering}
 %
-% Compared with the standard styles, the main difference is that the editors
-% precede the booktitle.
+% Types are always printed longhand.
 %
 %    \begin{macrocode}
-\xpatchbibdriver{incollection}{%
-  \usebibmacro{in:}%
-  \usebibmacro{maintitle+booktitle}%
-  \newunit\newblock
-  \usebibmacro{byeditor+others}%
-}{%
-  \ifnameundef{editor}{}{\usebibmacro{in:}}%
-  \usebibmacro{bookeditor}%
-  \newunit\newblock
-  \usebibmacro{maintitle+booktitle}%
-  \usebibmacro{byeditor+others}%
-}{}{\wlog{WARNING: biblatex-bath failed to patch incollection driver (bookeditor)}}
+\DeclareFieldFormat{type}{\ifbibstring{#1}{\biblstring{#1}}{#1}}
+\DeclareFieldFormat[software]{type}{\mkbibbrackets{#1}}
+\DeclareFieldFormat{series}{\MakeSentenceCase*{#1}}
+\DeclareFieldFormat
+  [audio,video,music,video]%
+  {series}{\ifboolexpr{
+    test {\iffieldequalstr{type}{TV}}
+    or
+    test {\iffieldequalstr{type}{Radio}}
+  }{\mkbibemph{\MakeSentenceCase*{#1}}}{\MakeSentenceCase*{#1}}}
+\DeclareFieldFormat
+  [audio,video,music,video]%
+  {number}{\ifboolexpr{
+    test {\iffieldequalstr{type}{TV}}
+    or
+    test {\iffieldequalstr{type}{Radio}}
+  }{\mkbibemph{#1}}{#1}}
+\DeclareFieldFormat[legislation,jurisdiction]{series}{#1}
+%    \end{macrocode}
+%
+% The |forceparens| format ensures the punctuation tracker doesn't override
+% semantically important parentheses.
+%
+%    \begin{macrocode}
+\DeclareFieldFormat{forceparens}{(#1)}
 
-\xpatchbibdriver{inproceedings}{%
-  \usebibmacro{in:}%
-  \usebibmacro{maintitle+booktitle}%
-  \newunit\newblock
-  \usebibmacro{event+venue+date}%
-  \newunit\newblock
-  \usebibmacro{byeditor+others}%
-}{%
-  \ifnameundef{editor}{}{\usebibmacro{in:}}%
-  \usebibmacro{bookeditor}%
-  \newunit\newblock
-  \usebibmacro{maintitle+booktitle}%
-  \usebibmacro{byeditor+others}%
-  \newunit
-  \usebibmacro{event+venue+date}%
-}{}{\wlog{WARNING: biblatex-bath failed to patch inproceedings driver (bookeditor)}}
-
 %    \end{macrocode}
 %
-% \subsection{Works in books known by their title}
+% Unlike the standard styles, we print a comma between series and number.
 %
-% In these cases, the title is moved after the edition information.
-%
 %    \begin{macrocode}
-\DeclareBibliographyDriver{inreference}{%
-  \usebibmacro{bibindex}%
-  \usebibmacro{begentry}%
-  \usebibmacro{author/translator+others}%
-  \setunit{\printdelim{nametitledelim}}\newblock
-  \ifnameundef{author}{}{\usebibmacro{title}%
-  \newunit}%
-  \printlist{language}%
-  \newunit\newblock
-  \usebibmacro{byauthor}%
-  \newunit\newblock
-  \ifboolexpr{
-    test {\iffieldundef{maintitle}}
-    and
-    test {\iffieldundef{booktitle}}
-  }{}{%
-    \ifnameundef{editor}{}{\usebibmacro{in:}}%
-    \usebibmacro{bookeditor}%
-    \newunit\newblock
-    \usebibmacro{maintitle+booktitle}}%
-  \usebibmacro{byeditor+others}%
-  \newunit\newblock
-  \printfield{edition}%
-  \newunit
-  \iffieldundef{maintitle}
-    {\printfield{volume}%
-     \printfield{part}}
-    {}%
-  \newunit
-  \ifnameundef{author}{\usebibmacro{title}%
-  \newunit}{}%
-  \printfield{volumes}%
-  \newunit\newblock
-  \usebibmacro{series+number}%
-  \newunit\newblock
-  \printfield{note}%
-  \newunit\newblock
-  \usebibmacro{publisher+location+date}%
-  \newunit\newblock
-  \usebibmacro{chapter+pages}%
-  \newunit\newblock
-  \iftoggle{bbx:isbn}
-    {\printfield{isbn}}
-    {}%
-  \newunit\newblock
-  \usebibmacro{doi+eprint+url}%
-  \newunit\newblock
-  \usebibmacro{addendum+pubstate}%
-  \setunit{\bibpagerefpunct}\newblock
-  \usebibmacro{pageref}%
-  \newunit\newblock
-  \iftoggle{bbx:related}
-    {\usebibmacro{related:init}%
-     \usebibmacro{related}}
-    {}%
-  \usebibmacro{finentry}}
+\newbibmacro*{series+number}{%
+  \printfield{series}%
+  \setunit*{\addcomma\space}%
+  \printfield{number}%
+  \newunit}
 
 %    \end{macrocode}
 %
-% \subsection{Datasets}
+% We also supply a version that incorporates the |type| field.
 %
-% We patch the new datasets driver from biblatex v3.13 so it can emulate what
-% we had previously done with the online driver.
-%
 %    \begin{macrocode}
-\xpatchbibdriver{dataset}{%
-  \printlist{organization}%
-  \newunit
-  \usebibmacro{publisher+location+date}%
-}{%
-  \usebibmacro{library}%
-  \newunit\newblock
-  \usebibmacro{organization+location+date}%
-}{}{\wlog{WARNING: biblatex-bath failed to patch dataset driver (publisher)}}
+\newbibmacro{manual:series+type+number}{%
+  \iffieldundef{series}{%
+    \newunit\newblock
+    \printfield{type}%
+    \setunit{\addspace}%
+    \printfield{number}%
+  }{%
+    \setunit{\addcomma\space}%
+    \usebibmacro{series+number}%
+    \newunit\newblock
+    \printfield{type}%
+  }%
+}
 
 %    \end{macrocode}
 %
-% \subsection{Online works}
+% We provide a wrapper macro for printing archival collections and locators.
 %
-% Compared with the standard styles, the main difference is that the
-% organization's address is printed.
-%
 %    \begin{macrocode}
-\xpatchbibdriver{online}{%
-  \printlist{organization}%
-  \newunit\newblock
-  \usebibmacro{date}%
-}{%
-  \usebibmacro{library}%
-  \newunit\newblock
-  \usebibmacro{organization+location+date}%
-}{}{\wlog{WARNING: biblatex-bath failed to patch online driver (publisher)}}
+\newbibmacro*{collection+shelfmark}{%
+  \ifboolexpr{
+    test {\iffieldundef{library}}
+    or (
+      test {\iffieldundef{collection}}
+      and
+      test {\iffieldundef{shelfmark}}
+    )
+  }{
+    \usebibmacro{series+number}%
+  }{
+    \printfield{collection}%
+    \setunit*{\addcomma\space}%
+    \printfield{shelfmark}%
+    \newunit}}
 
 %    \end{macrocode}
 %
-% \subsection{Reports}
+% Reports use a special macro for printing the |type|, |series| and |number| in
+% parentheses.
 %
-% Compared with the standard styles, the main differences are that we use a
-% special macro for printing the |type|, |series| and |number| in parentheses,
-% and we support the |library| field.
-%
 %    \begin{macrocode}
-\DeclareFieldFormat{forceparens}{(#1)}
 \newbibmacro{series+type+number}{%
   \ifboolexpr{
     test {\iffieldundef{series}}
@@ -4036,83 +5229,204 @@
         \printfield{number}%
       }}}}
 
-\DeclareBibliographyDriver{report}{%
-  \usebibmacro{bibindex}%
-  \usebibmacro{begentry}%
-  \usebibmacro{author}%
-  \setunit{\printdelim{nametitledelim}}\newblock
-  \usebibmacro{title}%
+%    \end{macrocode}
+%
+% \subsection{Publication block}
+%
+% The standard publisher macro is fine.
+%
+%    \begin{macrocode}
+\newbibmacro*{publisher+location+date}{%
+  \printlist{location}%
+  \iflistundef{publisher}
+    {\setunit*{\addcomma\space}}
+    {\setunit*{\addcolon\space}}%
+  \printlist{publisher}%
+  \setunit*{\addcomma\space}%
+  \usebibmacro{date}%
+  \newunit}
+
+%    \end{macrocode}
+%
+% We put a wrapper around the standard insitution macro so that it prints the
+% publisher field instead if present, and preprends the institution.
+%
+%    \begin{macrocode}
+\newbibmacro*{plain:institution+location+date}{%
+  \printlist{location}%
+  \iflistundef{institution}
+    {\setunit*{\addcomma\space}}
+    {\setunit*{\addcolon\space}}%
+  \printlist{institution}%
+  \setunit*{\addcomma\space}%
+  \usebibmacro{date}%
+  \newunit}
+\newbibmacro*{institution+location+date}{%
+  \iflistundef{publisher}{%
+    \usebibmacro{plain:institution+location+date}%
+  }{%
+    \printlist{institution}%
+    \newunit
+    \usebibmacro{publisher+location+date}}}
+
+%    \end{macrocode}
+%
+% As an additional hack for social media entries where the date is preceded by a
+% comma, we tweak the punctuation logic for |organization+location+date|.
+%
+%    \begin{macrocode}
+\newbibmacro*{organization+location+date}{%
+  \iflistundef{publisher}{%
+    \printlist{location}%
+    \iflistundef{organization}
+      {\setunit*{\addcomma\space}}
+      {\setunit*{\addcolon\space}}%
+    \printlist{organization}%
+    \iflistundef{location}
+      {\setunit{\addcomma\space}}%
+      {\setunit*{\addcomma\space}}%
+    \usebibmacro{date}%
+    \newunit
+  }{%
+    \printlist{organization}%
+    \newunit
+    \usebibmacro{publisher+location+date}}}
+
+%    \end{macrocode}
+%
+% We use the \texttt{library} field for databases and preprint repositories,
+% as well as streaming services and physical archives for the visual arts.
+%
+%    \begin{macrocode}
+\DeclareFieldFormat{library}{\mkbibemph{#1}}
+\DeclareFieldFormat[image]{library}{#1}
+\newbibmacro*{library}{%
+  \iffieldundef{library}{}{%
+    \printfield{library}\clearfield{library}%
+    \setunit*{\addspace}%
+    \usebibmacro{isonline}}}
+\newbibmacro*{location+library}{%
+  \iffieldundef{library}{%
+    \iffieldundef{institution}{}{%
+      \printlist{institution}%
+      \setunit{\addcomma\space}%
+      \printlist{location}%
+    }%
+  }{%
+    \printfield{library}\clearfield{library}%
+    \setunit*{\addcomma\space}%
+    \printlist{location}}}
+
+
+%    \end{macrocode}
+%
+% The following macro includes availability from a physical archive.
+%
+%    \begin{macrocode}
+\newbibmacro*{organization+location+date+library}{%
+  \ifboolexpr{
+    test {\iffieldundef{library}}
+    or
+    not test {\iflistundef{publisher}}
+  }{%
+    \printlist{location}\clearfield{location}%
+    \setunit*{\addcolon\space}%
+  }{}%
+  \iflistundef{publisher}{%
+    \iflistundef{organization}{
+      \printlist{location}%
+    }{%
+      \printlist{organization}}
+  }{%
+    \printlist{publisher}%
+  }%
+  \setunit{\addcomma\space}%
+  \usebibmacro{date}%
   \newunit
-  \printlist{language}%
-  \newunit\newblock
-  \usebibmacro{byauthor}%
-  \newunit\newblock
-  \usebibmacro{series+type+number}%
-  \newunit\newblock
+  \usebibmacro{location+library}}
+
+%    \end{macrocode}
+%
+% Here is the |isunpublished| macro used by the |unpublished| driver. It can be
+% renewed if displaying the string needs to be suppressed or made conditional.
+%
+%    \begin{macrocode}
+\newbibmacro*{isunpublished}{%
+  \bibstring{unpublished}}
+
+%    \end{macrocode}
+%
+% \subsection{Pinpointing}
+%
+% We remove the space between \enquote{p.\@} and the page numbers, and allow
+% a couple of letters for representing newspaper columns.
+%
+%    \begin{macrocode}
+\renewcommand*{\ppspace}{}
+\DeclareNumChars{ab}
+
+\newbibmacro*{chapter+pages}{%
+  \printfield{chapter}%
+  \setunit{\bibpagespunct}%
+  \printfield{eid}%
+  \setunit{\bibpagespunct}%
+  \printfield{pages}%
+  \newunit}
+
+\newbibmacro*{note+pages}{%
   \printfield{note}%
+  \setunit{\bibpagespunct}%
+  \printfield{pages}%
+  \newunit}
+
+%    \end{macrocode}
+%
+% \subsection{Addenda}
+%
+%    \begin{macrocode}
+\newbibmacro*{addendum+pubstate}{%
+  \printfield{addendum}%
   \newunit\newblock
-  \usebibmacro{institution+location+date}%
-  \newunit\newblock
-  \usebibmacro{chapter+pages}%
-  \newunit
-  \printfield{pagetotal}%
-  \newunit\newblock
-  \iftoggle{bbx:isbn}
-    {\printfield{isrn}}
-    {}%
-  \newunit\newblock
-  \usebibmacro{library}%
-  \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}}
+  \printfield{pubstate}}
 
 %    \end{macrocode}
 %
-% \subsection{Manuals}
+% \subsection{Access and URLs}
 %
-% The \texttt{manual} driver is useful for a variety of technical publications,
-% such as standards, patents and maps. (Patents have their own driver, in fact,
-% but we set things up so the \texttt{manual} driver can be used instead if
-% needed for compatibility.)
+% URLs are prefaced by a `from' statement, and the URL date is enclosed in
+% brackets rather than parentheses.
 %
 %    \begin{macrocode}
-\newbibmacro{manual:series+type+number}{%
-  \iffieldundef{series}{%
-    \newunit\newblock
-    \printfield{type}%
-    \setunit{\addspace}%
-    \printfield{number}%
+\DeclareFieldFormat{url}{\bibsentence\bibstring{urlfrom}\addcolon\space\url{#1}}
+\DeclareFieldFormat{doi}{\bibsentence\bibstring{urlfrom}\addcolon\space\url{https://doi.org/#1}}
+\DeclareFieldFormat{pseudourl}{\bibsentence\bibstring{urlfrom}\addcolon\space#1}
+\DeclareFieldFormat{urldate}{\mkbibbrackets{\bibstring{urlseen}\space#1}}
+
+%    \end{macrocode}
+%
+% Since URLs and DOIs are presented in exactly the same way, we combine them
+% such that the DOI overrides the URL. We also allow the \texttt{library} field
+% to be used as a fallback URL.
+%
+%    \begin{macrocode}
+\renewbibmacro*{url}{%
+  \iffieldundef{doi}{%
+    \ifboolexpr{
+      test {\iffieldundef{url}}
+      and not
+      test {\iffieldundef{urlyear}}
+    }{\printfield[pseudourl]{library}}{\printfield{url}}%
   }{%
-    \setunit{\addcomma\space}%
-    \usebibmacro{series+number}%
-    \newunit\newblock
-    \printfield{type}%
-  }%
-}
-\xpatchbibdriver{manual}{%
+    \printfield{doi}%
+  }}
+\newbibmacro*{doi+eprint+url}{%
+  \iftoggle{bbx:eprint}
+    {\usebibmacro{eprint}}
+    {}%
   \newunit\newblock
-  \usebibmacro{series+number}%
-  \newunit\newblock
-  \printfield{type}%
-}{%
-  \usebibmacro{manual:series+type+number}%
-}{}{\wlog{WARNING: biblatex-bath failed to patch manual driver}}
-\xpatchbibdriver{manual}{%
-  \printlist{organization}%
-  \newunit
-  \usebibmacro{publisher+location+date}%
-}{%
-  \usebibmacro{organization+location+date}%
-}{}{\wlog{WARNING: biblatex-bath failed to patch manual driver}}
+  \iftoggle{bbx:url}
+    {\usebibmacro{url+urldate}}
+    {}}
 
 %    \end{macrocode}
 %
@@ -4148,57 +5462,6 @@
 
 %    \end{macrocode}
 %
-% \subsection{Audiovisual materials}
-%
-% The \texttt{audio} and \texttt{video} drivers are based on \texttt{misc}.
-%
-%    \begin{macrocode}
-\DeclareBibliographyDriver{audio}{%
-  \usebibmacro{bibindex}%
-  \usebibmacro{begentry}%
-  \usebibmacro{author/editor+others/translator+others}%
-  \setunit{\printdelim{nametitledelim}}\newblock
-  \usebibmacro{title}%
-  \newunit\newblock
-  \usebibmacro{series+number}%
-  \ifboolexpr{
-    test {\iffieldequalstr{type}{TV}}
-    or
-    test {\iffieldequalstr{type}{Radio}}
-  }{%
-    \setunit{\addspace}%
-    \usebibmacro{isonline}}{}%
-  \newunit
-  \printlist{language}%
-  \newunit\newblock
-  \printfield{type}%
-  \newunit\newblock
-  \usebibmacro{byauthor}[given-family:full]%
-  \newunit\newblock
-  \usebibmacro{byeditor+others}[given-family:full]%
-  \newunit\newblock
-  \printfield{howpublished}%
-  \newunit\newblock
-  \printfield{note}%
-  \newunit\newblock
-  \usebibmacro{publisher+location+date}%
-  \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}}
-\DeclareBibliographyAlias{movie}{audio}
-\DeclareBibliographyAlias{music}{audio}
-\DeclareBibliographyAlias{video}{audio}
-%    \end{macrocode}
-%
 % \subsection{Case reports}
 %
 % We provide a test to see if a work was published in the Official Journal of
@@ -4382,48 +5645,6 @@
 %    \begin{macrocode}
 \DeclareFieldFormat[jurisdiction]{institution}{\mkbibparens{#1}}
 
-\DeclareBibliographyDriver{jurisdiction}{%
-  \savebibmacro{title}%
-  \xapptobibmacro{labeltitle}{%
-    \setunit*{\addspace}%
-    \usebibmacro{casenumber}%
-  }{}{}%
-  \usebibmacro{bibindex}%
-  \usebibmacro{begentry}%
-  \usebibmacro{eucheck}%
-  \usebibmacro{author}%
-  \setunit{\printdelim{nametitledelim}}\newblock
-  \usebibmacro{title}%
-  \newunit
-  \printlist{language}%
-  \newunit\newblock
-  \usebibmacro{byauthor}%
-  \newunit\newblock
-  \printfield{note}%
-  \setunit{\addspace}%
-  \usebibmacro{reporter}%
-  \newunit
-  \printfield{pagetotal}%
-  \newunit\newblock
-  \printfield{institution}%
-  \newunit\newblock
-  \iftoggle{bbx:isbn}
-    {\printfield{isrn}}
-    {}%
-  \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}%
-  \restorebibmacro{title}}
-
 %    \end{macrocode}
 %
 % \subsection{Legislation}
@@ -4476,275 +5697,135 @@
           \setunit*{\addcomma\space}%
           \printfield{chapter}}}}}}
 
-\DeclareBibliographyDriver{legislation}{%
-  \usebibmacro{bibindex}%
-  \usebibmacro{begentry}%
-  \usebibmacro{eucheck}%
-  \usebibmacro{author}%
-  \setunit{\printdelim{nametitledelim}}\newblock
-  \usebibmacro{title}%
-  \newunit
-  \printlist{language}%
-  \newunit\newblock
-  \usebibmacro{byauthor}%
-  \newunit\newblock
-  \usebibmacro{journal+series+volume+number+chapter+pages}
-  \newunit\newblock
-  \printfield{note}%
-  \newunit\newblock
-  \usebibmacro{institution+location+date}%
-  \newunit\newblock
-  \printfield{pagetotal}%
-  \newunit\newblock
-  \iftoggle{bbx:isbn}
-    {\printfield{isrn}}
-    {}%
-  \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}}
-
 %    \end{macrocode}
 %
-% \subsection{Letters}
+% \subsection{Related items}
 %
-% This driver is used for emails. It is based loosely on the one for articles.
-% The particular foible with this type is that the date must be printed complete
-% at the start.
+% This is intended to be unchanged from the standard (author--year) definition.
 %
 %    \begin{macrocode}
-\DeclareFieldFormat[letter]{title}{\iffieldundef{journaltitle}{\emph{#1}}{#1}}
-\ExecuteBibliographyOptions[letter]{mergedate=maximum}
-\DeclareBibliographyDriver{letter}{%
-  \usebibmacro{bibindex}%
-  \usebibmacro{begentry}%
-  \usebibmacro{author/translator+others}%
-  \setunit{\printdelim{nametitledelim}}\newblock
-  \usebibmacro{title}%
-  \newunit
-  \printlist{language}%
-  \newunit\newblock
-  \usebibmacro{byauthor}%
-  \newunit\newblock
-  \usebibmacro{bytranslator+others}%
-  \newunit\newblock
-  \usebibmacro{journal+issuetitle}%
-  \newunit\newblock
-  \printfield{howpublished}%
-  \newunit
-  \printfield{note}%
-  \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}%
-}
+\newcounter{bbx:relatedcount}
+\newcounter{bbx:relatedtotal}
 
-%    \end{macrocode}
-%
-% \subsection{Software}
-%
-% The driver for software entries is based on misc. The main difference is in
-% how the type is printed.
-%
-%    \begin{macrocode}
-\DeclareFieldFormat[software]{type}{\mkbibbrackets{#1}}
-\DeclareBibliographyDriver{software}{%
-  \usebibmacro{bibindex}%
-  \usebibmacro{begentry}%
-  \usebibmacro{author/editor+others/translator+others}%
-  \setunit{\printdelim{nametitledelim}}\newblock
-  \usebibmacro{title}%
-  \setunit{\addspace}
-  \printfield{type}%
-  \newunit
-  \printlist{language}%
-  \newunit\newblock
-  \usebibmacro{byauthor}%
-  \newunit\newblock
-  \usebibmacro{byeditor+others}%
-  \newunit\newblock
-  \printfield{howpublished}%
-  \newunit\newblock
-  \printfield{note}%
-  \newunit\newblock
-  \usebibmacro{organization+location+date}%
-  \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}}
+\newbibmacro*{related:init}{%
+  \csundef{bbx:relatedloop}}
 
-%    \end{macrocode}
-%
-% \subsection{Images}
-%
-% The driver for image is based on misc. The main difference is the
-% support for the \texttt{library} field.
-%
-%    \begin{macrocode}
-\DeclareFieldFormat[image]{library}{#1}
-\DeclareBibliographyDriver{image}{%
-  \usebibmacro{bibindex}%
-  \usebibmacro{begentry}%
-  \usebibmacro{author/editor+others/translator+others}%
-  \setunit{\printdelim{nametitledelim}}\newblock
-  \usebibmacro{title}%
-  \newunit
-  \printlist{language}%
-  \newunit\newblock
-  \usebibmacro{byauthor}%
-  \newunit\newblock
-  \usebibmacro{byeditor+others}%
-  \newunit\newblock
-  \printfield{howpublished}%
-  \newunit\newblock
-  \printfield{type}%
-  \newunit
-  \printfield{note}%
-  \newunit\newblock
-  \usebibmacro{organization+location+date+library}%
-  \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}}
-%    \end{macrocode}
-%
-% The following code works slightly differently
-%
-%    \begin{macrocode}
-\newbibmacro*{organization+location+date+library}{%
-  \ifboolexpr{
-    test {\iffieldundef{library}}
-    or
-    not test {\iflistundef{publisher}}
-  }{%
-    \printlist{location}%
-    \setunit*{\addcolon\space}%
-    \clearfield{location}%
-  }{}%
-  \iflistundef{publisher}{%
-    \printlist{organization}%
-  }{%
-    \printlist{publisher}%
-  }%
-  \setunit{\addcomma\space}%
-  \usebibmacro{date}%
-  \newunit
-  \iffieldundef{library}{%
-    \iffieldundef{institution}{}{%
-      \bibsentence
-      \bibstring{at}%
-      \setunit{\addcolon\space}%
-      \printlist{location}%
-      \setunit*{\addperiod\space}%
-      \printfield{institution}%
-    }%
-  }{%
-    \bibsentence
-    \bibstring{at}%
-    \setunit{\addcolon\space}%
-    \printlist{location}%
-    \setunit*{\addperiod\space}%
-    \printfield{library}\clearfield{library}%
-  }%
-}
+\newbibmacro*{begrelated}{%
+  \booltrue{bbx at inset}}
 
-%    \end{macrocode}
-%
-% \subsection{Unpublished}
-%
-% This driver is used for miscellaneous unpublished written material. It differs
-% from the standard version by supporting |maintitle| and |booktitle|, and
-% including a label at the end. The unpublished label is delegated to a macro
-% in case future versions of the style place conditions on whether it is displayed.
-%
-%    \begin{macrocode}
-\newbibmacro*{isunpublished}{%
-  \bibstring{unpublished}%
-}
-\DeclareBibliographyDriver{unpublished}{%
-  \usebibmacro{bibindex}%
-  \usebibmacro{begentry}%
-  \usebibmacro{author}%
-  \setunit{\printdelim{nametitledelim}}\newblock
-  \usebibmacro{title}%
-  \newunit
-  \printlist{language}%
-  \newunit\newblock
-  \usebibmacro{byauthor}%
-  \newunit\newblock
-  \ifnameundef{editor}{}{\usebibmacro{in:}}%
-  \usebibmacro{bookeditor}%
-  \newunit\newblock
-  \usebibmacro{maintitle+booktitle}%
-  \usebibmacro{byeditor+others}%
-  \newunit\newblock
-  \printfield{howpublished}%
-  \newunit\newblock
-  \printfield{type}%
-  \newunit\newblock
-  \usebibmacro{event+venue+date}%
-  \newunit\newblock
-  \printfield{note}%
-  \newunit\newblock
-  \usebibmacro{location+date}%
-  \newunit\newblock
-  \usebibmacro{isunpublished}%
-  \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}}
+\newbibmacro*{endrelated}{%
+  \usebibmacro*{bbx:savehash}}
 
+\newbibmacro*{begrelatedloop}{}
+\newbibmacro*{endrelatedloop}{}
+
+\def\ifrelatedloop{%
+  \ifboolexpr{ test {\xifinlistcs{\strfield{entrykey}}{bbx:relatedloop}}
+    or test {\xifinlistcs{\strfield{clonesourcekey}}{bbx:relatedloop}} }}
+
+\newbibmacro*{related}{%
+  \ifboolexpr{ test {\iffieldundef{related}} or test {\ifrelatedloop} }
+    {}
+    {\ifcsundef{begrelateddelim\strfield{relatedtype}}
+        {\printunit{\begrelateddelim}}
+        {\printunit{\csuse{begrelateddelim\strfield{relatedtype}}}}%
+      \usebibmacro{begrelated}%
+      \def\bbx at tempa{}%
+      \setcounter{bbx:relatedtotal}{0}%
+      \def\do##1{%
+        \entrydata{##1}{%
+          \ifrelatedloop
+            {}
+            {\stepcounter{bbx:relatedtotal}%
+            \gappto{\bbx at tempa}{##1,}}}}%
+      \docsvfield{related}%
+      \restorefield{related}{\bbx at tempa}%
+      \ifnumgreater{\value{bbx:relatedtotal}}{0}
+        {\listcsxadd{bbx:relatedloop}{\strfield{entrykey}}%
+        \iffieldundef{clonesourcekey}
+          {}
+          {\listcsxadd{bbx:relatedloop}{\strfield{clonesourcekey}}}%
+        \setcounter{bbx:relatedcount}{0}%
+        \def\do{%
+          \stepcounter{bbx:relatedcount}%
+          \ifnumgreater{\value{bbx:relatedcount}}{1}
+            {\ifcsundef{relateddelim\strfield{relatedtype}}
+              {\printunit{\relateddelim}}
+              {\expandafter\expandafter\expandafter\expandafter\expandafter
+                \expandafter\expandafter\printunit
+                \expandafter\expandafter\expandafter\expandafter\expandafter
+                \expandafter\expandafter{%
+                  \csuse{relateddelim\strfield{relatedtype}}}}}
+            {}}%
+        \ifbibmacroundef{related:\strfield{relatedtype}}
+          {\appto{\do}{\usebibmacro{related:default}}}
+          {\appto{\do}{\usebibmacro*{related:\strfield{relatedtype}}}}%
+        \iffieldformatundef{related:\strfield{relatedtype}}
+          {\def\bbx at tempa{related}}
+          {\def\bbx at tempa{related:\strfield{relatedtype}}}%
+        \iffieldformatundef{relatedstring:\strfield{relatedtype}}
+          {\def\bbx at tempb{relatedstring:default}}
+          {\def\bbx at tempb{relatedstring:\strfield{relatedtype}}}%
+        \printtext[\bbx at tempa]{%
+          \usebibmacro{begrelatedloop}%
+          \iffieldundef{relatedstring}
+            {\ifboolexpr{
+                test {\ifnumgreater{\value{bbx:relatedtotal}}{1}}
+                and
+                test {\ifbibxstring{\thefield{relatedtype}s}}
+              }
+                {\printtext[\bbx at tempb]{%
+                  \bibstring[\mkrelatedstringtext]{\thefield{relatedtype}s}}}
+                {\iffieldbibstring{relatedtype}
+                  {\printtext[\bbx at tempb]{%
+                      \bibstring[\mkrelatedstringtext]{\thefield{relatedtype}}}}
+                  {}}}
+            {\iffieldbibstring{relatedstring}
+                {\printtext[\bbx at tempb]{%
+                  \bibstring[\mkrelatedstringtext]{\thefield{relatedstring}}}}
+                {\printfield[\bbx at tempb]{relatedstring}}}%
+          \docsvfield{related}%
+          \usebibmacro{endrelatedloop}}}%
+        {}%
+      \usebibmacro{endrelated}}}
+
 %    \end{macrocode}
 %
-% \subsection{Aliases}
+% \subsection{Bibliography formatting}
 %
-% We define some handy semantic aliases.
+% We allow the bibliography look more like the Bib\TeX\ default.
 %
 %    \begin{macrocode}
-\DeclareBibliographyAlias{standard}{manual}
+\DeclareFieldFormat{shorthandwidth}{#1}
+\setlength{\bibhang}{0pt}
+\setlength{\bibitemsep}{1em plus 0.2em minus 0.2em}
+\renewcommand*{\bibfont}{\normalfont\normalsize}
 
+\defbibenvironment{bibliography}
+  {\list
+     {}
+     {\setlength{\leftmargin}{\bibhang}%
+      \setlength{\itemindent}{-\leftmargin}%
+      \setlength{\itemsep}{\bibitemsep}%
+      \setlength{\parsep}{\bibparsep}}}
+  {\endlist}
+  {\item}
+
+\defbibenvironment{shorthand}
+  {\list
+     {\printfield[shorthandwidth]{shorthand}}
+     {\setlength{\labelwidth}{\shorthandwidth}%
+      \setlength{\leftmargin}{\labelwidth}%
+      \setlength{\labelsep}{\biblabelsep}%
+      \addtolength{\leftmargin}{\labelsep}%
+      \setlength{\itemsep}{\bibitemsep}%
+      \setlength{\parsep}{\bibparsep}%
+      \renewcommand*{\makelabel}[1]{##1\hss}}}
+  {\endlist}
+  {\item}
+
+\InitializeBibliographyStyle{\global\undef\bbx at lasthash}
+
 %    \end{macrocode}
 %
 % \subsection{Sorting}
@@ -4773,9 +5854,20 @@
 %
 % \setcounter{lstnumber}{20}
 %
+% We add support for a CJK component of names.
+%
 %    \begin{macrocode}
 \DeclareDatamodelConstant[type=list]{nameparts}{prefix,family,suffix,given,cjk}
 %    \end{macrocode}
+%
+% We add some fields for compatibility with \textsf{biblatex-manuscripts-philology}
+% and \textsf{biblatex-oxref}.
+%
+%    \begin{macrocode}
+\DeclareDatamodelFields[type=field,datatype=literal]{collection,shelfmark}
+\DeclareDatamodelEntryfields[booklet,image,map,unpublished]{collection,shelfmark}
+%    \end{macrocode}
+%
 % \iffalse
 %</dbx>
 %<*lbx>
@@ -4928,8 +6020,8 @@
 \xpatchbibmacro{cite:label}{%
   \printtext[bibhyperref]{\printfield[citetitle]{labeltitle}}%
 }{%
+  \toggletrue{bbx:labelistitle}%
   \printtext[bibhyperref]{\printfield[citetitle]{labeltitle}}%
-  \toggletrue{bbx:labelistitle}%
 }{}{\wlog{WARNING: biblatex-bath failed to patch cite:label}}
 %    \end{macrocode}
 % \iffalse

Modified: trunk/Master/texmf-dist/tex/latex/biblatex-bath/bath.bbx
===================================================================
--- trunk/Master/texmf-dist/tex/latex/biblatex-bath/bath.bbx	2022-05-25 20:19:05 UTC (rev 63400)
+++ trunk/Master/texmf-dist/tex/latex/biblatex-bath/bath.bbx	2022-05-25 20:19:25 UTC (rev 63401)
@@ -13,13 +13,12 @@
 %% See:     http://www.latex-project.org/lppl.txt
 %% ----------------------------------------------------------------
 %% 
-\def\Version{2022/03/04 v5.0}
+\def\Version{2022/05/25 v6.0}
 \NeedsTeXFormat{LaTeX2e}[1999/12/01]
 \ProvidesFile{bath.bbx}
     [\Version\space Biblography style as recommended by the University of Bath Library]
-\RequirePackage{xpatch}
+\RequirePackage{etoolbox,xpatch}
 \RequirePackage{xstring}
-\RequirePackage{etoolbox}
 \ifcsdef{DeclareLanguageMappingSuffix}{%
   \DeclareLanguageMappingSuffix{-bath}
 }{%
@@ -26,13 +25,6 @@
   \DeclareLanguageMapping{english}{english-bath}
   \DeclareLanguageMapping{british}{british-bath}
 }
-
-\RequireBibliographyStyle{authoryear}
-\ExecuteBibliographyOptions{%
-  maxcitenames=3,maxbibnames=9999,isbn=false,giveninits=true,dashed=false,
-  alldates=comp,labeldate=year,labelalpha=true}
-\ExecuteBibliographyOptions[reference,audio,video,music,movie]{%
-  useeditor=false}
 \NewBibliographyString{%
   online, hours, at, unpublished, legalchapter,
   director, performer, reader, conductor,
@@ -39,9 +31,7 @@
   directors, performers, readers, conductors,
   bydirector, byperformer, byreader, byconductor,
 }
-\setlength{\bibhang}{0pt}
-\setlength{\bibitemsep}{1em plus 0.2em minus 0.2em}
-\renewcommand*{\bibfont}{\normalfont\normalsize}
+
 \ifcsdef{letbibmacro}{}{%
   \def\letbibmacro#1#2{%
     \ifcsundef{abx at macro@#2}
@@ -59,6 +49,18 @@
       (test {\iffieldequalstr{labeldatesource}{}}
       or test {\iffieldequalstr{labeldatesource}{year}})}}%
 }
+\ifcsdef{DeclareBiblatexOption}{}{%
+  \def\DeclareBiblatexOption at II#1[#2]#3[#4]#5{
+    \IfSubStr#1{global}{\DeclareBibliographyOption[#2]{#3}[#4]{#5}}{}%
+    \IfSubStr#1{type}{\DeclareTypeOption[#2]{#3}[#4]{#5}}{}%
+    \IfSubStr#1{entry}{\DeclareEntryOption[#2]{#3}[#4]{#5}}{}}%
+  \def\DeclareBiblatexOption at I#1[#2]#3#4{\@ifnextchar[%
+    {\DeclareBiblatexOption at II#1[#2]#3#4}%
+    {\DeclareBiblatexOption at II#1[#2]#3[]#4}}%
+  \def\DeclareBiblatexOption#1#2{\@ifnextchar[%
+    {\DeclareBiblatexOption at I#1#2}%
+    {\DeclareBiblatexOption at I#1[]#2}}%
+}
 \def\blx at setsfcodes{%
   \let\blx at setsfcodes\relax
   \let\frenchspacing\blx at setfrcodes
@@ -76,10 +78,1173 @@
   \sfcode`\<=\@m
   \sfcode`\>=\@m}
 
-\DeclareNameAlias{author}{family-given}
-\DeclareNameAlias{editor}{family-given}
-\DeclareNameAlias{bookeditor}{given-family}
-\renewcommand*{\bibinitdelim}{}
+\newtoggle{bbx:isbn}
+\newtoggle{bbx:url}
+\newtoggle{bbx:doi}
+\newtoggle{bbx:eprint}
+\newtoggle{bbx:related}
+
+\DeclareBiblatexOption{global,type,entry}[boolean]{isbn}[true]{%
+  \settoggle{bbx:isbn}{#1}}
+\DeclareBiblatexOption{global,type,entry}[boolean]{url}[true]{%
+  \settoggle{bbx:url}{#1}}
+\DeclareBiblatexOption{global,type,entry}[boolean]{doi}[true]{%
+  \settoggle{bbx:doi}{#1}}
+\DeclareBiblatexOption{global,type,entry}[boolean]{eprint}[true]{%
+  \settoggle{bbx:eprint}{#1}}
+\DeclareBiblatexOption{global,type,entry}[boolean]{related}[true]{%
+  \settoggle{bbx:related}{#1}}
+
+\newbibmacro*{bbx:savehash}{%
+  \savefield{fullhash}{\bbx at lasthash}}
+
+\DeclareBibliographyOption[boolean]{dashed}[true]{%
+  \ifstrequal{#1}{true}
+    {\ExecuteBibliographyOptions{pagetracker}%
+     \renewbibmacro*{bbx:savehash}{\savefield{fullhash}{\bbx at lasthash}}}
+    {\renewbibmacro*{bbx:savehash}{}}}
+
+\newtoggle{bbx:nonodate}
+\DeclareBiblatexOption{global,type,entry}[boolean]{nonodate}[true]{%
+  \settoggle{bbx:nonodate}{#1}}
+
+\providebibmacro*{date+extradate}{}
+\newbibmacro*{issue+date}{%
+  \printtext[parens]{%
+    \printfield{issue}%
+    \setunit*{\addspace}%
+    \usebibmacro{date}}%
+  \newunit}
+
+\newbibmacro*{bbx:ifmergeddate}{\@secondoftwo}
+\renewbibmacro*{date}{%
+  \usebibmacro{bbx:ifmergeddate}{}{%
+    \printdate
+    \setunit*{\bibdatetimesep}%
+  }%
+  \printtime}%
+
+\def\bbx at opt@mergedate at maximum{%
+  \renewbibmacro*{date+extradate}{%
+    \iffieldundef{labelyear}
+      {}
+      {\printtext[datelabel]{%
+         \iflabeldateisdate
+           {\printfield{issue}%
+            \setunit*{\addspace}%
+            \printdateextra}
+           {\printlabeldateextra}}}}%
+  \renewbibmacro*{bbx:ifmergeddate}{\iflabeldateisdate}%
+  \renewbibmacro*{issue+date}{%
+    \usebibmacro{bbx:ifmergeddate}
+      {}
+      {\printtext[parens]{%
+         \printfield{issue}%
+         \setunit*{\addspace}%
+         \printdate}}}}
+
+\def\bbx at opt@mergedate at compact{%
+  \renewbibmacro*{date+extradate}{%
+    \ifboolexpr{
+      togl {bbx:nonodate}
+      and not test {\iflabeldateisdate}}
+      {}
+      {\printtext[datelabel]{%
+         \iflabeldateisdate
+           {\printdateextra}
+           {\printlabeldateextra}}}}%
+  \renewbibmacro*{bbx:ifmergeddate}{\iflabeldateisdate}%
+  \renewbibmacro*{issue+date}{%
+    \ifboolexpr{test {\usebibmacro{bbx:ifmergeddate}}
+                and
+                test {\iffieldundef{issue}}}
+      {}
+      {\printtext[parens]{%
+         \printfield{issue}%
+         \setunit*{\addspace}%
+         \usebibmacro{bbx:ifmergeddate}
+           {}
+           {\printdate}}}%
+    \newunit}}
+
+\def\bbx at opt@mergedate at basic{%
+  \renewbibmacro*{date+extradate}{%
+    \ifboolexpr{
+      togl {bbx:nonodate}
+      and not test {\iflabeldateisdate}}
+      {}
+      {\printtext[datelabel]{\printlabeldateextra}}}%
+  \renewbibmacro*{bbx:ifmergeddate}{%
+    \ifboolexpr{
+      test {\iflabeldateisdate}
+      and
+      not test {\ifdateshavedifferentprecision{label}{}}
+    }%
+  }%
+  \renewbibmacro*{issue+date}{%
+    \ifboolexpr{
+      test {\usebibmacro{bbx:ifmergeddate}}
+      and
+      test {\iffieldundef{issue}}
+    }
+      {}
+      {\printtext[parens]{%
+         \printfield{issue}%
+         \setunit*{\addspace}%
+         \printdate}}%
+    \newunit}}
+
+\def\bbx at opt@mergedate at minimum{%
+  \renewbibmacro*{date+extradate}{%
+    \ifboolexpr{
+      togl {bbx:nonodate}
+      and not test {\iflabeldateisdate}}
+      {}
+      {\printtext[datelabel]{\printlabeldateextra}}}%
+  \renewbibmacro*{bbx:ifmergeddate}{%
+    \ifboolexpr{
+      test {\iflabeldateisdate}
+      and
+      not test {\ifdateshavedifferentprecision{label}{}}
+      and
+      test {\iffieldundef{extradate}}
+    }%
+  }%
+  \renewbibmacro*{issue+date}{%
+    \ifboolexpr{
+      test {\usebibmacro{bbx:ifmergeddate}}
+      and
+      test {\iffieldundef{issue}}
+    }
+      {}
+      {\printtext[parens]{%
+         \printfield{issue}%
+         \setunit*{\addspace}%
+         \printdate}}%
+    \newunit}}
+
+\def\bbx at opt@mergedate at false{%
+  \renewbibmacro*{date+extradate}{%
+    \iffieldundef{labelyear}
+      {}
+      {\printtext[parens]{\printlabeldateextra}}}%
+  \renewbibmacro*{bbx:ifmergeddate}{\@secondoftwo}%
+  \renewbibmacro*{issue+date}{%
+    \printtext[parens]{%
+      \printfield{issue}%
+      \setunit*{\addspace}%
+      \usebibmacro{date}}%
+    \newunit}}
+
+\def\bbx at opt@mergedate at year{%
+  \renewbibmacro*{date+extradate}{%
+    \iffieldundef{labelyear}{}{%
+      \ifboolexpr{
+        togl {bbx:nonodate}
+        and
+        not test {\iflabeldateisdate}
+      }{}{%
+        \printtext[datelabel]{\printlabeldateextra}%
+      }%
+      \iflabeldateisdate{%
+        \clearfield{year}%
+      }{}}}
+  \ifcsundef{abx at macro@date+extrayear}{}{%
+    \renewbibmacro*{date+extrayear}{\usebibmacro{date+extradate}}%
+  }
+  \renewbibmacro*{issue+date}{%
+    \iffieldundef{issue}{}{%
+      \ifboolexpr{(
+        test {\iffieldundef{volume}}
+        and
+        test {\iffieldundef{number}}
+        ) and
+        test {\iffieldundef{eid}}
+      }{%
+        \newunit
+        \printfield{issue}%
+      }{%
+        \printtext[parens]{%
+          \printfield{issue}%
+        }%
+      }
+    }%
+    \setunit{\addcomma\space}%
+    \printdate
+    \newunit
+  }%
+}%
+
+\def\bbx at opt@mergedate at true{\bbx at opt@mergedate at year}
+
+\DeclareBiblatexOption{global,type,entry}[boolean]{mergedate}[true]{%
+  \ifcsdef{bbx at opt@mergedate@#1}
+    {\csuse{bbx at opt@mergedate@#1}}
+    {\PackageError{biblatex}
+       {Invalid option 'mergedate=#1'}
+       {Valid values are 'maximum', 'compact', 'basic', 'minimum',\MessageBreak
+        'year', 'true' (=year), and 'false'.}}}
+
+\ExecuteBibliographyOptions{isbn,url,doi,eprint,related}
+\ExecuteBibliographyOptions{labeldateparts,sorting=nyt,pagetracker,mergedate}
+\ExecuteBibliographyOptions{%
+  maxcitenames=3,maxbibnames=9999,isbn=false,giveninits=true,dashed=false,
+  alldates=comp,labeldate=year,labelalpha=true}
+\ExecuteBibliographyOptions[online]{url=true}
+\ExecuteBibliographyOptions[reference,audio,video,music,movie]{%
+  useeditor=false}
+\ExecuteBibliographyOptions[letter]{mergedate=maximum}
+
+\newbibmacro*{begentry}{}
+\newbibmacro*{finentry}{\finentry}
+
+\DeclareBibliographyDriver{article}{%
+  \usebibmacro{bibindex}%
+  \usebibmacro{begentry}%
+  \usebibmacro{author/translator+others}%
+  \setunit{\printdelim{nametitledelim}}\newblock
+  \usebibmacro{title}%
+  \newunit\newblock
+  \usebibmacro{byauthor}%
+  \newunit\newblock
+  \usebibmacro{bytranslator+others}%
+  \newunit\newblock
+  \usebibmacro{journal+issuetitle}%
+  \newunit
+  \usebibmacro{byeditor+others}%
+  \newunit
+  \usebibmacro{note+pages}%
+  \newunit\newblock
+  \iftoggle{bbx:isbn}
+    {\printfield{issn}}
+    {}%
+  \newunit\newblock
+  \usebibmacro{doi+eprint+url}%
+  \newunit\newblock
+  \printfield{addendum}%
+  \setunit{\bibpagerefpunct}\newblock
+  \usebibmacro{pageref}%
+  \newunit\newblock
+  \iftoggle{bbx:related}
+    {\usebibmacro{related:init}%
+     \usebibmacro{related}}
+    {}%
+  \usebibmacro{finentry}}
+
+\DeclareBibliographyDriver{periodical}{%
+  \usebibmacro{bibindex}%
+  \usebibmacro{begentry}%
+  \usebibmacro{editor}%
+  \setunit{\printdelim{nametitledelim}}\newblock
+  \usebibmacro{title+issuetitle}%
+  \newunit\newblock
+  \usebibmacro{byeditor}%
+  \newunit\newblock
+  \printfield{note}%
+  \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{\printdelim{nametitledelim}}\newblock
+  \usebibmacro{maintitle+title}%
+  \newunit\newblock
+  \usebibmacro{byauthor}%
+  \newunit\newblock
+  \usebibmacro{byeditor+others}%
+  \newunit\newblock
+  \printfield{edition}%
+  \newunit
+  \iffieldundef{maintitle}
+    {\printfield{volume}%
+     \printfield{part}}
+    {}%
+  \newunit
+  \printfield{volumes}%
+  \setunit{\addcomma\space}%
+  \usebibmacro{series+number}%
+  \newunit\newblock
+  \printfield{note}%
+  \newunit\newblock
+  \usebibmacro{publisher+location+date}%
+  \newunit\newblock
+  \usebibmacro{chapter+pages}%
+  \newunit\newblock
+  \iftoggle{bbx:isbn}
+    {\printfield{isbn}}
+    {}%
+  \newunit\newblock
+  \usebibmacro{doi+eprint+url}%
+  \newunit\newblock
+  \usebibmacro{addendum+pubstate}%
+  \setunit{\bibpagerefpunct}\newblock
+  \usebibmacro{pageref}%
+  \newunit\newblock
+  \iftoggle{bbx:related}
+    {\usebibmacro{related:init}%
+     \usebibmacro{related}}
+    {}%
+  \usebibmacro{finentry}}
+
+\DeclareBibliographyDriver{collection}{%
+  \usebibmacro{bibindex}%
+  \usebibmacro{begentry}%
+  \usebibmacro{editor+others}%
+  \setunit{\printdelim{nametitledelim}}\newblock
+  \usebibmacro{maintitle+title}%
+  \newunit\newblock
+  \usebibmacro{byeditor+others}%
+  \newunit\newblock
+  \printfield{edition}%
+  \newunit
+  \iffieldundef{maintitle}
+    {\printfield{volume}%
+     \printfield{part}}
+    {}%
+  \newunit
+  \printfield{volumes}%
+  \setunit{\addcomma\space}%
+  \usebibmacro{series+number}%
+  \newunit\newblock
+  \printfield{note}%
+  \newunit\newblock
+  \usebibmacro{publisher+location+date}%
+  \newunit\newblock
+  \usebibmacro{chapter+pages}%
+  \newunit\newblock
+  \iftoggle{bbx:isbn}
+    {\printfield{isbn}}
+    {}%
+  \newunit\newblock
+  \usebibmacro{doi+eprint+url}%
+  \newunit\newblock
+  \usebibmacro{addendum+pubstate}%
+  \setunit{\bibpagerefpunct}\newblock
+  \usebibmacro{pageref}%
+  \newunit\newblock
+  \iftoggle{bbx:related}
+    {\usebibmacro{related:init}%
+     \usebibmacro{related}}
+    {}%
+  \usebibmacro{finentry}}
+
+\DeclareBibliographyDriver{proceedings}{%
+  \usebibmacro{bibindex}%
+  \usebibmacro{begentry}%
+  \usebibmacro{editor+others}%
+  \setunit{\printdelim{nametitledelim}}\newblock
+  \usebibmacro{maintitle+title}%
+  \newunit\newblock
+  \usebibmacro{event+venue+date}%
+  \newunit\newblock
+  \usebibmacro{byeditor+others}%
+  \newunit\newblock
+  \iffieldundef{maintitle}
+    {\printfield{volume}%
+     \printfield{part}}
+    {}%
+  \newunit
+  \printfield{volumes}%
+  \setunit{\addcomma\space}%
+  \usebibmacro{series+number}%
+  \newunit\newblock
+  \printfield{note}%
+  \newunit\newblock
+  \printlist{organization}%
+  \newunit
+  \usebibmacro{publisher+location+date}%
+  \newunit\newblock
+  \usebibmacro{chapter+pages}%
+  \newunit\newblock
+  \iftoggle{bbx:isbn}
+    {\printfield{isbn}}
+    {}%
+  \newunit\newblock
+  \usebibmacro{doi+eprint+url}%
+  \newunit\newblock
+  \usebibmacro{addendum+pubstate}%
+  \setunit{\bibpagerefpunct}\newblock
+  \usebibmacro{pageref}%
+  \newunit\newblock
+  \iftoggle{bbx:related}
+    {\usebibmacro{related:init}%
+     \usebibmacro{related}}
+    {}%
+  \usebibmacro{finentry}}
+
+\DeclareBibliographyDriver{inbook}{%
+  \usebibmacro{bibindex}%
+  \usebibmacro{begentry}%
+  \usebibmacro{author/translator+others}%
+  \setunit{\printdelim{nametitledelim}}\newblock
+  \usebibmacro{title}%
+  \newunit\newblock
+  \usebibmacro{byauthor}%
+  \newunit\newblock
+  \usebibmacro{in:}%
+  \usebibmacro{bybookauthor}%
+  \newunit\newblock
+  \usebibmacro{maintitle+booktitle}%
+  \newunit\newblock
+  \usebibmacro{byeditor+others}%
+  \newunit\newblock
+  \printfield{edition}%
+  \newunit
+  \iffieldundef{maintitle}
+    {\printfield{volume}%
+     \printfield{part}}
+    {}%
+  \newunit
+  \printfield{volumes}%
+  \setunit{\addcomma\space}%
+  \usebibmacro{series+number}%
+  \newunit\newblock
+  \printfield{note}%
+  \newunit\newblock
+  \usebibmacro{publisher+location+date}%
+  \newunit\newblock
+  \usebibmacro{chapter+pages}%
+  \newunit\newblock
+  \iftoggle{bbx:isbn}
+    {\printfield{isbn}}
+    {}%
+  \newunit\newblock
+  \usebibmacro{doi+eprint+url}%
+  \newunit\newblock
+  \usebibmacro{addendum+pubstate}%
+  \setunit{\bibpagerefpunct}\newblock
+  \usebibmacro{pageref}%
+  \newunit\newblock
+  \iftoggle{bbx:related}
+    {\usebibmacro{related:init}%
+     \usebibmacro{related}}
+    {}%
+  \usebibmacro{finentry}}
+
+\DeclareBibliographyDriver{incollection}{%
+  \usebibmacro{bibindex}%
+  \usebibmacro{begentry}%
+  \usebibmacro{author/translator+others}%
+  \setunit{\printdelim{nametitledelim}}\newblock
+  \usebibmacro{title}%
+  \newunit\newblock
+  \usebibmacro{byauthor}%
+  \newunit\newblock
+  \usebibmacro{in:}%
+  \usebibmacro{bookeditor}%
+  \newunit\newblock
+  \usebibmacro{maintitle+booktitle}%
+  \usebibmacro{byeditor+others}%
+  \newunit\newblock
+  \printfield{edition}%
+  \newunit
+  \iffieldundef{maintitle}
+    {\printfield{volume}%
+     \printfield{part}}
+    {}%
+  \newunit
+  \printfield{volumes}%
+  \setunit{\addcomma\space}%
+  \usebibmacro{series+number}%
+  \newunit\newblock
+  \printfield{note}%
+  \newunit\newblock
+  \usebibmacro{publisher+location+date}%
+  \newunit\newblock
+  \usebibmacro{chapter+pages}%
+  \newunit\newblock
+  \iftoggle{bbx:isbn}
+    {\printfield{isbn}}
+    {}%
+  \newunit\newblock
+  \usebibmacro{doi+eprint+url}%
+  \newunit\newblock
+  \usebibmacro{addendum+pubstate}%
+  \setunit{\bibpagerefpunct}\newblock
+  \usebibmacro{pageref}%
+  \newunit\newblock
+  \iftoggle{bbx:related}
+    {\usebibmacro{related:init}%
+     \usebibmacro{related}}
+    {}%
+  \usebibmacro{finentry}}
+
+\DeclareBibliographyDriver{inproceedings}{%
+  \usebibmacro{bibindex}%
+  \usebibmacro{begentry}%
+  \usebibmacro{author/translator+others}%
+  \setunit{\printdelim{nametitledelim}}\newblock
+  \usebibmacro{title}%
+  \newunit\newblock
+  \usebibmacro{byauthor}%
+  \newunit\newblock
+  \ifnameundef{editor}{}{\usebibmacro{in:}}%
+  \usebibmacro{bookeditor}%
+  \newunit\newblock
+  \usebibmacro{maintitle+booktitle}%
+  \usebibmacro{byeditor+others}%
+  \newunit
+  \usebibmacro{event+venue+date}%
+  \newunit\newblock
+  \iffieldundef{maintitle}
+    {\printfield{volume}%
+     \printfield{part}}
+    {}%
+  \newunit
+  \printfield{volumes}%
+  \setunit{\addcomma\space}%
+  \usebibmacro{series+number}%
+  \newunit\newblock
+  \printfield{note}%
+  \newunit\newblock
+  \printlist{organization}%
+  \newunit
+  \usebibmacro{publisher+location+date}%
+  \newunit\newblock
+  \usebibmacro{chapter+pages}%
+  \newunit\newblock
+  \iftoggle{bbx:isbn}
+    {\printfield{isbn}}
+    {}%
+  \newunit\newblock
+  \usebibmacro{doi+eprint+url}%
+  \newunit\newblock
+  \usebibmacro{addendum+pubstate}%
+  \setunit{\bibpagerefpunct}\newblock
+  \usebibmacro{pageref}%
+  \newunit\newblock
+  \iftoggle{bbx:related}
+    {\usebibmacro{related:init}%
+     \usebibmacro{related}}
+    {}%
+  \usebibmacro{finentry}}
+
+\DeclareBibliographyDriver{inreference}{%
+  \usebibmacro{bibindex}%
+  \usebibmacro{begentry}%
+  \usebibmacro{author/translator+others}%
+  \setunit{\printdelim{nametitledelim}}\newblock
+  \ifnameundef{author}{}{%
+    \usebibmacro{title}%
+    \newunit}%
+  \printlist{language}%
+  \newunit\newblock
+  \usebibmacro{byauthor}%
+  \newunit\newblock
+  \ifboolexpr{
+    test {\iffieldundef{maintitle}}
+    and
+    test {\iffieldundef{booktitle}}
+  }{}{%
+    \ifnameundef{editor}{}{\usebibmacro{in:}}%
+    \usebibmacro{bookeditor}%
+    \newunit\newblock
+    \usebibmacro{maintitle+booktitle}}%
+  \usebibmacro{byeditor+others}%
+  \newunit\newblock
+  \printfield{edition}%
+  \newunit
+  \iffieldundef{maintitle}
+    {\printfield{volume}%
+     \printfield{part}}
+    {}%
+  \newunit
+  \ifnameundef{author}{\usebibmacro{title}%
+  \newunit}{}%
+  \printfield{volumes}%
+  \setunit{\addcomma\space}%
+  \usebibmacro{series+number}%
+  \newunit\newblock
+  \printfield{note}%
+  \newunit\newblock
+  \usebibmacro{publisher+location+date}%
+  \newunit\newblock
+  \usebibmacro{chapter+pages}%
+  \newunit\newblock
+  \iftoggle{bbx:isbn}
+    {\printfield{isbn}}
+    {}%
+  \newunit\newblock
+  \usebibmacro{doi+eprint+url}%
+  \newunit\newblock
+  \usebibmacro{addendum+pubstate}%
+  \setunit{\bibpagerefpunct}\newblock
+  \usebibmacro{pageref}%
+  \newunit\newblock
+  \iftoggle{bbx:related}
+    {\usebibmacro{related:init}%
+     \usebibmacro{related}}
+    {}%
+  \usebibmacro{finentry}}
+
+\DeclareBibliographyDriver{dataset}{%
+  \usebibmacro{bibindex}%
+  \usebibmacro{begentry}%
+  \usebibmacro{author/editor+others/translator+others}%
+  \setunit{\printdelim{nametitledelim}}\newblock
+  \usebibmacro{title}%
+  \newunit\newblock
+  \usebibmacro{byauthor}%
+  \newunit\newblock
+  \usebibmacro{byeditor+others}%
+  \newunit\newblock
+  \printfield{type}%
+  \newunit
+  \printfield{edition}%
+  \setunit{\addcomma\space}%
+  \usebibmacro{series+number}%
+  \newunit\newblock
+  \printfield{note}%
+  \newunit\newblock
+  \usebibmacro{library}%
+  \newunit\newblock
+  \usebibmacro{organization+location+date}%
+  \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{software}{%
+  \usebibmacro{bibindex}%
+  \usebibmacro{begentry}%
+  \usebibmacro{author/editor+others/translator+others}%
+  \setunit{\printdelim{nametitledelim}}\newblock
+  \usebibmacro{title}%
+  \setunit{\addspace}
+  \printfield{type}%
+  \newunit\newblock
+  \usebibmacro{byauthor}%
+  \newunit\newblock
+  \usebibmacro{byeditor+others}%
+  \newunit\newblock
+  \printfield{howpublished}%
+  \newunit\newblock
+  \printfield{note}%
+  \newunit\newblock
+  \usebibmacro{organization+location+date}%
+  \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{manual}{%
+  \usebibmacro{bibindex}%
+  \usebibmacro{begentry}%
+  \usebibmacro{author/editor}%
+  \setunit{\printdelim{nametitledelim}}\newblock
+  \usebibmacro{title}%
+  \newunit\newblock
+  \usebibmacro{byauthor}%
+  \newunit\newblock
+  \usebibmacro{byeditor}%
+  \newunit\newblock
+  \printfield{edition}%
+  \usebibmacro{manual:series+type+number}%
+  \newunit
+  \printfield{note}%
+  \newunit\newblock
+  \usebibmacro{organization+location+date}%
+  \newunit\newblock
+  \usebibmacro{chapter+pages}%
+  \newunit\newblock
+  \iftoggle{bbx:isbn}
+    {\printfield{isbn}}
+    {}%
+  \newunit\newblock
+  \usebibmacro{doi+eprint+url}%
+  \newunit\newblock
+  \usebibmacro{addendum+pubstate}%
+  \setunit{\bibpagerefpunct}\newblock
+  \usebibmacro{pageref}%
+  \newunit\newblock
+  \iftoggle{bbx:related}
+    {\usebibmacro{related:init}%
+     \usebibmacro{related}}
+    {}%
+  \usebibmacro{finentry}}
+
+\DeclareBibliographyDriver{patent}{%
+  \usebibmacro{bibindex}%
+  \usebibmacro{begentry}%
+  \usebibmacro{author}%
+  \setunit{\printdelim{nametitledelim}}\newblock
+  \usebibmacro{title}%
+  \newunit\newblock
+  \usebibmacro{byauthor}%
+  \newunit\newblock
+  \printfield{type}%
+  \setunit*{\addspace}%
+  \printfield{number}%
+  \iflistundef{location}
+    {}
+    {\setunit*{\addspace}%
+      \printtext[parens]{%
+        \printlist[][-\value{listtotal}]{location}}}%
+  \newunit\newblock
+  \usebibmacro{byholder}%
+  \newunit\newblock
+  \printfield{note}%
+  \newunit\newblock
+  \usebibmacro{date}%
+  \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{online}{%
+  \usebibmacro{bibindex}%
+  \usebibmacro{begentry}%
+  \usebibmacro{author/editor+others/translator+others}%
+  \setunit{\printdelim{nametitledelim}}\newblock
+  \usebibmacro{title}%
+  \newunit\newblock
+  \usebibmacro{byauthor}%
+  \newunit\newblock
+  \usebibmacro{byeditor+others}%
+  \newunit
+  \printfield{note}%
+  \newunit\newblock
+  \usebibmacro{library}%
+  \newunit\newblock
+  \usebibmacro{organization+location+date}%
+  \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{report}{%
+  \usebibmacro{bibindex}%
+  \usebibmacro{begentry}%
+  \usebibmacro{author}%
+  \setunit{\printdelim{nametitledelim}}\newblock
+  \usebibmacro{title}%
+  \newunit\newblock
+  \usebibmacro{byauthor}%
+  \newunit\newblock
+  \usebibmacro{series+type+number}%
+  \newunit\newblock
+  \printfield{note}%
+  \newunit\newblock
+  \usebibmacro{institution+location+date}%
+  \newunit\newblock
+  \usebibmacro{chapter+pages}%
+  \newunit\newblock
+  \iftoggle{bbx:isbn}
+    {\printfield{isrn}}
+    {}%
+  \newunit\newblock
+  \usebibmacro{library}%
+  \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{\printdelim{nametitledelim}}\newblock
+  \usebibmacro{title}%
+  \newunit\newblock
+  \usebibmacro{byauthor}%
+  \newunit\newblock
+  \printfield{note}%
+  \newunit\newblock
+  \printfield{type}%
+  \newunit
+  \usebibmacro{institution+location+date}%
+  \newunit\newblock
+  \usebibmacro{chapter+pages}%
+  \newunit\newblock
+  \iftoggle{bbx:isbn}
+    {\printfield{isbn}}
+    {}%
+  \newunit\newblock
+  \usebibmacro{doi+eprint+url}%
+  \newunit\newblock
+  \usebibmacro{addendum+pubstate}%
+  \setunit{\bibpagerefpunct}\newblock
+  \usebibmacro{pageref}%
+  \newunit\newblock
+  \iftoggle{bbx:related}
+    {\usebibmacro{related:init}%
+     \usebibmacro{related}}
+    {}%
+  \usebibmacro{finentry}}
+
+\DeclareBibliographyDriver{audio}{%
+  \usebibmacro{bibindex}%
+  \usebibmacro{begentry}%
+  \usebibmacro{author/editor+others/translator+others}%
+  \setunit{\printdelim{nametitledelim}}\newblock
+  \usebibmacro{title}%
+  \newunit\newblock
+  \usebibmacro{series+number}%
+  \ifboolexpr{
+    test {\iffieldequalstr{type}{TV}}
+    or
+    test {\iffieldequalstr{type}{Radio}}
+  }{%
+    \setunit{\addspace}%
+    \usebibmacro{isonline}}{}%
+  \newunit\newblock
+  \printfield{type}%
+  \newunit\newblock
+  \usebibmacro{byauthor}[given-family:full]%
+  \newunit\newblock
+  \usebibmacro{byeditor+others}[given-family:full]%
+  \newunit\newblock
+  \printfield{howpublished}%
+  \newunit\newblock
+  \printfield{note}%
+  \newunit\newblock
+  \usebibmacro{publisher+location+date}%
+  \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{image}{%
+  \usebibmacro{bibindex}%
+  \usebibmacro{begentry}%
+  \usebibmacro{author/editor+others/translator+others}%
+  \setunit{\printdelim{nametitledelim}}\newblock
+  \usebibmacro{title}%
+  \newunit\newblock
+  \usebibmacro{byauthor}%
+  \newunit\newblock
+  \usebibmacro{byeditor+others}%
+  \newunit\newblock
+  \printfield{howpublished}%
+  \newunit\newblock
+  \printfield{type}%
+  \newunit
+  \printfield{note}%
+  \newunit\newblock
+  \usebibmacro{collection+shelfmark}%
+  \newunit\newblock
+  \usebibmacro{organization+location+date+library}%
+  \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{jurisdiction}{%
+  \savebibmacro{title}%
+  \xapptobibmacro{labeltitle}{%
+    \setunit*{\addspace}%
+    \usebibmacro{casenumber}%
+  }{}{}%
+  \usebibmacro{bibindex}%
+  \usebibmacro{begentry}%
+  \usebibmacro{eucheck}%
+  \usebibmacro{author}%
+  \setunit{\printdelim{nametitledelim}}\newblock
+  \usebibmacro{title}%
+  \newunit\newblock
+  \usebibmacro{byauthor}%
+  \newunit\newblock
+  \printfield{note}%
+  \setunit{\addspace}%
+  \usebibmacro{reporter}%
+  \newunit\newblock
+  \printfield{institution}%
+  \newunit\newblock
+  \iftoggle{bbx:isbn}
+    {\printfield{isrn}}
+    {}%
+  \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}%
+  \restorebibmacro{title}}
+
+\DeclareBibliographyDriver{legislation}{%
+  \usebibmacro{bibindex}%
+  \usebibmacro{begentry}%
+  \usebibmacro{eucheck}%
+  \usebibmacro{author}%
+  \setunit{\printdelim{nametitledelim}}\newblock
+  \usebibmacro{title}%
+  \newunit\newblock
+  \usebibmacro{byauthor}%
+  \newunit\newblock
+  \usebibmacro{journal+series+volume+number+chapter+pages}
+  \newunit\newblock
+  \printfield{note}%
+  \newunit\newblock
+  \usebibmacro{institution+location+date}%
+  \newunit\newblock
+  \printfield{pagetotal}%
+  \newunit\newblock
+  \iftoggle{bbx:isbn}
+    {\printfield{isrn}}
+    {}%
+  \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{booklet}{%
+  \usebibmacro{bibindex}%
+  \usebibmacro{begentry}%
+  \usebibmacro{author/editor+others/translator+others}%
+  \setunit{\printdelim{nametitledelim}}\newblock
+  \usebibmacro{title}%
+  \newunit\newblock
+  \usebibmacro{byauthor}%
+  \newunit\newblock
+  \usebibmacro{byeditor+others}%
+  \newunit\newblock
+  \printfield{howpublished}%
+  \newunit\newblock
+  \printfield{type}%
+  \newunit\newblock
+  \printfield{note}%
+  \usebibmacro{collection+shelfmark}%
+  \newunit\newblock
+  \usebibmacro{organization+location+date+library}%
+  \newunit\newblock
+  \usebibmacro{chapter+pages}%
+  \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{letter}{%
+  \usebibmacro{bibindex}%
+  \usebibmacro{begentry}%
+  \usebibmacro{author/translator+others}%
+  \setunit{\printdelim{nametitledelim}}\newblock
+  \usebibmacro{title}%
+  \newunit\newblock
+  \usebibmacro{byauthor}%
+  \newunit\newblock
+  \usebibmacro{bytranslator+others}%
+  \newunit\newblock
+  \usebibmacro{journal+issuetitle}%
+  \newunit\newblock
+  \printfield{howpublished}%
+  \newunit
+  \printfield{note}%
+  \newunit\newblock
+  \usebibmacro{collection+shelfmark}%
+  \newunit\newblock
+  \usebibmacro{organization+location+date+library}%
+  \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{misc}{%
+  \usebibmacro{bibindex}%
+  \usebibmacro{begentry}%
+  \usebibmacro{author/editor+others/translator+others}%
+  \setunit{\printdelim{nametitledelim}}\newblock
+  \usebibmacro{title}%
+  \newunit\newblock
+  \usebibmacro{byauthor}%
+  \newunit\newblock
+  \usebibmacro{byeditor+others}%
+  \newunit\newblock
+  \printfield{howpublished}%
+  \newunit\newblock
+  \printfield{type}%
+  \newunit
+  \printfield{note}%
+  \newunit\newblock
+  \usebibmacro{collection+shelfmark}%
+  \newunit\newblock
+  \usebibmacro{organization+location+date+library}%
+  \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{\printdelim{nametitledelim}}\newblock
+  \usebibmacro{title}%
+  \newunit\newblock
+  \usebibmacro{byauthor}%
+  \newunit\newblock
+  \ifnameundef{editor}{}{\usebibmacro{in:}}%
+  \usebibmacro{bookeditor}%
+  \newunit\newblock
+  \usebibmacro{maintitle+booktitle}%
+  \usebibmacro{byeditor+others}%
+  \newunit\newblock
+  \printfield{howpublished}%
+  \newunit\newblock
+  \printfield{type}%
+  \newunit\newblock
+  \usebibmacro{event+venue+date}%
+  \newunit\newblock
+  \printfield{note}%
+  \newunit\newblock
+  \usebibmacro{collection+shelfmark}%
+  \newunit\newblock
+  \usebibmacro{organization+location+date+library}%
+  \newunit\newblock
+  \usebibmacro{isunpublished}%
+  \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{shorthand}{%
+  \usedriver
+    {\DeclareNameAlias{sortname}{default}}
+    {\thefield{entrytype}}%
+  \finentry}
+
+\newbool{bbx at inset}
+\DeclareBibliographyDriver{set}{%
+  \booltrue{bbx at inset}%
+  \entryset{}{}%
+  \newunit\newblock
+  \usebibmacro{setpageref}%
+  \finentry}
+
+\DeclareBibliographyAlias{mvbook}{book}
+\DeclareBibliographyAlias{bookinbook}{inbook}
+\DeclareBibliographyAlias{suppbook}{inbook}
+\DeclareBibliographyAlias{mvcollection}{collection}
+\DeclareBibliographyAlias{suppcollection}{incollection}
+\DeclareBibliographyAlias{movie}{audio}
+\DeclareBibliographyAlias{music}{audio}
+\DeclareBibliographyAlias{mvproceedings}{proceedings}
+\DeclareBibliographyAlias{reference}{collection}
+\DeclareBibliographyAlias{mvreference}{reference}
+\DeclareBibliographyAlias{suppperiodical}{article}
+\DeclareBibliographyAlias{review}{article}
+\DeclareBibliographyAlias{standard}{manual}
+\DeclareBibliographyAlias{software}{misc}
+\DeclareBibliographyAlias{video}{audio}
+\DeclareBibliographyAlias{*}{misc}
+
 \newbibmacro*{name:cjk-given-family}[3]{%
   \ifitemannotation{cjk}{%
     \usebibmacro{name:delim}{#2#1#3}%
@@ -179,6 +1344,49 @@
   \usebibmacro{name:andothers}%
 }
 
+\DeclareNameFormat{given-family:full}{%
+  \ifdefvoid{\namepartcjk}{%
+    \usebibmacro{name:given-family}
+      {\namepartfamily}
+      {\namepartgiven}
+      {\namepartprefix}
+      {\namepartsuffix}%
+  }{%
+    \usebibmacro{name:cjk-given-family}
+      {\namepartfamily}
+      {\namepartgiven}
+      {\namepartcjk}%
+  }%
+  \usebibmacro{name:andothers}%
+}
+
+\DeclareNameAlias{author}{family-given}
+\DeclareNameAlias{editor}{family-given}
+\DeclareNameAlias{translator}{family-given}
+
+\DeclareNameWrapperAlias{author}{family-given}
+\DeclareNameWrapperAlias{editor}{family-given}
+\DeclareNameWrapperAlias{translator}{family-given}
+
+\DeclareNameAlias{bookeditor}{given-family}
+
+\renewcommand*{\bibinitdelim}{}
+
+\newbibmacro*{bbx:dashcheck}[2]{%
+  \ifboolexpr{
+    test {\iffieldequals{fullhash}{\bbx at lasthash}}
+    and
+    not test \iffirstonpage
+    and
+    (
+       not bool {bbx at inset}
+       or
+       test {\iffieldequalstr{entrysetcount}{1}}
+    )
+  }
+    {#1}
+    {#2}}
+
 \DeclareFieldFormat{nameaddon}{\mkbibbrackets{#1}}
 \renewbibmacro*{author}{%
   \ifboolexpr{
@@ -203,17 +1411,63 @@
         \setunit{\printdelim{nameyeardelim}}}}%
     {\global\undef\bbx at lasthash
      \usebibmacro{labeltitle}%
-     \setunit*{\printdelim{nonameyeardelim}}}%
-  \usebibmacro{date+extradate}%
-  \usebibmacro{labeltitleaddon}}
-\DeclareNameFormat{given-family:full}{%
-  \usebibmacro{name:given-family}
-    {\namepartfamily}
-    {\namepartgiven}
-    {\namepartprefix}
-    {\namepartsuffix}%
-  \usebibmacro{name:andothers}}
+     \iftoggle{bbx:labelistitle}{\setunit{\printdelim{nonameyeardelim}}}{}}%
+  \usebibmacro{date+extradate}}
 
+\renewbibmacro*{editor}{%
+  \usebibmacro{bbx:editor}{editorstrg}}
+\renewbibmacro*{editor+others}{%
+  \usebibmacro{bbx:editor}{editor+othersstrg}}
+\newbibmacro*{bbx:editor}[1]{%
+  \ifboolexpr{
+    test \ifuseeditor
+    and
+    not test {\ifnameundef{editor}}
+  }
+    {\usebibmacro{bbx:dashcheck}
+       {\bibnamedash}
+       {\printnames{editor}%
+        \setunit{\printdelim{editortypedelim}}%
+        \usebibmacro{bbx:savehash}}%
+     \usebibmacro{#1}%
+     \clearname{editor}%
+     \setunit{\printdelim{nameyeardelim}}}%
+    {\global\undef\bbx at lasthash
+     \usebibmacro{labeltitle}%
+     \iftoggle{bbx:labelistitle}{\setunit{\printdelim{nonameyeardelim}}}{}}%
+  \usebibmacro{date+extradate}}
+
+\renewbibmacro*{translator}{%
+  \usebibmacro{bbx:translator}{translatorstrg}}
+\renewbibmacro*{translator+others}{%
+  \usebibmacro{bbx:translator}{translator+othersstrg}}
+\newbibmacro*{bbx:translator}[1]{%
+  \ifboolexpr{
+    test \ifusetranslator
+    and
+    not test {\ifnameundef{translator}}
+  }
+    {\usebibmacro{bbx:dashcheck}
+       {\bibnamedash}
+       {\printnames{translator}%
+        \setunit{\printdelim{translatortypedelim}}%
+        \usebibmacro{bbx:savehash}}%
+     \usebibmacro{#1}%
+     \clearname{translator}%
+     \setunit{\printdelim{nameyeardelim}}}%
+    {\global\undef\bbx at lasthash
+     \usebibmacro{labeltitle}%
+     \iftoggle{bbx:labelistitle}{\setunit{\printdelim{nonameyeardelim}}}{}}%
+  \usebibmacro{date+extradate}}
+
+\newbibmacro*{bookeditor}{%
+  \ifnameundef{editor}{}{%
+    \printnames[bookeditor]{editor}%
+    \setunit*{\addcomma\space}%
+    \usebibmacro{editor+othersstrg}%
+    \clearname{editor}%
+  }}
+
 \renewbibmacro*{byauthor}[1][byauthor]{%
   \ifboolexpr{
     test \ifuseauthor
@@ -301,262 +1555,12 @@
     \newunit
     \usebibmacro{withothers}}}}
 
-\newbibmacro*{bookeditor}{%
-  \ifnameundef{editor}{}{%
-    \printnames[bookeditor]{editor}%
-    \setunit*{\addcomma\space}%
-    \usebibmacro{editor+othersstrg}%
-    \clearname{editor}%
-  }}
-
-\DeclareFieldFormat{sentencecase}{\MakeSentenceCase*{#1}}
-\DeclareFieldFormat{midsentencecase}{\MakeSentenceCase*{{}#1}}
-\DeclareFieldFormat{title}{\mkbibemph{#1}}
-\DeclareFieldFormat
-  [article,inbook,incollection,inproceedings]%
-  {title}{#1}
-\DeclareFieldFormat
-  [reference,mvreference]%
-  {title}{\ifnameundef{author}{#1}{\mkbibemph{#1}}}
-\DeclareFieldFormat
-  [inreference]%
-  {title}{\ifnameundef{author}{\mkbibemph{#1}}{#1}}
-\DeclareFieldFormat
-  [inreference]%
-  {booktitle}{\ifnameundef{author}{#1}{\mkbibemph{#1}}}
-\DeclareFieldFormat
-  [patent,thesis]%
-  {title}{\mkbibemph{#1}}
-\DeclareFieldFormat
-  [audio,video,music,video]%
-  {title}{\ifboolexpr{
-    test {\iffieldequalstr{type}{TV}}
-    or
-    test {\iffieldequalstr{type}{Radio}}
-  }{#1}{\mkbibemph{#1}}}
-\DeclareFieldFormat
-  [unpublished]%
-  {title}{\iffieldundef{booktitle}{\mkbibemph{#1}}{#1}}
-
-\newtoggle{bbx:onlineshown}
-\newbibmacro*{isonline}{%
-  \ifboolexpr{(
-      test {\iffieldundef{doi}}
-      and
-      test {\iffieldundef{url}}
-      and
-      test {\iffieldundef{urlyear}}
-      and
-      not test {\ifentrytype{online}}
-    ) or
-    togl {bbx:onlineshown}
-  }{}{%
-    \bibstring[\mkbibbrackets]{online}%
-    \toggletrue{bbx:onlineshown}}}
-
-\DeclareFieldFormat{titleaddon}{\mkbibbrackets{%
-  \IfBeginWith{#1}{[}{%
-    \IfEndWith{#1}{]}{%
-      \StrBetween{#1}{[}{]}%
-    }{#1}%
-  }{#1}%
-}}
-
-\renewbibmacro*{title}{%
-  \ifboolexpr{
-    test {\iffieldundef{title}}
-    and
-    test {\iffieldundef{subtitle}}
-  }{}{%
-    \printtext[title]{%
-      \printfield[sentencecase]{title}%
-      \setunit{\subtitlepunct}%
-      \printfield[midsentencecase]{subtitle}%
-      \setunit{\addspace}%
-    }%
-    \printfield{version}%
-    \clearfield{version}%
-    \setunit*{\addspace}%
-    \printfield{titleaddon}%
-    \ifboolexpr{
-      test {\iffieldundef{journaltitle}}
-      and
-      test {\iffieldundef{booktitle}}
-      and (
-        test {\iffieldundef{library}}
-        or
-        test {\ifentrytype{image}}
-        or
-        test {\ifentrytype{audio}}
-        or
-        test {\ifentrytype{video}}
-        or
-        test {\ifentrytype{music}}
-        or
-        test {\ifentrytype{movie}}
-      ) and
-      not test {\ifentrytype{software}}
-      and (
-        not (
-          test {\iffieldequalstr{type}{TV}}
-          or
-          test {\iffieldequalstr{type}{Radio}}
-        )
-        or
-        test {\iffieldundef{series}}
-      )
-    }{%
-      \setunit*{\addspace}%
-      \usebibmacro{isonline}%
-    }{}%
-  }%
-}
-
-\renewbibmacro*{booktitle}{%
-  \ifboolexpr{
-    test {\iffieldundef{booktitle}}
-    and
-    test {\iffieldundef{booksubtitle}}
-  }{}{%
-    \printtext[booktitle]{%
-      \printfield[sentencecase]{booktitle}%
-      \setunit{\subtitlepunct}%
-      \printfield[midsentencecase]{booksubtitle}%
-      \setunit{\addspace}%
-    }%
-    \printfield{booktitleaddon}
-    \setunit*{\addspace}%
-    \usebibmacro{isonline}%
-  }%
-}
-
-\renewbibmacro*{maintitle}{%
-  \ifboolexpr{
-    test {\iffieldundef{maintitle}}
-    and
-    test {\iffieldundef{mainsubtitle}}
-  }{}{
-    \printtext[maintitle]{%
-      \printfield[sentencecase]{maintitle}%
-      \setunit{\subtitlepunct}%
-      \printfield[midsentencecase]{mainsubtitle}%
-      \setunit{\addspace}%
-    }%
-    \printfield{maintitleaddon}%
-  }%
-}
-
-\renewcommand*{\subtitlepunct}{\addcolon\space}
-
-\DeclareLabeltitle[inreference]{%
-  \field{shorttitle}
-  \field{booktitle}
-  \field{title}
-}
-\providetoggle{bbx:labelistitle}
-\renewbibmacro*{labeltitle}{%
-  \iffieldundef{label}{%
-    \ifboolexpr{
-      test {\ifentrytype{inreference}}
-      and
-      not test {\iffieldundef{booktitle}}
-    }{%
-      \printtext[booktitle]{%
-        \printfield[sentencecase]{booktitle}%
-        \setunit{\booksubtitlepunct}%
-        \printfield[midsentencecase]{booksubtitle}}%
-      \clearfield{booktitle}\clearfield{booksubtitle}%
-    }{%
-      \ifboolexpr{
-        test {\iffieldundef{title}}
-        and
-        test {\iffieldundef{subtitle}}
-      }{}{%
-        \printtext[title]{%
-          \printfield[sentencecase]{title}%
-          \setunit{\subtitlepunct}%
-          \printfield[midsentencecase]{subtitle}}%
-        \clearfield{title}\clearfield{subtitle}%
-        \toggletrue{bbx:labelistitle}}%
-        \ifboolexpr{
-          test {\iffieldundef{journaltitle}}
-          and
-          test {\iffieldundef{booktitle}}
-          and (
-            test {\iffieldundef{library}}
-            or
-            test {\ifentrytype{image}}
-            or
-            test {\ifentrytype{audio}}
-            or
-            test {\ifentrytype{video}}
-            or
-            test {\ifentrytype{music}}
-            or
-            test {\ifentrytype{movie}}
-          ) and
-          not test {\ifentrytype{software}}
-          and
-          not test {\ifentrytype{legislation}}
-          and
-          not test {\ifentrytype{jurisdiction}}
-          and (
-            not (
-              test {\iffieldequalstr{type}{TV}}
-              or
-              test {\iffieldequalstr{type}{Radio}}
-            )
-            or
-            test {\iffieldundef{series}}
-          )
-        }{%
-          \setunit*{\addspace}%
-          \usebibmacro{isonline}%
-        }{}%
-    }%
-  }{%
-    \printfield{label}%
-  }%
-}
-\DeclareDelimFormat{yearlabeltitleaddondelim}{\addspace}
-\newbibmacro*{labeltitleaddon}{%
-  \iftoggle{bbx:labelistitle}{%
-    \setunit{\printdelim{yearlabeltitleaddondelim}}%
-    \printfield{version}%
-    \clearfield{version}%
-    \setunit*{\addspace}%
-    \printfield{titleaddon}%
-    \clearfield{titleaddon}%
-    \ifboolexpr{(
-        test {\ifentrytype{legislation}}
-        or
-        test {\ifentrytype{jurisdiction}}
-      )
-      and
-      test {\iffieldundef{journaltitle}}
-      and
-      test {\iffieldundef{booktitle}}
-    }{%
-      \setunit*{\addspace}%
-      \usebibmacro{isonline}%
-    }{}%
-  }{}%
-}
-\xapptobibmacro{bbx:editor}{\usebibmacro{labeltitleaddon}}{}{}
-\xapptobibmacro{bbx:translator}{\usebibmacro{labeltitleaddon}}{}{}
-
 \DeclareLabeldate{%
   \field{date}
   \field{year}
   \literal{nodate}
 }
-\newtoggle{bbx:nonodate}
-\DeclareBibliographyOption[boolean]{nonodate}[true]{%
-  \settoggle{bbx:nonodate}{#1}}
-\DeclareTypeOption[boolean]{nonodate}[true]{%
-  \settoggle{bbx:nonodate}{#1}}
-\DeclareEntryOption[boolean]{nonodate}[true]{%
-  \settoggle{bbx:nonodate}{#1}}
+
 \DeclareStyleSourcemap{
   \maps[datatype=bibtex]{
     \map[overwrite=true]{
@@ -572,6 +1576,9 @@
   }
 }
 
+\DeclareFieldFormat{datelabel}{#1}
+\DeclareFieldFormat{time}{#1~\bibstring{hours}}
+
 \DeclareDelimFormat{nameyeardelim}{\addcomma\space}
 \DeclareDelimFormat[parencite,bib,biblist]{nameyeardelim}{\addcomma\space}
 \newcommand{\dononameyeardelim}{%
@@ -626,161 +1633,6 @@
     togl {bbx:labelistitle}
   }{\addspace}{\labelnamepunct}}
 
-\renewbibmacro*{date}{%
-  \printdate
-  \setunit*{\bibdatetimesep}
-  \printtime
-}
-\DeclareFieldFormat{time}{#1~\bibstring{hours}}
-
-\xpatchcmd{\KV at blx@opt at pre@mergedate}{%
-  'true' (=compact)%
-}{%
-  'year', 'true' (=year)%
-}{}{\wlog{WARNING: biblatex-bath failed to patch KV at blx@opt at pre@datemerge}}
-\ifdefined\KV at blx@opt at typ@mergedate
-  \xpatchcmd{\KV at blx@opt at typ@mergedate}{%
-    'true' (=compact)%
-  }{%
-    'year', 'true' (=year)%
-  }{}{\wlog{WARNING: biblatex-bath failed to patch KV at blx@opt at typ@datemerge}}
-\else
-  \DeclareTypeOption[boolean]{mergedate}[true]{%
-    \ifcsdef{bbx at opt@mergedate@#1}{%
-      \csuse{bbx at opt@mergedate@#1}%
-    }{%
-      \PackageError{biblatex}
-        {Invalid option 'mergedate=#1'}
-        {Valid values are 'maximum', 'compact', 'basic', 'minimum',\MessageBreak
-          'year', 'true' (=year), and 'false'.}}}
-\fi
-\xpatchcmd{\KV at blx@opt at ent@mergedate}{%
-  'true' (=compact)%
-}{%
-  'year', 'true' (=year)%
-}{}{\wlog{WARNING: biblatex-bath failed to patch KV at blx@opt at ent@datemerge}}
-
-\DeclareFieldFormat{datelabel}{#1}
-\xpatchcmd{\bbx at opt@mergedate at maximum}{%
-  \iffieldundef{labelyear}%
-}{%
-  \ifboolexpr{
-    togl {bbx:nonodate}
-    and
-    not test {\iflabeldateisdate}}%
-}{}{\wlog{WARNING: biblatex-bath failed to patch bbx at opt@mergedate at maximum}}
-\xpatchcmd{\bbx at opt@mergedate at maximum}{%
-  \printtext[parens]%
-}{%
-  \printtext[datelabel]%
-}{}{\wlog{WARNING: biblatex-bath failed to patch bbx at opt@mergedate at maximum}}
-\xpatchcmd{\bbx at opt@mergedate at compact}{%
-  \iffieldundef{labelyear}%
-}{%
-  \ifboolexpr{
-    togl {bbx:nonodate}
-    and
-    not test {\iflabeldateisdate}}%
-}{}{\wlog{WARNING: biblatex-bath failed to patch bbx at opt@mergedate at compact}}
-\xpatchcmd{\bbx at opt@mergedate at compact}{%
-  \printtext[parens]%
-}{%
-  \printtext[datelabel]%
-}{}{\wlog{WARNING: biblatex-bath failed to patch bbx at opt@mergedate at compact}}
-\xpatchcmd{\bbx at opt@mergedate at basic}{%
-  \iffieldundef{labelyear}%
-}{%
-  \ifboolexpr{
-    togl {bbx:nonodate}
-    and
-    not test {\iflabeldateisdate}}%
-}{}{\wlog{WARNING: biblatex-bath failed to patch bbx at opt@mergedate at basic}}
-\xpatchcmd{\bbx at opt@mergedate at basic}{%
-  \printtext[parens]%
-}{%
-  \printtext[datelabel]%
-}{}{\wlog{WARNING: biblatex-bath failed to patch bbx at opt@mergedate at basic}}
-\xpatchcmd{\bbx at opt@mergedate at minimum}{%
-  \iffieldundef{labelyear}%
-}{%
-  \ifboolexpr{
-    togl {bbx:nonodate}
-    and
-    not test {\iflabeldateisdate}}%
-}{}{\wlog{WARNING: biblatex-bath failed to patch bbx at opt@mergedate at minimum}}
-\xpatchcmd{\bbx at opt@mergedate at minimum}{%
-  \printtext[parens]%
-}{%
-  \printtext[datelabel]%
-}{}{\wlog{WARNING: biblatex-bath failed to patch bbx at opt@mergedate at minimum}}
-\xpatchcmd{\bbx at opt@mergedate at false}{%
-  \iffieldundef{labelyear}%
-}{%
-  \ifboolexpr{
-    togl {bbx:nonodate}
-    and
-    not test {\iflabeldateisdate}}%
-}{}{\wlog{WARNING: biblatex-bath failed to patch bbx at opt@mergedate at false}}
-\xpatchcmd{\bbx at opt@mergedate at false}{%
-  \printtext[parens]%
-}{%
-  \printtext[datelabel]%
-}{}{\wlog{WARNING: biblatex-bath failed to patch bbx at opt@mergedate at false}}
-\xpatchcmd{\bbx at opt@mergedate at maximum}{%
-  \iffieldsequal{year}{labelyear}
-    {\printlabeldateextra}%
-    {\printfield{labelyear}%
-    \printfield{extrayear}}%
-}{%
-  \iflabeldateisdate
-    {\printfield{issue}%
-    \setunit*{\addspace}%
-    \printdateextra}
-    {\printlabeldateextra}%
-}{}{}
-
-\def\bbx at opt@mergedate at year{%
-  \renewbibmacro*{date+extradate}{%
-    \iffieldundef{labelyear}{}{%
-      \ifboolexpr{
-        togl {bbx:nonodate}
-        and
-        not test {\iflabeldateisdate}
-      }{}{%
-        \printtext[datelabel]{\printlabeldateextra}%
-      }%
-      \iflabeldateisdate{%
-        \clearfield{year}%
-      }{}}}
-  \ifcsundef{abx at macro@date+extrayear}{}{%
-    \renewbibmacro*{date+extrayear}{\usebibmacro{date+extradate}}%
-  }
-  \renewbibmacro*{issue+date}{%
-    \iffieldundef{issue}{}{%
-      \ifboolexpr{(
-        test {\iffieldundef{volume}}
-        and
-        test {\iffieldundef{number}}
-        ) and
-        test {\iffieldundef{eid}}
-      }{%
-        \newunit
-        \printfield{issue}%
-      }{%
-        \printtext[parens]{%
-          \printfield{issue}%
-        }%
-      }
-    }%
-    \setunit{\addcomma\space}%
-    \printdate
-    \newunit
-  }%
-}%
-
-\def\bbx at opt@mergedate at true{\bbx at opt@mergedate at year}
-\ExecuteBibliographyOptions{mergedate}
-
 \newrobustcmd*{\mknoyeardaterangefull}[2]{%
   \iffieldundef{#2month}{}{%
     \printtext[{#2date}]{%
@@ -923,30 +1775,279 @@
   \printfield{extraalpha}%
 }{}{\wlog{WARNING: biblatex-bath failed to patch mkdaterangetruncextra at i thrice}}%
 
-\DeclareFieldFormat{version}{\mkbibparens{\biblcsstring{version}#1}}
-\DeclareFieldFormat{type}{\ifbibstring{#1}{\biblstring{#1}}{#1}}
-\DeclareFieldFormat{series}{\MakeSentenceCase*{#1}}
+\DeclareFieldFormat{sentencecase}{\MakeSentenceCase*{#1}}
+\DeclareFieldFormat{midsentencecase}{\MakeSentenceCase*{{}#1}}
+\DeclareFieldFormat{title}{\mkbibemph{#1}}
 \DeclareFieldFormat
+  [article,inbook,incollection,inproceedings]%
+  {title}{#1}
+\DeclareFieldFormat
+  [reference,mvreference]%
+  {title}{\iftoggle{bbx:labelistitle}{#1}{\mkbibemph{#1}}}
+\DeclareFieldFormat
+  [inreference]%
+  {title}{\iftoggle{bbx:labelistitle}{\mkbibemph{#1}}{#1}}
+\DeclareFieldFormat
+  [inreference]%
+  {booktitle}{\iftoggle{bbx:labelistitle}{#1}{\mkbibemph{#1}}}
+\DeclareFieldFormat
+  [patent,thesis]%
+  {title}{\mkbibemph{#1}}
+\DeclareFieldFormat
   [audio,video,music,video]%
-  {series}{\ifboolexpr{
+  {title}{\ifboolexpr{
     test {\iffieldequalstr{type}{TV}}
     or
     test {\iffieldequalstr{type}{Radio}}
-  }{\mkbibemph{\MakeSentenceCase*{#1}}}{\MakeSentenceCase*{#1}}}
+  }{#1}{\mkbibemph{#1}}}
 \DeclareFieldFormat
-  [audio,video,music,video]%
-  {number}{\ifboolexpr{
-    test {\iffieldequalstr{type}{TV}}
-    or
-    test {\iffieldequalstr{type}{Radio}}
-  }{\mkbibemph{#1}}{#1}}
-\DeclareFieldFormat[legislation,jurisdiction]{series}{#1}
-\renewbibmacro*{series+number}{%
-  \printfield{series}%
-  \setunit*{\addcomma\space}%
-  \printfield{number}%
+  [unpublished]%
+  {title}{\iffieldundef{booktitle}{\mkbibemph{#1}}{#1}}
+\DeclareFieldFormat
+  [letter]%
+  {title}{\iffieldundef{journaltitle}{\emph{#1}}{#1}}
+
+\DeclareFieldFormat{version}{\mkbibparens{\biblcsstring{version}#1}}
+
+\DeclareFieldFormat{titleaddon}{\mkbibbrackets{%
+  \IfBeginWith{#1}{[}{%
+    \IfEndWith{#1}{]}{%
+      \StrBetween{#1}{[}{]}%
+    }{#1}%
+  }{#1}%
+}}
+
+\renewcommand*{\subtitlepunct}{\addcolon\space}
+
+\newbibmacro*{maintitle+title}{%
+  \iffieldsequal{maintitle}{title}
+    {\clearfield{maintitle}%
+      \clearfield{mainsubtitle}%
+      \clearfield{maintitleaddon}}
+    {\iffieldundef{maintitle}
+        {}
+        {\usebibmacro{maintitle}%
+        \newunit\newblock
+        \iffieldundef{volume}
+          {}
+          {\printfield{volume}%
+            \printfield{part}%
+            \setunit{\addcolon\space}}}}%
+  \usebibmacro{title}%
   \newunit}
-\renewbibmacro*{event+venue+date}{%
+
+\newbibmacro*{title+issuetitle}{%
+  \usebibmacro{periodical}%
+  \setunit*{\addspace}%
+  \iffieldundef{series}
+    {}
+    {\newunit
+      \printfield{series}%
+      \setunit{\addspace}}%
+  \usebibmacro{volume+number+eid}%
+  \setunit{\addspace}%
+  \usebibmacro{issue+date}%
+  \setunit{\addcolon\space}%
+  \usebibmacro{issue}%
+  \newunit}
+
+\renewbibmacro*{title}{%
+  \ifboolexpr{
+    test {\iffieldundef{title}}
+    and
+    test {\iffieldundef{subtitle}}
+  }{%
+    \ifboolexpr{
+      test {\ifentrytype{legislation}}
+      and
+      test {\iffieldundef{journaltitle}}
+    }{%
+      \setunit*{\addspace}%
+      \usebibmacro{isonline}%
+    }{}%
+  }{%
+    \printtext[title]{%
+      \printfield[sentencecase]{title}%
+      \setunit{\subtitlepunct}%
+      \printfield[midsentencecase]{subtitle}%
+      \setunit{\addspace}}%
+    \printfield{titleaddon}%
+    \setunit*{\addspace}%
+    \printfield{version}\clearfield{version}%
+    \ifboolexpr{
+      test {\iffieldundef{entrysubtype}}
+      or (
+        test {\ifentrytype{legislation}}
+        or
+        test {\ifentrytype{jurisdiction}}
+      )
+    }{%
+      \ifboolexpr{
+        test {\iffieldundef{journaltitle}}
+        and
+        test {\iffieldundef{booktitle}}
+        and (
+          test {\iffieldundef{library}}
+          or
+          test {\ifentrytype{image}}
+          or
+          test {\ifentrytype{audio}}
+          or
+          test {\ifentrytype{video}}
+          or
+          test {\ifentrytype{music}}
+          or
+          test {\ifentrytype{movie}}
+        )
+        and (
+          not (
+            test {\iffieldequalstr{type}{TV}}
+            or
+            test {\iffieldequalstr{type}{Radio}}
+          )
+          or
+          test {\iffieldundef{series}}
+        )
+      }{%
+        \setunit*{\addspace}%
+        \usebibmacro{isonline}%
+      }{}%
+    }{%
+      \setunit*{\addspace}%
+      \printfield{entrysubtype}}
+  }%
+}
+
+\renewbibmacro*{booktitle}{%
+  \ifboolexpr{
+    test {\iffieldundef{booktitle}}
+    and
+    test {\iffieldundef{booksubtitle}}
+  }{}{%
+    \printtext[booktitle]{%
+      \printfield[sentencecase]{booktitle}%
+      \setunit{\subtitlepunct}%
+      \printfield[midsentencecase]{booksubtitle}%
+      \setunit{\addspace}%
+    }%
+    \printfield{booktitleaddon}
+    \setunit*{\addspace}%
+    \usebibmacro{isonline}%
+  }%
+}
+
+\renewbibmacro*{maintitle}{%
+  \ifboolexpr{
+    test {\iffieldundef{maintitle}}
+    and
+    test {\iffieldundef{mainsubtitle}}
+  }{}{
+    \printtext[maintitle]{%
+      \printfield[sentencecase]{maintitle}%
+      \setunit{\subtitlepunct}%
+      \printfield[midsentencecase]{mainsubtitle}%
+      \setunit{\addspace}%
+    }%
+    \printfield{maintitleaddon}%
+  }%
+}
+
+\DeclareLabeltitle[inreference]{%
+  \field{shorttitle}
+  \field{booktitle}
+  \field{title}
+}
+\DeclareFieldFormat{entrysubtype}{\mkbibbrackets{#1}}
+\providetoggle{bbx:labelistitle}
+\newbibmacro*{labeltitle}{%
+  \iffieldundef{label}{%
+    \ifboolexpr{
+      test {\ifentrytype{inreference}}
+      and
+      not test {\iffieldundef{booktitle}}
+    }{%
+      \toggletrue{bbx:labelistitle}%
+      \printtext[booktitle]{%
+        \printfield[sentencecase]{booktitle}%
+        \setunit{\booksubtitlepunct}%
+        \printfield[midsentencecase]{booksubtitle}}%
+      \clearfield{booktitle}\clearfield{booksubtitle}%
+    }{%
+      \ifboolexpr{
+        test {\iffieldundef{title}}
+        and
+        test {\iffieldundef{subtitle}}
+      }{}{%
+        \toggletrue{bbx:labelistitle}%
+        \printtext[title]{%
+          \printfield[sentencecase]{title}%
+          \setunit{\subtitlepunct}%
+          \printfield[midsentencecase]{subtitle}%
+          \setunit{\addspace}}%
+        \clearfield{title}\clearfield{subtitle}}%
+      \printfield{titleaddon}%
+      \ifboolexpr{
+        test {\ifentrytype{legislation}}
+        or
+        test {\ifentrytype{jurisdiction}}
+      }{}{%
+        \setunit*{\addspace}%
+        \printfield{version}\clearfield{version}%
+        \iffieldundef{entrysubtype}{%
+          \ifboolexpr{
+            test {\iffieldundef{journaltitle}}
+            and
+            test {\iffieldundef{booktitle}}
+            and (
+              test {\iffieldundef{library}}
+              or
+              test {\ifentrytype{image}}
+              or
+              test {\ifentrytype{audio}}
+              or
+              test {\ifentrytype{video}}
+              or
+              test {\ifentrytype{music}}
+              or
+              test {\ifentrytype{movie}}
+            )
+            and (
+              not (
+                test {\iffieldequalstr{type}{TV}}
+                or
+                test {\iffieldequalstr{type}{Radio}}
+              )
+              or
+              test {\iffieldundef{series}}
+            )
+          }{%
+            \setunit*{\addspace}%
+            \usebibmacro{isonline}%
+          }{}%
+        }{%
+          \setunit*{\addspace}%
+          \printfield{entrysubtype}}}}%
+  }{%
+    \printfield{label}%
+  }}
+
+\newtoggle{bbx:onlineshown}
+\newbibmacro*{isonline}{%
+  \ifboolexpr{(
+      test {\iffieldundef{doi}}
+      and
+      test {\iffieldundef{url}}
+      and
+      test {\iffieldundef{urlyear}}
+      and
+      not test {\ifentrytype{online}}
+    ) or
+    togl {bbx:onlineshown}
+  }{}{%
+    \bibstring[\mkbibbrackets]{online}%
+    \toggletrue{bbx:onlineshown}}}
+
+\newbibmacro*{event+venue+date}{%
   \printfield{eventtitle}%
   \setunit*{\addspace}%
   \printfield{eventtitleaddon}%
@@ -962,89 +2063,6 @@
      \printfield{venue}%
      \newunit}}
 
-\letbibmacro{plain:institution+location+date}{institution+location+date}
-\renewbibmacro*{institution+location+date}{%
-  \iflistundef{publisher}{%
-    \usebibmacro{plain:institution+location+date}%
-  }{%
-    \printlist{institution}%
-    \newunit
-    \usebibmacro{publisher+location+date}}}
-\renewbibmacro*{organization+location+date}{%
-  \iflistundef{publisher}{%
-    \printlist{location}%
-    \iflistundef{organization}
-      {\setunit*{\addcomma\space}}
-      {\setunit*{\addcolon\space}}%
-    \printlist{organization}%
-    \iflistundef{location}
-      {\setunit{\addcomma\space}}%
-      {\setunit*{\addcomma\space}}%
-    \usebibmacro{date}%
-    \newunit
-  }{%
-    \printlist{organization}%
-    \newunit
-    \usebibmacro{publisher+location+date}}}
-
-\DeclareFieldFormat{library}{\mkbibemph{#1}}
-\newbibmacro*{library}{%
-  \iffieldundef{library}{}{%
-    \printfield{library}\clearfield{library}%
-    \setunit*{\addspace}%
-    \usebibmacro{isonline}%
-  }%
-}
-
-\renewcommand*{\ppspace}{}
-\DeclareNumChars{ab}
-\DeclareFieldFormat{url}{\bibsentence\bibstring{urlfrom}\addcolon\space\url{#1}}
-\DeclareFieldFormat{doi}{\bibsentence\bibstring{urlfrom}\addcolon\space\url{https://doi.org/#1}}
-\DeclareFieldFormat{pseudourl}{\bibsentence\bibstring{urlfrom}\addcolon\space#1}
-\DeclareFieldFormat{urldate}{\mkbibbrackets{\bibstring{urlseen}\space#1}}
-\renewbibmacro*{url}{%
-  \iffieldundef{doi}{%
-    \ifboolexpr{
-      test {\iffieldundef{url}}
-      and not
-      test {\iffieldundef{urlyear}}
-    }{\printfield[pseudourl]{library}}{\printfield{url}}%
-  }{%
-    \printfield{doi}%
-  }}
-\renewbibmacro*{doi+eprint+url}{%
-  \iftoggle{bbx:eprint}
-    {\usebibmacro{eprint}}
-    {}%
-  \newunit\newblock
-  \iftoggle{bbx:url}
-    {\usebibmacro{url+urldate}}
-    {}}
-\xpatchbibdriver{online}{%
-  \iftoggle{bbx:doi}
-    {\printfield{doi}}
-    {}%
-  \newunit\newblock
-  \iftoggle{bbx:eprint}
-    {\usebibmacro{eprint}}
-    {}%
-  \newunit\newblock
-  \usebibmacro{url+urldate}%
-}{%
-  \toggletrue{bbx:url}%
-  \usebibmacro{doi+eprint+url}%
-}{}{}
-
-\xpatchbibdriver{article}{%
-  \usebibmacro{in:}\usebibmacro{journal+issuetitle}%
-}{%
-  \usebibmacro{journal+issuetitle}%
-}{}{\wlog{WARNING: biblatex-bath failed to patch article driver}}
-\xpatchbibdriver{article}{%
-  \usebibmacro{addendum+pubstate}%
-}{%
-  \printfield{addendum}%
-}{}{\wlog{WARNING: biblatex-bath failed to patch article driver}}
 \xpatchbibmacro{journal}{%
   \printfield[titlecase]{journaltitle}%
 }{%
@@ -1055,7 +2073,8 @@
 }{%
   \printfield[sentencecase]{journalsubtitle}%
 }{}{\wlog{WARNING: biblatex-bath failed to patch journal macro}}
-\renewbibmacro*{journal+issuetitle}{%
+
+\newbibmacro*{journal+issuetitle}{%
   \usebibmacro{journal}%
   \setunit*{\addspace}%
   \usebibmacro{isonline}%
@@ -1073,168 +2092,82 @@
   \setunit{\addcomma\space}%
   \printfield{pubstate}%
   \newunit}
-\renewbibmacro*{volume+number+eid}{%
+
+\newbibmacro*{volume+number+eid}{%
   \printfield{volume}%
   \printfield[parens]{number}%
   \setunit{\addcomma\space}%
   \printfield{eid}}
 
-\xpatchbibdriver{book}{%
-  \newunit\newblock
-  \usebibmacro{series+number}%
-}{%
-  \setunit{\addcomma\space}%
-  \usebibmacro{series+number}%
-}{}{\wlog{WARNING: biblatex-bath failed to patch book driver (series+number)}}
+\newbibmacro*{maintitle+booktitle}{%
+  \iffieldundef{maintitle}
+    {}
+    {\usebibmacro{maintitle}%
+      \newunit\newblock
+      \iffieldundef{volume}
+        {}
+        {\printfield{volume}%
+        \printfield{part}%
+        \setunit{\addcolon\space}}}%
+  \usebibmacro{booktitle}%
+  \newunit}
 
-\xpatchbibdriver{collection}{%
-  \newunit\newblock
-  \usebibmacro{series+number}%
-}{%
-  \setunit{\addcomma\space}%
-  \usebibmacro{series+number}%
-}{}{\wlog{WARNING: biblatex-bath failed to patch collection driver (series+number)}}
+\DeclareFieldFormat{type}{\ifbibstring{#1}{\biblstring{#1}}{#1}}
+\DeclareFieldFormat[software]{type}{\mkbibbrackets{#1}}
+\DeclareFieldFormat{series}{\MakeSentenceCase*{#1}}
+\DeclareFieldFormat
+  [audio,video,music,video]%
+  {series}{\ifboolexpr{
+    test {\iffieldequalstr{type}{TV}}
+    or
+    test {\iffieldequalstr{type}{Radio}}
+  }{\mkbibemph{\MakeSentenceCase*{#1}}}{\MakeSentenceCase*{#1}}}
+\DeclareFieldFormat
+  [audio,video,music,video]%
+  {number}{\ifboolexpr{
+    test {\iffieldequalstr{type}{TV}}
+    or
+    test {\iffieldequalstr{type}{Radio}}
+  }{\mkbibemph{#1}}{#1}}
+\DeclareFieldFormat[legislation,jurisdiction]{series}{#1}
+\DeclareFieldFormat{forceparens}{(#1)}
 
-\xpatchbibdriver{inbook}{%
-  \newunit\newblock
-  \usebibmacro{series+number}%
-}{%
-  \setunit{\addcomma\space}%
-  \usebibmacro{series+number}%
-}{}{\wlog{WARNING: biblatex-bath failed to patch inbook driver (series+number)}}
+\newbibmacro*{series+number}{%
+  \printfield{series}%
+  \setunit*{\addcomma\space}%
+  \printfield{number}%
+  \newunit}
 
-\xpatchbibdriver{incollection}{%
-  \newunit\newblock
-  \usebibmacro{series+number}%
-}{%
-  \setunit{\addcomma\space}%
-  \usebibmacro{series+number}%
-}{}{\wlog{WARNING: biblatex-bath failed to patch incollection driver (series+number)}}
+\newbibmacro{manual:series+type+number}{%
+  \iffieldundef{series}{%
+    \newunit\newblock
+    \printfield{type}%
+    \setunit{\addspace}%
+    \printfield{number}%
+  }{%
+    \setunit{\addcomma\space}%
+    \usebibmacro{series+number}%
+    \newunit\newblock
+    \printfield{type}%
+  }%
+}
 
-\xpatchbibdriver{inproceedings}{%
-  \newunit\newblock
-  \usebibmacro{series+number}%
-}{%
-  \setunit{\addcomma\space}%
-  \usebibmacro{series+number}%
-}{}{\wlog{WARNING: biblatex-bath failed to patch inproceedings driver (series+number)}}
-
-\xpatchbibdriver{proceedings}{%
-  \newunit\newblock
-  \usebibmacro{series+number}%
-}{%
-  \setunit{\addcomma\space}%
-  \usebibmacro{series+number}%
-}{}{\wlog{WARNING: biblatex-bath failed to patch proceedings driver (series+number)}}
-
-\xpatchbibdriver{incollection}{%
-  \usebibmacro{in:}%
-  \usebibmacro{maintitle+booktitle}%
-  \newunit\newblock
-  \usebibmacro{byeditor+others}%
-}{%
-  \ifnameundef{editor}{}{\usebibmacro{in:}}%
-  \usebibmacro{bookeditor}%
-  \newunit\newblock
-  \usebibmacro{maintitle+booktitle}%
-  \usebibmacro{byeditor+others}%
-}{}{\wlog{WARNING: biblatex-bath failed to patch incollection driver (bookeditor)}}
-
-\xpatchbibdriver{inproceedings}{%
-  \usebibmacro{in:}%
-  \usebibmacro{maintitle+booktitle}%
-  \newunit\newblock
-  \usebibmacro{event+venue+date}%
-  \newunit\newblock
-  \usebibmacro{byeditor+others}%
-}{%
-  \ifnameundef{editor}{}{\usebibmacro{in:}}%
-  \usebibmacro{bookeditor}%
-  \newunit\newblock
-  \usebibmacro{maintitle+booktitle}%
-  \usebibmacro{byeditor+others}%
-  \newunit
-  \usebibmacro{event+venue+date}%
-}{}{\wlog{WARNING: biblatex-bath failed to patch inproceedings driver (bookeditor)}}
-
-\DeclareBibliographyDriver{inreference}{%
-  \usebibmacro{bibindex}%
-  \usebibmacro{begentry}%
-  \usebibmacro{author/translator+others}%
-  \setunit{\printdelim{nametitledelim}}\newblock
-  \ifnameundef{author}{}{\usebibmacro{title}%
-  \newunit}%
-  \printlist{language}%
-  \newunit\newblock
-  \usebibmacro{byauthor}%
-  \newunit\newblock
+\newbibmacro*{collection+shelfmark}{%
   \ifboolexpr{
-    test {\iffieldundef{maintitle}}
-    and
-    test {\iffieldundef{booktitle}}
-  }{}{%
-    \ifnameundef{editor}{}{\usebibmacro{in:}}%
-    \usebibmacro{bookeditor}%
-    \newunit\newblock
-    \usebibmacro{maintitle+booktitle}}%
-  \usebibmacro{byeditor+others}%
-  \newunit\newblock
-  \printfield{edition}%
-  \newunit
-  \iffieldundef{maintitle}
-    {\printfield{volume}%
-     \printfield{part}}
-    {}%
-  \newunit
-  \ifnameundef{author}{\usebibmacro{title}%
-  \newunit}{}%
-  \printfield{volumes}%
-  \newunit\newblock
-  \usebibmacro{series+number}%
-  \newunit\newblock
-  \printfield{note}%
-  \newunit\newblock
-  \usebibmacro{publisher+location+date}%
-  \newunit\newblock
-  \usebibmacro{chapter+pages}%
-  \newunit\newblock
-  \iftoggle{bbx:isbn}
-    {\printfield{isbn}}
-    {}%
-  \newunit\newblock
-  \usebibmacro{doi+eprint+url}%
-  \newunit\newblock
-  \usebibmacro{addendum+pubstate}%
-  \setunit{\bibpagerefpunct}\newblock
-  \usebibmacro{pageref}%
-  \newunit\newblock
-  \iftoggle{bbx:related}
-    {\usebibmacro{related:init}%
-     \usebibmacro{related}}
-    {}%
-  \usebibmacro{finentry}}
+    test {\iffieldundef{library}}
+    or (
+      test {\iffieldundef{collection}}
+      and
+      test {\iffieldundef{shelfmark}}
+    )
+  }{
+    \usebibmacro{series+number}%
+  }{
+    \printfield{collection}%
+    \setunit*{\addcomma\space}%
+    \printfield{shelfmark}%
+    \newunit}}
 
-\xpatchbibdriver{dataset}{%
-  \printlist{organization}%
-  \newunit
-  \usebibmacro{publisher+location+date}%
-}{%
-  \usebibmacro{library}%
-  \newunit\newblock
-  \usebibmacro{organization+location+date}%
-}{}{\wlog{WARNING: biblatex-bath failed to patch dataset driver (publisher)}}
-
-\xpatchbibdriver{online}{%
-  \printlist{organization}%
-  \newunit\newblock
-  \usebibmacro{date}%
-}{%
-  \usebibmacro{library}%
-  \newunit\newblock
-  \usebibmacro{organization+location+date}%
-}{}{\wlog{WARNING: biblatex-bath failed to patch online driver (publisher)}}
-
-\DeclareFieldFormat{forceparens}{(#1)}
 \newbibmacro{series+type+number}{%
   \ifboolexpr{
     test {\iffieldundef{series}}
@@ -1261,73 +2194,139 @@
         \printfield{number}%
       }}}}
 
-\DeclareBibliographyDriver{report}{%
-  \usebibmacro{bibindex}%
-  \usebibmacro{begentry}%
-  \usebibmacro{author}%
-  \setunit{\printdelim{nametitledelim}}\newblock
-  \usebibmacro{title}%
+\newbibmacro*{publisher+location+date}{%
+  \printlist{location}%
+  \iflistundef{publisher}
+    {\setunit*{\addcomma\space}}
+    {\setunit*{\addcolon\space}}%
+  \printlist{publisher}%
+  \setunit*{\addcomma\space}%
+  \usebibmacro{date}%
+  \newunit}
+
+\newbibmacro*{plain:institution+location+date}{%
+  \printlist{location}%
+  \iflistundef{institution}
+    {\setunit*{\addcomma\space}}
+    {\setunit*{\addcolon\space}}%
+  \printlist{institution}%
+  \setunit*{\addcomma\space}%
+  \usebibmacro{date}%
+  \newunit}
+\newbibmacro*{institution+location+date}{%
+  \iflistundef{publisher}{%
+    \usebibmacro{plain:institution+location+date}%
+  }{%
+    \printlist{institution}%
+    \newunit
+    \usebibmacro{publisher+location+date}}}
+
+\newbibmacro*{organization+location+date}{%
+  \iflistundef{publisher}{%
+    \printlist{location}%
+    \iflistundef{organization}
+      {\setunit*{\addcomma\space}}
+      {\setunit*{\addcolon\space}}%
+    \printlist{organization}%
+    \iflistundef{location}
+      {\setunit{\addcomma\space}}%
+      {\setunit*{\addcomma\space}}%
+    \usebibmacro{date}%
+    \newunit
+  }{%
+    \printlist{organization}%
+    \newunit
+    \usebibmacro{publisher+location+date}}}
+
+\DeclareFieldFormat{library}{\mkbibemph{#1}}
+\DeclareFieldFormat[image]{library}{#1}
+\newbibmacro*{library}{%
+  \iffieldundef{library}{}{%
+    \printfield{library}\clearfield{library}%
+    \setunit*{\addspace}%
+    \usebibmacro{isonline}}}
+\newbibmacro*{location+library}{%
+  \iffieldundef{library}{%
+    \iffieldundef{institution}{}{%
+      \printlist{institution}%
+      \setunit{\addcomma\space}%
+      \printlist{location}%
+    }%
+  }{%
+    \printfield{library}\clearfield{library}%
+    \setunit*{\addcomma\space}%
+    \printlist{location}}}
+
+\newbibmacro*{organization+location+date+library}{%
+  \ifboolexpr{
+    test {\iffieldundef{library}}
+    or
+    not test {\iflistundef{publisher}}
+  }{%
+    \printlist{location}\clearfield{location}%
+    \setunit*{\addcolon\space}%
+  }{}%
+  \iflistundef{publisher}{%
+    \iflistundef{organization}{
+      \printlist{location}%
+    }{%
+      \printlist{organization}}
+  }{%
+    \printlist{publisher}%
+  }%
+  \setunit{\addcomma\space}%
+  \usebibmacro{date}%
   \newunit
-  \printlist{language}%
-  \newunit\newblock
-  \usebibmacro{byauthor}%
-  \newunit\newblock
-  \usebibmacro{series+type+number}%
-  \newunit\newblock
+  \usebibmacro{location+library}}
+
+\newbibmacro*{isunpublished}{%
+  \bibstring{unpublished}}
+
+\renewcommand*{\ppspace}{}
+\DeclareNumChars{ab}
+
+\newbibmacro*{chapter+pages}{%
+  \printfield{chapter}%
+  \setunit{\bibpagespunct}%
+  \printfield{eid}%
+  \setunit{\bibpagespunct}%
+  \printfield{pages}%
+  \newunit}
+
+\newbibmacro*{note+pages}{%
   \printfield{note}%
+  \setunit{\bibpagespunct}%
+  \printfield{pages}%
+  \newunit}
+
+\newbibmacro*{addendum+pubstate}{%
+  \printfield{addendum}%
   \newunit\newblock
-  \usebibmacro{institution+location+date}%
-  \newunit\newblock
-  \usebibmacro{chapter+pages}%
-  \newunit
-  \printfield{pagetotal}%
-  \newunit\newblock
-  \iftoggle{bbx:isbn}
-    {\printfield{isrn}}
-    {}%
-  \newunit\newblock
-  \usebibmacro{library}%
-  \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}}
+  \printfield{pubstate}}
 
-\newbibmacro{manual:series+type+number}{%
-  \iffieldundef{series}{%
-    \newunit\newblock
-    \printfield{type}%
-    \setunit{\addspace}%
-    \printfield{number}%
+\DeclareFieldFormat{url}{\bibsentence\bibstring{urlfrom}\addcolon\space\url{#1}}
+\DeclareFieldFormat{doi}{\bibsentence\bibstring{urlfrom}\addcolon\space\url{https://doi.org/#1}}
+\DeclareFieldFormat{pseudourl}{\bibsentence\bibstring{urlfrom}\addcolon\space#1}
+\DeclareFieldFormat{urldate}{\mkbibbrackets{\bibstring{urlseen}\space#1}}
+
+\renewbibmacro*{url}{%
+  \iffieldundef{doi}{%
+    \ifboolexpr{
+      test {\iffieldundef{url}}
+      and not
+      test {\iffieldundef{urlyear}}
+    }{\printfield[pseudourl]{library}}{\printfield{url}}%
   }{%
-    \setunit{\addcomma\space}%
-    \usebibmacro{series+number}%
-    \newunit\newblock
-    \printfield{type}%
-  }%
-}
-\xpatchbibdriver{manual}{%
+    \printfield{doi}%
+  }}
+\newbibmacro*{doi+eprint+url}{%
+  \iftoggle{bbx:eprint}
+    {\usebibmacro{eprint}}
+    {}%
   \newunit\newblock
-  \usebibmacro{series+number}%
-  \newunit\newblock
-  \printfield{type}%
-}{%
-  \usebibmacro{manual:series+type+number}%
-}{}{\wlog{WARNING: biblatex-bath failed to patch manual driver}}
-\xpatchbibdriver{manual}{%
-  \printlist{organization}%
-  \newunit
-  \usebibmacro{publisher+location+date}%
-}{%
-  \usebibmacro{organization+location+date}%
-}{}{\wlog{WARNING: biblatex-bath failed to patch manual driver}}
+  \iftoggle{bbx:url}
+    {\usebibmacro{url+urldate}}
+    {}}
 
 \DeclareStyleSourcemap{%
   \maps[datatype=bibtex]{%
@@ -1348,50 +2347,6 @@
   }}
 \ExecuteBibliographyOptions[standard]{useeditor=false}
 
-\DeclareBibliographyDriver{audio}{%
-  \usebibmacro{bibindex}%
-  \usebibmacro{begentry}%
-  \usebibmacro{author/editor+others/translator+others}%
-  \setunit{\printdelim{nametitledelim}}\newblock
-  \usebibmacro{title}%
-  \newunit\newblock
-  \usebibmacro{series+number}%
-  \ifboolexpr{
-    test {\iffieldequalstr{type}{TV}}
-    or
-    test {\iffieldequalstr{type}{Radio}}
-  }{%
-    \setunit{\addspace}%
-    \usebibmacro{isonline}}{}%
-  \newunit
-  \printlist{language}%
-  \newunit\newblock
-  \printfield{type}%
-  \newunit\newblock
-  \usebibmacro{byauthor}[given-family:full]%
-  \newunit\newblock
-  \usebibmacro{byeditor+others}[given-family:full]%
-  \newunit\newblock
-  \printfield{howpublished}%
-  \newunit\newblock
-  \printfield{note}%
-  \newunit\newblock
-  \usebibmacro{publisher+location+date}%
-  \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}}
-\DeclareBibliographyAlias{movie}{audio}
-\DeclareBibliographyAlias{music}{audio}
-\DeclareBibliographyAlias{video}{audio}
 \newtoggle{bbx:eu-oj}
 \newbibmacro*{eucheck}{%
   \IfBeginWith{\thefield{journaltitle}}{OJ}{%
@@ -1525,48 +2480,6 @@
 
 \DeclareFieldFormat[jurisdiction]{institution}{\mkbibparens{#1}}
 
-\DeclareBibliographyDriver{jurisdiction}{%
-  \savebibmacro{title}%
-  \xapptobibmacro{labeltitle}{%
-    \setunit*{\addspace}%
-    \usebibmacro{casenumber}%
-  }{}{}%
-  \usebibmacro{bibindex}%
-  \usebibmacro{begentry}%
-  \usebibmacro{eucheck}%
-  \usebibmacro{author}%
-  \setunit{\printdelim{nametitledelim}}\newblock
-  \usebibmacro{title}%
-  \newunit
-  \printlist{language}%
-  \newunit\newblock
-  \usebibmacro{byauthor}%
-  \newunit\newblock
-  \printfield{note}%
-  \setunit{\addspace}%
-  \usebibmacro{reporter}%
-  \newunit
-  \printfield{pagetotal}%
-  \newunit\newblock
-  \printfield{institution}%
-  \newunit\newblock
-  \iftoggle{bbx:isbn}
-    {\printfield{isrn}}
-    {}%
-  \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}%
-  \restorebibmacro{title}}
-
 \DeclareFieldFormat[legislation]{datelabel}{%
   \iftoggle{bbx:eu-oj}{%
     \mkbibbrackets{#1}%
@@ -1610,228 +2523,121 @@
           \setunit*{\addcomma\space}%
           \printfield{chapter}}}}}}
 
-\DeclareBibliographyDriver{legislation}{%
-  \usebibmacro{bibindex}%
-  \usebibmacro{begentry}%
-  \usebibmacro{eucheck}%
-  \usebibmacro{author}%
-  \setunit{\printdelim{nametitledelim}}\newblock
-  \usebibmacro{title}%
-  \newunit
-  \printlist{language}%
-  \newunit\newblock
-  \usebibmacro{byauthor}%
-  \newunit\newblock
-  \usebibmacro{journal+series+volume+number+chapter+pages}
-  \newunit\newblock
-  \printfield{note}%
-  \newunit\newblock
-  \usebibmacro{institution+location+date}%
-  \newunit\newblock
-  \printfield{pagetotal}%
-  \newunit\newblock
-  \iftoggle{bbx:isbn}
-    {\printfield{isrn}}
-    {}%
-  \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}}
+\newcounter{bbx:relatedcount}
+\newcounter{bbx:relatedtotal}
 
-\DeclareFieldFormat[letter]{title}{\iffieldundef{journaltitle}{\emph{#1}}{#1}}
-\ExecuteBibliographyOptions[letter]{mergedate=maximum}
-\DeclareBibliographyDriver{letter}{%
-  \usebibmacro{bibindex}%
-  \usebibmacro{begentry}%
-  \usebibmacro{author/translator+others}%
-  \setunit{\printdelim{nametitledelim}}\newblock
-  \usebibmacro{title}%
-  \newunit
-  \printlist{language}%
-  \newunit\newblock
-  \usebibmacro{byauthor}%
-  \newunit\newblock
-  \usebibmacro{bytranslator+others}%
-  \newunit\newblock
-  \usebibmacro{journal+issuetitle}%
-  \newunit\newblock
-  \printfield{howpublished}%
-  \newunit
-  \printfield{note}%
-  \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}%
-}
+\newbibmacro*{related:init}{%
+  \csundef{bbx:relatedloop}}
 
-\DeclareFieldFormat[software]{type}{\mkbibbrackets{#1}}
-\DeclareBibliographyDriver{software}{%
-  \usebibmacro{bibindex}%
-  \usebibmacro{begentry}%
-  \usebibmacro{author/editor+others/translator+others}%
-  \setunit{\printdelim{nametitledelim}}\newblock
-  \usebibmacro{title}%
-  \setunit{\addspace}
-  \printfield{type}%
-  \newunit
-  \printlist{language}%
-  \newunit\newblock
-  \usebibmacro{byauthor}%
-  \newunit\newblock
-  \usebibmacro{byeditor+others}%
-  \newunit\newblock
-  \printfield{howpublished}%
-  \newunit\newblock
-  \printfield{note}%
-  \newunit\newblock
-  \usebibmacro{organization+location+date}%
-  \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}}
+\newbibmacro*{begrelated}{%
+  \booltrue{bbx at inset}}
 
-\DeclareFieldFormat[image]{library}{#1}
-\DeclareBibliographyDriver{image}{%
-  \usebibmacro{bibindex}%
-  \usebibmacro{begentry}%
-  \usebibmacro{author/editor+others/translator+others}%
-  \setunit{\printdelim{nametitledelim}}\newblock
-  \usebibmacro{title}%
-  \newunit
-  \printlist{language}%
-  \newunit\newblock
-  \usebibmacro{byauthor}%
-  \newunit\newblock
-  \usebibmacro{byeditor+others}%
-  \newunit\newblock
-  \printfield{howpublished}%
-  \newunit\newblock
-  \printfield{type}%
-  \newunit
-  \printfield{note}%
-  \newunit\newblock
-  \usebibmacro{organization+location+date+library}%
-  \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}}
-\newbibmacro*{organization+location+date+library}{%
-  \ifboolexpr{
-    test {\iffieldundef{library}}
-    or
-    not test {\iflistundef{publisher}}
-  }{%
-    \printlist{location}%
-    \setunit*{\addcolon\space}%
-    \clearfield{location}%
-  }{}%
-  \iflistundef{publisher}{%
-    \printlist{organization}%
-  }{%
-    \printlist{publisher}%
-  }%
-  \setunit{\addcomma\space}%
-  \usebibmacro{date}%
-  \newunit
-  \iffieldundef{library}{%
-    \iffieldundef{institution}{}{%
-      \bibsentence
-      \bibstring{at}%
-      \setunit{\addcolon\space}%
-      \printlist{location}%
-      \setunit*{\addperiod\space}%
-      \printfield{institution}%
-    }%
-  }{%
-    \bibsentence
-    \bibstring{at}%
-    \setunit{\addcolon\space}%
-    \printlist{location}%
-    \setunit*{\addperiod\space}%
-    \printfield{library}\clearfield{library}%
-  }%
-}
+\newbibmacro*{endrelated}{%
+  \usebibmacro*{bbx:savehash}}
 
-\newbibmacro*{isunpublished}{%
-  \bibstring{unpublished}%
-}
-\DeclareBibliographyDriver{unpublished}{%
-  \usebibmacro{bibindex}%
-  \usebibmacro{begentry}%
-  \usebibmacro{author}%
-  \setunit{\printdelim{nametitledelim}}\newblock
-  \usebibmacro{title}%
-  \newunit
-  \printlist{language}%
-  \newunit\newblock
-  \usebibmacro{byauthor}%
-  \newunit\newblock
-  \ifnameundef{editor}{}{\usebibmacro{in:}}%
-  \usebibmacro{bookeditor}%
-  \newunit\newblock
-  \usebibmacro{maintitle+booktitle}%
-  \usebibmacro{byeditor+others}%
-  \newunit\newblock
-  \printfield{howpublished}%
-  \newunit\newblock
-  \printfield{type}%
-  \newunit\newblock
-  \usebibmacro{event+venue+date}%
-  \newunit\newblock
-  \printfield{note}%
-  \newunit\newblock
-  \usebibmacro{location+date}%
-  \newunit\newblock
-  \usebibmacro{isunpublished}%
-  \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}}
+\newbibmacro*{begrelatedloop}{}
+\newbibmacro*{endrelatedloop}{}
 
-\DeclareBibliographyAlias{standard}{manual}
+\def\ifrelatedloop{%
+  \ifboolexpr{ test {\xifinlistcs{\strfield{entrykey}}{bbx:relatedloop}}
+    or test {\xifinlistcs{\strfield{clonesourcekey}}{bbx:relatedloop}} }}
 
+\newbibmacro*{related}{%
+  \ifboolexpr{ test {\iffieldundef{related}} or test {\ifrelatedloop} }
+    {}
+    {\ifcsundef{begrelateddelim\strfield{relatedtype}}
+        {\printunit{\begrelateddelim}}
+        {\printunit{\csuse{begrelateddelim\strfield{relatedtype}}}}%
+      \usebibmacro{begrelated}%
+      \def\bbx at tempa{}%
+      \setcounter{bbx:relatedtotal}{0}%
+      \def\do##1{%
+        \entrydata{##1}{%
+          \ifrelatedloop
+            {}
+            {\stepcounter{bbx:relatedtotal}%
+            \gappto{\bbx at tempa}{##1,}}}}%
+      \docsvfield{related}%
+      \restorefield{related}{\bbx at tempa}%
+      \ifnumgreater{\value{bbx:relatedtotal}}{0}
+        {\listcsxadd{bbx:relatedloop}{\strfield{entrykey}}%
+        \iffieldundef{clonesourcekey}
+          {}
+          {\listcsxadd{bbx:relatedloop}{\strfield{clonesourcekey}}}%
+        \setcounter{bbx:relatedcount}{0}%
+        \def\do{%
+          \stepcounter{bbx:relatedcount}%
+          \ifnumgreater{\value{bbx:relatedcount}}{1}
+            {\ifcsundef{relateddelim\strfield{relatedtype}}
+              {\printunit{\relateddelim}}
+              {\expandafter\expandafter\expandafter\expandafter\expandafter
+                \expandafter\expandafter\printunit
+                \expandafter\expandafter\expandafter\expandafter\expandafter
+                \expandafter\expandafter{%
+                  \csuse{relateddelim\strfield{relatedtype}}}}}
+            {}}%
+        \ifbibmacroundef{related:\strfield{relatedtype}}
+          {\appto{\do}{\usebibmacro{related:default}}}
+          {\appto{\do}{\usebibmacro*{related:\strfield{relatedtype}}}}%
+        \iffieldformatundef{related:\strfield{relatedtype}}
+          {\def\bbx at tempa{related}}
+          {\def\bbx at tempa{related:\strfield{relatedtype}}}%
+        \iffieldformatundef{relatedstring:\strfield{relatedtype}}
+          {\def\bbx at tempb{relatedstring:default}}
+          {\def\bbx at tempb{relatedstring:\strfield{relatedtype}}}%
+        \printtext[\bbx at tempa]{%
+          \usebibmacro{begrelatedloop}%
+          \iffieldundef{relatedstring}
+            {\ifboolexpr{
+                test {\ifnumgreater{\value{bbx:relatedtotal}}{1}}
+                and
+                test {\ifbibxstring{\thefield{relatedtype}s}}
+              }
+                {\printtext[\bbx at tempb]{%
+                  \bibstring[\mkrelatedstringtext]{\thefield{relatedtype}s}}}
+                {\iffieldbibstring{relatedtype}
+                  {\printtext[\bbx at tempb]{%
+                      \bibstring[\mkrelatedstringtext]{\thefield{relatedtype}}}}
+                  {}}}
+            {\iffieldbibstring{relatedstring}
+                {\printtext[\bbx at tempb]{%
+                  \bibstring[\mkrelatedstringtext]{\thefield{relatedstring}}}}
+                {\printfield[\bbx at tempb]{relatedstring}}}%
+          \docsvfield{related}%
+          \usebibmacro{endrelatedloop}}}%
+        {}%
+      \usebibmacro{endrelated}}}
+
+\DeclareFieldFormat{shorthandwidth}{#1}
+\setlength{\bibhang}{0pt}
+\setlength{\bibitemsep}{1em plus 0.2em minus 0.2em}
+\renewcommand*{\bibfont}{\normalfont\normalsize}
+
+\defbibenvironment{bibliography}
+  {\list
+     {}
+     {\setlength{\leftmargin}{\bibhang}%
+      \setlength{\itemindent}{-\leftmargin}%
+      \setlength{\itemsep}{\bibitemsep}%
+      \setlength{\parsep}{\bibparsep}}}
+  {\endlist}
+  {\item}
+
+\defbibenvironment{shorthand}
+  {\list
+     {\printfield[shorthandwidth]{shorthand}}
+     {\setlength{\labelwidth}{\shorthandwidth}%
+      \setlength{\leftmargin}{\labelwidth}%
+      \setlength{\labelsep}{\biblabelsep}%
+      \addtolength{\leftmargin}{\labelsep}%
+      \setlength{\itemsep}{\bibitemsep}%
+      \setlength{\parsep}{\bibparsep}%
+      \renewcommand*{\makelabel}[1]{##1\hss}}}
+  {\endlist}
+  {\item}
+
+\InitializeBibliographyStyle{\global\undef\bbx at lasthash}
+
 \DeclareStyleSourcemap{%
   \maps[datatype=bibtex]{%
     \map{%

Modified: trunk/Master/texmf-dist/tex/latex/biblatex-bath/bath.cbx
===================================================================
--- trunk/Master/texmf-dist/tex/latex/biblatex-bath/bath.cbx	2022-05-25 20:19:05 UTC (rev 63400)
+++ trunk/Master/texmf-dist/tex/latex/biblatex-bath/bath.cbx	2022-05-25 20:19:25 UTC (rev 63401)
@@ -13,7 +13,7 @@
 %% See:     http://www.latex-project.org/lppl.txt
 %% ----------------------------------------------------------------
 %% 
-\def\Version{2022/03/04 v5.0}
+\def\Version{2022/05/25 v6.0}
 \NeedsTeXFormat{LaTeX2e}[1999/12/01]
 \ProvidesFile{bath.cbx}
     [\Version\space Citation style as recommended by the University of Bath Library]
@@ -32,8 +32,8 @@
 \xpatchbibmacro{cite:label}{%
   \printtext[bibhyperref]{\printfield[citetitle]{labeltitle}}%
 }{%
+  \toggletrue{bbx:labelistitle}%
   \printtext[bibhyperref]{\printfield[citetitle]{labeltitle}}%
-  \toggletrue{bbx:labelistitle}%
 }{}{\wlog{WARNING: biblatex-bath failed to patch cite:label}}
 
 %% 

Modified: trunk/Master/texmf-dist/tex/latex/biblatex-bath/bath.dbx
===================================================================
--- trunk/Master/texmf-dist/tex/latex/biblatex-bath/bath.dbx	2022-05-25 20:19:05 UTC (rev 63400)
+++ trunk/Master/texmf-dist/tex/latex/biblatex-bath/bath.dbx	2022-05-25 20:19:25 UTC (rev 63401)
@@ -13,11 +13,13 @@
 %% See:     http://www.latex-project.org/lppl.txt
 %% ----------------------------------------------------------------
 %% 
-\def\Version{2022/03/04 v5.0}
+\def\Version{2022/05/25 v6.0}
 \NeedsTeXFormat{LaTeX2e}[1999/12/01]
 \ProvidesFile{bath.dbx}
     [\Version\space Data model required by the biblatex-bath style]
 \DeclareDatamodelConstant[type=list]{nameparts}{prefix,family,suffix,given,cjk}
+\DeclareDatamodelFields[type=field,datatype=literal]{collection,shelfmark}
+\DeclareDatamodelEntryfields[booklet,image,map,unpublished]{collection,shelfmark}
 
 %% 
 %% Copyright (C) 2016-2022 by University of Bath

Modified: trunk/Master/texmf-dist/tex/latex/biblatex-bath/british-bath.lbx
===================================================================
--- trunk/Master/texmf-dist/tex/latex/biblatex-bath/british-bath.lbx	2022-05-25 20:19:05 UTC (rev 63400)
+++ trunk/Master/texmf-dist/tex/latex/biblatex-bath/british-bath.lbx	2022-05-25 20:19:25 UTC (rev 63401)
@@ -13,7 +13,7 @@
 %% See:     http://www.latex-project.org/lppl.txt
 %% ----------------------------------------------------------------
 %% 
-\def\Version{2022/03/04 v5.0}
+\def\Version{2022/05/25 v6.0}
 \NeedsTeXFormat{LaTeX2e}[1999/12/01]
 \ProvidesFile{british-bath.lbx}
     [\Version\space British English conventions required by the biblatex-bath style]

Modified: trunk/Master/texmf-dist/tex/latex/biblatex-bath/english-bath.lbx
===================================================================
--- trunk/Master/texmf-dist/tex/latex/biblatex-bath/english-bath.lbx	2022-05-25 20:19:05 UTC (rev 63400)
+++ trunk/Master/texmf-dist/tex/latex/biblatex-bath/english-bath.lbx	2022-05-25 20:19:25 UTC (rev 63401)
@@ -13,7 +13,7 @@
 %% See:     http://www.latex-project.org/lppl.txt
 %% ----------------------------------------------------------------
 %% 
-\def\Version{2022/03/04 v5.0}
+\def\Version{2022/05/25 v6.0}
 \NeedsTeXFormat{LaTeX2e}[1999/12/01]
 \ProvidesFile{english-bath.lbx}
     [\Version\space Generic English conventions required by the biblatex-bath style]



More information about the tex-live-commits mailing list.