summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/biblatex-contrib/windycity/windycity.bbx
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/biblatex-contrib/windycity/windycity.bbx')
-rw-r--r--macros/latex/contrib/biblatex-contrib/windycity/windycity.bbx574
1 files changed, 366 insertions, 208 deletions
diff --git a/macros/latex/contrib/biblatex-contrib/windycity/windycity.bbx b/macros/latex/contrib/biblatex-contrib/windycity/windycity.bbx
index f7679dc8ad..6537e4c13d 100644
--- a/macros/latex/contrib/biblatex-contrib/windycity/windycity.bbx
+++ b/macros/latex/contrib/biblatex-contrib/windycity/windycity.bbx
@@ -1,4 +1,4 @@
-% Last modified: Wed 07 Jul 2021 05:45:49 PM CDT
+% Last modified: Tue 09 Nov 2021 07:46:28 PM CST
% Permission is granted to copy, distribute and/or modify this
% software under the terms of the LaTeX Project Public License (LPPL),
@@ -11,7 +11,7 @@
% implied warranties of merchantability and fitness for a particular
% purpose.
-\ProvidesFile{windycity.bbx}[2021/07/07 Windy City bibliography style
+\ProvidesFile{windycity.bbx}[2021/11/09 Windy City bibliography style
for biblatex]
\@ifpackagelater{biblatex}{2019/08/17}
{}
@@ -128,7 +128,10 @@
\providetoggle{shortlinks}
\DeclareBiblatexOption{global}[boolean]{shortlinks}[true]{%
- \settoggle{shortlinks}{#1}}%
+ \ifstrequal{#1}{true}
+ {\toggletrue{shortlinks}%
+ \AtBeginBibliography{\togglefalse{shortlinks}}}
+ {}}
\providetoggle{skipdate}
\DeclareBiblatexOption{entry}[boolean]{skipdate}[true]{%
@@ -180,7 +183,8 @@
\settoggle{url}{#1}}
% For setting 'minbibnames' and such, see CMOS, 17th ed., 14.76 and
-% 15.29.
+% 15.29. For 'citetracker' and 'loccittracker', 'constrict' is too
+% strict but seems to work well for 'ibidtracker'.
\ExecuteBibliographyOptions{%
abbreviate=true,
@@ -198,7 +202,7 @@
idemtracker=false,
indexing=true,
labeldateparts=true,
- loccittracker=constrict,
+ loccittracker=context,
minbibnames=7,
maxbibnames=10,
mincitenames=1,
@@ -312,8 +316,8 @@
\field{volume}
\literal{0}}}
-% When 'journal', 'journaltitle', 'organization', or 'blogtitle' goes
-% in the author's position.
+% When 'journal', 'journaltitle', 'organization', 'blogtitle' or
+% 'collection' goes in the author's position.
\DeclareStyleSourcemap{
\maps[datatype=bibtex]{
@@ -392,6 +396,19 @@
}
}
}
+\DeclareStyleSourcemap{
+ \maps[datatype=bibtex]{
+ \map[overwrite=false]{
+ \pertype{unpublished}
+ \step[notfield=author, final]
+ \step[fieldsource=collection]
+ \step[fieldset=sortname, origfieldval]
+ \step[fieldsource=sortname,
+ match=\regexp{(.+)},
+ replace=\regexp{{$1}}]
+ }
+ }
+}
% Save the entry key of every editor, translator, and title.
@@ -522,6 +539,7 @@
\providetoggle{cbx:first}
\providetoggle{cbx:idem}
\providetoggle{cbx:short}
+\providetoggle{cbx:skipdate}
\providetoggle{collection}
\providetoggle{collection:bk}
@@ -682,13 +700,18 @@
\DeclareFieldFormat{journaltitleaddon}{\mkbibbrackets{#1}}
\DeclareFieldFormat{titleaddon}{\mkbibbrackets{#1}}
-\DeclareFieldFormat[article,incollection,online,reference,review]
+\DeclareFieldFormat[article,incollection,online,reference,review,thesis]
{title}{\mkbibquote{#1}}
-\DeclareFieldFormat[article,incollection,online,reference,review]
+\DeclareFieldFormat[article,incollection,online,reference,review,thesis]
{labeltitle}{\mkbibquote{#1}}
-\DeclareIndexFieldFormat[article,incollection,online,reference,review]
+\DeclareIndexFieldFormat[article,incollection,online,reference,review,thesis]
{indextitle}{\usebibmacro{index:title}{\index}{\mkbibquote{#1}}}
+\DeclareFieldFormat[letter,misc,patent]{title}{#1}
+\DeclareFieldFormat[letter,misc,patent]{labeltitle}{#1}
+\DeclareIndexFieldFormat[letter,misc,patent]
+ {indextitle}{\usebibmacro{index:title}{\index}{#1}}
+
\DeclareFieldAlias[inbook]{title}{title}
\DeclareFieldAlias[inbook]{labeltitle}{labeltitle}
\DeclareIndexFieldAlias[inbook]{indextitle}{indextitle}
@@ -696,20 +719,18 @@
\DeclareFieldFormat{chapter}{\bibstring{chapter}\space #1}
\DeclareFieldFormat{issuetitle}{\ifcapital{\MakeCapital{#1}}{#1}}
-\DeclareFieldFormat[letter,misc,patent]{title}{#1}
-\DeclareFieldFormat[letter,misc,patent]{labeltitle}{#1}
-\DeclareFieldFormat[thesis,unpublished]{title}{%
- \iftoggle{bibliography}
- {\mkbibquote{#1}}%
- {\iftoggle{cbx:short}
- {\mkbibquote{#1}}%
- {\mkbibquote{#1}\nopunct}}}
-\DeclareFieldFormat[thesis]{labeltitle}{%
- \iftoggle{bibliography}
+
+\DeclareFieldFormat[unpublished]
+ {title}{\usebibmacro{unpublished:format}{#1}}
+\DeclareFieldFormat[unpublished]
+ {labeltitle}{\usebibmacro{unpublished:format}{#1}}
+\DeclareIndexFieldFormat[unpublished]
+ {indextitle}{\usebibmacro{index:title}{\index}{% Macro below won't work here
+ \iffieldundef{collection}{\mkbibquote{#1}}{#1}}}
+\newbibmacro*{unpublished:format}[1]{%
+ \iffieldundef{collection}
{\mkbibquote{#1}}%
- {\iftoggle{cbx:short}
- {\mkbibquote{#1}}%
- {\mkbibquote{#1}\nopunct}}}
+ {#1}}%
%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Other Field Formats %%
@@ -797,9 +818,6 @@
\DeclareBibliographyAlias{cite:inbook}{cite:incollection}
\DeclareBibliographyAlias{cite:letter}{cite:incollection}
-\DeclareBibliographyAlias{unpublished}{thesis}
-\DeclareBibliographyAlias{cite:unpublished}{cite:thesis}
-
%%%%%%%%%%%%%%%%%%%%%%%%%
%% Author's Position %%
%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -817,6 +835,7 @@
{\usebibmacro{editors:a}%
\ifnameundef{\cbx@namelist}
{\toggletrue{noauth}%
+ \usebibmacro{unpublished:collection}%
\usebibmacro{authpos+deflabel}}%
{\usebibmacro{addplus+etc}%
\usebibmacro{namehash+etc}}}
@@ -835,32 +854,38 @@
{}
{\ifboolexpr{ togl {collection:ib}
and togl {swapvol}}
- {\usebibmacro{author+namelist}{bookauthor}}%
+ {\usebibmacro{shortnames}{bookauthor}}%
{\ifnameundef{author}
- {\usebibmacro{author+namelist}{bookauthor}}%
- {\usebibmacro{author+namelist}{author}}}}}
+ {\usebibmacro{shortnames}{bookauthor}%
+ \usebibmacro{test:authortypes}{bookauthor}}%
+ {\usebibmacro{shortnames}{author}%
+ \usebibmacro{test:authortypes}{author}}}}}
-\newbibmacro*{author+namelist}[1]{%
+\newbibmacro*{shortnames}[1]{%
\ifboolexpr{ test {\ifnameundef{short#1}}
or togl {cbx:first}
or togl {bibliography}}
{\renewcommand*{\cbx@namelist}{#1}}%
- {\renewcommand*{\cbx@namelist}{short#1}}%
- \usebibmacro{author+type}{#1}}%
+ {\renewcommand*{\cbx@namelist}{short#1}}}
-\newbibmacro*{author+type}[1]{%
+\newbibmacro*{test:authortypes}[1]{%
\iffieldundef{#1type}
{}
- {\iffieldequalstr{#1type}{anon}
+ {\let\authtypes\empty
+ \forcsvfield{\listadd\authtypes}{#1type}%
+ \usebibmacro{types:shared}{\authtypes}}}
+
+\newbibmacro*{types:shared}[1]{%
+ \ifinlist{anon}{#1}
+ {\renewcommand*{\anona}{\bibopenbracket}%
+ \renewcommand*{\anonb}{\bibclosebracket}}%
+ {\ifinlist{anon?}{#1}
{\renewcommand*{\anona}{\bibopenbracket}%
- \renewcommand*{\anonb}{\bibclosebracket}}%
- {\iffieldequalstr{#1type}{anon?}
- {\renewcommand*{\anona}{\bibopenbracket}%
- \renewcommand*{\anonb}{\addquestion\bibclosebracket}}%
- {\ifboolexpr{ test {\iffieldequalstr{#1type}{pseudo}}
- and not togl {cbx:short}}
- {\renewcommand*{\anonb}{\space\mkbibbrackets{\bibstring{pseudo}}}}
- {}}}}}
+ \renewcommand*{\anonb}{\addquestion\bibclosebracket}}%
+ {\ifboolexpr{ test {\ifinlist{pseudo}{#1}}
+ and not togl {cbx:short}}
+ {\renewcommand*{\anonb}{\space\mkbibbrackets{\bibstring{pseudo}}}}
+ {}}}}
\newbibmacro*{namehash+etc}{%
\usebibmacro{printnames+etc}%
@@ -871,6 +896,19 @@
\newunit}%
{\setunit{\addcomma\space}}}
+\newbibmacro*{unpublished:collection}{%
+ \ifboolexpr{ test {\iffieldundef{collection}}
+ and test {\iffieldundef{shortcollection}}}
+ {}
+ {\ifboolexpr{ togl {cbx:short}
+ and not test {\iffieldundef{shortcollection}}}
+ {\iftoggle{shortlinks}
+ {\printtext[bibhyperref]{\printfield{shortcollection}}}
+ {\printfield{shortcollection}}}
+ {\iftoggle{shortlinks}
+ {\printtext[bibhyperref]{\printfield{collection}}}
+ {\printfield{collection}}}}}
+
\newbibmacro*{supplement}{%
\ifnameundef{afterword}
{\ifnameundef{foreword}
@@ -1156,26 +1194,30 @@
% Macros common to 'editors:a', 'editors:b', and 'editors:c'.
\newbibmacro*{edcombos:a}{%
- \renewcommand*{\cbx@namelist}{\xeditor}%
+ \usebibmacro{shortnames}{\xeditor}%
\ifnamesequal{\xeditor}{\yeditor}
{\clearname{\yeditor}%
\toggletrue{notrans}%
\usebibmacro{edcombos:b}{\edtypes}{edtrans}%
\iftoggle{atleastone}
- {}
- {\usebibmacro{edcombos:b}{\transtypes}{edtrans}}}
- {\usebibmacro{edcombos:c}}}
+ {\usebibmacro{types:shared}{\edtypes}}%
+ {\usebibmacro{edcombos:b}{\transtypes}{edtrans}%
+ \usebibmacro{types:shared}{\transtypes}}}
+ {\usebibmacro{edcombos:c}%
+ \usebibmacro{types:shared}{\edtypes}}}
\newbibmacro*{transcombos:a}{%
- \renewcommand*{\cbx@namelist}{\yeditor}%
+ \usebibmacro{shortnames}{\yeditor}%
\ifnamesequal{\xeditor}{\yeditor}
{\clearname{\xeditor}%
\toggletrue{noed}%
\usebibmacro{transcombos:b}{\edtypes}{transed}%
\iftoggle{atleastone}
- {}
- {\usebibmacro{transcombos:b}{\transtypes}{transed}}}
- {\usebibmacro{transcombos:c}}}
+ {\usebibmacro{types:shared}{\edtypes}}%
+ {\usebibmacro{transcombos:b}{\transtypes}{transed}%
+ \usebibmacro{types:shared}{\transtypes}}}
+ {\usebibmacro{transcombos:c}%
+ \usebibmacro{types:shared}{\transtypes}}}
\newbibmacro*{edcombos:b}[2]{%
\togglefalse{atleastone}%
@@ -1303,7 +1345,7 @@
{\usebibmacro{printnames}}%
\usebibmacro{handle}%
\usebibmacro{nameaddon}%
- \usebibmacro{newauth+journallocation}%
+ \usebibmacro{newauth+location}%
\usebibmacro{a:labeldate+extradate}%
\usebibmacro{clearnames+empty}}%
@@ -1351,11 +1393,11 @@
{\printfield[brackets]{nameaddon}%
\clearfield{nameaddon}}}}
-\newbibmacro*{newauth+journallocation}{%
+\newbibmacro*{newauth+location}{%
\iftoggle{newauth}
{\ifboolexpr{ test {\ifentrytype{article}}
and togl {bibliography}}
- {\usebibmacro{journallocation}%
+ {\usebibmacro{article:location}%
\newunit}%
{}}
{}}
@@ -1601,14 +1643,17 @@
{\iffieldundef{pubstate}
{\usebibmacro{labeldate+date}{#1}}%
{\iffieldequalstr{pubstate}{preprint}
- {\bibstring{preprint}}%
+ {\newunit
+ \bibstring{preprint}%
+ \setunit{\space}}%
{\iffieldequalstr{pubstate}{prepub}
{\newunit% necessary if no 'date'
\bibstring{prepub}%
\setunit{\addcomma\space}%
\printdate}%
{\iffieldequalstr{pubstate}{working}
- {\bibstring{working}%
+ {\newunit
+ \bibstring{working}%
\setunit{\addcomma\space}}%
{\ifstrequal{#1}{parens}
{\printtext[parens]{\printfield{pubstate}}}
@@ -1711,6 +1756,26 @@
{}
{\textendash\printfield{endorigyear}}}}
+\newbibmacro*{year+month+day}{%
+ \iffieldundef{year}
+ {}
+ {\iffieldundef{month}
+ {\usebibmacro{reflist+year+day}%
+ \printdate}%
+ {\printdate}}}
+
+\newbibmacro*{year+month+day+old}{%
+ \iffieldundef{year}
+ {}
+ {\ifboolexpr{ togl {reflist}
+ and togl {bibliography}
+ and test {\iffieldundef{month}}}
+ {}
+ {\iffieldundef{month}
+ {\usebibmacro{reflist+year+day}%
+ \printdate}%
+ {\printdate}}}}
+
% For reference lists.
\newbibmacro*{a:labeldate+extradate}{%
@@ -1765,6 +1830,14 @@
%% Locations %%
%%%%%%%%%%%%%%%%%
+\newbibmacro*{article:location}{%
+ \iflistundef{location}
+ {}
+ {\nopunct\setunit{\space}%
+ \printtext[parens]{%
+ \printlist{location}}}%
+ \clearlist{location}}%
+
\newbibmacro*{loc+pub+year}{%
\usebibmacro{loc+pub}{1}%
\ifnumgreater{\value{publisher}}{1}
@@ -1775,11 +1848,11 @@
\usebibmacro{year+bookyear}}%
\newbibmacro*{loc+pub}[1]{%
- \usebibmacro{location}{#1}%
+ \usebibmacro{location:a}{#1}%
\setunit{\addcolon\space}%
\printlist[publisher][#1-#1]{publisher}}%
-\newbibmacro*{location}[1]{%
+\newbibmacro*{location:a}[1]{%
\ifboolexpr{ test {\iflistundef{location}}
and test {\iffieldundef{howpublished}}
and test {\iffieldundef{url}}
@@ -1787,6 +1860,12 @@
{\bibstring{noplace}}%
{\printlist[location][#1-#1]{location}}}
+\newbibmacro*{location:b}{%
+ \iflistundef{location}
+ {}
+ {\printlist{location}%
+ \setunit{\addcomma\space}}}
+
\newbibmacro*{origlocation}{%
\iflistundef{origlocation}
{}
@@ -1795,79 +1874,14 @@
{\setunit{\addcomma\space}}%
{\setunit{\addcolon\space}}}}
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%% Bibliography Drivers %%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-\DeclareBibliographyDriver{shorthand}{%
- \usedriver
- {\DeclareNameAlias{author}{sortname}}%
- {\thefield{entrytype}}%
- \iftoggle{annotate}
- {\global\togglefalse{annotate}%
- \usebibmacro{pageref+finentry}%
- \global\toggletrue{annotate}}%
- {\usebibmacro{pageref+finentry}}}
-
-\DeclareBibliographyDriver{article}{%
- \usebibmacro{bibindex}%
- \usebibmacro{newauth}%
- \usebibmacro{author+title+etc}%
- \usebibmacro{articles}%
- \usebibmacro{colon+pages+etc}%
- \usebibmacro{doi+finentry+etc}}%
-
-\DeclareBibliographyDriver{book}{%
- \usebibmacro{bibindex}%
- \usebibmacro{author+collection+etc}%
- \usebibmacro{doi+finentry+etc}}%
-
-\DeclareBibliographyDriver{incollection}{%
- \usebibmacro{bibindex}%
- \usebibmacro{author+incollection+etc}%
- \usebibmacro{crossref+incollections}%
- \usebibmacro{doi+finentry+etc}}%
-
-\DeclareBibliographyDriver{misc}{%
- \usebibmacro{bibindex}%
- \usebibmacro{author+bookauthor+etc}%
- \usebibmacro{title+labeldate}%
- \newunit
- \printfield{userb}%
- \usebibmacro{doi+finentry+etc}}%
-
-\DeclareBibliographyDriver{online}{%
- \usebibmacro{bibindex}%
- \usebibmacro{newauth}%
- \usebibmacro{author+title+etc}%
- \newunit
- \usebibmacro{websites}%
- \usebibmacro{issue+month+etc}{}%
- \usebibmacro{doi+finentry+etc}}%
-
-\DeclareBibliographyDriver{patent}{%
- \usebibmacro{bibindex}%
- \usebibmacro{author+title+etc}%
- \newunit
- \printfield{number}%
- \newunit
- \printfield{addendum}%
- \usebibmacro{pageref+finentry}}%
-
-\DeclareBibliographyDriver{review}{%
- \usebibmacro{bibindex}%
- \usebibmacro{newauth}%
- \usebibmacro{reviews}%
- \usebibmacro{articles}%
- \usebibmacro{colon+pages+etc}%
- \usebibmacro{doi+finentry+etc}}%
-
-\DeclareBibliographyDriver{thesis}{%
- \usebibmacro{bibindex}%
- \usebibmacro{author+title+etc}%
- \newunit
- \usebibmacro{inst+loc+date}%
- \usebibmacro{doi+finentry+etc}}%
+\newbibmacro*{institution+venue}{%
+ \ifboolexpr{ test {\iflistundef{institution}}
+ and test {\iflistundef{venue}}}
+ {}
+ {\iflistundef{institution}
+ {\printfield{venue}}%
+ {\printlist{institution}}%
+ \setunit{\addcomma\space}}}
%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Second Tier Macros %%
@@ -1894,12 +1908,14 @@
\usebibmacro{editors:b}}%
\newbibmacro*{articles}{%
- \newunit
+ \iftoggle{newauth}
+ {\printunit{\newunitpunct}}%
+ {\newunit}%
\usebibmacro{part}%
\usebibmacro{issuetitle}%
\usebibmacro{title+titleaddon}{journal}%
- \usebibmacro{journallocation}%
- \usebibmacro{journalseries}%
+ \usebibmacro{article:series}%
+ \usebibmacro{article:location}%
\usebibmacro{volume}%
\iftoggle{newauth}
{\newunit}%
@@ -1951,14 +1967,14 @@
\toggletrue{edshift}%
\usebibmacro{byauthor}%
\usebibmacro{editors:b}%
- \usebibmacro{volumes+bookseries+etc}{}}%
- {\usebibmacro{title+labeldate}{}%
+ \usebibmacro{volumes+series+etc}{}}%
+ {\usebibmacro{title+labeldate}%
\usebibmacro{byauthor}%
\iffieldundef{maintitle}
{\usebibmacro{note+edition+etc}%
- \usebibmacro{volumes+bookseries+etc}{}}%
+ \usebibmacro{volumes+series+etc}{}}%
{\usebibmacro{editors:b}%
- \usebibmacro{volumes+bookseries+etc}{}%
+ \usebibmacro{volumes+series+etc}{}%
\usebibmacro{maintitle+note+etc}}}
\usebibmacro{date+loc+etc}%
\usebibmacro{origtitle}}%
@@ -2036,23 +2052,68 @@
\toggletrue{edshift}%
\usebibmacro{editors:b}}%
-\newbibmacro*{inst+loc+date}{%
- \usebibmacro{thesis+type}%
- \ifboolexpr{ test {\iflistundef{institution}}
- and test {\iflistundef{venue}}}
- {}
- {\iflistundef{institution}
- {\printfield{venue}}%
- {\printlist{institution}}%
+\newbibmacro*{thesis:type+pubstate}{%
+ \ifentrytype{mathesis}
+ {\bibstring{mathesis}%
\setunit{\addcomma\space}}%
- \iflistundef{location}
+ {\ifentrytype{phdthesis}
+ {\bibstring{phdthesis}%
+ \setunit{\addcomma\space}}%
+ {\iffieldundef{type}
+ {\usebibmacro{pubstate}{}}%
+ {\iffieldbibstring{type}
+ {\bibstring{\thefield{type}}}
+ {\printfield{type}}%
+ \setunit{\addcomma\space}}}}}
+
+\newbibmacro*{inst+loc+date}{%
+ \usebibmacro{institution+venue}%
+ \usebibmacro{location:b}%
+ \usebibmacro{year+month+day}}%
+
+\newbibmacro*{type+typeaddon}{%
+ \iffieldundef{type}
{}
- {\printlist{location}%
- \setunit{\addcomma\space}}%
- \iffieldundef{month}
- {\usebibmacro{reflist+year+day}}%
+ {\newunit
+ \printfield{type}%
+ \iffieldundef{typeaddon}
+ {\setunit{\addcomma\space}}%
+ {\iffieldstart{typeaddon}{,}
+ {}
+ {\setunit{\space}}%
+ \printfield{typeaddon}%
+ \setunit{\space}}}}
+
+\newbibmacro*{unpublished:series}{%
+ \iffieldundef{series}
{}
- \printdate}%
+ {\newunit
+ \usebibmacro{series+seriesaddon}%
+ \iffieldundef{collection}
+ {\setunit{\addcomma\space}}%
+ {\newunit}}}
+
+\newbibmacro*{manuscripts}{%
+ \iffieldundef{title}
+ {\toggletrue{skipdate}%
+ \usebibmacro{author+bookauthor+etc}%
+ \usebibmacro{type+typeaddon}}%
+ {\usebibmacro{author+bookauthor+etc}%
+ \usebibmacro{title+titleaddon}{}%
+ \usebibmacro{type+typeaddon}%
+ \setunit{\addcomma\space}%
+ \ifboolexpr{ togl {reflist}
+ and test {\iffieldundef{month}}}
+ {}
+ {\iffieldundef{year}
+ {\printlabeldate}% for 'n.d.'
+ {\printdate
+ \clearfield{year}}}
+ \iffieldundef{type}
+ {\newunit
+ \usebibmacro{unpublished:collection}}%
+ {}}
+ \usebibmacro{unpublished:note+etc}}%
%%%%%%%%%%%%%%%%%%%%%%%%%
%% Third Tier Macros %%
@@ -2082,35 +2143,19 @@
\setunit{\addcomma\space}%
\clearfield{part}}}
-\newbibmacro*{journallocation}{%
- \iflistundef{location}
- {}
- {\nopunct\setunit{\space}%
- \printtext[parens]{%
- \printlist{location}}}%
- \clearlist{location}}%
-
-\newbibmacro*{journalseries}{%
+\newbibmacro*{article:series}{%
\iffieldundef{series}
{}
{\iftoggle{newauth}
- {\newunit
- \printfield{series}}%
- {\setunit{\addcomma\space}%
- \printfield{series}}%
- \isdot\addcomma
- \usebibmacro{seriesaddon}%
- \usebibmacro{editors:c}{series}%
- \newunit}}%
+ {\newunit}%
+ {\setunit{\addcomma\space}}%
+ \usebibmacro{series+seriesaddon}}}
\newbibmacro*{volume}{%
\iffieldundef{volume}
{}
- {\ifboolexpr{ togl {bibliography}
- and togl {newauth}}
- {\printfield[noformat]{volume}}%
- {\setunit{\space}%
- \printfield[noformat]{volume}}}}
+ {\setunit{\space}%
+ \printfield[noformat]{volume}}}
% On how to format the issue number of periodicals, see CMOS, 17th
% ed., 14.171 and 15.47.
@@ -2237,12 +2282,12 @@
\setunit{\addcomma\space}\bibstring{by}\space}}%
{\renewcommand*{\pluga}{\newunit\bibstring{by}\space}}%
\renewcommand*{\cbx@namelist}{author}%
- \usebibmacro{author+type}{author}%
+ \usebibmacro{test:authortypes}{author}%
\usebibmacro{printnames+etc}}}
-\newbibmacro*{volumes+bookseries+etc}[1]{%
+\newbibmacro*{volumes+series+etc}[1]{%
\usebibmacro{volumes}%
- \usebibmacro{bookseries}%
+ \usebibmacro{book:series}%
\usebibmacro{pages}%
\usebibmacro{volume+number+etc}{#1}%
\usebibmacro{book:number}%
@@ -2297,7 +2342,7 @@
{\renewcommand*{\pluga}{%
\setunit{\addcomma\space}\bibstring{by}\space}%
\renewcommand*{\cbx@namelist}{bookauthor}%
- \usebibmacro{author+type}{bookauthor}%
+ \usebibmacro{test:authortypes}{bookauthor}%
\usebibmacro{printnames+etc}%
\usebibmacro{pages}}}
@@ -2322,9 +2367,9 @@
\usebibmacro{note+edition+etc}%
\iffieldundef{volume}
{\iffieldundef{bookvolume}%
- {\usebibmacro{volumes+bookseries+etc}{bookbook}}%
- {\usebibmacro{volumes+bookseries+etc}{book}}}
- {\usebibmacro{volumes+bookseries+etc}{}}}}
+ {\usebibmacro{volumes+series+etc}{bookbook}}%
+ {\usebibmacro{volumes+series+etc}{book}}}
+ {\usebibmacro{volumes+series+etc}{}}}}
\usebibmacro{date+loc+etc}%
\usebibmacro{origtitle}}%
@@ -2349,19 +2394,40 @@
\togglefalse{edshift}}%
{}}}
-\newbibmacro*{thesis+type}{%
- \ifentrytype{mathesis}
- {\bibstring{mathesis}%
- \setunit{\addcomma\space}}%
- {\ifentrytype{phdthesis}
- {\bibstring{phdthesis}%
- \setunit{\addcomma\space}}%
- {\iffieldundef{type}
- {\usebibmacro{pubstate}{}}%
- {\iffieldbibstring{type}
- {\bibstring{\thefield{type}}}
- {\printfield{type}}%
- \setunit{\addcomma\space}}}}}
+% Thanks to David Fussner's biblatex-chicago for pointing me to this
+% command by Philipp Lehman. Source:
+% https://groups.google.com/forum/#!topic/comp.text.tex/kG003fkZK1I
+
+\newrobustcmd*{\iffieldstart}[2]{%
+ \iffieldundef{#1}
+ {\@secondoftwo}% originally '\@gobbletwo'
+ {\begingroup
+ \edef\@tempa{%
+ \long\def\noexpand\iffieldstart@i####1\detokenize{#2}####2}%
+ \@tempa\@nil{\endgroup\ifblank{##1}}%
+ \savefield*{#1}{\@tempa}%
+ \expandafter\iffieldstart@i\detokenize
+ \expandafter\expandafter\expandafter{%
+ \expandafter\@tempa\detokenize{#2}}\@nil}}%
+
+\newbibmacro*{series+seriesaddon}{%
+ \printfield{series}%
+ \usebibmacro{seriesaddon}%
+ \ifterm
+ {\printunit{\isdot\addcomma\space}}%
+ {\setunit{\addcomma\space}}%
+ \usebibmacro{editors:c}{series}}%
+
+\newbibmacro*{unpublished:note+etc}{%
+ \ifboolexpr{ test {\ifentrytype{unpublished}}
+ and not test {\iffieldundef{collection}}}
+ {\usebibmacro{note}%
+ \usebibmacro{editors:b}%
+ \usebibmacro{unpublished:series}%
+ \usebibmacro{unpublished:volume}%
+ \newunit
+ \usebibmacro{inst+loc+date}}%
+ {}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Fourth and Higher Tier Macros %%
@@ -2410,21 +2476,12 @@
\printfield{volumes}%
\clearfield{volumes}}}}
-\newbibmacro*{bookseries}{%
+\newbibmacro*{book:series}{%
\iffieldundef{series}
{}
{\usebibmacro{pages}%
\newunit
- \printfield{series}%
- \usebibmacro{seriesaddon}%
- \usebibmacro{editors:c}{series}}}
-
-\newbibmacro*{seriesaddon}{%
- \iffieldundef{seriesaddon}
- {}
- {\addcomma\space
- \printfield{seriesaddon}%
- \isdot\addcomma}}%
+ \usebibmacro{series+seriesaddon}}}
\newbibmacro*{swapvol+pages}{%
\ifboolexpr{ togl {collection}
@@ -2491,7 +2548,7 @@
\iftoggle{swapvol}
{\usebibmacro{note}%
\usebibmacro{edition}{}%
- \usebibmacro{volumes+bookseries+etc}{}%
+ \usebibmacro{volumes+series+etc}{}%
\usebibmacro{title+titleaddon}{}%
\toggletrue{edshift}%
\usebibmacro{byauthor}%
@@ -2500,7 +2557,7 @@
\toggletrue{edshift}%
\usebibmacro{booktitle}%
\usebibmacro{note+edition+etc}%
- \usebibmacro{volumes+bookseries+etc}{}}}
+ \usebibmacro{volumes+series+etc}{}}}
\newbibmacro*{incollections:ic}{%
\iftoggle{swapvol}
@@ -2509,7 +2566,7 @@
{\usebibmacro{bookbooktitle}{}%
\toggletrue{edshift}%
\usebibmacro{note+edition+etc}}%
- \usebibmacro{volumes+bookseries+etc}{book}%
+ \usebibmacro{volumes+series+etc}{book}%
\toggletrue{edshift}%
\usebibmacro{booktitle}%
\usebibmacro{editors:b}}%
@@ -2522,6 +2579,107 @@
{\usebibmacro{bookbooktitle}{}%
\toggletrue{edshift}%
\usebibmacro{note+edition+etc}}%
- \usebibmacro{volumes+bookseries+etc}{book}}}
+ \usebibmacro{volumes+series+etc}{book}}}
+
+\newbibmacro*{seriesaddon}{%
+ \iffieldundef{seriesaddon}
+ {}
+ {\ifterm
+ {\printunit{\isdot\addcomma\space}}%
+ {\setunit{\addcomma\space}}%
+ \printfield{seriesaddon}}}
+
+\newbibmacro*{unpublished:volume}{%
+ \iffieldundef{volume}
+ {}
+ {\printfield{volume}%
+ \newunit}}%
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Bibliography Drivers %%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\DeclareBibliographyDriver{shorthand}{%
+ \usedriver
+ {\DeclareNameAlias{author}{sortname}}%
+ {\thefield{entrytype}}%
+ \iftoggle{annotate}
+ {\global\togglefalse{annotate}%
+ \usebibmacro{pageref+finentry}%
+ \global\toggletrue{annotate}}%
+ {\usebibmacro{pageref+finentry}}}
+
+\DeclareBibliographyDriver{article}{%
+ \usebibmacro{bibindex}%
+ \usebibmacro{newauth}%
+ \usebibmacro{author+title+etc}%
+ \usebibmacro{articles}%
+ \usebibmacro{colon+pages+etc}%
+ \usebibmacro{doi+finentry+etc}}%
+
+\DeclareBibliographyDriver{book}{%
+ \usebibmacro{bibindex}%
+ \usebibmacro{author+collection+etc}%
+ \usebibmacro{doi+finentry+etc}}%
+
+\DeclareBibliographyDriver{incollection}{%
+ \usebibmacro{bibindex}%
+ \usebibmacro{author+incollection+etc}%
+ \usebibmacro{crossref+incollections}%
+ \usebibmacro{doi+finentry+etc}}%
+
+\DeclareBibliographyDriver{misc}{%
+ \usebibmacro{bibindex}%
+ \usebibmacro{author+bookauthor+etc}%
+ \usebibmacro{title+labeldate}%
+ \newunit
+ \printfield{userb}%
+ \usebibmacro{doi+finentry+etc}}%
+
+\DeclareBibliographyDriver{online}{%
+ \usebibmacro{bibindex}%
+ \usebibmacro{newauth}%
+ \usebibmacro{author+title+etc}%
+ \newunit
+ \usebibmacro{websites}%
+ \usebibmacro{issue+month+etc}{}%
+ \usebibmacro{doi+finentry+etc}}%
+
+\DeclareBibliographyDriver{patent}{%
+ \usebibmacro{bibindex}%
+ \usebibmacro{author+title+etc}%
+ \newunit
+ \printfield{number}%
+ \newunit
+ \printfield{addendum}%
+ \usebibmacro{pageref+finentry}}%
+
+\DeclareBibliographyDriver{review}{%
+ \usebibmacro{bibindex}%
+ \usebibmacro{newauth}%
+ \usebibmacro{reviews}%
+ \usebibmacro{articles}%
+ \usebibmacro{colon+pages+etc}%
+ \usebibmacro{doi+finentry+etc}}%
+
+\DeclareBibliographyDriver{thesis}{%
+ \usebibmacro{bibindex}%
+ \usebibmacro{author+title+etc}%
+ \newunit
+ \usebibmacro{thesis:type+pubstate}%
+ \usebibmacro{inst+loc+date}%
+ \usebibmacro{doi+finentry+etc}}%
+
+\DeclareBibliographyDriver{unpublished}{%
+ \usebibmacro{bibindex}%
+ \iffieldundef{collection}
+ {\usebibmacro{author+title+etc}%
+ \newunit
+ \usebibmacro{type+typeaddon}%
+ \usebibmacro{pubstate}{}%
+ \usebibmacro{unpublished:series}%
+ \usebibmacro{inst+loc+date}}%
+ {\usebibmacro{manuscripts}}%
+ \usebibmacro{doi+finentry+etc}}%
\endinput