diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/biblatex-chicago/chicago-dates-common.cbx')
-rw-r--r-- | Master/texmf-dist/tex/latex/biblatex-chicago/chicago-dates-common.cbx | 1341 |
1 files changed, 965 insertions, 376 deletions
diff --git a/Master/texmf-dist/tex/latex/biblatex-chicago/chicago-dates-common.cbx b/Master/texmf-dist/tex/latex/biblatex-chicago/chicago-dates-common.cbx index 7a410eba8ac..7c1f7975614 100644 --- a/Master/texmf-dist/tex/latex/biblatex-chicago/chicago-dates-common.cbx +++ b/Master/texmf-dist/tex/latex/biblatex-chicago/chicago-dates-common.cbx @@ -4,7 +4,7 @@ % list) for the two author-date styles of the Chicago Manual of Style, % 17th edition. -\ProvidesFile{chicago-dates-common.cbx}[2021/03/27 v 3.16 biblatex +\ProvidesFile{chicago-dates-common.cbx}[2022/07/02 v 3.18 biblatex citation style] %%%% Biblatex initialization + Chicago options + Toggles %%%% @@ -15,6 +15,7 @@ citation style] \newbool{cms:comma} \newbool{cms:atcite} \newbool{cms:tcit} +\newbool{cms:postsh} \providecommand*{\mkibid}[1]{#1} @@ -35,6 +36,8 @@ citation style] \providetoggle{cms@nodatebrackets}% For brackets in uncertain & circa \providetoggle{cms@noyearbrackets}% \providetoggle{cms@authorparens} +\providetoggle{cms@strippunct} +\providetoggle{cms@postspace} \providetoggle{cms@modpostnote} \providetoggle{cms@ukord} \providetoggle{cms@fullnote}% For the legal entry types @@ -44,6 +47,7 @@ citation style] \providetoggle{cms@urltime}% 17th ed. \providetoggle{cms@doi} \providetoggle{cms@doionly} +\providetoggle{cms@doinodate} \providetoggle{cms@eprint} \providetoggle{cms@isbn} \providetoggle{cms@numbermonth} @@ -51,6 +55,7 @@ citation style] \providetoggle{cms@shser} \providetoggle{cms@addendum} \providetoggle{cms@hidevolumes}% Modify Volume fix +\providetoggle{cms@notitle}% For classical short notes \providetoggle{cms@comprange} \providetoggle{cms@compyears} @@ -81,6 +86,8 @@ citation style] \providetoggle{cms@xrefurl} \providetoggle{cms@related} \providetoggle{cms@linkit} +\providetoggle{cms@linkname} +\providetoggle{cms@leaveit} \providetoggle{cms@authortitle} \providetoggle{cms@shortrelated} @@ -183,9 +190,15 @@ citation style] \DeclareBiblatexOption{global,entry}[boolean]{genallnames}[true]{% \settoggle{cms@genallnames}{#1}}% -\DeclareBiblatexOption{global,entry}[boolean]{hypertitle}[true]{% +\DeclareBiblatexOption{global,type,entry}[boolean]{hypertitle}[true]{% \settoggle{cms@linkit}{#1}}% +\DeclareBiblatexOption{global,type,entry}[boolean]{hypername}[true]{% + \settoggle{cms@linkname}{#1}}% + +\DeclareBiblatexOption{global,type,entry}[boolean]{hyperall}[true]{% + \settoggle{cms@linkit}{#1}\settoggle{cms@linkname}{#1}}% + \DeclareBiblatexOption{global,type,entry}[string]{annotation}[true]{% \ifcsdef{cms@opt@annot@#1}% {\csuse{cms@opt@annot@#1}}% @@ -315,10 +328,10 @@ citation style] \DeclareBiblatexOption{global,type,entry}[boolean]{dashed}[true]{% \settoggle{cms@namedash}{#1}} -\DeclareBibliographyOption[boolean]{short}[true]{% - \global\settoggle{cms@allshort}{#1}} +\DeclareBiblatexOption{global,type,entry}[boolean]{short}[true]{% + \settoggle{cms@allshort}{#1}} -\DeclareBiblatexOption{global,entry}[boolean]{noneshort}[true]{% +\DeclareBiblatexOption{global,type,entry}[boolean]{noneshort}[true]{% \settoggle{cms@noneshort}{#1}} \DeclareBibliographyOption[boolean]{legalnotes}[true]{% @@ -330,8 +343,8 @@ citation style] \DeclareBibliographyOption[boolean]{cmslos}[true]{% \global\settoggle{cms@los}{#1}}% -\DeclareBibliographyOption[boolean]{noibid}[true]{% - \global\settoggle{cms@noibid}{#1}}% +\DeclareBiblatexOption{global,type,entry}[boolean]{noibid}[true]{% + \settoggle{cms@noibid}{#1}}% \DeclareBibliographyOption[boolean]{compresspages}[true]{% \global\settoggle{cms@comprange}{#1}}% @@ -345,7 +358,7 @@ citation style] \DeclareBiblatexOption{global,entry}[boolean]{usecompiler}[true]{% \settoggle{blx@usenamec}{#1}}% -\DeclareBiblatexOption{global,entry}[boolean]{nodates}[true]{% +\DeclareBiblatexOption{global,type,entry}[boolean]{nodates}[true]{% \settoggle{cms@nodates}{#1}}% \DeclareBiblatexOption{global,entry}[boolean]{juniorcomma}[true]{% @@ -486,8 +499,33 @@ citation style] \def\cms@opt@ctao@period{% \def\ctitleaddonpunct{\newunitpunct}}% +\DeclareBiblatexOption{global,type,entry}[string]{jtitleaddon}[space]{% + \ifcsdef{cms@opt@jtao@#1}% + {\csuse{cms@opt@jtao@#1}}% + {\csuse{cms@opt@jtao@space}\cms@warning@noline% + {'jtitleaddon=#1' is not a valid option.\MessageBreak + The default - 'space' - has been set.\MessageBreak + Please see biblatex-chicago.pdf for valid\MessageBreak + option keys}}}% +\def\cms@opt@jtao@none{% + \let\jtitleaddonpunct\@empty}% +\def\cms@opt@jtao@comma{% + \def\jtitleaddonpunct{\addcomma\addspace}}% +\def\cms@opt@jtao@colon{% + \def\jtitleaddonpunct{\addcolon\addspace}}% +\def\cms@opt@jtao@space{% + \def\jtitleaddonpunct{\addspace}}% +\def\cms@opt@jtao@semicolon{% + \def\jtitleaddonpunct{\addsemicolon\addspace}}% +\def\cms@opt@jtao@period{% + \def\jtitleaddonpunct{\newunitpunct}}% + % The field-exclusion options % +\DeclareBiblatexOption{global,type,entry}[boolean]{notitle}[true]{% + \settoggle{cms@notitle}{#1}% + \iftoggle{cms@notitle}{\toggletrue{cms@linkname}}{}}% + \DeclareBiblatexOption{global,type,entry}[boolean]{urlstamp}[true]{% \settoggle{cms@urltime}{#1}}% @@ -505,6 +543,9 @@ citation style] \togglefalse{cms@doi}}% \def\cms@opt@doi@only{% \toggletrue{cms@doionly}}% +\def\cms@opt@doi@onlynd{% + \toggletrue{cms@doionly}% + \toggletrue{cms@doinodate}}% \DeclareBiblatexOption{global,type,entry}[boolean]{eprint}[true]{% \settoggle{cms@eprint}{#1}}% \DeclareBiblatexOption{global,type,entry}[boolean]{numbermonth}[true]{% @@ -543,11 +584,14 @@ citation style] \settoggle{cms@authortitle}{#1}}% \ExecuteBibliographyOptions{includeall,hidevolumes,booklongxref,related,% - ctitleaddon,ptitleaddon,journalabbrev=notes,legalnotes,supranotes,% - dashed,bibannotesep,citeannotesep,nameaddonsep=space}% + ctitleaddon,ptitleaddon,jtitleaddon,journalabbrev=notes,legalnotes,% + supranotes,dashed,bibannotesep,citeannotesep,nameaddonsep=space}% \ExecuteBibliographyOptions[standard]{useeditor=false,usenamec=false}% -\ExecuteBibliographyOptions[dataset]{authortitle=true}% +\ExecuteBibliographyOptions[dataset]{authortitle=true,nodates=false}% +\ExecuteBibliographyOptions[misc]{nodates=false}% + +\ExecuteBibliographyOptions[article,review,suppperiodical]{labeltitleyear=true} \iftoggle{cms@legalnotes}% {\ExecuteBibliographyOptions[jurisdiction,legal,legislation]{skipbib}}% @@ -583,6 +627,27 @@ citation style] \field{titleaddon}% \field{title}}% +%% This is an ugly kludge, only required because we need the extradate +%% mechanism for authorless articles in magazines where the +%% journaltitle takes the place of the author, and the labelname +%% mechanism won't accept non-name fields. No other idea presenting +%% itself, we use the extratitleyear mechanism in these 3 types, and +%% this declaration keeps any article with an author from interfering +%% with it. It means we can't simply print the labeltitle for these +%% entry types. + +\DeclareLabeltitle[article,review,suppperiodical]{% + \field{shortauthor} + \field{author} + \field{shorteditor} + \field{namea} + \field{editor} + \field{nameb} + \field{translator} + \field{namec} + \field{shortjournal} + \field{journaltitle}}% + \DeclareDataInheritance{collection}{suppcollection}{% \inherit{title}{title} \inherit{subtitle}{subtitle} @@ -628,6 +693,16 @@ citation style] \noinherit{indexsorttitle} } +\DeclareDataInheritance{audio,music,video}{audio,music,video}{% + \inherit{title}{booktitle} + \inherit{subtitle}{booksubtitle} + \inherit{titleaddon}{booktitleaddon} + \noinherit{shorttitle} + \noinherit{sorttitle} + \noinherit{indextitle} + \noinherit{indexsorttitle} +} + \DeclareDataInheritance{*}{*}{% \noinherit{namea} \noinherit{nameb} @@ -638,7 +713,7 @@ citation style] \noinherit{urlyear} \noinherit{urlmonth} \noinherit{urlday} - \noinherit{urlseason} + \noinherit{urlyeardivision} \noinherit{urlhour} \noinherit{urlminute} \noinherit{doi} @@ -651,19 +726,19 @@ citation style] \noinherit{year} \noinherit{month} \noinherit{day} - \noinherit{season} + \noinherit{yeardivision} \noinherit{endyear} \noinherit{endmonth} \noinherit{endday} - \noinherit{endseason} + \noinherit{endyeardivision} \noinherit{origyear} \noinherit{origmonth} \noinherit{origday} - \noinherit{origseason} + \noinherit{origyeardivision} \noinherit{origendyear} \noinherit{origendmonth} \noinherit{origendday} - \noinherit{origendseason}} + \noinherit{origendyeardivision}} % More authordate options % @@ -772,6 +847,350 @@ citation style] \DefineBibliographyExtras{american}{% \DeclarePunctuationPairs{comma}{*!?}} +%%%% These are the macros and declarations needed to use non-default +%%%% name presentations, including new name parts and different +%%%% orderings of existing name parts. All of this becomes available +%%%% only when a user sets the "cmsnameparts" option. Nearly all of it +%%%% comes from the standard biblatex example file 93-nameparts.tex, +%%%% with changes to make it possible for users to add new name +%%%% treatments and also to set a new default name presentation style +%%%% for their documents. + +\ifdefvoid{\cms@ldt@cmsnameparts}{}{% + + %% Wrapper for biblatex's Template declarations, allowing a chosen + %% named template also to provide the default ("global") template. + %% <template command><[template name]><definition of template> + + \def\cms@template@wrapper#1[#2]#3{% + \def\cms@tpl{#2} + \ifx\cms@ldt@cmsnameparts\cms@tpl + #1{#3}% + #1[#2]{#3} + \blx@warning@noline{#2 is the So Global Template} + \else + #1[#2]{#3} + \blx@warning@noline{#2 is the Local Template} + \fi} + + %% Name format declarations for bibliography and notes. The + %% "default" format is for the head of long notes and for names in + %% the body of long notes and bibliography entries. They should work + %% for any name styles users might want to add themselves. + + \DeclareNameFormat{sortname}{% + \ifdefstring{\blx@refcontext@sortingnamekeytemplatename}{global}% + {\ifcsdef{cmssort:\cms@ldt@cmsnameparts-rev}% + {\ifnumequal{\value{listcount}}{1}% + {\csuse{cmssort:\cms@ldt@cmsnameparts-rev}}% + {\ifcsdef{cmssort:\cms@ldt@cmsnameparts}% + {\csuse{cmssort:\cms@ldt@cmsnameparts}}% + {\csuse{cmssort:western}}}}% + {\ifcsdef{cmssort:\cms@ldt@cmsnameparts}% + {\csuse{cmssort:\cms@ldt@cmsnameparts}}% + {\ifnumequal{\value{listcount}}{1}% + {\csuse{cmssort:western-rev}}% + {\csuse{cmssort:western}}}}}% + {\ifcsdef{cmssort:\blx@refcontext@sortingnamekeytemplatename-rev}% + {\ifnumequal{\value{listcount}}{1}% + {\csuse{cmssort:\blx@refcontext@sortingnamekeytemplatename-rev}}% + {\ifcsdef{cmssort:\blx@refcontext@sortingnamekeytemplatename}% + {\csuse{cmssort:\blx@refcontext@sortingnamekeytemplatename}}% + {\csuse{cmssort:western}}}}% + {\ifcsdef{cmssort:\blx@refcontext@sortingnamekeytemplatename}% + {\csuse{cmssort:\blx@refcontext@sortingnamekeytemplatename}}% + {\ifnumequal{\value{listcount}}{1}% + {\csuse{cmssort:western-rev}}% + {\csuse{cmssort:western}}}}}% + \usebibmacro{name:andothers}}% + + \DeclareNameFormat{default}{% + \ifdefstring{\blx@refcontext@sortingnamekeytemplatename}{global}% + {\ifcsdef{cmssort:\cms@ldt@cmsnameparts}% + {\csuse{cmssort:\cms@ldt@cmsnameparts}}% + {\csuse{cmssort:western}}}% + {\ifcsdef{cmssort:\blx@refcontext@sortingnamekeytemplatename}% + {\csuse{cmssort:\blx@refcontext@sortingnamekeytemplatename}}% + {\csuse{cmssort:western}}}% + \usebibmacro{name:andothers}}% + + \DeclareNameFormat{labelname}{% + \ifdefstring{\blx@refcontext@sortingnamekeytemplatename}{global}% + {\ifcsdef{cmslabel:\cms@ldt@cmsnameparts}% + {\csuse{cmslabel:\cms@ldt@cmsnameparts}}% + {\csuse{cmslabel:western}}}% + {\ifcsdef{cmslabel:\blx@refcontext@sortingnamekeytemplatename}% + {\csuse{cmslabel:\blx@refcontext@sortingnamekeytemplatename}}% + {\csuse{cmslabel:western}}}% + \usebibmacro{name:andothers}}% + + %% These are the template definitions for the four pre-defined + %% styles, each with two templates, one for the sortname and one for + %% the labelname. The "western" style, as in 93-nameparts.tex, is + %% identical to biblatex's default style, but giving it a name + %% allows other styles to become the default, if desired. You will + %% need one template of each sort for any new style you wish to + %% provide. + + \cms@template@wrapper{\DeclareSortingNamekeyTemplate}[cjk]{ + \keypart{ + \namepart{family} + } + \keypart{ + \namepart{given} + } + \keypart{ + \namepart{cjk} + } + } + + \cms@template@wrapper{\DeclareUniquenameTemplate}[cjk]{ + \namepart[base=true]{family} + \namepart[disambiguation=full]{given} + \namepart[disambiguation=full]{cjk} + } + + \cms@template@wrapper{\DeclareSortingNamekeyTemplate}[ethiopian]{ + \keypart{ + \namepart{given} + } + \keypart{ + \namepart{patronymic} + } + \keypart{ + \namepart{papponymic} + } + } + + \cms@template@wrapper{\DeclareUniquenameTemplate}[ethiopian]{ + \namepart[base=true]{given} + \namepart[disambiguation=full]{patronymic} + \namepart[disambiguation=full]{papponymic} + } + + \cms@template@wrapper{\DeclareSortingNamekeyTemplate}[russian]{ + \keypart{ + \namepart{family} + } + \keypart{ + \namepart{given} + } + \keypart{ + \namepart{patronymic} + } + } + + \cms@template@wrapper{\DeclareUniquenameTemplate}[russian]{ + \namepart[base=true]{family} + \namepart{given} + \namepart{patronymic} + } + + \DeclareSortingNamekeyTemplate[western]{ + \keypart{ + \namepart[use=true]{prefix} + \namepart{family} + } + \keypart{ + \namepart{given} + } + \keypart{ + \namepart{suffix} + } + \keypart{ + \namepart[use=false]{prefix} + } + } + + \DeclareUniquenameTemplate[western]{ + \namepart[use=true, base=true]{prefix} + \namepart[base=true]{family} + \namepart{given} + } + + %% These bibmacros print the names when the standard biblatex + %% equivalents are insufficient. You only need to provide a new one + %% for a new style if standard biblatex doesn't provide one that is + %% suitable. + + \newbibmacro*{name:cjk}[3]{% + \usebibmacro{name:delim}{#2#3#1}% + \usebibmacro{name:hook}{#2#3#1}% + \mkbibnamefamily{#1}% + \ifdefvoid{#2}{}{\bibnamedelimd\mkbibnamegiven{#2}}% + \ifdefvoid{#3}{}{\bibnamedelimd\mkbibnamecjk{#3}}} + + \newbibmacro*{name:ethiopian}[3]{% + \usebibmacro{name:delim}{#1#2#3}% + \usebibmacro{name:hook}{#1#2#3}% + \mkbibethgiven{#1}% + \ifdefvoid{#2}{}{\bibnamedelimd\mkbibethpat{#2}\isdot}% + \ifdefvoid{#3}{}{\bibnamedelimd\mkbibethpap{#3}\isdot}} + + \let\mkbibethgiven\mkbibnamefamily + \let\mkbibethpat\mkbibnamegiven + \let\mkbibethpap\mkbibnamegiven + + \newbibmacro*{name:russian}[3]{% + \usebibmacro{name:delim}{#1#2#3}% + \usebibmacro{name:hook}{#1#2#3}% + \ifdefvoid{#2} + {} + {\mkbibnamegiven{#2}\isdot\bibnamedelimd + \ifdefvoid{#3} + {} + {\mkbibnamepatronymic{#3}\isdot\bibnamedelimd}}% + \mkbibnamefamily{#1}} + + \newbibmacro*{name:russian-rev}[3]{% + \usebibmacro{name:delim}{#1#2#3}% + \usebibmacro{name:hook}{#1#2#3}% + \mkbibnamefamily{#1}% + \ifdefvoid{#2} + {} + {\revsdnamepunct\bibnamedelimd + \mkbibnamegiven{#2}\isdot + \ifdefvoid{#3} + {} + {\bibnamedelimd\mkbibnamepatronymic{#3}\isdot}}} + + %% These macros call the name-printing bibmacros with the + %% appropriate arguments for the "sortname" and "default" name + %% formats. Each style needs at least one for printing sortnames, + %% and possibly a second if you wish to reverse the first name in a + %% list. + + \csdef{cmssort:cjk}{% + \usebibmacro{name:cjk} + {\namepartfamily} + {\namepartgiven} + {\namepartcjk}}% + + \csdef{cmssort:russian}{% + \usebibmacro{name:russian} + {\namepartfamily} + {\namepartgiven} + {\namepartpatronymic}}% + + \csdef{cmssort:russian-rev}{% + \usebibmacro{name:russian-rev} + {\namepartfamily} + {\namepartgiven} + {\namepartpatronymic}% + \ifboolexpe{% + test {\ifdefvoid\namepartgiven} + and + test {\ifdefvoid\namepartpatronymic}} + {}% + {\usebibmacro{name:revsdelim}}}% + + \csdef{cmssort:ethiopian}{% + \usebibmacro{name:ethiopian} + {\namepartgiven} + {\namepartpatronymic} + {\namepartpapponymic}}% + + \csdef{cmssort:western}{% + \usebibmacro{name:given-family} + {\namepartfamily} + {\namepartgiven} + {\namepartprefix} + {\namepartsuffix}}% + + \csdef{cmssort:western-rev}{% + \usebibmacro{name:family-given} + {\namepartfamily} + {\namepartgiven} + {\namepartprefix} + {\namepartsuffix}% + \ifboolexpe{% + test {\ifdefvoid\namepartgiven} + and + test {\ifdefvoid\namepartprefix}} + {}% + {\usebibmacro{name:revsdelim}}}% + + %% These macros call the name-printing macros for the labelname, + %% i.e., in short notes. You'll need one for each new style you wish + %% to provide for your documents. + + \csdef{cmslabel:cjk}{% + \iffieldequalstr{uniquepart}{base}% + {\usebibmacro{name:cjk} + {\namepartfamily} + {\empty} + {\empty}} + {\iffieldequalstr{uniquepart}{given}% + {\usebibmacro{name:cjk} + {\namepartfamily} + {\namepartgiven} + {\empty}} + {\usebibmacro{name:cjk} + {\namepartfamily} + {\namepartgiven} + {\namepartcjk}}}} + + \csdef{cmslabel:ethiopian}{% + \iffieldequalstr{uniquepart}{base}% + {\usebibmacro{name:ethiopian} + {\namepartgiven} + {\empty} + {\empty}} + {\iffieldequalstr{uniquepart}{patronymic}% + {\usebibmacro{name:ethiopian} + {\namepartgiven} + {\namepartpatronymic} + {\empty}} + {\usebibmacro{name:ethiopian} + {\namepartgiven} + {\namepartpatronymic} + {\namepartpapponymic}}}} + + \csdef{cmslabel:russian}{% + \iffieldequalstr{uniquepart}{base}% + {\usebibmacro{name:russian} + {\namepartfamily} + {\empty} + {\empty}} + {\ifnum\namepartgivenun=1\relax + \usebibmacro{name:russian} + {\namepartfamily} + {\namepartgiveni} + {\namepartpatronymici}% + \else + \usebibmacro{name:russian} + {\namepartfamily} + {\namepartgiven} + {\namepartpatronymic}% + \fi}} + + \csdef{cmslabel:western}{% + \ifcase\value{uniquename}% + \usebibmacro{name:family} + {\namepartfamily} + {\namepartgiven} + {\namepartprefix} + {\namepartsuffix}% + \or + \ifuseprefix + {\usebibmacro{name:given-family} + {\namepartfamily} + {\namepartgiveni} + {\namepartprefix} + {\namepartsuffixi}} + {\usebibmacro{name:given-family} + {\namepartfamily} + {\namepartgiveni} + {\namepartprefixi} + {\namepartsuffixi}}% + \or + \usebibmacro{name:given-family} + {\namepartfamily} + {\namepartgiven} + {\namepartprefix} + {\namepartsuffix}% + \fi}} + %%%% Macros from authoryear-comp.cbx, revised for CMS %%%% \newbibmacro*{cite:init}{% @@ -859,12 +1278,12 @@ citation style] \newbibmacro*{cmsbracketname}{% \iffieldequalstr{authortype}{anon}% - {\printtext{\bibleftbracket\printnames{labelname}% + {\printtext[cmsnamehyper]{\bibleftbracket\printnames{labelname}% \bibrightbracket}}% {\iffieldequalstr{authortype}{anon?}% - {\printtext{\bibleftbracket\printnames{labelname}?% + {\printtext[cmsnamehyper]{\bibleftbracket\printnames{labelname}?% \bibrightbracket}}% - {\printnames{labelname}}}}% + {\printtext[cmsnamehyper]{\printnames{labelname}}}}}% \newbibmacro*{citeyear}{% \ifboolexpr{% @@ -913,6 +1332,15 @@ citation style] {\savefield{fullhash}{\cbx@lasthash}}% {}}}}% +\def\cms@choose@unit{% + \ifboolexpr{% + togl {cms@notitle}% + and + bool {cbx:parens}% + }% + {\printunit}% + {\setunit}} + \newbibmacro*{textcite}{% \iftoggle{cms@los}% {\usebibmacro{textcite:authshort}}% @@ -920,7 +1348,14 @@ citation style] \newbibmacro*{textcite:authshort}{% \iffieldequals{fullhash}{\cbx@lasthash}% - {\iffieldundef{postnote}% + {\ifbool{cbx:parens}% + {}% + {\iftoggle{cms@notitle}% + {}% + {\printunit{% + \global\booltrue{cbx:parens}% + \cms@testspace\bibopenparen}}}% + \iffieldundef{postnote}% {\iffieldequals{fullhash}{\cbx@lastyear}% {\setunit{\multicitedelim}% \global\undef\cbx@lastyear}% @@ -933,7 +1368,11 @@ citation style] }% {\setunit{\multicitedelim}}% {\setunit{\compcitedelim}}}}% - {\setunit{\multicitedelim}}% + {\ifbool{cbx:parens}% + {\cms@choose@unit{\multicitedelim}}% + {\printunit{% + \global\booltrue{cbx:parens}% + \cms@testspace\bibopenparen}}}% \ifboolexpr{% togl {cms@authortitle}% or @@ -987,21 +1426,30 @@ citation style] {\usebibmacro{prenote}}% {}% \usebibmacro{cmscitesortdate}}}% - {\printnames{labelname}% + {\printtext[cmsnamehyper]{% + \printnames{labelname}% + \ifboolexpr{% + togl {cms@gencite}% + and + ( + test {\iffinalcitedelim}% + or + togl {cms@genallnames}% + ) + }% + {\thegen}% + {}}% \ifboolexpr{% - togl {cms@gencite}% + togl {cms@notitle}% and - ( - test {\iffinalcitedelim}% - or - togl {cms@genallnames}% - ) + not test {\iffieldundef{postnote}}% }% - {\thegen}% - {}% - \setunit{% - \global\booltrue{cbx:parens}% - \cms@testspace\bibopenparen}% + {\printunit{% + \global\booltrue{cbx:parens}% + \cms@testspace\bibopenparen}}% + {\setunit{% + \global\booltrue{cbx:parens}% + \cms@testspace\bibopenparen}}% \ifnumequal{\value{citecount}}{1}% {\usebibmacro{prenote}}% {}% @@ -1015,21 +1463,30 @@ citation style] {\usebibmacro{cite:label}}}% {\usebibmacro{cmscitesortdate}}% \savefield{fullhash}{\cbx@lasthash}}}% - {\printfield{shorthand}% + {\printtext[cmsnamehyper]{% + \printfield{shorthand}% + \ifboolexpr{% + togl {cms@gencite}% + and + ( + test {\iffinalcitedelim}% + or + togl {cms@genallnames}% + ) + }% + {\thegen}% + {}}% \ifboolexpr{% - togl {cms@gencite}% + togl {cms@notitle}% and - ( - test {\iffinalcitedelim}% - or - togl {cms@genallnames}% - ) + not test {\iffieldundef{postnote}}% }% - {\thegen}% - {}% - \setunit{% - \global\booltrue{cbx:parens}% - \cms@testspace\bibopenparen}% + {\printunit{% + \global\booltrue{cbx:parens}% + \cms@testspace\bibopenparen}}% + {\setunit{% + \global\booltrue{cbx:parens}% + \cms@testspace\bibopenparen}}% \ifnumequal{\value{citecount}}{1}% {\usebibmacro{prenote}}% {}% @@ -1052,129 +1509,172 @@ citation style] \newbibmacro*{textcite:citeshort}{% \iffieldequals{fullhash}{\cbx@lasthash}% - {\iffieldundef{shorthand}% - {\iffieldundef{postnote}% - {\iffieldequals{fullhash}{\cbx@lastyear}% - {\setunit{\multicitedelim}% - \global\undef\cbx@lastyear}% - {\ifboolexpr{% - togl {cms@authortitle}% - or - test {\iffieldequalstr{entrysubtype}{classical}}% - or - bool {cms:atcite}% - }% - {\setunit{\multicitedelim}}% - {\setunit{\compcitedelim}}}}% - {\setunit{\multicitedelim}}% - \ifboolexpr{% - togl {cms@authortitle}% - or - test {\iffieldequalstr{entrysubtype}{classical}}% - }% - {\usebibmacro{cite:label}}% - {\usebibmacro{cmscitesortdate}}}% - {\iffieldundef{postnote}% - {\iffieldequals{fullhash}{\cbx@lastyear}% - {\setunit{\multicitedelim}% - \global\undef\cbx@lastyear}% - {\ifbool{cms:atcite}% - {\setunit{\multicitedelim}}% - {\setunit{\compcitedelim}}}}% - {\setunit{\multicitedelim}}% - \printtext[bibhyperref]{% - \printfield{shorthand}}}}% - {\ifthenelse{\ifnameundef{labelname}\OR - \ifentrytype{inreference}\OR - \ifentrytype{reference}\OR - \ifentrytype{mvreference}}% - {\iffieldundef{shorthand}% - {\ifboolexpr{% + {\ifbool{cms:postsh}% + {\ifciteibid% + {\ifbool{cbx:parens}% + {\iffieldundef{postnote}% + {}% + {\printunit{\multicitedelim}}}% + {\iffieldundef{postnote}% + {}% + {\printunit{% + \global\booltrue{cbx:parens}% + \cms@testspace\bibopenparen}}}}% + {\global\boolfalse{cms:postsh}% + \ifbool{cbx:parens}% + {\printunit{\bibcloseparen\global\boolfalse{cbx:parens}% + \textcitedelim}% + \usebibmacro{textcite:mainref}}% + {\printunit{\textcitedelim}% + \usebibmacro{textcite:mainref}}}}% + {\ifbool{cbx:parens}% + {}% + {\iftoggle{cms@notitle}% + {}% + {\printunit{% + \global\booltrue{cbx:parens}% + \cms@testspace\bibopenparen}}}% + \iffieldundef{shorthand}% + {\iffieldundef{postnote}% + {\iffieldequals{fullhash}{\cbx@lastyear}% + {\setunit{\multicitedelim}% + \global\undef\cbx@lastyear}% + {\ifboolexpr{% + togl {cms@authortitle}% + or + test {\iffieldequalstr{entrysubtype}{classical}}% + or + bool {cms:atcite}% + }% + {\setunit{\multicitedelim}}% + {\setunit{\compcitedelim}}}}% + {\ifbool{cbx:parens}% + {\cms@choose@unit{\multicitedelim}}% + {\printunit{% + \global\booltrue{cbx:parens}% + \cms@testspace\bibopenparen}}}% + \ifboolexpr{% togl {cms@authortitle}% or test {\iffieldequalstr{entrysubtype}{classical}}% }% - {\ifentrytype{customc}% - {\setunit{% - \global\booltrue{cbx:parens}% - \multicitedelim}%\bibopenparen% - \ifnumequal{\value{citecount}}{1}% - {\usebibmacro{prenote}\clearfield{prenote}}% - {}% - \savefield{postnote}{\cms@tempz}\clearfield{postnote}% - \usebibmacro{cite:label}% - \restorefield{postnote}{\cms@tempz}}% - {\setunit{% - \global\booltrue{cbx:parens}% - \cms@testspace\bibopenparen}% - \ifnumequal{\value{citecount}}{1}% - {\usebibmacro{prenote}}% - {}% - \usebibmacro{cite:label}}}% - {\usebibmacro{cite:label}% - \ifboolexpr{% - togl {cms@gencite}% - and - ( - test {\iffinalcitedelim}% - or - togl {cms@genallnames}% - ) - }% - {\thegen}% + {\usebibmacro{cite:label}}% + {\usebibmacro{cmscitesortdate}}}% + {\iffieldundef{postnote}% + {\iffieldequals{fullhash}{\cbx@lastyear}% + {\global\undef\cbx@lastyear}% + {}}% + {}% + \setunit{\multicitedelim}% + \printtext[bibhyperref]{% + \printfield{shorthand}}}}}% + {\global\boolfalse{cms:postsh}% + \usebibmacro{textcite:mainref}}% + \setunit{% + \ifbool{cbx:parens}% + {\bibcloseparen\global\boolfalse{cbx:parens}}% + {}% + \textcitedelim}}% Not \multicitedelim ??? + +\newbibmacro*{textcite:mainref}{% + \iffieldundef{shorthand}% + {\ifthenelse{\ifnameundef{labelname}\OR + \ifentrytype{inreference}\OR + \ifentrytype{reference}\OR + \ifentrytype{mvreference}}% + {\ifboolexpr{% + togl {cms@authortitle}% + or + test {\iffieldequalstr{entrysubtype}{classical}}% + }% + {\ifentrytype{customc}% + {\setunit{% + \global\booltrue{cbx:parens}% + \multicitedelim}%\bibopenparen% + \ifnumequal{\value{citecount}}{1}% + {\usebibmacro{prenote}\clearfield{prenote}}% {}% - \setunit{% + \savefield{postnote}{\cms@tempz}\clearfield{postnote}% + \usebibmacro{cite:label}% + \restorefield{postnote}{\cms@tempz}}% + {\setunit{% \global\booltrue{cbx:parens}% \cms@testspace\bibopenparen}% \ifnumequal{\value{citecount}}{1}% {\usebibmacro{prenote}}% {}% - \usebibmacro{cmscitesortdate}}}% - {\printtext[bibhyperref]{% - \printfield{shorthand}}}}% - {\printnames{labelname}% + \usebibmacro{cite:label}}}% + {\usebibmacro{cite:label}% + \ifboolexpr{% + togl {cms@gencite}% + and + ( + test {\iffinalcitedelim}% + or + togl {cms@genallnames}% + ) + }% + {\thegen}% + {}% + \setunit{% + \global\booltrue{cbx:parens}% + \cms@testspace\bibopenparen}% + \ifnumequal{\value{citecount}}{1}% + {\usebibmacro{prenote}}% + {}% + \usebibmacro{cmscitesortdate}}}% + {\printtext[cmsnamehyper]{\printnames{labelname}% + \ifboolexpr{% + togl {cms@gencite}% + and + ( + test {\iffinalcitedelim}% + or + togl {cms@genallnames}% + ) + }% + {\thegen}% + {}}% \ifboolexpr{% - togl {cms@gencite}% - and - ( - test {\iffinalcitedelim}% - or - togl {cms@genallnames}% - ) - }% - {\thegen}% - {}% - \setunit{% - \global\booltrue{cbx:parens}% - \cms@testspace\bibopenparen}% + togl {cms@notitle}% + and + not test {\iffieldundef{postnote}}% + }% + {\printunit{% + \global\booltrue{cbx:parens}% + \cms@testspace\bibopenparen}}% + {\setunit{% + \global\booltrue{cbx:parens}% + \cms@testspace\bibopenparen}}% \ifnumequal{\value{citecount}}{1}% {\usebibmacro{prenote}}% {}% - \iffieldundef{shorthand}% - {\ifboolexpr{% - togl {cms@authortitle}% - or - test {\iffieldequalstr{entrysubtype}{classical}}% - }% - {\ifthenelse{\ifentrytype{manual}\OR\ifentrytype{standard}}% - {\printtext[cmshyper]{\printfield[citetitle]{labeltitle}}}% - {\usebibmacro{cite:label}}}% - {\usebibmacro{cmscitesortdate}}}% - {\printtext[bibhyperref]{% - \printfield{shorthand}}}% - \savefield{fullhash}{\cbx@lasthash}}% - \stepcounter{textcitecount}}% Added ??? - \setunit{% - \ifbool{cbx:parens}% - {\bibcloseparen\global\boolfalse{cbx:parens}}% + \ifboolexpr{% + togl {cms@authortitle}% + or + test {\iffieldequalstr{entrysubtype}{classical}}% + }% + {\ifthenelse{\ifentrytype{manual}\OR\ifentrytype{standard}}% + {\printtext[cmshyper]{\printfield[citetitle]{labeltitle}}}% + {\usebibmacro{cite:label}}}% + {\usebibmacro{cmscitesortdate}}% + \savefield{fullhash}{\cbx@lasthash}}}% + {\printtext[bibhyperref]{% + \printfield{shorthand}}% + \iffieldundef{postnote}% {}% - \textcitedelim}}% Not \multicitedelim ??? + {\printunit{% + \global\booltrue{cbx:parens}% + \cms@testspace\bibopenparen}}% + \savefield{fullhash}{\cbx@lasthash}% + \global\booltrue{cms:postsh}}% + \stepcounter{textcitecount}} \newbibmacro*{textcite:postnote}{% \iffieldundef{postnote}% {}% {\savefield{fullhash}{\cbx@lastyear}% - \postnotewrapper%\setunit{\postnotewrapper} + \iftoggle{blx@keepunit}{}{\postnotewrapper}% Shorthand or notitle \printfield{postnote}}% \ifthenelse{\value{multicitecount}=\value{multicitetotal}}% {\setunit{}% @@ -1191,82 +1691,85 @@ citation style] \newbibmacro*{cite:shorthand}{% \iftoggle{cms@los}% {\iffieldequals{fullhash}{\cbx@lasthash}% - {\printtext[cmshyper]{% - \ifbool{cms:atcite}% - {\setunit{\multicitedelim}}% - {\setunit{\compcitedelim}}% - \usebibmacro{cmscitesortdate}}}% - {\printfield{shorthand}% - \printtext[cmshyper]{% - \setunit{\nameyeardelim}% - \usebibmacro{cmscitesortdate}}% + {\ifbool{cms:atcite}% + {\setunit{\multicitedelim}}% + {\setunit{\compcitedelim}}% + \usebibmacro{cmscitesortdate}}% + {\printtext[cmsnamehyper]{\printfield{shorthand}}% + \setunit{\nameyeardelim}% + \usebibmacro{cmscitesortdate}% \savefield{fullhash}{\cbx@lasthash}}}% - {\printtext[bibhyperref]{\printfield{shorthand}}% + {\printtext[cmsyearhyper]{\printfield{shorthand}}% \usebibmacro{cite:reinit}}}% \newbibmacro*{cite:shorthand+title}{% \iftoggle{cms@los}% {\iffieldequals{fullhash}{\cbx@lasthash}% - {\printtext[cmshyper]{% - \setunit{\multicitedelim}% - \usebibmacro{cite:label}}}% - {\printfield{shorthand}% - \printtext[cmshyper]{% - \setunit{\addcomma\addspace}% FIXME: wrong in 16th _and_ 17th eds? - \ifthenelse{\ifentrytype{standard}\OR\ifentrytype{manual}}% - {\printtext[cmshyper]{\printfield[citetitle]{labeltitle}}}% - {\usebibmacro{cite:label}}}% + {\setunit{\multicitedelim}% + \usebibmacro{cite:label}}% + {\printtext[cmsnamehyper]{\printfield{shorthand}}% + \setunit{\addcomma\addspace}% FIXME: wrong in 16th _and_ 17th eds? + \ifthenelse{\ifentrytype{standard}\OR\ifentrytype{manual}}% + {\printtext[cmshyper]{\printfield[citetitle]{labeltitle}}}% + {\usebibmacro{cite:label}}% \savefield{fullhash}{\cbx@lasthash}}}% - {\printtext[bibhyperref]{\printfield{shorthand}}% + {\printtext[cmsyearhyper]{\printfield{shorthand}}% \usebibmacro{cite:reinit}}}% \newbibmacro*{cite:label}{% Test this - \iffieldundef{label}% - {\ifthenelse{\iffieldequalstr{entrysubtype}{magazine}\AND\NOT% - \ifentrytype{periodical}}% Simplifies .bib creation - {\ifboolexpr{% - not test {\iffieldundef{shortjournal}}% - and - (( - test {\ifcitation}% - and - togl {cms@citejtabb}% - ) - or - ( - test {\ifbibliography}% - and - togl {cms@bibjtabb}% - )) - }% - {\printtext[cmshyper]{\printfield[shortjournal]{shortjournal}}}% - {\printtext[cmshyper]{\printfield[journaltitle]{journaltitle}}}}% - {\ifthenelse{\ifentrytype{manual}\OR\ifentrytype{standard}}% - {\printtext[cmshyper]{\printlist{organization}}}% + \iftoggle{cms@notitle}% + {}% + {\iffieldundef{label}% + {\ifthenelse{\iffieldequalstr{entrysubtype}{magazine}\AND\NOT% + \ifentrytype{periodical}}% Simplifies .bib creation {\ifboolexpr{% - test {\ifentrytype{video}}% + not test {\iffieldundef{shortjournal}}% and - test {\iffieldequalstr{entrysubtype}{tvepisode}}% + (( + test {\ifcitation}% and - not test {\iffieldundef{title}}% + togl {cms@citejtabb}% + ) + or + ( + test {\ifbibliography}% and - not test {\iffieldundef{booktitle}}% + togl {cms@bibjtabb}% + )) }% - {\iffieldundef{shorttitle}% - {\printtext[cmshyper]{% + {\printtext[cmshyper]{\printfield[shortjournal]{shortjournal}}}% + {\printtext[cmshyper]{\printfield[journaltitle]{journaltitle}}}}% + {\ifthenelse{\ifentrytype{manual}\OR\ifentrytype{standard}}% + {\printtext[cmshyper]{\printlist{organization}}}% + {\ifboolexpr{% + test {\ifentrytype{video}}% + and + test {\iffieldequalstr{entrysubtype}{tvepisode}}% + and + not test {\iffieldundef{title}}% + and + not test {\iffieldundef{booktitle}}% + }% + {\iffieldundef{shorttitle}% + {\printtext[cmshyper]{% \printfield{booktitle}% \setunit{\subtitlepunct}% \printfield[booksubtitle]{booksubtitle}}% (?) \setunit{\ctitleaddonpunct}% \printfield{booktitleaddon}% \iffieldundef{booktitleaddon}{}{\addcomma\addspace}}% - {\printtext[cmshyper]{\printfield[citetitle]{labeltitle}}% - \setunit{\ctitleaddonpunct}% - \printfield{booktitleaddon}% - \iffieldundef{booktitleaddon}{}{\addcomma\addspace}}}% - {\printtext[cmshyper]{\printfield[citetitle]{labeltitle}}}}}}% - {\printtext[cmshyper]{\printfield{label}}}% - \global\booltrue{cms:atcite}}% + {\printtext[cmshyper]{\printfield[citetitle]{labeltitle}}% + \setunit{\ctitleaddonpunct}% + \printfield{booktitleaddon}% + \iffieldundef{booktitleaddon}{}{\addcomma\addspace}}}% + {\ifthenelse{\ifentrytype{article}\OR\ifentrytype{review}\OR% + \ifentrytype{suppperiodical}}% + {\iffieldundef{shorttitle}% Authorless articles w/o subtype + {\printtext[cmshyper]{\printfield[citetitle]{title}}}% + {\printtext[cmshyper]{\printfield[citetitle]{shorttitle}}}}% + {\printtext[cmshyper]{\printfield[citetitle]{labeltitle}}}}}}}% + {\printtext[cmshyper]{\printfield{label}}}% + \global\booltrue{cms:atcite}}}% \newbibmacro*{cite:labelyear+extrayear}{% \ifboolexpr{ ( @@ -1291,27 +1794,15 @@ citation style] \newbibmacro*{cite:standard+labelyear+extrayear}{% \ifthenelse{\iffieldundef{labelyear}\OR% \iffieldequalstr{labelyear}{nodate}}% - {\ifboolexpr{% - test {\ifentrytype{misc}}% - or - test {\ifentrytype{dataset}}% - or - not togl {cms@nodates}% - }% - {}% - {\printtext[cmsyearhyper]{\bibstring{nodate}}}}% For CMS? + {\iftoggle{cms@nodates}% + {\printtext[cmsyearhyper]{\bibstring{nodate}}}% + {}}% For CMS? {\printtext[cmsyearhyper]{% \iffieldundef{year}% {\iffieldundef{eventyear}% {\iffieldundef{origyear}% {\iffieldundef{userd}% - {\ifboolexpr{% - togl {cms@nodates}% - and - not test {\ifentrytype{misc}}% - and - not test {\ifentrytype{dataset}}% - }% + {\iftoggle{cms@nodates}% {\bibstring{nodate}}% {}}% {\printurldateextra}}% @@ -1322,27 +1813,15 @@ citation style] \newbibmacro*{cite:origfirst+labelyear+extrayear}{% \ifthenelse{\iffieldundef{labelyear}\OR% \iffieldequalstr{labelyear}{nodate}}% - {\ifboolexpr{% - test {\ifentrytype{misc}}% - or - test {\ifentrytype{dataset}}% - or - not togl {cms@nodates}% - }% - {}% - {\printtext[cmsyearhyper]{\bibstring{nodate}}}}% For CMS? + {\iftoggle{cms@nodates}% + {\printtext[cmsyearhyper]{\bibstring{nodate}}}% For CMS? + {}}% {\printtext[cmsyearhyper]{% \iffieldundef{origyear}% {\iffieldundef{year}% {\iffieldundef{eventyear}% {\iffieldundef{userd}% - {\ifboolexpr{% - togl {cms@nodates}% - and - not test {\ifentrytype{misc}}% - and - not test {\ifentrytype{dataset}}% - }% + {\iftoggle{cms@nodates}% {\bibstring{nodate}}% {}}% {\printurldateextra}}% @@ -1353,27 +1832,15 @@ citation style] \newbibmacro*{cite:av+labelyear+extrayear}{% \ifthenelse{\iffieldundef{labelyear}\OR% \iffieldequalstr{labelyear}{nodate}}% - {\ifboolexpr{% - test {\ifentrytype{misc}}% - or - test {\ifentrytype{dataset}}% - or - not togl {cms@nodates}% - }% - {}% - {\printtext[cmsyearhyper]{\bibstring{nodate}}}}% For CMS? + {\iftoggle{cms@nodates}% + {\printtext[cmsyearhyper]{\bibstring{nodate}}}% For CMS? + {}}% {\printtext[cmsyearhyper]{% \iffieldundef{eventyear}% {\iffieldundef{origyear}% {\iffieldundef{year}% {\iffieldundef{userd}% - {\ifboolexpr{% - togl {cms@nodates}% - and - not test {\ifentrytype{misc}}% - and - not test {\ifentrytype{dataset}}% - }% + {\iftoggle{cms@nodates}% {\bibstring{nodate}}% {}}% {\printurldateextra}}% @@ -1452,11 +1919,11 @@ citation style] {\iffieldundef{origyear}% {\iftoggle{cms@ordate}% ??? {}% - {\clearfield{extradate}}% + {\clearfield{extradate}\clearfield{extratitleyear}}% \usebibmacro{cite:standard+labelyear+extrayear}}% {\iftoggle{cms@ordate}% {\usebibmacro{cite:origfirst+labelyear+extrayear}}% - {\clearfield{extradate}% + {\clearfield{extradate}\clearfield{extratitleyear}% \printtext[cmsyearhyper]{% \printorigdateextra}}}}}}% \usebibmacro{origyear+endyear} @@ -1481,13 +1948,13 @@ citation style] \bibopenparen% \usebibmacro{cite:labelyear+extrayear}% \bibcloseparen% - \clearfield{extradate}% + \clearfield{extradate}\clearfield{extratitleyear}% \addspace% \printorigdateextra}}% \usebibmacro{origyear+endyear} {\iffieldundef{origyear}% ??? {\iftoggle{cms@ordate}% {}% - {\clearfield{extradate}}% + {\clearfield{extradate}\clearfield{extratitleyear}}% \usebibmacro{cite:standard+labelyear+extrayear}}% {\iftoggle{cms@ordate}% Added test for year field ??? {\iffieldundef{year}% @@ -1497,13 +1964,13 @@ citation style] \usebibmacro{cite:origfirst+labelyear+extrayear}% \bibcloseparen% \setunit{\addspace}%\addspace% ??? - \clearfield{extradate}% + \clearfield{extradate}\clearfield{extratitleyear}% \printdateextra}}}%\usebibmacro{year+endyear} {\iffieldundef{year}% {\usebibmacro{cite:origfirst+labelyear+extrayear}}% {\printtext[cmsyearhyper]{% \bibopenparen% - \clearfield{extradate}% + \clearfield{extradate}\clearfield{extratitleyear}% \printorigdateextra% % \usebibmacro{origyear+endyear}% \bibcloseparen% @@ -2104,6 +2571,8 @@ citation style] togl {cms@url}% and not test {\iffieldundef{urlyear}}% + and + not togl {cms@doinodate}% }% {\printurldate% \ifboolexpr{% 17th ed. @@ -2327,8 +2796,14 @@ citation style] \xappto\cbx@savedkeys{\thefield{entrykey},}% \iffieldequals{fullhash}{\cbx@lasthash}% {}% - {\stepcounter{textcitetotal}% - \savefield{fullhash}{\cbx@lasthash}}} + {\ifboolexpr{% The shorthand isn't a name, but the ID of a whole work. + togl {cms@los}% Hence we don't treat it as common to what follows. + or + test {\iffieldundef{shorthand}}% + }% + {\savefield{fullhash}{\cbx@lasthash}}% + {\global\undef\cbx@lasthash}% + \stepcounter{textcitetotal}}}% {}% {\protected@xappto\cbx@savedcites{% [\thefield{prenote}][\thefield{postnote}]{\cbx@savedkeys}}} @@ -2368,8 +2843,14 @@ citation style] \xappto\cbx@savedkeys{\thefield{entrykey},}% \iffieldequals{fullhash}{\cbx@lasthash}% {}% - {\stepcounter{textcitetotal}% - \savefield{fullhash}{\cbx@lasthash}}} + {\ifboolexpr{% + togl {cms@los}% + or + test {\iffieldundef{shorthand}}% + }% + {\savefield{fullhash}{\cbx@lasthash}}% + {\global\undef\cbx@lasthash}% + \stepcounter{textcitetotal}}} {}% {\protected@xappto\cbx@savedcites{% [\thefield{prenote}][\thefield{postnote}]{\cbx@savedkeys}}} @@ -2754,6 +3235,11 @@ citation style] {\bibstring{broadcast}\space #1}% {\printfield{userd}\addspace #1}} +\DeclareFieldFormat{extratitleyear}{% + \iffieldnums{labelyear}% + {\mknumalph{#1}}% + {\mkbibparens{\mknumalph{#1}}}} + \DeclareFieldAlias{userd}{titleaddon}% 16th ed. \DeclareFieldFormat{nameaddon}{% @@ -2802,10 +3288,19 @@ citation style] \DeclareFieldFormat{titleaddon}{% \if@cms@capital{#1}{\MakeCapital{#1\isdot}}{#1\isdot}}%\custpunctc? +\DeclareFieldFormat[periodical]{titleaddon}{% + \ifcapital{\MakeCapital{#1\isdot}}{#1\isdot}} + \DeclareFieldAlias{booktitleaddon}{titleaddon} \DeclareFieldAlias{maintitleaddon}{titleaddon} +\DeclareFieldAlias[article,periodical,review,suppperiodical]{maintitleaddon}% +{journaltitleaddon} + +\DeclareFieldFormat{journaltitleaddon}{% + \ifcapital{\MakeCapital{#1\isdot}}{#1\isdot}} + \DeclareFieldFormat{jourser}{% \ifinteger{#1}% {\mkbibordseries{#1}% @@ -2871,25 +3366,28 @@ citation style] \DeclareFieldAlias[suppperiodical]{volume}[article]{volume} -\DeclareFieldFormat{cmshyper}{% Control the number of elements hyperlinked. +\DeclareFieldFormat{cmshyper}{% Control number of elements hyperlinked \ifboolexpr{% - (( - not test {\iffieldequalstr{entrysubtype}{classical}}% - and - not togl {cms@authortitle}% - ) + togl {cms@authortitle}% or - togl {blx@skipbib}% - ) - and - not togl {cms@linkit}% + test {\iffieldequalstr{entrysubtype}{classical}}% }% - {\iftoggle{cms@shortrelated}% - {\ifentryinbib{\strfield{clonesourcekey}}% - {\bibhyperref[\strfield{clonesourcekey}]{#1}}% + {\iftoggle{blx@skipbib}% + {\iftoggle{cms@shortrelated}% + {\ifentryinbib{\strfield{clonesourcekey}}% + {\bibhyperref[\strfield{clonesourcekey}]{#1}}% + {#1}}% {#1}}% - {#1}}% - {\bibhyperref{#1}}}% + {\bibhyperref{#1}}}% + {\iftoggle{cms@linkit}% + {\iftoggle{blx@skipbib}% + {\iftoggle{cms@shortrelated}% + {\ifentryinbib{\strfield{clonesourcekey}}% + {\bibhyperref[\strfield{clonesourcekey}]{#1}}% + {#1}}% + {#1}}% + {\bibhyperref{#1}}}% + {#1}}}% \DeclareFieldFormat{cmsyearhyper}{% Only link when in ref list \iftoggle{blx@skipbib} @@ -2900,6 +3398,33 @@ citation style] {#1}}% {\bibhyperref{#1}}}% +\DeclareFieldFormat{cmsnamehyper}{% Two cases: 1. only a name is present + \ifboolexpr{% 2. new user option hypername + togl {cms@nodates}% + or + togl {cms@authortitle}% + or + test {\iffieldequalstr{entrysubtype}{classical}}% + or + not test {\iffieldundef{labeldate}}% + }% + {\iftoggle{cms@linkname}% + {\iftoggle{blx@skipbib}% + {\iftoggle{cms@shortrelated}% + {\ifentryinbib{\strfield{clonesourcekey}}% + {\bibhyperref[\strfield{clonesourcekey}]{#1}}% + {#1}}% + {#1}}% + {\bibhyperref{#1}}}% + {#1}}% + {\iftoggle{blx@skipbib}% + {\iftoggle{cms@shortrelated}% + {\ifentryinbib{\strfield{clonesourcekey}}% + {\bibhyperref[\strfield{clonesourcekey}]{#1}}% + {#1}}% + {#1}}% + {\bibhyperref{#1}}}} + %%%% Related field formats from biblatex.def %%%% \DeclareFieldFormat{related:origpubas}{#1}% This and next remove parens @@ -3194,42 +3719,67 @@ citation style] {\newcunit}}% {\newcunit}\DeclareNumChars{.}}}} -\newcommand*{\postnotewrapper}{% - \iftoggle{cms@modpostnote}% Multiple bugs in v 2.0. - {\ifboolexpr{% - test {\iffieldstart{postnote}{,}}% - or - test {\iffieldstart{postnote}{\bibrangessep}}% - }% - {\togglefalse{blx@unit}% +\DeclareListParser{\docmslist}{|} +\DeclareListParser*{\forcmslist}{|} +\newcounter{cms@punct} + +\def\cms@strip@spaces#1{% + \def\do@i##1{% + \iffieldstart{postnote}{##1}% + {\toggletrue{cms@postspace}% \expandarg - \StrGobbleLeft{\abx@field@postnote}{1}[\abx@field@postnote]% - \iffieldstart{postnote}{\ }% - {\setunit{\addcomma}}% - {\newcunit}}% - {\iffieldstart{postnote}{;}% + \StrGobbleLeft{#1}{1}[#1]\listbreak}% + {}}% + \forcmslist{\do@i}{\space|\,|\addspace|\;|\:|\!}} + +\newcommand*{\postnotewrapper}{% To fix bugs in v 2.0 & ff. + \setcounter{cms@punct}{0}% + \iftoggle{cms@modpostnote}% + {\def\do##1{% + \iffieldstart{postnote}{##1}% {\togglefalse{blx@unit}% + \toggletrue{cms@strippunct}% + \ifcase\c@cms@punct% Allows US-style punctuation to work + \def\cms@userpunct{\addcolon}% + \or + \def\cms@userpunct{\addsemicolon}% + \or + \def\cms@userpunct{\addperiod}% + \or + \def\cms@userpunct{\addcomma}% + \or + \def\cms@userpunct{\addcomma}% + \else + \def\cms@userpunct{##1}% + \fi \expandarg \StrGobbleLeft{\abx@field@postnote}{1}[\abx@field@postnote]% + \cms@strip@spaces{\abx@field@postnote}% + \ifboolexpr{% + not test {\iffieldpages{postnote}}% + and + test {\iffieldstart{postnote}{ }}% + }% + {\StrSubstitute[1]{\abx@field@postnote}{ }{\ }[\abx@field@postnote]}% + {}% \iffieldstart{postnote}{\ }% - {\setunit{\addsemicolon}}% - {\setunit{\addsemicolon\addspace}}}% - {\iffieldstart{postnote}{:}% - {\togglefalse{blx@unit}% - \expandarg - \StrGobbleLeft{\abx@field@postnote}{1}[\abx@field@postnote]% - \iffieldstart{postnote}{\ }% - {\setunit{\addcolon}}% - {\setunit{\addcolon\addspace}}}% - {\iffieldstart{postnote}{.}% - {\togglefalse{blx@unit}% - \expandarg - \StrGobbleLeft{\abx@field@postnote}{1}[\abx@field@postnote]% - \iffieldstart{postnote}{\ }% - {\setunit{\addperiod}}% - {\newunit}}% - {\postnotedelim}}}}}% - {\postnotedelim}}% + {\setunit{\cms@userpunct}}% + {\ifboolexpr{% + test {\iffieldstart{postnote}{ }}% + or + togl {cms@postspace}% + }% + {\togglefalse{cms@postspace}% + \setunit{\cms@userpunct\addspace}}% + {\setunit{\cms@userpunct}}}% + \listbreak}% + {\stepcounter{cms@punct}}}% + \docmslist{:|;|.|,|\bibrangessep|\addcolon|\addsemicolon| + \addcomma|\addperiod}% + \iftoggle{cms@strippunct}% + {\togglefalse{cms@strippunct}}% + {\postnotedelim}}% + {\postnotedelim}} \newrobustcmd*{\iffieldstart}[2]{% Philipp Lehman's code, from \begingroup% comp.text.tex @@ -3485,10 +4035,15 @@ citation style] togl {cms@namedash}% }% {\printtext{\bibnamedash}}% - {\usebibmacro{journal+sub}{}% - \setunit*{\addspace}% - \printlist[periodplace]{location}% - \savefield{journaltitle}{\bbx@lasthash}}}% + {\iftoggle{cms@authorparens}% + {\bibopenparen\usebibmacro{journal+sub}{}% + \setunit{\addspace}% + \printlist[periodplace]{location}\bibcloseparen% + \savefield{journaltitle}{\bbx@lasthash}}% + {\usebibmacro{journal+sub}{}% + \setunit{\addspace}% + \printlist[periodplace]{location}% + \savefield{journaltitle}{\bbx@lasthash}}}}% {\usebibmacro{author}}} \newbibmacro*{type+inst+year}{% @@ -3784,6 +4339,12 @@ citation style] test {\ifentrytype{audio}}% and not togl {cms@origpublished}% + and + ( + not test {\iffieldundef{title}}% + or + not test {\iffieldundef{titleaddon}}% + ) }% {\bibstring{in}\setunit{\addspace}}% {}}% @@ -3802,6 +4363,12 @@ citation style] not test {\iffieldundef{booktitle}}% and not togl {cms@origpublished}% + and + ( + not test {\iffieldundef{title}}% + or + not test {\iffieldundef{titleaddon}} + ) }% {\bibstring{on}\setunit{\addspace}}% {}}% @@ -3815,11 +4382,11 @@ citation style] {}% {\iftoggle{cms@switchdates}% Date fix {\ifthenelse{\iffieldundef{year}\AND\iffieldundef{month}\AND% - \iffieldundef{season}}% + \iffieldundef{yeardivision}}% {}% {\usebibmacro{cmsorigdate}}}% {\ifthenelse{\iffieldundef{origyear}\AND\iffieldundef{origmonth}\AND% - \iffieldundef{origseason}}% + \iffieldundef{origyeardivision}}% {}% {\usebibmacro{cmsorigdate}}}% \iffieldundef{pubstate}% @@ -3942,11 +4509,11 @@ citation style] \newcunit\newblock}% \iftoggle{cms@switchdates}% {\ifthenelse{\iffieldundef{year}\AND\iffieldundef{month}\AND% - \iffieldundef{season}}% + \iffieldundef{yeardivision}}% {}% {\cms@datelong{}}}% {\ifthenelse{\iffieldundef{origyear}\AND\iffieldundef{origmonth}\AND% - \iffieldundef{origseason}}% + \iffieldundef{origyeardivision}}% {}% {\cms@datelong{orig}}}} @@ -3957,11 +4524,11 @@ citation style] \newcunit\newblock}% \iftoggle{cms@switchdates}% {\ifthenelse{\iffieldundef{year}\AND\iffieldundef{month}\AND% - \iffieldundef{season}}% + \iffieldundef{yeardivision}}% {}% {\cms@datelong{}}}% {\ifthenelse{\iffieldundef{origyear}\AND\iffieldundef{origmonth}\AND% - \iffieldundef{origseason}}% + \iffieldundef{origyeardivision}}% {\printdate}% For interviews and other dated non-letters {\cms@datelong{orig}}}} @@ -3979,11 +4546,11 @@ citation style] \renewbibmacro*{date}{% Adding the test solved some issues in 0.9 with \iftoggle{cms@switchdates}% {\ifthenelse{\iffieldundef{origyear}\AND\iffieldundef{origmonth}% - \AND\iffieldundef{origday}\AND\iffieldundef{origseason}}% + \AND\iffieldundef{origday}\AND\iffieldundef{origyeardivision}}% {}% {\printorigdate}}% {\ifthenelse{\iffieldundef{year}\AND\iffieldundef{month}% - \AND\iffieldundef{day}\AND\iffieldundef{season}}% Punctuation in some + \AND\iffieldundef{day}\AND\iffieldundef{yeardivision}}% Punctuation in some {}% entry types (Misc). The whole \printdate thing may need further work. {\printdate}}} @@ -4029,29 +4596,33 @@ citation style] {\printorigdate}}}% \newbibmacro*{journal+sub}[1]{% - \iffieldundef{journaltitle}% - {}% - {\ifboolexpr{% - not test {\iffieldundef{shortjournal}}% - and - (( - test {\ifcitation}% - and - togl {cms@citejtabb}% - ) - or - ( - test {\ifbibliography}% - and - togl {cms@bibjtabb}% - )) - }% - {\clearlist{location}\printtext[#1shortjournal]{% - \printfield[jtsnoformat]{shortjournal}}}% - {\printtext[#1journaltitle]{% - \printfield[jtnoformat]{journaltitle}% - \setunit{\subtitlepunct}% - \printfield[sjtnoformat]{journalsubtitle}}}}}% + \ifboolexpr{% + not test {\iffieldundef{shortjournal}}% + and + (( + test {\ifcitation}% + and + togl {cms@citejtabb}% + ) + or + ( + test {\ifbibliography}% + and + togl {cms@bibjtabb}% + )) + }% + {\clearlist{location}\printtext[#1shortjournal]{% + \printfield[jtsnoformat]{shortjournal}}}% + {\iffieldundef{journaltitle}% + {\iffieldundef{journaltitleaddon}% + {}% + {\printfield{journaltitleaddon}}}% + {\printtext[#1journaltitle]{% + \printfield[jtnoformat]{journaltitle}% + \setunit{\subtitlepunct}% + \printfield[sjtnoformat]{journalsubtitle}}% + \setunit{\jtitleaddonpunct}% + \printfield{journaltitleaddon}}}}% \newbibmacro*{chap+pag}{% \printfield{chapter}% @@ -4078,7 +4649,7 @@ citation style] \printfield{maintitle}% \setunit{\subtitlepunct}% \printfield[mainsubtitle]{mainsubtitle}}% - \setunit{\ctitleaddonpunct}% + \setunit{\jtitleaddonpunct}% \printfield{maintitleaddon}% \newcunit\newblock}% \printfield{usera}% For network ID and possible section of newspaper. @@ -4098,15 +4669,15 @@ citation style] \newbibmacro*{mag+date+issue}{% \usebibmacro{journal+sub}{in}% - \setunit*{\addspace}% + \setunit{\addspace}% \printlist[periodplace]{location}% \newunit\newblock \usebibmacro{date+issue}{}} \newbibmacro*{cmsyear}{% \iftoggle{cms@switchdates}% - {\clearfield{extradate}\printorigdateextra}% \printfield{origyear} - {\clearfield{extradate}\printdateextra}}% \printfield{year} + {\clearfield{extradate}\clearfield{extratitleyear}\printorigdateextra}% + {\clearfield{extradate}\clearfield{extratitleyear}\printdateextra}}% \newbibmacro*{cmsorigdate}{% New for 0.9 \iftoggle{cms@switchdates}% @@ -4114,38 +4685,47 @@ citation style] {\printorigdate}} \newbibmacro*{cperiodical+ser+vol+num}[1]{% For periodical entries, - \ifboolexpr{% article subtype + \ifboolexpr{% no subtype + not test {\iffieldundef{shorttitle}}% + and + (( togl {cms@citejtabb}% and test {\ifcitation}% + ) + or + ( + togl {cms@bibjtabb}% and - not test {\iffieldundef{shorttitle}}% + test {\ifbibliography}% + ) + or + ( + test {\iffieldundef{title}}% + and + test {\iffieldundef{titleaddon}}% + ))% }% {\clearlist{location}\printtext[shorttitle]{% \printfield[tnoformat]{shorttitle}}}% - {\ifboolexpr{% - togl {cms@bibjtabb}% - and - test {\ifbibliography}% - and - not test {\iffieldundef{shorttitle}}% - }% - {\clearlist{location}\printtext[shorttitle]{% - \printfield[tnoformat]{shorttitle}}}% + {\iffieldundef{title}% + {\printfield{titleaddon}}% {\printtext[title]{% \printfield[tnoformat]{title}% \setunit{\subtitlepunct}% - \printfield[stnoformat]{subtitle}}}}% - \setunit*{\addspace}% + \printfield[stnoformat]{subtitle}}% + \setunit{\jtitleaddonpunct}% + \printfield{titleaddon}}}% + \setunit{\addspace}% \printlist[periodplace]{location}% - \setunit*{\addspace}% + \setunit{\addspace}% \iffieldundef{series}% {}% {\newcunit \printfield[jourser]{series}% \newcunit}%\setunit*{\addspace}? \ifthenelse{\iffieldundef{#1year}\AND\iffieldundef{#1month}\AND% - \iffieldundef{issue}\AND\iffieldundef{#1season}}% New, more accurate + \iffieldundef{issue}\AND\iffieldundef{#1yeardivision}}% New, more accurate {\iffieldundef{volume}% test, also in article {\newcunit% \printfield[journum]{number}% @@ -4160,29 +4740,38 @@ citation style] \setunit{\addcomma\addspace}}}% Moved eid for 17th ed. \newbibmacro*{periodical+date+issue}{% For periodical type & - \ifboolexpr{% magazine subtype + \ifboolexpr{% no subtype + not test {\iffieldundef{shorttitle}}% + and + (( togl {cms@citejtabb}% and test {\ifcitation}% + ) + or + ( + togl {cms@bibjtabb}% and - not test {\iffieldundef{shorttitle}}% + test {\ifbibliography}% + ) + or + ( + test {\iffieldundef{title}}% + and + test {\iffieldundef{titleaddon}}% + ))% }% {\clearlist{location}\printtext[shorttitle]{% \printfield[tnoformat]{shorttitle}}}% - {\ifboolexpr{% - togl {cms@bibjtabb}% - and - test {\ifbibliography}% - and - not test {\iffieldundef{shorttitle}}% - }% - {\clearlist{location}\printtext[shorttitle]{% - \printfield[tnoformat]{shorttitle}}}% + {\iffieldundef{title}% + {\printfield{titleaddon}}% {\printtext[title]{% \printfield[tnoformat]{title}% \setunit{\subtitlepunct}% - \printfield[stnoformat]{subtitle}}}}% - \setunit*{\addspace}% + \printfield[stnoformat]{subtitle}}% + \setunit{\jtitleaddonpunct}% + \printfield{titleaddon}}}% + \setunit{\addspace}% \printlist[periodplace]{location}% \newunit\newblock \usebibmacro{date+issue}{}} @@ -4348,8 +4937,8 @@ citation style] {}}% \ifentrytype{letter}% {\iftoggle{cms@switchdates}% - {\clearfield{year}\clearfield{month}\clearfield{season}}% - {\clearfield{origyear}\clearfield{origmonth}\clearfield{origseason}}% + {\clearfield{year}\clearfield{month}\clearfield{yeardivision}}% + {\clearfield{origyear}\clearfield{origmonth}\clearfield{origyeardivision}}% \clearfield{origlocation}}% {\ifthenelse{\ifentrytype{article}\OR\ifentrytype{periodical}\OR% \ifentrytype{review}\OR\ifentrytype{suppperiodical}}% |