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.bbx316
1 files changed, 179 insertions, 137 deletions
diff --git a/macros/latex/contrib/biblatex-contrib/windycity/windycity.bbx b/macros/latex/contrib/biblatex-contrib/windycity/windycity.bbx
index 6537e4c13d..f0ebc54803 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: Tue 09 Nov 2021 07:46:28 PM CST
+% Last modified: Sat 04 Dec 2021 01:25:10 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/11/09 Windy City bibliography style
+\ProvidesFile{windycity.bbx}[2021/12/04 Windy City bibliography style
for biblatex]
\@ifpackagelater{biblatex}{2019/08/17}
{}
@@ -32,8 +32,7 @@
\DeclareBiblatexOption{global}[boolean]{collsonly}[true]{%
\ifstrequal{#1}{true}
- {\ExecuteBibliographyOptions{mincrossrefs=1}%
- \ExecuteBibliographyOptions{minxrefs=1}%
+ {\ExecuteBibliographyOptions{mincrossrefs=1,minxrefs=1}%
\AtBeginBibliography{\blx@key@bibcheck{collsonly}}}
{}}
@@ -85,6 +84,10 @@
\DeclareBiblatexOption{entry}[boolean]{noauth}[true]{%
\settoggle{noauth}{#1}}%
+\providetoggle{noetal}
+\DeclareBiblatexOption{entry,global}[boolean]{noetal}[true]{%
+ \settoggle{noetal}{#1}}%
+
\DeclareBiblatexOption{global}[boolean]{nolos}[true]{%
\ifstrequal{#1}{true}
{\AtBeginBibliography{\blx@key@bibcheck{nolos}}}
@@ -94,6 +97,10 @@
\DeclareBiblatexOption{global}[boolean]{nopages}[true]{%
\settoggle{nopages}{#1}}%
+\providetoggle{noplace}
+\DeclareBiblatexOption{entry}[boolean]{noplace}[true]{%
+ \settoggle{noplace}{#1}}%
+
\providetoggle{noreprint}
\DeclareBiblatexOption{entry}[boolean]{noreprint}[true]{%
\settoggle{noreprint}{#1}}%
@@ -102,14 +109,7 @@
\DeclareBiblatexOption{global}[boolean]{reflist}[true]{%
\ifstrequal{#1}{true}
{\toggletrue{reflist}%
- \DeclareLabeldate{%
- \field{date}
- \field{year}
- \field{origdate}
- \field{urldate}
- \literal{nodate}}
- \ExecuteBibliographyOptions{%
- sorting=nyt}}%
+ \ExecuteBibliographyOptions{sorting=nyt}}%
{\togglefalse{reflist}}}
\providetoggle{short}
@@ -175,12 +175,17 @@
\settoggle{swaptrans:maintitle}{#1}}%
\providetoggle{swapvol}
-\DeclareBiblatexOption{entry,global}[boolean]{swapvol}[true]{%
+\DeclareBiblatexOption{entry}[boolean]{swapvol}[true]{%
\settoggle{swapvol}{#1}}%
+\providetoggle{swapvol:global}
+\DeclareBiblatexOption{global}[boolean]{swapvol}[true]{%
+ \settoggle{swapvol}{#1}%
+ \settoggle{swapvol:global}{#1}}%
+
\providetoggle{url}
\DeclareBiblatexOption{entry,global}[boolean]{url}[true]{%
- \settoggle{url}{#1}}
+ \settoggle{url}{#1}}%
% For setting 'minbibnames' and such, see CMOS, 17th ed., 14.76 and
% 15.29. For 'citetracker' and 'loccittracker', 'constrict' is too
@@ -201,6 +206,7 @@
ibidtracker=constrict,
idemtracker=false,
indexing=true,
+ labeldate=year,
labeldateparts=true,
loccittracker=context,
minbibnames=7,
@@ -209,6 +215,7 @@
maxcitenames=3,
mincrossrefs=2,
minxrefs=2,
+ nohashothers=false,
pagetracker=page,
parentracker=true,
sortcites=false,
@@ -226,7 +233,9 @@
\DeclareLanguageMapping{english}{american-windycity}
\DeclareLanguageMappingSuffix{-windycity}
-\DeclareLabeldate{% 'reflist' preamble option loads an alternative
+\DeclareLabeldate{%
+ \field{label}
+ \field{setlabel}
\field{bookyear}
\field{date}
\field{year}
@@ -421,7 +430,7 @@
\step[fieldset=$MAPLOOPkey, null]
}
\map[overwrite, foreach={%
- editor,editora,editorb,editorc,translator,translatora,translatorb}]{
+ editor,editora,editorb,editorc,translator,translatora,translatorb}]{
\step[fieldsource=entrykey]
\step[fieldset=$MAPLOOPtype, fieldvalue={,}, appendstrict]
\step[fieldset=$MAPLOOPtype, origfieldval, append]
@@ -431,7 +440,32 @@
}
}
-% For 'collsonly' and 'nolos' options and the 'reference' entry type.
+% Workarounds to get the correct 'labeldate'.
+
+\DeclareStyleSourcemap{
+ \maps[datatype=bibtex]{
+ \map[overwrite=false]{
+ \pertype{inbook}
+ \pertype{bookinbook}
+ \step[notfield=options, final]
+ \step[fieldsource=year, final]
+ \step[fieldset=setlabel, origfieldval]
+ }
+ }
+}
+\DeclareStyleSourcemap{
+ \maps[datatype=bibtex]{
+ \map[overwrite=false]{
+ \pertype{inbook}
+ \pertype{bookinbook}
+ \step[fieldsource=options, notmatch=\regexp{swapvol}, final]
+ \step[fieldsource=year, final]
+ \step[fieldset=setlabel, origfieldval]
+ }
+ }
+}
+
+% For 'collsonly' and 'nolos' options and the '@reference' entry type.
\defbibcheck{collsonly}{%
\ifentrytype{inbook}
@@ -764,14 +798,14 @@
\DeclareListFormat{publisher}{#1}
\DeclareFieldFormat{pubstate}{\ifcapital{\MakeCapital{#1}}{#1}}%
\DeclareFieldFormat{season}{\MakeCapital{#1}}% always capitalize
+\DeclareFieldFormat{series}{\ifcapital{\MakeCapital{#1}}{#1}}
% A shorthand should be italicized if the title that it abbreviates is
% also italicized. See CMOS, 17th ed., 14.60. Set italics for it in
% the bibliography database with '\emph{}' or '\mkbibemph{}'.
\DeclareFieldFormat{shorthand}{#1}
-\DeclareFieldFormat{shorthandintro}{%
- \ifcapital{\MakeCapital{#1}}{#1}}%
+\DeclareFieldFormat{shorthandintro}{\ifcapital{\MakeCapital{#1}}{#1}}%
\DeclareFieldFormat{shorthandwidth}{#1}
\DeclareFieldFormat{type}{\ifcapital{\MakeCapital{#1}}{#1}}%
\DeclareFieldFormat{url}{\url{#1}}
@@ -784,6 +818,7 @@
\DeclareDriverSourcemap[datatype=bibtex]{
\map{
\step[typesource=periodical, typetarget=article]
+ \step[typesource=image, typetarget=artwork]
\step[typesource=booklet, typetarget=book]
\step[typesource=manual, typetarget=book]
\step[typesource=mvbook, typetarget=book]
@@ -1365,8 +1400,11 @@
\newbibmacro*{printnames}{%
\ifnameundef{\cbx@namelist}
{}
- {\pluga\anona\printnames[\cbx@deflabel]{%
- \cbx@namelist}\anonb\plugb}}%
+ {\iftoggle{noetal}
+ {\pluga\anona\printnames[\cbx@deflabel][-\value{listtotal}]{%
+ \cbx@namelist}\anonb\plugb}%
+ {\pluga\anona\printnames[\cbx@deflabel]{%
+ \cbx@namelist}\anonb\plugb}}}
% A screen name precedes 'nameaddon' and can be omitted from short
% citations. See CMOS, 17th ed., 14.209.
@@ -1503,12 +1541,11 @@
\usebibmacro{title+titleaddon}{orig}%
\setunit{\addspace}% not '\setunit{\space}'
\printtext[parens]{%
- \usebibmacro{origlocation}%
- \usebibmacro{origpublisher}%
+ \usebibmacro{loc+pub+etc}{orig}%
\ifboolexpr{ togl {bibliography}
and togl {reflist}}
{}
- {\usebibmacro{origyear+origendyear}}}}}
+ {\usebibmacro{year+endyear}{orig}}}}}
%%%%%%%%%%%%%%%%%%%
%% Collections %%
@@ -1712,49 +1749,50 @@
\newbibmacro*{year+bookyear}{%
\ifboolexpr{ togl {bibliography}
and togl {reflist}}
- {\ifboolexpr{ test {\iffieldundef{bookyear}}
- or test {\iffieldundef{year}}
- or test {\iffieldsequal{year}{bookyear}}
- or not test {\iffieldequalstr{labeldatesource}{bookyear}}}
+ {\ifboolexpr{ test {\iffieldundef{year}}
+ or test {\iffieldundef{bookyear}}
+ or test {\iffieldsequal{year}{bookyear}}}
{}
- {\printfield{bookyear}%
- \usebibmacro{endbookyear}}}
+ {\ifboolexpr{ togl {collection}
+ and togl {swapvol}}
+ {\usebibmacro{year+endyear}{}}%
+ {\usebibmacro{year+endyear}{book}}}}
{\ifboolexpr{ test {\iffieldundef{year}}
and test {\iffieldundef{bookyear}}}
{\usebibmacro{pubstate}{label}}%
{\iffieldundef{bookyear}
- {\printfield{year}%
- \usebibmacro{endyear}}%
+ {\usebibmacro{year+endyear}{}}%
{\ifboolexpr{ togl {collection}
and togl {swapvol}
and not test {\iffieldundef{year}}}
- {\printfield{year}%
- \usebibmacro{endyear}}%
- {\printfield{bookyear}%
- \usebibmacro{endbookyear}}}}}}
+ {\usebibmacro{year+endyear}{}}%
+ {\usebibmacro{year+endyear}{book}}}}}}
-\newbibmacro*{endyear}{%
- \iffieldundef{endyear}
+\newbibmacro*{year+endyear}[1]{%
+ \iffieldundef{#1year}
{}
- {\iffieldsequal{year}{endyear}
+ {\ifboolexpr{ togl {bibliography}
+ and togl {reflist}
+ and test {\iffieldsequal{#1year}{label}}}
{}
- {\textendash\printfield{endyear}}}}
+ {\printfield{#1year}%
+ \usebibmacro{endyear}{#1}}}}
-\newbibmacro*{endbookyear}{%
- \iffieldundef{endbookyear}
+\newbibmacro*{endyear}[1]{%
+ \ifboolexpr{ test {\iffieldundef{#1endyear}}
+ or test {\iffieldsequal{#1year}{#1endyear}}}
{}
- {\iffieldsequal{bookyear}{endbookyear}
- {}
- {\textendash\printfield{endbookyear}}}}
+ {\textendash\printfield{#1endyear}}}
-\newbibmacro*{origyear+origendyear}{%
- \iffieldundef{origyear}
+\newbibmacro*{month+season+year}{%
+ \ifboolexpr{ togl {reflist}
+ and test {\iffieldundef{month}}
+ and test {\iffieldundef{season}}}
{}
- {\printfield{origyear}%
- \ifboolexpr{ test {\iffieldundef{endorigyear}}
- or test {\iffieldsequal{origyear}{endorigyear}}}
- {}
- {\textendash\printfield{endorigyear}}}}
+ {\iffieldundef{year}
+ {\printlabeldate}% for 'n.d.'
+ {\printdate
+ \clearfield{year}}}}
\newbibmacro*{year+month+day}{%
\iffieldundef{year}
@@ -1764,18 +1802,6 @@
\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}{%
@@ -1805,26 +1831,17 @@
\newbibmacro*{reflist+origyear}{%
\iffieldundef{origyear}
{}
- {\printtext[parens]{\usebibmacro{origyear+origendyear}}%
+ {\printtext[parens]{\usebibmacro{year+endyear}{orig}}%
\space}}%
-% The next macro helps bib environments that use the 'reflist' toggle
-% (see the 'reflist' bib environment set elsewhere in this file).
-% Since they can't use the 'reflist' preamble option, they can't load
-% the DeclareLabeldate for reference lists. The macro below makes the
-% output consistent in those cases but can cause problems with
-% sorting. Resolve them with '\sortyear'. Also, end dates go here. See
-% CMOS, 17th ed., 15.37 and 15.41. Although '\printlabeldate' prints
-% them, the workaround needs to run 'endyear', which can cause
-% problems not only with sorting but with 'extralabeldate'.
-
\newbibmacro*{labeldate+endyear}{%
- \iffieldequalstr{labeldatesource}{bookyear}
- {\iffieldundef{year}
- {\usebibmacro{pubstate}{label}}%
- {\usebibmacro{pubstate}{date}%
- \usebibmacro{endyear}}}
- {\usebibmacro{pubstate}{label}}}
+ \ifboolexpr{ togl {collection}
+ and togl {swapvol:global}
+ and test {\iffieldundef{label}}
+ and not test {\iffieldundef{bookyear}}
+ and not test {\iffieldsequal{year}{bookyear}}}
+ {\usebibmacro{year+endyear}{book}}%
+ {\usebibmacro{pubstate}{label}}}
%%%%%%%%%%%%%%%%%
%% Locations %%
@@ -1834,45 +1851,43 @@
\iflistundef{location}
{}
{\nopunct\setunit{\space}%
- \printtext[parens]{%
- \printlist{location}}}%
+ \printtext[parens]{\printlist{location}}}%
\clearlist{location}}%
-\newbibmacro*{loc+pub+year}{%
- \usebibmacro{loc+pub}{1}%
- \ifnumgreater{\value{publisher}}{1}
- {\setunit{\addsemicolon\space}%
- \usebibmacro{loc+pub}{2}}%
+\newbibmacro*{loc+pub+etc}[1]{%
+ \ifboolexpr{ test {\iflistundef{#1location}}
+ and test {\iflistundef{#1publisher}}}
{}
- \setunit{\addcomma\space}%
- \usebibmacro{year+bookyear}}%
+ {\usebibmacro{pubcount}%
+ \whileboolexpr{ test {\ifnumless{\value{pubcount}}{\value{#1location}}}
+ or test {\ifnumless{\value{pubcount}}{\value{#1publisher}}}}
+ {\stepcounter{pubcount}%
+ \usebibmacro{#1loc+#1pub}{\value{pubcount}}%
+ \setunit{\addsemicolon\space}}%
+ \setunit{\addcomma\space}}}
-\newbibmacro*{loc+pub}[1]{%
- \usebibmacro{location:a}{#1}%
- \setunit{\addcolon\space}%
- \printlist[publisher][#1-#1]{publisher}}%
+\newbibmacro*{pubcount}{%
+ \ifltxcounter{pubcount}
+ {\setcounter{pubcount}{0}}%
+ {\newcounter{pubcount}}}
-\newbibmacro*{location:a}[1]{%
+\newbibmacro*{loc+pub}[1]{%
\ifboolexpr{ test {\iflistundef{location}}
- and test {\iffieldundef{howpublished}}
- and test {\iffieldundef{url}}
- and test {\iffieldundef{doi}}}
- {\bibstring{noplace}}%
- {\printlist[location][#1-#1]{location}}}
-
-\newbibmacro*{location:b}{%
- \iflistundef{location}
- {}
- {\printlist{location}%
- \setunit{\addcomma\space}}}
+ and togl {noplace}}
+ {\bibstring{noplace}%
+ \setunit{\addcolon\space}}%
+ {\iflistundef{location}
+ {}
+ {\printlist[location][#1-#1]{location}%
+ \setunit{\addcolon\space}}}% needs '%'
+ \printlist[publisher][#1-#1]{publisher}}%
-\newbibmacro*{origlocation}{%
+\newbibmacro*{origloc+origpub}[1]{%
\iflistundef{origlocation}
{}
- {\printlist{origlocation}%
- \iflistundef{origpublisher}
- {\setunit{\addcomma\space}}%
- {\setunit{\addcolon\space}}}}
+ {\printlist[location][#1-#1]{origlocation}%
+ \setunit{\addcolon\space}}% needs '%'
+ \printlist[publisher][#1-#1]{origpublisher}}%
\newbibmacro*{institution+venue}{%
\ifboolexpr{ test {\iflistundef{institution}}
@@ -1956,6 +1971,18 @@
\usebibmacro{library}%
\usebibmacro{pageref+finentry}}%
+\newbibmacro*{artworks}{%
+ \usebibmacro{author+bookauthor+etc}%
+ \usebibmacro{title+titleaddon}{}%
+ \newunit
+ \usebibmacro{month+season+year}%
+ \usebibmacro{type+typeaddon}%
+ \usebibmacro{note}%
+ \newunit
+ \usebibmacro{institution+venue}%
+ \printlist{location}%
+ \setunit{\addcomma\space}}%
+
\newbibmacro*{author+collection+etc}{%
\usebibmacro{test:collection}%
\usebibmacro{author+bookauthor+etc}%
@@ -2052,6 +2079,17 @@
\toggletrue{edshift}%
\usebibmacro{editors:b}}%
+\newbibmacro*{standards}{%
+ \usebibmacro{author+bookauthor+etc}%
+ \usebibmacro{title+labeldate}%
+ \usebibmacro{note+edition+etc}%
+ \usebibmacro{volumes+series+etc}{}%
+ \iftoggle{bibliography}
+ {\newunit
+ \usebibmacro{loc+pub+year}}%
+ {\setunit{\addspace}% not '\setunit{\space}'
+ \printtext[parens]{\usebibmacro{loc+pub+year}}}}
+
\newbibmacro*{thesis:type+pubstate}{%
\ifentrytype{mathesis}
{\bibstring{mathesis}%
@@ -2068,7 +2106,8 @@
\newbibmacro*{inst+loc+date}{%
\usebibmacro{institution+venue}%
- \usebibmacro{location:b}%
+ \printlist{location}%
+ \setunit*{\addcomma\space}%
\usebibmacro{year+month+day}}%
\newbibmacro*{type+typeaddon}{%
@@ -2102,13 +2141,7 @@
\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}}}
+ \usebibmacro{month+season+year}%
\iffieldundef{type}
{\newunit
\usebibmacro{unpublished:collection}}%
@@ -2323,7 +2356,9 @@
{\setunit{\addspace}% not '\setunit{\space}'
\printtext[parens]{\usebibmacro{orig+etc}}}}
{\newunit
- \usebibmacro{loc+pub+year}}}}
+ \usebibmacro{loc+pub+etc}{}%
+ \setunit{\addcomma\space}%
+ \usebibmacro{year+bookyear}}}}
\newbibmacro*{test:bookauthor}{%
\ifboolexpr{ test {\ifnamesequal{author}{bookauthor}}
@@ -2394,6 +2429,13 @@
\togglefalse{edshift}}%
{}}}
+\newbibmacro*{loc+pub+year}{%
+ \usebibmacro{loc+pub+etc}{}%
+ \setunit{\addcomma\space}%
+ \usebibmacro{month+season+year}%
+ \setunit{\addcomma\space}%
+ \usebibmacro{pubstate}{}}%
+
% 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
@@ -2424,7 +2466,8 @@
{\usebibmacro{note}%
\usebibmacro{editors:b}%
\usebibmacro{unpublished:series}%
- \usebibmacro{unpublished:volume}%
+ \newunit
+ \printfield{volume}%
\newunit
\usebibmacro{inst+loc+date}}%
{}}
@@ -2518,20 +2561,15 @@
\printfield{number}}}
\newbibmacro*{orig+etc}{%
- \usebibmacro{origlocation}%
- \usebibmacro{origpublisher}%
+ \usebibmacro{loc+pub+etc}{orig}%
\ifboolexpr{ togl {bibliography}
and togl {reflist}}
{}
- {\usebibmacro{origyear+origendyear}}%
+ {\usebibmacro{year+endyear}{orig}}%
\usebibmacro{reprint}%
- \usebibmacro{loc+pub+year}}%
-
-\newbibmacro*{origpublisher}{%
- \iflistundef{origpublisher}
- {}
- {\printlist{origpublisher}%
- \setunit{\addcomma\space}}}
+ \usebibmacro{loc+pub+etc}{}%
+ \setunit{\addcomma\space}%
+ \usebibmacro{year+bookyear}}%
\newbibmacro*{reprint}{%
\ifboolexpr{ test {\iffieldundef{origyear}}
@@ -2589,12 +2627,6 @@
{\setunit{\addcomma\space}}%
\printfield{seriesaddon}}}
-\newbibmacro*{unpublished:volume}{%
- \iffieldundef{volume}
- {}
- {\printfield{volume}%
- \newunit}}%
-
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Bibliography Drivers %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -2617,6 +2649,11 @@
\usebibmacro{colon+pages+etc}%
\usebibmacro{doi+finentry+etc}}%
+\DeclareBibliographyDriver{artwork}{%
+ \usebibmacro{bibindex}%
+ \usebibmacro{artworks}%
+ \usebibmacro{doi+finentry+etc}}%
+
\DeclareBibliographyDriver{book}{%
\usebibmacro{bibindex}%
\usebibmacro{author+collection+etc}%
@@ -2662,6 +2699,11 @@
\usebibmacro{colon+pages+etc}%
\usebibmacro{doi+finentry+etc}}%
+\DeclareBibliographyDriver{standard}{%
+ \usebibmacro{bibindex}%
+ \usebibmacro{standards}%
+ \usebibmacro{doi+finentry+etc}}%
+
\DeclareBibliographyDriver{thesis}{%
\usebibmacro{bibindex}%
\usebibmacro{author+title+etc}%