summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/biblatex-bath/bath.bbx
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2019-07-10 20:28:52 +0000
committerKarl Berry <karl@freefriends.org>2019-07-10 20:28:52 +0000
commit332943b2e6215950e6462a0691583913da8d6ba6 (patch)
tree9e4b0403ec656de476ea806f5eb5e5ea8f63ac68 /Master/texmf-dist/tex/latex/biblatex-bath/bath.bbx
parent4f58a04bac374894a50724aa34f44f3dd46298c1 (diff)
biblatex-bath (10jul19)
git-svn-id: svn://tug.org/texlive/trunk@51599 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/biblatex-bath/bath.bbx')
-rw-r--r--Master/texmf-dist/tex/latex/biblatex-bath/bath.bbx331
1 files changed, 230 insertions, 101 deletions
diff --git a/Master/texmf-dist/tex/latex/biblatex-bath/bath.bbx b/Master/texmf-dist/tex/latex/biblatex-bath/bath.bbx
index f93e14bbdeb..0678e0acea3 100644
--- a/Master/texmf-dist/tex/latex/biblatex-bath/bath.bbx
+++ b/Master/texmf-dist/tex/latex/biblatex-bath/bath.bbx
@@ -15,7 +15,13 @@
%%
\RequirePackage{xpatch}
\RequirePackage{xstring}
-\DeclareLanguageMappingSuffix{-bath}
+\RequirePackage{etoolbox}
+\ifcsdef{DeclareLanguageMappingSuffix}{%
+ \DeclareLanguageMappingSuffix{-bath}
+}{%
+ \DeclareLanguageMapping{english}{english-bath}
+ \DeclareLanguageMapping{british}{british-bath}
+}
\RequireBibliographyStyle{authoryear}
\ExecuteBibliographyOptions{%
maxcitenames=3,maxbibnames=9999,isbn=false,giveninits=true,dashed=false,
@@ -23,16 +29,34 @@
\ExecuteBibliographyOptions[audio,video,music,movie]{%
useeditor=false}
\NewBibliographyString{%
- online, hours, at, legalchapter,
+ online, hours, at, unpublished, legalchapter,
director, performer, reader, conductor,
directors, performers, readers, conductors,
bydirector, byperformer, byreader, byconductor,
}
\setlength{\bibitemsep}{1em plus 0.2em minus 0.2em}
\renewcommand*{\bibfont}{\normalfont\normalsize}
+\ifcsdef{letbibmacro}{}{%
+ \def\letbibmacro#1#2{%
+ \ifcsundef{abx@macro@#2}
+ {\blx@error
+ {Bibliography macro '#2' undefined}
+ {Use '\string\newbibmacro' to define this macro}}
+ {\csletcs{abx@macro@#1}{abx@macro@#2}}}
+}
+\ifcsdef{iflabeldateisdate}{}{%
+ \def\iflabeldateisdate{%
+ \ifboolexpr{%
+ togl {blx@labeldateparts}
+ and not test {\iffieldundef{labeldatesource}}
+ and
+ (test {\iffieldequalstr{labeldatesource}{}}
+ or test {\iffieldequalstr{labeldatesource}{year}})}}%
+}
\DeclareNameAlias{author}{family-given}
\DeclareNameAlias{editor}{family-given}
+\DeclareNameAlias{bookeditor}{given-family}
\renewcommand*{\bibinitdelim}{}
\newbibmacro*{name:cjk-given-family}[3]{%
\ifitemannotation{cjk}{%
@@ -195,8 +219,8 @@
{\setunit{\addspace}%
\printtext[parens]{%
\printnames[#1]{translator}%
- \newunit
- \bibstring{translator}%
+ \setunit{\addcomma\space}%
+ \bibcpstring{translator}%
\clearname{translator}}}}
\renewbibmacro*{byeditor+others}[1][byeditor]{%
@@ -222,8 +246,8 @@
{\setunit{\addspace}%
\printtext[parens]{%
\printnames[bytranslator]{translator}%
- \newunit
- \bibstring{translator}%
+ \setunit{\addcomma\space}%
+ \bibcpstring{translator}%
\clearname{translator}%
\newunit
\usebibmacro{withothers}}}}
@@ -231,7 +255,7 @@
\newbibmacro*{bookeditor}{%
\ifnameundef{editor}{}{%
\printnames[bookeditor]{editor}%
- \setunit*{\addspace}%
+ \setunit*{\addcomma\space}%
\usebibmacro{editor+othersstrg}%
\clearname{editor}%
}}
@@ -243,8 +267,11 @@
[article,inbook,incollection,inproceedings]%
{title}{#1}
\DeclareFieldFormat
- [patent,thesis,unpublished]%
+ [patent,thesis]%
{title}{\mkbibemph{#1}}
+\DeclareFieldFormat
+ [unpublished]%
+ {title}{\iffieldundef{booktitle}{\mkbibemph{#1}}{#1}}
\newtoggle{bbx:onlineshown}
\newbibmacro*{isonline}{%
@@ -474,7 +501,7 @@
'true' (=compact)%
}{%
'year', 'true' (=year)%
-}{}{}
+}{}{\wlog{WARNING: biblatex-bath failed to patch KV@blx@opt@pre@datemerge}}
\DeclareTypeOption[boolean]{mergedate}[true]{%
\ifcsdef{bbx@opt@mergedate@#1}{%
\csuse{bbx@opt@mergedate@#1}%
@@ -491,12 +518,12 @@
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}%
}{%
@@ -504,12 +531,12 @@
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}%
}{%
@@ -517,12 +544,12 @@
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}%
}{%
@@ -530,12 +557,12 @@
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}%
}{%
@@ -543,11 +570,23 @@
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}}
+\xpatchcmd{\bbx@opt@mergedate@maximum}{%
+ \iffieldsequal{year}{labelyear}
+ {\printlabeldateextra}%
+ {\printfield{labelyear}%
+ \printfield{extrayear}}%
+}{%
+ \iflabeldateisdate
+ {\printfield{issue}%
+ \setunit*{\addspace}%
+ \printdateextra}
+ {\printlabeldateextra}%
}{}{}
\def\bbx@opt@mergedate@year{%
@@ -563,6 +602,9 @@
\iflabeldateisdate{%
\clearfield{year}%
}{}}}
+ \ifcsundef{abx@macro@date+extrayear}{}{%
+ \renewbibmacro*{date+extrayear}{\usebibmacro{date+extradate}}%
+ }
\renewbibmacro*{issue+date}{%
\ifboolexpr{
test {\iffieldundef{issue}}
@@ -643,25 +685,53 @@
\csuse{mkbibseasondate#1}{}{#2endseason}}%
\enddateuncertainprint}}}}}
\xpatchcmd{\mkdaterangefull}{%
- \iffieldundef{#2year} {}%
+ \iffieldundef{#2year} {\blx@nounit}%
}{%
\iffieldundef{#2year} {\mknoyeardaterangefull{#1}{#2}}%
-}{}{}
+}{\@tempswafalse}{\@tempswatrue}%
+\if@tempswa
+ \xpatchcmd{\mkdaterangefull}{%
+ \iffieldundef{#2year} {}%
+ }{%
+ \iffieldundef{#2year} {\mknoyeardaterangefull{#1}{#2}}%
+ }{}{\wlog{WARNING: biblatex-bath failed to patch mkdaterangefull}}%
+\fi
\xpatchcmd{\mkdaterangetrunc}{%
- \iffieldundef{#2year} {}%
+ \iffieldundef{#2year} {\blx@nounit}%
}{%
\iffieldundef{#2year} {\mknoyeardaterangetrunc{#1}{#2}}%
-}{}{}
+}{\@tempswafalse}{\@tempswatrue}%
+\if@tempswa
+ \xpatchcmd{\mkdaterangetrunc}{%
+ \iffieldundef{#2year} {}%
+ }{%
+ \iffieldundef{#2year} {\mknoyeardaterangetrunc{#1}{#2}}%
+ }{}{\wlog{WARNING: biblatex-bath failed to patch mkdaterangetrunc}}%
+\fi
\xpatchcmd{\mkdaterangefullextra}{%
- \iffieldundef{#2year} {}%
+ \iffieldundef{#2year} {\blx@nounit}%
}{%
\iffieldundef{#2year} {\mknoyeardaterangefull{#1}{#2}}%
-}{}{}
+}{\@tempswafalse}{\@tempswatrue}%
+\if@tempswa
+ \xpatchcmd{\mkdaterangefullextra}{%
+ \iffieldundef{#2year} {}%
+ }{%
+ \iffieldundef{#2year} {\mknoyeardaterangefull{#1}{#2}}%
+ }{}{\wlog{WARNING: biblatex-bath failed to patch mkdaterangefullextra}}%
+\fi
\xpatchcmd{\mkdaterangetruncextra}{%
- \iffieldundef{#2year} {}%
+ \iffieldundef{#2year} {\blx@nounit}%
}{%
\iffieldundef{#2year} {\mknoyeardaterangetrunc{#1}{#2}}%
-}{}{}
+}{\@tempswafalse}{\@tempswatrue}%
+\if@tempswa
+ \xpatchcmd{\mkdaterangetruncextra}{%
+ \iffieldundef{#2year} {}%
+ }{%
+ \iffieldundef{#2year} {\mknoyeardaterangetrunc{#1}{#2}}%
+ }{}{\wlog{WARNING: biblatex-bath failed to patch mkdaterangetruncextra}}%
+\fi
\DeclareFieldFormat{version}{\mkbibparens{\bibstring{version}#1}}
\DeclareFieldFormat{type}{\ifbibstring{#1}{\biblstring{#1}}{#1}}
@@ -677,42 +747,26 @@
{}
{\setunit{\addcomma\space}%
\printeventdate
- \setunit*{\addspace}%
+ \setunit*{\addcomma\space}%
\printfield{venue}%
\newunit}}
+\letbibmacro{plain:institution+location+date}{institution+location+date}
\renewbibmacro*{institution+location+date}{%
- \printlist{location}%
\iflistundef{publisher}{%
- \iflistundef{institution}{%
- \setunit*{\addcomma\space}%
- }{%
- \setunit*{\addcolon\space}%
- \printlist{institution}%
- }%
+ \usebibmacro{plain:institution+location+date}%
}{%
- \setunit*{\addcolon\space}%
- \printlist{publisher}%
- }%
- \setunit*{\addcomma\space}%
- \usebibmacro{date}%
- \newunit}
+ \printlist{institution}%
+ \newunit
+ \usebibmacro{publisher+location+date}}}
+\letbibmacro{plain:organization+location+date}{organization+location+date}
\renewbibmacro*{organization+location+date}{%
- \printlist{location}%
\iflistundef{publisher}{%
- \iflistundef{organization}{%
- \setunit*{\addcomma\space}%
- }{%
- \setunit*{\addcolon\space}%
- \printlist{organization}%
- }%
+ \usebibmacro{plain:organization+location+date}%
}{%
- \setunit*{\addcolon\space}%
- \printlist{publisher}%
- }%
- \setunit*{\addcomma\space}%
- \usebibmacro{date}%
- \newunit}
+ \printlist{organization}%
+ \newunit
+ \usebibmacro{publisher+location+date}}}
\DeclareFieldFormat{library}{\mkbibemph{#1}}
\newbibmacro*{library}{%
@@ -746,7 +800,22 @@
\usebibmacro{in:}\usebibmacro{journal+issuetitle}%
}{%
\usebibmacro{journal+issuetitle}%
-}{}{}
+}{}{\wlog{WARNING: biblatex-bath failed to patch article driver}}
+\xpatchbibdriver{article}{%
+ \usebibmacro{addendum+pubstate}%
+}{%
+ \printfield{addendum}%
+}{}{\wlog{WARNING: biblatex-bath failed to patch article driver}}
+\xpatchbibmacro{journal}{%
+ \printfield[titlecase]{journaltitle}%
+}{%
+ \printfield[sentencecase]{journaltitle}%
+}{}{\wlog{WARNING: biblatex-bath failed to patch journal macro}}
+\xpatchbibmacro{journal}{%
+ \printfield[titlecase]{journalsubtitle}%
+}{%
+ \printfield[sentencecase]{journalsubtitle}%
+}{}{\wlog{WARNING: biblatex-bath failed to patch journal macro}}
\renewbibmacro*{journal+issuetitle}{%
\usebibmacro{journal}%
\setunit*{\addspace}%
@@ -762,6 +831,8 @@
\usebibmacro{issue+date}%
\setunit{\addcolon\space}%
\usebibmacro{issue}%
+ \setunit{\addcomma\space}%
+ \printfield{pubstate}%
\newunit}
\renewbibmacro*{volume+number+eid}{%
\printfield{volume}%
@@ -775,7 +846,7 @@
}{%
\setunit{\addcomma\space}%
\usebibmacro{series+number}%
-}{}{}
+}{}{\wlog{WARNING: biblatex-bath failed to patch book driver}}
\xpatchbibdriver{collection}{%
\newunit\newblock
@@ -783,7 +854,7 @@
}{%
\setunit{\addcomma\space}%
\usebibmacro{series+number}%
-}{}{}
+}{}{\wlog{WARNING: biblatex-bath failed to patch collection driver}}
\xpatchbibdriver{inbook}{%
\newunit\newblock
@@ -791,7 +862,7 @@
}{%
\setunit{\addcomma\space}%
\usebibmacro{series+number}%
-}{}{}
+}{}{\wlog{WARNING: biblatex-bath failed to patch inbook driver}}
\xpatchbibdriver{incollection}{%
\newunit\newblock
@@ -799,7 +870,7 @@
}{%
\setunit{\addcomma\space}%
\usebibmacro{series+number}%
-}{}{}
+}{}{\wlog{WARNING: biblatex-bath failed to patch incollection driver}}
\xpatchbibdriver{inproceedings}{%
\newunit\newblock
@@ -807,7 +878,7 @@
}{%
\setunit{\addcomma\space}%
\usebibmacro{series+number}%
-}{}{}
+}{}{\wlog{WARNING: biblatex-bath failed to patch inproceedings driver}}
\xpatchbibdriver{proceedings}{%
\newunit\newblock
@@ -815,7 +886,7 @@
}{%
\setunit{\addcomma\space}%
\usebibmacro{series+number}%
-}{}{}
+}{}{\wlog{WARNING: biblatex-bath failed to patch proceedings driver}}
\xpatchbibdriver{incollection}{%
\usebibmacro{in:}%
@@ -828,7 +899,7 @@
\newunit\newblock
\usebibmacro{maintitle+booktitle}%
\usebibmacro{byeditor+others}%
-}{}{}
+}{}{\wlog{WARNING: biblatex-bath failed to patch incollection driver}}
\xpatchbibdriver{inproceedings}{%
\usebibmacro{in:}%
@@ -845,7 +916,7 @@
\usebibmacro{byeditor+others}%
\newunit
\usebibmacro{event+venue+date}%
-}{}{}
+}{}{\wlog{WARNING: biblatex-bath failed to patch inproceedings driver}}
\xpatchbibdriver{online}{%
\printlist{organization}%
@@ -853,7 +924,7 @@
\usebibmacro{library}%
\newunit\newblock
\usebibmacro{organization+location+date}%
-}{}{}
+}{}{\wlog{WARNING: biblatex-bath failed to patch online driver}}
\DeclareFieldFormat{forceparens}{(#1)}
\newbibmacro{series+type+number}{%
@@ -893,14 +964,11 @@
\newunit\newblock
\usebibmacro{byauthor}%
\newunit\newblock
+ \usebibmacro{series+type+number}%
+ \newunit\newblock
\printfield{note}%
\newunit\newblock
\usebibmacro{institution+location+date}%
- \iffieldundef{series}{%
- \setunit{\addcomma\space}%
- }{%
- \setunit{\addspace}}%
- \usebibmacro{series+type+number}%
\newunit\newblock
\usebibmacro{chapter+pages}%
\newunit
@@ -944,7 +1012,14 @@
\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}}
\DeclareStyleSourcemap{%
\maps[datatype=bibtex]{%
@@ -1178,21 +1253,45 @@
\DeclareFieldFormat[legislation]{datelabel}{%
\iftoggle{bbx:eu-oj}{%
\mkbibbrackets{#1}%
- }{%
- #1}}
+ }{#1}}
\DeclareFieldFormat[legislation]{labeldate}{%
- \iftoggle{bbx:labelistitle}{\mkbibemph{#1}}{#1}}
+ \iftoggle{bbx:labelistitle}{\printtext[title]{#1}}{#1}}
\DeclareFieldFormat[legislation]{chapter}{\biblcsstring{legalchapter}#1}
-\newbibmacro*{series+chapter}{%
- \iffieldundef{chapter}{}{%
- \iffieldundef{series}{%
- \printfield{chapter}%
+\newbibmacro*{journal+series+volume+number+chapter+pages}{%
+ \iftoggle{bbx:eu-oj}{%
+ \setunit{\addspace}%
+ \usebibmacro{eu:journal+series+volume+pages}%
+ }{%
+ \iffieldequalstr{entrysubtype}{secondary}{%
+ \setunit{\addcomma\space}%
+ \printfield{number}%
+ \clearfield{number}%
+ \printunit{\addcomma\space}%
}{%
- \printtext[parens]{%
- \printfield{series}%
- \setunit{\addcomma\space}%
- \printfield{chapter}}}%
- \clearfield{series}}}
+ \ifboolexpr{
+ test {\iffieldundef{series}}
+ and
+ test {\iffieldundef{type}}
+ }{%
+ \iffieldundef{number}{%
+ \setunit{\addcomma\space}%
+ \printfield{chapter}%
+ }{%
+ \setunit{\addspace}%
+ \printtext[parens]{%
+ \printfield{number}%
+ \setunit*{\addcomma\space}%
+ \printfield{chapter}}}%
+ }{%
+ \iffieldundef{chapter}{}{\setunit{\addspace}}%
+ \printtext[parens]{%
+ \printfield{series}%
+ \setunit{\addcomma\space}%
+ \printfield{type}%
+ \setunit*{\addspace}%
+ \printfield{number}%
+ \setunit*{\addcomma\space}%
+ \printfield{chapter}}}}}}
\DeclareBibliographyDriver{legislation}{%
\usebibmacro{bibindex}%
@@ -1205,28 +1304,12 @@
\printlist{language}%
\newunit\newblock
\usebibmacro{byauthor}%
- \iffieldequalstr{entrysubtype}{secondary}{%
- \setunit{\addcomma\space}%
- \printfield{number}%
- \clearfield{number}%
- \printunit{\addcomma\space}%
- }{%
- \setunit{\addcomma\space}%
- }%
+ \newunit\newblock
+ \usebibmacro{journal+series+volume+number+chapter+pages}
+ \newunit\newblock
\printfield{note}%
- \iffieldundef{series}{%
- \setunit{\addcomma\space}%
- }{%
- \setunit{\addspace}}%
- \iftoggle{bbx:eu-oj}{%
- \usebibmacro{eu:journal+series+volume+pages}%
- }{%
- \usebibmacro{series+chapter}%
- }
\newunit\newblock
\usebibmacro{institution+location+date}%
- \setunit{\addspace}%
- \usebibmacro{series+type+number}%
\newunit\newblock
\printfield{pagetotal}%
\newunit\newblock
@@ -1384,10 +1467,56 @@
}%
}
+\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}}
+
\DeclareBibliographyAlias{standard}{manual}
\DeclareBibliographyAlias{dataset}{online}
%%
-%% Copyright (C) 2018 by University of Bath
+%% Copyright (C) 2019 by University of Bath
%%
%% End of file `bath.bbx'.