diff options
Diffstat (limited to 'macros/latex')
-rw-r--r-- | macros/latex/contrib/biblatex-contrib/biblatex-bath/biblatex-bath.dtx | 3732 | ||||
-rw-r--r-- | macros/latex/contrib/biblatex-contrib/biblatex-bath/biblatex-bath.pdf | bin | 397737 -> 462745 bytes | |||
-rw-r--r-- | macros/latex/contrib/mnotes/Makefile | 2 | ||||
-rw-r--r-- | macros/latex/contrib/mnotes/mnotes.dtx | 81 | ||||
-rw-r--r-- | macros/latex/contrib/mnotes/mnotes.pdf | bin | 210491 -> 212401 bytes | |||
-rw-r--r-- | macros/latex/contrib/nicematrix/nicematrix-french.pdf | bin | 504733 -> 504127 bytes | |||
-rw-r--r-- | macros/latex/contrib/nicematrix/nicematrix-french.tex | 52 | ||||
-rw-r--r-- | macros/latex/contrib/nicematrix/nicematrix.dtx | 206 | ||||
-rw-r--r-- | macros/latex/contrib/nicematrix/nicematrix.pdf | bin | 1512102 -> 1526205 bytes |
9 files changed, 2687 insertions, 1386 deletions
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-bath/biblatex-bath.dtx b/macros/latex/contrib/biblatex-contrib/biblatex-bath/biblatex-bath.dtx index 59e99148e3..a0cb54fdf2 100644 --- a/macros/latex/contrib/biblatex-contrib/biblatex-bath/biblatex-bath.dtx +++ b/macros/latex/contrib/biblatex-contrib/biblatex-bath/biblatex-bath.dtx @@ -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 @@ concerning the handling of dates). \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 @@ Use the most appropriate \texttt{reference} entry type instead of, say, \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 @@ automatically for you. \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 @@ automatically for you. \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 @@ for `preprint'. \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 @@ patent requests\slash applications. \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,33 +1379,46 @@ record the source of the image. \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> -@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}} +@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} \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 @@ You can also use \texttt{movie} as an alias for \texttt{video}. \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 @@ Otherwise, give both series and episode number as the \texttt{title}. \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 @@ and the \texttt{library} field for the name of the database itself. 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 @@ and the \texttt{library} field for the name of the database itself. \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 @@ Use the \texttt{titleaddon} field to supply the English translation of the title \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 @@ Use the \texttt{titleaddon} field to supply the English translation of the title {清代以來三峽地區水旱災害的初步硏}}, 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 @@ This work is `maintained' (as per LPPL maintenance status) by [Alex Ball][me]. % instead of writing out our own in full. % % \begin{macrocode} -\RequirePackage{xpatch} +\RequirePackage{etoolbox,xpatch} % \end{macrocode} % % Some string analysis is required. @@ -2450,25 +2481,12 @@ This work is `maintained' (as per LPPL maintenance status) by [Alex Ball][me]. % American English. Adapted language files have the following suffix: % % \begin{macrocode} -\RequirePackage{etoolbox} \ifcsdef{DeclareLanguageMappingSuffix}{% \DeclareLanguageMappingSuffix{-bath} }{% \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. @@ -2480,14 +2498,7 @@ This work is `maintained' (as per LPPL maintenance status) by [Alex Ball][me]. 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}, @@ -2511,6 +2522,18 @@ This work is `maintained' (as per LPPL maintenance status) by [Alex Ball][me]. (test {\iffieldequalstr{labeldatesource}{}} or test {\iffieldequalstr{labeldatesource}{year}})}}% } +\ifcsdef{DeclareBiblatexOption}{}{% + \def\DeclareBiblatexOption@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@I#1[#2]#3#4{\@ifnextchar[% + {\DeclareBiblatexOption@II#1[#2]#3#4}% + {\DeclareBiblatexOption@II#1[#2]#3[]#4}}% + \def\DeclareBiblatexOption#1#2{\@ifnextchar[% + {\DeclareBiblatexOption@I#1#2}% + {\DeclareBiblatexOption@I#1[]#2}}% +} % \end{macrocode} % % This makes \textsf{biblatex} take notice of parentheses, brackets @@ -2536,19 +2559,1484 @@ This work is `maintained' (as per LPPL maintenance status) by [Alex Ball][me]. % \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} +% +% \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@lasthash}} + +\DeclareBibliographyOption[boolean]{dashed}[true]{% + \ifstrequal{#1}{true} + {\ExecuteBibliographyOptions{pagetracker}% + \renewbibmacro*{bbx:savehash}{\savefield{fullhash}{\bbx@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@opt@mergedate@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@opt@mergedate@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@opt@mergedate@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@opt@mergedate@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@opt@mergedate@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@opt@mergedate@year{% + \renewbibmacro*{date+extradate}{% + \iffieldundef{labelyear}{}{% + \ifboolexpr{ + togl {bbx:nonodate} + and + not test {\iflabeldateisdate} + }{}{% + \printtext[datelabel]{\printlabeldateextra}% + }% + \iflabeldateisdate{% + \clearfield{year}% + }{}}} + \ifcsundef{abx@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@opt@mergedate@true{\bbx@opt@mergedate@year} + +% \end{macrocode} +% +% We define the option in terms of the above. +% +% \begin{macrocode} +\DeclareBiblatexOption{global,type,entry}[boolean]{mergedate}[true]{% + \ifcsdef{bbx@opt@mergedate@#1} + {\csuse{bbx@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@inset} +\DeclareBibliographyDriver{set}{% + \booltrue{bbx@inset}% + \entryset{}{}% + \newunit\newblock + \usebibmacro{setpageref}% + \finentry} + % \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}. +% \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), @@ -2592,6 +4080,12 @@ This work is `maintained' (as per LPPL maintenance status) by [Alex Ball][me]. }% } +% \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,7 +4150,72 @@ This work is `maintained' (as per LPPL maintenance status) by [Alex Ball][me]. % \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@lasthash}} + and + not test \iffirstonpage + and + ( + not bool {bbx@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}} @@ -2683,22 +4242,74 @@ This work is `maintained' (as per LPPL maintenance status) by [Alex Ball][me]. \setunit{\printdelim{nameyeardelim}}}}% {\global\undef\bbx@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@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@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 @@ This work is `maintained' (as per LPPL maintenance status) by [Alex Ball][me]. \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 @@ This work is `maintained' (as per LPPL maintenance status) by [Alex Ball][me]. % \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 @@ This work is `maintained' (as per LPPL maintenance status) by [Alex Ball][me]. \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 @@ This work is `maintained' (as per LPPL maintenance status) by [Alex Ball][me]. % \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,199 +4518,6 @@ This work is `maintained' (as per LPPL maintenance status) by [Alex Ball][me]. 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@blx@opt@pre@mergedate}{% - 'true' (=compact)% -}{% - 'year', 'true' (=year)% -}{}{\wlog{WARNING: biblatex-bath failed to patch KV@blx@opt@pre@datemerge}} -\ifdefined\KV@blx@opt@typ@mergedate - \xpatchcmd{\KV@blx@opt@typ@mergedate}{% - 'true' (=compact)% - }{% - 'year', 'true' (=year)% - }{}{\wlog{WARNING: biblatex-bath failed to patch KV@blx@opt@typ@datemerge}} -\else - \DeclareTypeOption[boolean]{mergedate}[true]{% - \ifcsdef{bbx@opt@mergedate@#1}{% - \csuse{bbx@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@blx@opt@ent@mergedate}{% - 'true' (=compact)% -}{% - 'year', 'true' (=year)% -}{}{\wlog{WARNING: biblatex-bath failed to patch KV@blx@opt@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@opt@mergedate@maximum}{% - \iffieldundef{labelyear}% -}{% - \ifboolexpr{ - togl {bbx:nonodate} - and - not test {\iflabeldateisdate}}% -}{}{\wlog{WARNING: biblatex-bath failed to patch bbx@opt@mergedate@maximum}} -\xpatchcmd{\bbx@opt@mergedate@maximum}{% - \printtext[parens]% -}{% - \printtext[datelabel]% -}{}{\wlog{WARNING: biblatex-bath failed to patch bbx@opt@mergedate@maximum}} -\xpatchcmd{\bbx@opt@mergedate@compact}{% - \iffieldundef{labelyear}% -}{% - \ifboolexpr{ - togl {bbx:nonodate} - and - not test {\iflabeldateisdate}}% -}{}{\wlog{WARNING: biblatex-bath failed to patch bbx@opt@mergedate@compact}} -\xpatchcmd{\bbx@opt@mergedate@compact}{% - \printtext[parens]% -}{% - \printtext[datelabel]% -}{}{\wlog{WARNING: biblatex-bath failed to patch bbx@opt@mergedate@compact}} -\xpatchcmd{\bbx@opt@mergedate@basic}{% - \iffieldundef{labelyear}% -}{% - \ifboolexpr{ - togl {bbx:nonodate} - and - not test {\iflabeldateisdate}}% -}{}{\wlog{WARNING: biblatex-bath failed to patch bbx@opt@mergedate@basic}} -\xpatchcmd{\bbx@opt@mergedate@basic}{% - \printtext[parens]% -}{% - \printtext[datelabel]% -}{}{\wlog{WARNING: biblatex-bath failed to patch bbx@opt@mergedate@basic}} -\xpatchcmd{\bbx@opt@mergedate@minimum}{% - \iffieldundef{labelyear}% -}{% - \ifboolexpr{ - togl {bbx:nonodate} - and - not test {\iflabeldateisdate}}% -}{}{\wlog{WARNING: biblatex-bath failed to patch bbx@opt@mergedate@minimum}} -\xpatchcmd{\bbx@opt@mergedate@minimum}{% - \printtext[parens]% -}{% - \printtext[datelabel]% -}{}{\wlog{WARNING: biblatex-bath failed to patch bbx@opt@mergedate@minimum}} -\xpatchcmd{\bbx@opt@mergedate@false}{% - \iffieldundef{labelyear}% -}{% - \ifboolexpr{ - togl {bbx:nonodate} - and - not test {\iflabeldateisdate}}% -}{}{\wlog{WARNING: biblatex-bath failed to patch bbx@opt@mergedate@false}} -\xpatchcmd{\bbx@opt@mergedate@false}{% - \printtext[parens]% -}{% - \printtext[datelabel]% -}{}{\wlog{WARNING: biblatex-bath failed to patch bbx@opt@mergedate@false}} -% \end{macrocode} -% -% If an older version of biblatex is used, we update the logic for -% |\bbx@opt@mergedate@maximum|, which is used by the |letter| driver. -% -% \begin{macrocode} -\xpatchcmd{\bbx@opt@mergedate@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@opt@mergedate@year{% - \renewbibmacro*{date+extradate}{% - \iffieldundef{labelyear}{}{% - \ifboolexpr{ - togl {bbx:nonodate} - and - not test {\iflabeldateisdate} - }{}{% - \printtext[datelabel]{\printlabeldateextra}% - }% - \iflabeldateisdate{% - \clearfield{year}% - }{}}} - \ifcsundef{abx@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@opt@mergedate@true{\bbx@opt@mergedate@year} -\ExecuteBibliographyOptions{mergedate} - % \end{macrocode} % % The problem with moving years but leaving months and days behind is that the @@ -3515,9 +4641,12 @@ This work is `maintained' (as per LPPL maintenance status) by [Alex Ball][me]. \iffieldundef{#2year} {\mknoyeardaterangetrunc{#1}{#2}}% }{}{\wlog{WARNING: biblatex-bath failed to patch mkdaterangetruncextra@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 @@ This work is `maintained' (as per LPPL maintenance status) by [Alex Ball][me]. % \end{macrocode} % -% \subsection{Versions} -% -% Versions are printed with `v.\@' in parentheses. +% \subsection{Title block} % -% \begin{macrocode} -\DeclareFieldFormat{version}{\mkbibparens{\biblcsstring{version}#1}} -% \end{macrocode} -% -% \subsection{Types} -% -% Types are always printed longhand. +% Most titles are set in italics, but some are set roman and unquoted. % % \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 - [audio,video,music,video]% - {series}{\ifboolexpr{ - test {\iffieldequalstr{type}{TV}} - or - test {\iffieldequalstr{type}{Radio}} - }{\mkbibemph{\MakeSentenceCase*{#1}}}{\MakeSentenceCase*{#1}}} + [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]% - {number}{\ifboolexpr{ + {title}{\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} + }{#1}{\mkbibemph{#1}}} +\DeclareFieldFormat + [unpublished]% + {title}{\iffieldundef{booktitle}{\mkbibemph{#1}}{#1}} +\DeclareFieldFormat + [letter]% + {title}{\iffieldundef{journaltitle}{\emph{#1}}{#1}} + % \end{macrocode} % -% \subsection{Events} -% -% Events are printed as date then venue with no intermediate punctuation. +% Versions are printed with `v.\@' in parentheses. % % \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{version}{\mkbibparens{\biblcsstring{version}#1}} % \end{macrocode} % -% \subsection{Publishers} -% -% We patch the secondary publication macros so they will use the -% publisher list instead, if provided. +% 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} -\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}}} +\DeclareFieldFormat{titleaddon}{\mkbibbrackets{% + \IfBeginWith{#1}{[}{% + \IfEndWith{#1}{]}{% + \StrBetween{#1}{[}{]}% + }{#1}% + }{#1}% +}} + % \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}. +% Subtitles are set off with a colon % % \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}}} +\renewcommand*{\subtitlepunct}{\addcolon\space} % \end{macrocode} % -% We use the \texttt{library} field for databases and preprint repositories. +% The |maintitle+title| and |title+issuetitle| are intended to be unchanged from +% the standard definitions. % % \begin{macrocode} -\DeclareFieldFormat{library}{\mkbibemph{#1}} -\newbibmacro*{library}{% - \iffieldundef{library}{}{% - \printfield{library}\clearfield{library}% - \setunit*{\addspace}% - \usebibmacro{isonline}% - }% -} +\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} % -% \subsection{Page numbers} +% 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} -\renewcommand*{\ppspace}{} -\DeclareNumChars{ab} +\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}} + }% +} + % \end{macrocode} % -% \subsection{URLs} -% -% URLs are prefaced by a `from' statement, and the URL date is enclosed in -% brackets rather than parentheses. +% Similar changes are needed for the |booktitle| and |maintitle| macros. % % \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}} +\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} % -% 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. +% 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). % % \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 @@ This work is `maintained' (as per LPPL maintenance status) by [Alex Ball][me]. }{% \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 @@ This work is `maintained' (as per LPPL maintenance status) by [Alex Ball][me]. % position. % % \begin{macrocode} -\renewbibmacro*{journal+issuetitle}{% +\newbibmacro*{journal+issuetitle}{% \usebibmacro{journal}% \setunit*{\addspace}% \usebibmacro{isonline}% @@ -3799,7 +5088,8 @@ This work is `maintained' (as per LPPL maintenance status) by [Alex Ball][me]. \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 @@ This work is `maintained' (as per LPPL maintenance status) by [Alex Ball][me]. % \end{macrocode} % -% \subsection{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. +% \subsection{Monograph containers and entry titles} % % \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)}} - -\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)}} +\newbibmacro*{maintitle+booktitle}{% + \iffieldundef{maintitle} + {} + {\usebibmacro{maintitle}% + \newunit\newblock + \iffieldundef{volume} + {} + {\printfield{volume}% + \printfield{part}% + \setunit{\addcolon\space}}}% + \usebibmacro{booktitle}% + \newunit} % \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)}} - -\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)}} - +\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} % -% \subsection{Works in books known by their title} -% -% In these cases, the title is moved after the edition information. +% The |forceparens| format ensures the punctuation tracker doesn't override +% semantically important parentheses. % % \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}} +\DeclareFieldFormat{forceparens}{(#1)} % \end{macrocode} % -% \subsection{Datasets} -% -% We patch the new datasets driver from biblatex v3.13 so it can emulate what -% we had previously done with the online driver. +% Unlike the standard styles, we print a comma between series and number. % % \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*{series+number}{% + \printfield{series}% + \setunit*{\addcomma\space}% + \printfield{number}% + \newunit} % \end{macrocode} % -% \subsection{Online works} -% -% Compared with the standard styles, the main difference is that the -% organization's address is printed. +% We also supply a version that incorporates the |type| field. % % \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{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{Reports} +% We provide a wrapper macro for printing archival collections and locators. % -% 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} +\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} +% +% Reports use a special macro for printing the |type|, |series| and |number| in +% parentheses. % % \begin{macrocode} -\DeclareFieldFormat{forceparens}{(#1)} \newbibmacro{series+type+number}{% \ifboolexpr{ test {\iffieldundef{series}} @@ -4036,83 +5229,204 @@ This work is `maintained' (as per LPPL maintenance status) by [Alex Ball][me]. \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}{% - \newunit\newblock - \usebibmacro{series+number}% + \printfield{doi}% + }} +\newbibmacro*{doi+eprint+url}{% + \iftoggle{bbx:eprint} + {\usebibmacro{eprint}} + {}% \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 @@ This work is `maintained' (as per LPPL maintenance status) by [Alex Ball][me]. % \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 @@ This work is `maintained' (as per LPPL maintenance status) by [Alex Ball][me]. % \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,274 +5697,134 @@ This work is `maintained' (as per LPPL maintenance status) by [Alex Ball][me]. \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@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@tempa{}% + \setcounter{bbx:relatedtotal}{0}% + \def\do##1{% + \entrydata{##1}{% + \ifrelatedloop + {} + {\stepcounter{bbx:relatedtotal}% + \gappto{\bbx@tempa}{##1,}}}}% + \docsvfield{related}% + \restorefield{related}{\bbx@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@tempa{related}} + {\def\bbx@tempa{related:\strfield{relatedtype}}}% + \iffieldformatundef{relatedstring:\strfield{relatedtype}} + {\def\bbx@tempb{relatedstring:default}} + {\def\bbx@tempb{relatedstring:\strfield{relatedtype}}}% + \printtext[\bbx@tempa]{% + \usebibmacro{begrelatedloop}% + \iffieldundef{relatedstring} + {\ifboolexpr{ + test {\ifnumgreater{\value{bbx:relatedtotal}}{1}} + and + test {\ifbibxstring{\thefield{relatedtype}s}} + } + {\printtext[\bbx@tempb]{% + \bibstring[\mkrelatedstringtext]{\thefield{relatedtype}s}}} + {\iffieldbibstring{relatedtype} + {\printtext[\bbx@tempb]{% + \bibstring[\mkrelatedstringtext]{\thefield{relatedtype}}}} + {}}} + {\iffieldbibstring{relatedstring} + {\printtext[\bbx@tempb]{% + \bibstring[\mkrelatedstringtext]{\thefield{relatedstring}}}} + {\printfield[\bbx@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@lasthash} % \end{macrocode} % @@ -4773,9 +5854,20 @@ This work is `maintained' (as per LPPL maintenance status) by [Alex Ball][me]. % % \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 @@ This work is `maintained' (as per LPPL maintenance status) by [Alex Ball][me]. \xpatchbibmacro{cite:label}{% \printtext[bibhyperref]{\printfield[citetitle]{labeltitle}}% }{% - \printtext[bibhyperref]{\printfield[citetitle]{labeltitle}}% \toggletrue{bbx:labelistitle}% + \printtext[bibhyperref]{\printfield[citetitle]{labeltitle}}% }{}{\wlog{WARNING: biblatex-bath failed to patch cite:label}} % \end{macrocode} % \iffalse diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-bath/biblatex-bath.pdf b/macros/latex/contrib/biblatex-contrib/biblatex-bath/biblatex-bath.pdf Binary files differindex b65fcf099d..501b755df4 100644 --- a/macros/latex/contrib/biblatex-contrib/biblatex-bath/biblatex-bath.pdf +++ b/macros/latex/contrib/biblatex-contrib/biblatex-bath/biblatex-bath.pdf diff --git a/macros/latex/contrib/mnotes/Makefile b/macros/latex/contrib/mnotes/Makefile index e9d5e727a8..2cc0d6aac2 100644 --- a/macros/latex/contrib/mnotes/Makefile +++ b/macros/latex/contrib/mnotes/Makefile @@ -1,6 +1,6 @@ SHELL=/bin/bash NAME=mnotes -VERSION=0.8 +VERSION=0.9 DISTDIR=$(NAME) ARCHIVE_NAME=/tmp/$(NAME)-$(VERSION).tar.gz DISTFILES=$(NAME).dtx Makefile README $(NAME).ins $(NAME).pdf diff --git a/macros/latex/contrib/mnotes/mnotes.dtx b/macros/latex/contrib/mnotes/mnotes.dtx index babd0566a6..35a406bf01 100644 --- a/macros/latex/contrib/mnotes/mnotes.dtx +++ b/macros/latex/contrib/mnotes/mnotes.dtx @@ -28,13 +28,12 @@ % %% @LaTeX-package-file{ %% author = "Saturnino Luz", -%% version = "0.6", -%% date = "18 April 2013", +%% version = "0.9", +%% date = "25 May 2022", %% filename = "mnotes.dtx", %% address = "S Luz -%% Trinity College %% Dublin, Ireland", -%% URL = "http://www.scss.tcd.ie/~luzs/", +%% URL = "https://gitlab.com/e1700/mnotes/", %% email = "luzs@acm.org", %% codetable = "ISO/ASCII", %% keywords = "margin, notes, comments", @@ -55,7 +54,7 @@ This is a generated file. -Copyright (C) 2013 by S Luz <luzs@acm.org> +Copyright (C) 2013-2021 by S Luz <luzs@acm.org> This work may be distributed and/or modified under the conditions of the LaTeX Project Public License, either version 1.3 of this license @@ -93,7 +92,7 @@ and version 1.3 or later is part of all distributions of LaTeX version %</driver> %<package>\ProvidesPackage{mnotes}[% %<*driver|package> - 2013/20/04 v0.7 margin notes for collaborative document editing] + 2022/25/05 v0.9 margin notes for collaborative document editing] %</driver|package> %<*driver> \documentclass{ltxdoc} @@ -153,7 +152,7 @@ and version 1.3 or later is part of all distributions of LaTeX version % % \section{Package options} % -% The basic usage is to include a \verb+\usepackage{mnote}+ to the +% The basic usage is to include a \verb+\usepackage{mnotes}+ to the % preamble of your \LaTeX\ document. % % The \textsf{mnotes} package also provides some basic @@ -227,6 +226,23 @@ and version 1.3 or later is part of all distributions of LaTeX version % are not regular \LaTeX\ users. % \end{verbatim} % +% \DescribeMacro{\Mnewauthor} Define author-specific margin notes for +% comments. \\The +% \verb+\Mnewauthor[<initials>]{<name>}{<todonote specs>}+ macro +% defines a command for personalised comments by author \verb+name+ by +% setting up the command \verb+\mn<initials>[highlight]{comment}+ +% which can then be used in the text. Usage: +% \begin{verbatim} +% \newauthor[BD]{Bob}{yellow} +% \end{verbatim} +% This defines \verb+\mnBD+, which can be used to comment and highlight +% as follows: +% \begin{verbatim} +% \mnBD[this is highlighted]{this is a margin note.} or, +% alternatively, without highlighting +% \mnBDhis is a margin note with no highlights.} +% \end{verbatim} +% % \DescribeMacro{\HideMNOTES} Comments can be ``switched off'' at any % point in the text by adding a \verb+\HideMNOTES{}+ command anywhere % in the text. @@ -248,6 +264,7 @@ and version 1.3 or later is part of all distributions of LaTeX version % is passed % as an option. In this case, note placement reverts to \LaTeX{}'s % kernel's \verb+\marginpar+ macro. +% \item[soul] for highlighting. % \item[tikz] for graphics (boxes and connectors). N.B.: % \texttt{tikz} is note required if \texttt{basic} is passed as an % option. @@ -288,6 +305,7 @@ and version 1.3 or later is part of all distributions of LaTeX version % Get package options % \begin{macrocode} \RequirePackage{kvoptions} +\RequirePackage{soul} \DeclareVoidOption{basic}{\@mnotes@basictrue} \DeclareVoidOption{sidenotes}{\@mnotes@sidenotestrue} \DeclareVoidOption{hide}{\@mnotes@hidetrue \AtEndOfPackage{\HideMNOTES{}}} @@ -295,8 +313,8 @@ and version 1.3 or later is part of all distributions of LaTeX version \SetupKeyvalOptions{family=mnotes, prefix=mnotes@} \DeclareStringOption{scale}[1.05] \define@key{mnotes}{scale}{\if@mnotes@hide\else% -\pdfpagewidth#1\paperwidth\@mnotes@scaletrue\fi} -\DeclareVoidOption{centre}{\if@mnotes@scale\hoffset\pdfpagewidth +\setlength{\paperwidth}{#1\paperwidth}\@mnotes@scaletrue\fi} +\DeclareVoidOption{centre}{\if@mnotes@scale\hoffset\paperwidth \advance\hoffset-\paperwidth \hoffset.5\hoffset\fi} \DeclareStringOption{mnwidth}[\MNOTEWIDTH] @@ -307,6 +325,8 @@ and version 1.3 or later is part of all distributions of LaTeX version \define@key{mnotes}{fontsize}{% \count1=#1 \multiply \count1 by 116 \divide \count1 by 100% \def\MNFONT{\fontsize{#1}{\count1}\selectfont}} +%% try to keep notes on the same margin +% \makeatletter \@mparswitchfalse \makeatother %\ExecuteOptions{} \ProcessKeyvalOptions{mnotes} %\ProcessOptions @@ -352,8 +372,8 @@ and version 1.3 or later is part of all distributions of LaTeX version [{\MNFONT\raggedleft\color{#1}\em #2}]% {\MNFONT\raggedright\color{#1}\em #2}}% \else% not basic -\newcommand{\MNOTEon}[2][\MNCOLOUR]{ -\setlength{\marginparsep}{6pt}\setlength{\marginparwidth}{\MNOTEWIDTH} +\newcommand{\MNOTEon}[2][\MNCOLOUR]{% +\setlength{\marginparsep}{6pt}\setlength{\marginparwidth}{\MNOTEWIDTH}% \begin{tikzpicture}[remember picture, baseline=-0.75ex]% \node [coordinate] (textPOS) {};% \end{tikzpicture}% @@ -362,7 +382,7 @@ and version 1.3 or later is part of all distributions of LaTeX version {\MNFONT\raggedright\em% \begin{tikzpicture}[remember picture]% \draw node [draw=#1,text width=\MNOTEWIDTH-1pt] (notePOS) {#2};% -\end{tikzpicture} +\end{tikzpicture}% }% \else \marginpar% @@ -377,17 +397,17 @@ and version 1.3 or later is part of all distributions of LaTeX version \fi% \if@twocolumn% \if@firstcolumn% - \if@mnotes@reverseconnect + \if@mnotes@reverseconnect% \mnoteswestlink{#1}% - \else + \else% \mnoteseastlink{#1}% - \fi + \fi% \else% - \if@mnotes@reverseconnect + \if@mnotes@reverseconnect% \mnoteseastlink{#1}% - \else + \else% \mnoteswestlink{#1}% - \fi + \fi% \fi% \else% \if@twoside% @@ -419,6 +439,31 @@ and version 1.3 or later is part of all distributions of LaTeX version \fi % \end{macrocode} % \end{macro} +%\begin{macro} +% Define author-specific margin notes for comments. +% Syntax: \verb'\Mnewauthor[<initials>]{<name>}{color}' +% Example: +% \verb'\Mnewauthor[SL]{Nino}{yellow}' +% Sets up the command \verb'\mn<initials>{}' which can then be used in the +% text. +% E.g.: +% \verb'\mnSL[this is highlighted]{this is a margin note.}' +% \verb'\mnSL{this is a margin note with no highlights.}' +% \begin{macrocode} +\newcommand{\Mnewauthor}[3][]{% + % If #1 is not given, use #2 by default as the cmd name + \def\@tempa{#1}% + \ifx\@tempa\@empty% + \def\@authid{#2}% + \else% + \def\@authid{#1}% + \fi% + % Define the \mnX command with the colour and so on + \expandafter\newcommand\csname mn\@authid\endcsname[2][]{% + \if@mnotes@hide ##1\else\sethlcolor{#3}\hl{##1}\MNOTE[#3]{#2: ##2}{}\fi}% +} +% \end{macrocode} +% \end{macro} % \begin{macro}{\MNOTE} % User interface to \verb+\MNOTEon+ % \begin{macrocode} diff --git a/macros/latex/contrib/mnotes/mnotes.pdf b/macros/latex/contrib/mnotes/mnotes.pdf Binary files differindex c5aab4221e..ee8f03072c 100644 --- a/macros/latex/contrib/mnotes/mnotes.pdf +++ b/macros/latex/contrib/mnotes/mnotes.pdf diff --git a/macros/latex/contrib/nicematrix/nicematrix-french.pdf b/macros/latex/contrib/nicematrix/nicematrix-french.pdf Binary files differindex 92b1181a85..00a0f24a25 100644 --- a/macros/latex/contrib/nicematrix/nicematrix-french.pdf +++ b/macros/latex/contrib/nicematrix/nicematrix-french.pdf diff --git a/macros/latex/contrib/nicematrix/nicematrix-french.tex b/macros/latex/contrib/nicematrix/nicematrix-french.tex index 66246c9ba2..78e53f1346 100644 --- a/macros/latex/contrib/nicematrix/nicematrix-french.tex +++ b/macros/latex/contrib/nicematrix/nicematrix-french.tex @@ -1937,7 +1937,8 @@ Elle prend aussi en premier argument optionnel, entre crochets, une liste de couples \textsl{clé=valeur}. \begin{itemize} \item La clé |nb-rows| indique le nombre de rangées consécutives concernées par -les spécifications de cette commande. +les spécifications de cette commande (une valeur |*| signifie que toutes les +rangées restantes seront concernées). \item Les clés |cell-space-top-limit|, |cell-space-bottom-limit| et |cell-space-limits| sont disponibles avec le même effet que les clés globales de même nom (cf. p.~\pageref{cell-space}). @@ -2785,11 +2786,13 @@ $\begin{bNiceMatrix} Les lignes pointillées tracées par |\Ldots|, |\Cdots|, |\Vdots|, |\Ddots|, |\Iddots|, |\Hdotsfor| et |\Vdotsfor| (ainsi que par la commande |\line| dans le |\CodeAfter| décrite p.~\pageref{line-in-code-after}) peuvent être paramétrées -par trois options (que l'on met entre crochets après la commande) : +par les options suivantes (que l'on met entre crochets après la commande) : % \begin{itemize} \item |color| ; +\item |radius| ; \item |shorten| ; +\item |inter| ; \item |line-style|. \end{itemize} @@ -2800,7 +2803,9 @@ de |\CodeAfter|, ou bien au niveau d'un environnement mais elles doivent alors % \begin{itemize} \item |xdots/color| ; +\item |xdots/radius| ; \item |xdots/shorten| ; +\item |inter| ; \item |xdots/line-style|. \end{itemize} % @@ -2815,6 +2820,13 @@ remarquera néanmoins que les lignes tracées dans les rangées et colonnes extérieures (décrites plus loin) bénéficient d'un régime spécial : cf. p.~\pageref{exterior}. +\medskip +\colorbox{yellow!50}{\textbf{Nouveau 6.9}}\enskip \textbf{L'option xdots/radius}\par\nobreak + +\smallskip +L'option |radius| correspond au rayon des points circulaires qui sont tracés. La +valeur initiale est $0.53$~pt. + \medskip \textbf{L'option xdots/shorten}\par\nobreak @@ -2828,6 +2840,14 @@ unité de mesure dépendante de la fonte courante). \medskip +\colorbox{yellow!50}{\textbf{Nouveau 6.9}}\enskip \textbf{L'option xdots/inter}\par\nobreak + +\smallskip +L'option |xdots/inter| indique la distance entre deux points. La valeur +initiale est $0.45$~em (il est conseillé d'utiliser une +unité de mesure dépendante de la fonte courante). + +\medskip \textbf{L'option xdots/line-style}\par\nobreak \smallskip @@ -3633,6 +3653,34 @@ suivant (avec une version de LaTeX postérieure à 2020/10/01). \section{Autres fonctionnalités} +\subsection{Commande \textbackslash ShowCellNames} + +\colorbox{yellow!50}{\textbf{Nouveau 6.9}} La commande |\ShowCellNames|, +utilisable dans le |\CodeBefore| et dans le |\CodeAfter| affiche le nom (sous la +forme $i$-$j$) de chaque case. + + + +\begin{BVerbatim}[baseline=c,boxwidth=10.6cm] +\begin{NiceTabular}{ccc}[hvlines,cell-space-limits=3pt] +\CodeBefore + \ShowCellNames +\Body + \Block{2-2}{} & & test \\ + & & blabla \\ + & some text & nothing +\end{NiceTabular} +\end{BVerbatim} +\begin{NiceTabular}{ccc}[hvlines,cell-space-limits=3pt] +\CodeBefore + \ShowCellNames +\Body + \Block{2-2}{} & & test \\ + & & blabla \\ + & some text & nothing +\end{NiceTabular} + + \subsection{Utilisation du type de colonne S de siunitx} Si l'extension \pkg{siunitx} est chargée (avant ou après \pkg{nicematrix}), il est possible d'utiliser les colonnes diff --git a/macros/latex/contrib/nicematrix/nicematrix.dtx b/macros/latex/contrib/nicematrix/nicematrix.dtx index c95554cfac..a0776552ee 100644 --- a/macros/latex/contrib/nicematrix/nicematrix.dtx +++ b/macros/latex/contrib/nicematrix/nicematrix.dtx @@ -15,8 +15,8 @@ % % \fi % \iffalse -\def\myfileversion{6.8a} -\def\myfiledate{2022/05/08} +\def\myfileversion{6.9} +\def\myfiledate{2022/05/25} % % %<*batchfile> @@ -1188,7 +1188,7 @@ version 2005/12/01 or later. % \subsection{Commands for customized rules} % \label{custom-line} % -% \colorbox{yellow!50}{\textbf{New 6.5}}\enskip It's possible to define commands +% \colorbox{yellow!50}{\textbf{New 6.5}}\enskip It's also possible to define commands % and letters for customized rules with the key |custom-line| available in % |\NiceMatrixOptions| and in the options of individual environments. That key % takes in as argument a list of \textsl{key=value} pairs. First, there is two @@ -1925,7 +1925,7 @@ version 2005/12/01 or later. % \begin{itemize} % \item The key |nb-rows| sets % the number of rows to which the specifications of the current command will -% apply. +% apply (with the special value |*|, it will apply to all the following rows). % \item The keys |cell-space-top-limit|, |cell-space-bottom-limit| and % |cell-space-limits| are available with the same meaning that the corresponding % global keys (cf. p.~\pageref{cell-space}). @@ -2754,11 +2754,13 @@ version 2005/12/01 or later. % \label{customisation} % The dotted lines drawn by |\Ldots|, |\Cdots|, |\Vdots|, |\Ddots|, |\Iddots|, % |\Hdotsfor| and |\Vdotsfor| (and by the command |\line| in the |\CodeAfter| -% which is described p.~\pageref{line-in-code-after}) may be customized by three +% which is described p.~\pageref{line-in-code-after}) may be customized by the following % options (specified between square brackets after the command): % \begin{itemize} % \item |color|; +% \item |radius|; % \item |shorten|; +% \item |inter|; % \item |line-style|. % \end{itemize} % @@ -2768,7 +2770,9 @@ version 2005/12/01 or later. % |\Cdots|, |\Ldots|, |\Vdots|, etc.), and, thus have for names: % \begin{itemize} % \item |xdots/color|; +% \item |xdots/radius|; % \item |xdots/shorten|; +% \item |xdots/inter|; % \item |xdots/line-style|. % \end{itemize} % @@ -2783,6 +2787,12 @@ version 2005/12/01 or later. % special treatment: cf. p.~\pageref{exterior}. % % \bigskip +% \colorbox{yellow!50}{\textbf{New 6.9}}\enskip +% \textbf{The option xdots/radius}\par\nobreak +% +% The option |radius| fixes the radius of the dots. The initial value is 0.53~pt. +% +% \bigskip % \textbf{The option xdots/shorten}\par\nobreak % % \smallskip @@ -2793,6 +2803,15 @@ version 2005/12/01 or later. % recommanded to use a unit of length dependent of the current font). % % \bigskip +% \colorbox{yellow!50}{\textbf{New 6.9}}\enskip +% \textbf{The option xdots/inter}\par\nobreak +% +% \smallskip +% The option |xdots/inter| fixes the length between the dots. The initial value +% is 0.45~em (it is recommanded to use a unit of length dependent of the current +% font). +% +% \bigskip % \textbf{The option xdots/line-style}\par\nobreak % % \smallskip @@ -3588,6 +3607,34 @@ version 2005/12/01 or later. % % \section{Other features} % +% \section{Autres fonctionnalités} +% +% \subsection{Command \textbackslash ShowCellNames} +% +% \colorbox{yellow!50}{\textbf{New 6.9}} The command |\ShowCellNames|, +% which may be used in the |\CodeBefore| and in the |\CodeAfter| display the name (with the +% form $i$-$j$) of each cell. +% +% \begin{BVerbatim}[baseline=c,boxwidth=10.6cm] +% \begin{NiceTabular}{ccc}[hvlines,cell-space-limits=3pt] +% \CodeBefore +% \ShowCellNames +% \Body +% \Block{2-2}{} & & test \\ +% & & blabla \\ +% & some text & nothing +% \end{NiceTabular} +% \end{BVerbatim} +% \begin{NiceTabular}{ccc}[hvlines,cell-space-limits=3pt] +% \CodeBefore +% \ShowCellNames +% \Body +% \Block{2-2}{} & & test \\ +% & & blabla \\ +% & some text & nothing +% \end{NiceTabular} +% +% % \subsection{Use of the column type S of siunitx} % % If the package \pkg{siunitx} is loaded (before or after \pkg{nicematrix}), @@ -3878,7 +3925,7 @@ version 2005/12/01 or later. % \end{bNiceMatrix}$ % % \medskip -% This colour alos applies to the delimiters drawn by the command |\SubMatrix| +% This colour also applies to the delimiters drawn by the command |\SubMatrix| % (cf.~p.~\pageref{sub-matrix}). % % \subsection{The environment \{NiceArrayWithDelims\}} @@ -5688,11 +5735,8 @@ version 2005/12/01 or later. % this package for technical reasons. % % \bigskip -% We load some packages. The package \pkg{xparse} is still loaded for use on -% Overleaf. However, since oct. 2021, Overleaf uses TeXLive 2021 and we will be -% able to delete that row. +% We load some packages. % \begin{macrocode} -\RequirePackage { xparse } \RequirePackage { array } \RequirePackage { amsmath } % \end{macrocode} @@ -7146,9 +7190,9 @@ version 2005/12/01 or later. % (when |line-style| is equal to |standard|, which is the initial value). The % initial value is 0.45~em but it will be changed if the option |small| is used. % \begin{macrocode} -\dim_new:N \l_@@_inter_dots_dim +\dim_new:N \l_@@_xdots_inter_dim \hook_gput_code:nnn { begindocument } { . } - { \dim_set:Nn \l_@@_inter_dots_dim { 0.45 em } } + { \dim_set:Nn \l_@@_xdots_inter_dim { 0.45 em } } % \end{macrocode} % We use a hook only by security in case \cls{revtex4-1} % is used (even though it is obsolete). @@ -7171,9 +7215,9 @@ version 2005/12/01 or later. % |line-style| is equal to |standard|, which is the initial value). The initial % value is 0.53~pt but it will be changed if the option |small| is used. % \begin{macrocode} -\dim_new:N \l_@@_radius_dim +\dim_new:N \l_@@_xdots_radius_dim \hook_gput_code:nnn { begindocument } { . } - { \dim_set:Nn \l_@@_radius_dim { 0.53 pt } } + { \dim_set:Nn \l_@@_xdots_radius_dim { 0.53 pt } } % \end{macrocode} % We use a hook only by security in case \cls{revtex4-1} is used (even though it % is obsolete). @@ -7378,9 +7422,17 @@ version 2005/12/01 or later. { \dim_set:Nn \l_@@_xdots_shorten_dim { #1 } } , % \end{macrocode} % We use a hook only by security in case \cls{revtex4-1} -% is used (even though it is obsolete). +% is used (even though it is obsolete). Idem for the following keys. % \begin{macrocode} shorten .value_required:n = true , + radius .code:n = + \hook_gput_code:nnn { begindocument } { . } + { \dim_set:Nn \l_@@_xdots_radius_dim { #1 } } , + radius .value_required:n = true , + inter .code:n = + \hook_gput_code:nnn { begindocument } { . } + { \dim_set:Nn \l_@@_xdots_inter_dim { #1 } } , + radius .value_required:n = true , % \end{macrocode} % The options |down| and |up| are not documented for the final user because he % should use the syntax with |^| and |_|. @@ -8904,6 +8956,7 @@ version 2005/12/01 or later. \cs_set_eq:NN \columncolor \@@_columncolor \cs_set_eq:NN \chessboardcolors \@@_chessboardcolors \cs_set_eq:NN \SubMatrix \@@_SubMatrix_in_code_before + \cs_set_eq:NN \ShowCellNames \@@_ShowCellNames } % \end{macrocode} % @@ -10190,7 +10243,7 @@ version 2005/12/01 or later. { % \end{macrocode} % We test whether the version of \pkg{nicematrix} is at least 3.0. We will -% change de programmation of the test further with something like |\VersionAtLeast|. +% change de programmation of the test further with something like |\@ifpackagelater|. % % \begin{macrocode} \cs_if_exist:NTF \siunitx_cell_begin:w @@ -10437,7 +10490,7 @@ version 2005/12/01 or later. \cs_new_protected:Npn \@@_patch_preamble_xii:n #1 { \tl_gput_right:Nn \g_@@_preamble_tl - { ! { \skip_horizontal:N 2\l_@@_radius_dim } } + { ! { \skip_horizontal:N 2\l_@@_xdots_radius_dim } } % \end{macrocode} % The command |\@@_vdottedline:n| is protected, and, therefore, won't be % expanded before writing on |\g_@@_internal_code_after_tl|. @@ -10545,13 +10598,13 @@ version 2005/12/01 or later. \int_compare:nNnTF \c@jCol = 0 { \int_eval:n { \c@iRow + 1 } } { \int_use:N \c@iRow } - } % modified 2022/01/10 + } { \int_eval:n { \c@jCol + 1 } } { \int_compare:nNnTF \c@jCol = 0 { \int_eval:n { \c@iRow + 1 } } { \int_use:N \c@iRow } - } % modified 2022/01/10 + } { \int_eval:n { \c@jCol + #1 } } { } % for the name of the block } @@ -11918,19 +11971,18 @@ version 2005/12/01 or later. \bool_set_false:N \l_@@_final_open_bool % \end{macrocode} % -% If the option |small| is used, the values |\l_@@_radius_dim| and -% |\l_@@_inter_dots_dim| (used to draw the dotted lines created by +% If the option |small| is used, the values |\l_@@_xdots_radius_dim| and +% |\l_@@_xdots_inter_dim| (used to draw the dotted lines created by % |\hdottedline| and |\vdottedline| and also for all the other dotted lines when % |line-style| is equal to |standard|, which is the initial value) are changed. % \begin{macrocode} \bool_if:NT \l_@@_small_bool { - \dim_set:Nn \l_@@_radius_dim { 0.37 pt } - \dim_set:Nn \l_@@_inter_dots_dim { 0.25 em } + \dim_set:Nn \l_@@_xdots_radius_dim { 0.7 \l_@@_xdots_radius_dim } + \dim_set:Nn \l_@@_xdots_inter_dim { 0.55 \l_@@_xdots_inter_dim } % \end{macrocode} % The dimension |\l_@@_xdots_shorten_dim| corresponds to the option -% |xdots/shorten| available to the user. That's why we give a new value -% according to the current value, and not an absolute value. +% |xdots/shorten| available to the user. % \begin{macrocode} \dim_set:Nn \l_@@_xdots_shorten_dim { 0.6 \l_@@_xdots_shorten_dim } } @@ -11983,6 +12035,7 @@ version 2005/12/01 or later. \cs_set_eq:NN \SubMatrix \@@_SubMatrix \cs_set_eq:NN \UnderBrace \@@_UnderBrace \cs_set_eq:NN \OverBrace \@@_OverBrace + \cs_set_eq:NN \ShowCellNames \@@_ShowCellNames \cs_set_eq:NN \line \@@_line \g_@@_internal_code_after_tl \tl_gclear:N \g_@@_internal_code_after_tl @@ -12678,8 +12731,8 @@ version 2005/12/01 or later. % want the dots really ``on'' the line of texte. Of course, maybe we should not % do that when the option |line-style| is used (?). % \begin{macrocode} - \dim_add:Nn \l_@@_y_initial_dim \l_@@_radius_dim - \dim_add:Nn \l_@@_y_final_dim \l_@@_radius_dim + \dim_add:Nn \l_@@_y_initial_dim \l_@@_xdots_radius_dim + \dim_add:Nn \l_@@_y_final_dim \l_@@_xdots_radius_dim \@@_draw_line: } % \end{macrocode} @@ -13279,14 +13332,14 @@ version 2005/12/01 or later. \bool_if:NTF \l_@@_final_open_bool { \int_set:Nn \l_tmpa_int - { \dim_ratio:nn \l_@@_l_dim \l_@@_inter_dots_dim } + { \dim_ratio:nn \l_@@_l_dim \l_@@_xdots_inter_dim } } { \int_set:Nn \l_tmpa_int { \dim_ratio:nn { \l_@@_l_dim - \l_@@_xdots_shorten_dim } - \l_@@_inter_dots_dim + \l_@@_xdots_inter_dim } } } @@ -13297,7 +13350,7 @@ version 2005/12/01 or later. { \dim_ratio:nn { \l_@@_l_dim - \l_@@_xdots_shorten_dim } - \l_@@_inter_dots_dim + \l_@@_xdots_inter_dim } } { @@ -13305,7 +13358,7 @@ version 2005/12/01 or later. { \dim_ratio:nn { \l_@@_l_dim - 2 \l_@@_xdots_shorten_dim } - \l_@@_inter_dots_dim + \l_@@_xdots_inter_dim } } } @@ -13318,12 +13371,12 @@ version 2005/12/01 or later. \dim_set:Nn \l_tmpa_dim { ( \l_@@_x_final_dim - \l_@@_x_initial_dim ) * - \dim_ratio:nn \l_@@_inter_dots_dim \l_@@_l_dim + \dim_ratio:nn \l_@@_xdots_inter_dim \l_@@_l_dim } \dim_set:Nn \l_tmpb_dim { ( \l_@@_y_final_dim - \l_@@_y_initial_dim ) * - \dim_ratio:nn \l_@@_inter_dots_dim \l_@@_l_dim + \dim_ratio:nn \l_@@_xdots_inter_dim \l_@@_l_dim } % \end{macrocode} % @@ -13349,7 +13402,7 @@ version 2005/12/01 or later. { ( \l_@@_x_final_dim - \l_@@_x_initial_dim ) * \dim_ratio:nn - { \l_@@_l_dim - \l_@@_inter_dots_dim * \l_tmpa_int } + { \l_@@_l_dim - \l_@@_xdots_inter_dim * \l_tmpa_int } { 2 \l_@@_l_dim } * \l_tmpb_int } @@ -13357,7 +13410,7 @@ version 2005/12/01 or later. { ( \l_@@_y_final_dim - \l_@@_y_initial_dim ) * \dim_ratio:nn - { \l_@@_l_dim - \l_@@_inter_dots_dim * \l_tmpa_int } + { \l_@@_l_dim - \l_@@_xdots_inter_dim * \l_tmpa_int } { 2 \l_@@_l_dim } * \l_tmpb_int } @@ -13366,7 +13419,7 @@ version 2005/12/01 or later. { \pgfpathcircle { \pgfpoint \l_@@_x_initial_dim \l_@@_y_initial_dim } - { \l_@@_radius_dim } + { \l_@@_xdots_radius_dim } \dim_add:Nn \l_@@_x_initial_dim \l_tmpa_dim \dim_add:Nn \l_@@_y_initial_dim \l_tmpb_dim } @@ -13923,9 +13976,11 @@ version 2005/12/01 or later. bold .bool_set:N = \l_tmpa_bool , bold .default:n = true , bold .initial:n = false , - nb-rows .int_set:N = \l_@@_key_nb_rows_int , + nb-rows .code:n = + \str_if_eq:nnTF { #1 } { * } + { \int_set_eq:NN \l_@@_key_nb_rows_int 500 } + { \int_set:Nn \l_@@_key_nb_rows_int { #1 } } , nb-rows .value_required:n = true , - nb-rows .initial:n = 1 , rowcolor .tl_set:N = \l_@@_tmpc_tl , rowcolor .value_required:n = true , rowcolor .initial:n = , @@ -13938,6 +13993,7 @@ version 2005/12/01 or later. \NewDocumentCommand \@@_RowStyle:n { O { } m } { \tl_clear:N \l_tmpa_tl + \int_set:Nn \l_@@_key_nb_rows_int 1 \keys_set:nn { NiceMatrix / RowStyle } { #1 } % \end{macrocode} % If the key |rowcolor| has been used. @@ -15249,11 +15305,11 @@ version 2005/12/01 or later. { \dim_sub:Nn \l_@@_x_initial_dim \arraycolsep } % \end{macrocode} % For reasons purely aesthetic, we do an adjustment in the case of a rounded -% bracket. The correction by |0.5 \l_@@_inter_dots_dim| is \emph{ad hoc} for a +% bracket. The correction by |0.5 \l_@@_xdots_inter_dim| is \emph{ad hoc} for a % better result. % \begin{macrocode} \tl_if_eq:NnF \g_@@_left_delim_tl ( - { \dim_add:Nn \l_@@_x_initial_dim { 0.5 \l_@@_inter_dots_dim } } + { \dim_add:Nn \l_@@_x_initial_dim { 0.5 \l_@@_xdots_inter_dim } } } \@@_qpoint:n { col - \int_eval:n { \l_@@_local_end_int + 1 } } \dim_set_eq:NN \l_@@_x_final_dim \pgf@x @@ -15263,7 +15319,7 @@ version 2005/12/01 or later. \bool_if:NT \l_@@_NiceArray_bool { \dim_add:Nn \l_@@_x_final_dim \arraycolsep } \tl_if_eq:NnF \g_@@_right_delim_tl ) - { \dim_gsub:Nn \l_@@_x_final_dim { 0.5 \l_@@_inter_dots_dim } } + { \dim_gsub:Nn \l_@@_x_final_dim { 0.5 \l_@@_xdots_inter_dim } } } \CT@arc@ \@@_draw_line: @@ -15843,7 +15899,7 @@ version 2005/12/01 or later. % \begin{macrocode} \cs_new:Npn \@@_hdottedline: { - \noalign { \skip_vertical:N 2\l_@@_radius_dim } + \noalign { \skip_vertical:N 2\l_@@_xdots_radius_dim } \@@_hdottedline_i: } % \end{macrocode} @@ -18763,7 +18819,59 @@ version 2005/12/01 or later. { } } % \end{macrocode} +% +% \bigskip +% \subsection*{The command \textbackslash ShowCellNames} % +% \begin{macrocode} +\NewDocumentCommand \@@_ShowCellNames { } + { + \int_step_inline:nn \c@iRow + { + \begin { tikzpicture } + \@@_qpoint:n { row - ##1 } + \dim_set_eq:NN \l_tmpa_dim \pgf@y + \@@_qpoint:n { row - \int_eval:n { ##1 + 1 } } + \dim_gset:Nn \g_tmpa_dim { ( \l_tmpa_dim + \pgf@y ) / 2 } + \dim_gset:Nn \g_tmpb_dim { \l_tmpa_dim - \pgf@y } + \end { tikzpicture } + \int_step_inline:nn \c@jCol + { + \hbox_set:Nn \l_tmpa_box + { \normalfont \Large \color { red ! 50 } ##1 - ####1 } + \begin { tikzpicture } + \@@_qpoint:n { col - ####1 } + \dim_set_eq:NN \l_@@_tmpc_dim \pgf@x + \@@_qpoint:n { col - \int_eval:n { ####1 + 1 } } + \dim_set:Nn \l_tmpa_dim { \pgf@x - \l_@@_tmpc_dim } + \fp_set:Nn \l_tmpa_fp + { + \fp_min:nn + { + \fp_min:nn + { \dim_ratio:nn { \l_tmpa_dim } { \box_wd:N \l_tmpa_box } } + { \dim_ratio:nn { \g_tmpb_dim } { \box_ht_plus_dp:N \l_tmpa_box } } + } + { 1.0 } + } + \box_scale:Nnn \l_tmpa_box { \fp_use:N \l_tmpa_fp } { \fp_use:N \l_tmpa_fp } + \pgftransformshift + { + \pgfpoint + { 0.5 * ( \l_@@_tmpc_dim + \pgf@x ) } + { \dim_use:N \g_tmpa_dim } + } + \pgfnode + { rectangle } + { center } + { \box_use:N \l_tmpa_box } + { } + { } + \end { tikzpicture } + } + } + } +% \end{macrocode} % % % \bigskip @@ -19100,9 +19208,10 @@ version 2005/12/01 or later. % \begin{macrocode} \@@_msg_new:nn { Unknown~key~for~xdots } { - As~for~now,~there~is~only~three~keys~available~here:~'color',~'line-style'~ - and~'shorten'~(and~you~try~to~use~'\l_keys_key_str').~If~you~go~on,~ - this~key~will~be~ignored. + As~for~now,~there~is~only~five~keys~available~here:~'color',~'inter',~ + 'line-style',~'radius',~ + and~'shorten'~(and~you~try~to~use~'\l_keys_key_str').~ + If~you~go~on,~this~key~will~be~ignored. } % \end{macrocode} % @@ -20459,6 +20568,13 @@ version 2005/12/01 or later. % argument, only one note is created at the end of the tabular (but all the % labels are present, of course). % +% \subsection*{Changes between version 6.8 and 6.9} +% +% New keys |xdots/radius| and |xdots/inter| for customisation of the continuous +% dotted lines. +% +% New command |\ShowCellNames| available in the |\CodeBefore| and in the |\CodeAfter|. +% % \PrintIndex % % \tableofcontents diff --git a/macros/latex/contrib/nicematrix/nicematrix.pdf b/macros/latex/contrib/nicematrix/nicematrix.pdf Binary files differindex b09ef2e986..e6d692f83f 100644 --- a/macros/latex/contrib/nicematrix/nicematrix.pdf +++ b/macros/latex/contrib/nicematrix/nicematrix.pdf |