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 | 880 |
1 files changed, 780 insertions, 100 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 c0473ea82a6..6b8e1a41737 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 @@ -1,4 +1,4 @@ -% $Id: chicago-dates-common.cbx,v 0.9.1.33 2017/05/02 14:30:17 dfussner Exp $ +% $Id: chicago-dates-common.cbx,v 0.10.1.15 2018/01/11 09:49:53 dfussner Exp $ % This is a biblatex citation style file, adapted from Lehman's % authoryear-comp.cbx. It is heavily modified, and contains the @@ -6,7 +6,7 @@ % for the two author-date styles of the Chicago Manual of Style, 16th % edition. -\ProvidesFile{chicago-dates-common.cbx}[2017/05/02 v 3.7 biblatex +\ProvidesFile{chicago-dates-common.cbx}[2018/01/11 v 3.10 biblatex citation style] %%%% Biblatex initialization + Chicago options + Toggles %%%% @@ -31,6 +31,8 @@ citation style] \providetoggle{cms@datedash} \providetoggle{cms@modpostnote} \providetoggle{cms@ukord} +\providetoggle{cms@fullnote}% For the legal entry types +\providetoggle{cms@shortnote}% Ditto \providetoggle{cms@url}% These are for the field-exclusion options \providetoggle{cms@doi} @@ -39,6 +41,7 @@ citation style] \providetoggle{cms@isbn} \providetoggle{cms@numbermonth} \providetoggle{cms@bookpages} +\providetoggle{cms@addendum} \providetoggle{cms@hidevolumes}% Modify Volume fix \providetoggle{cms@comprange} @@ -51,6 +54,10 @@ citation style] \providetoggle{cms@annotation}% Keep \providetoggle{cms@postposit}% Keep \providetoggle{cms@fullshhand}% +\providetoggle{cms@allshort}% For legal types +\providetoggle{cms@noneshort}% Ditto +\providetoggle{cms@legalnotes}% Ditto +\providetoggle{cms@supranotes}% Ditto \providetoggle{cms@vol}% \providetoggle{cms@crossref}% \providetoggle{cms@bookcrossref} @@ -58,11 +65,13 @@ citation style] \providetoggle{cms@genallnames} \providetoggle{cms@xrefurl} \providetoggle{cms@related} +\providetoggle{cms@linkit} \AtEveryCitekey{% \iffieldundef{userc}% {}% {\nocite{\thefield{userc}}}% + \global\csundef{@cmsst}% \iffieldequalstr{pubstate}{reprint}% {\toggletrue{cms@reprint}}% {\togglefalse{cms@reprint}}}% @@ -161,9 +170,33 @@ citation style] \DeclareEntryOption[boolean]{genallnames}[true]{% \settoggle{cms@genallnames}{#1}}% +\DeclareBibliographyOption[boolean]{hypertitle}[true]{% + \settoggle{cms@linkit}{#1}}% + +\DeclareEntryOption[boolean]{hypertitle}[true]{% + \settoggle{cms@linkit}{#1}}% + \DeclareBibliographyOption[boolean]{annotation}[true]{% \global\settoggle{cms@annotation}{#1}}% +\DeclareBibliographyOption[boolean]{short}[true]{% + \global\settoggle{cms@allshort}{#1}} + +\DeclareBibliographyOption[boolean]{noneshort}[true]{% + \global\settoggle{cms@noneshort}{#1}} + +\DeclareEntryOption[boolean]{noneshort}[true]{% + \settoggle{cms@noneshort}{#1}} + +\DeclareBibliographyOption[boolean]{legalnotes}[true]{% + \global\settoggle{cms@legalnotes}{#1}} + +\DeclareBibliographyOption[boolean]{supranotes}[true]{% + \global\settoggle{cms@supranotes}{#1}} + +\DeclareEntryOption[boolean]{supranotes}[true]{% + \global\settoggle{cms@supranotes}{#1}} + \DeclareBibliographyOption[boolean]{cmslos}[true]{% \global\settoggle{cms@los}{#1}}% @@ -409,7 +442,7 @@ citation style] \settoggle{cms@hidevolumes}{#1}}% \ExecuteBibliographyOptions{includeall,hidevolumes,booklongxref,related,% - ctitleaddon,ptitleaddon,journalabbrev=notes}% + ctitleaddon,ptitleaddon,journalabbrev=notes,legalnotes,supranotes}% \@ifpackagelater{biblatex}{2016/09/01}% For biblatex 2.6 ff. {\ExecuteBibliographyOptions{labeldateparts=true}}% @@ -417,12 +450,21 @@ citation style] {\ExecuteBibliographyOptions{labeldate=true}} {\ExecuteBibliographyOptions{labelyear=true}}}% +\iftoggle{cms@legalnotes}% +{\ExecuteBibliographyOptions[jurisdiction,legal,legislation]{skipbib}}% +{}% + \@ifpackagelater{biblatex}{2016/09/01}% For biblatex 3.5 ff. {\global\togglefalse{cms@datedash}} {\@ifpackagelater{biblatex}{2014/02/20}% For biblatex 2.9 ff. {\global\toggletrue{cms@datedash}}% {\global\togglefalse{cms@datedash}}}% +\DeclareLabeltitle[legislation]{% + \field{shorttitle}% + \field{titleaddon}% + \field{title}}% + \DeclareDataInheritance{collection}{suppcollection}{% \inherit{title}{title} \inherit{subtitle}{subtitle} @@ -500,7 +542,7 @@ citation style] % More authordate options % -\DeclareSortingScheme{cms}{% Updated to >2.0 format +\DeclareSortingTemplate{cms}{% Updated to >3.7 format \sort{ \field{presort} } @@ -536,7 +578,7 @@ citation style] } } -\DeclareSortingScheme{shortjournal}{% +\DeclareSortingTemplate{shortjournal}{% \sort{ \field{shortjournal} } @@ -922,11 +964,11 @@ citation style] \newbibmacro*{cite:shorthand}{% \iftoggle{cms@los}% {\iffieldequals{fullhash}{\cbx@lasthash}% - {\printtext[bibhyperref]{% + {\printtext[cmshyper]{% \setunit{\compcitedelim}% \usebibmacro{cmscitesortdate}}}% - {\printtext[bibhyperref]{% - \printfield{shorthand}% + {\printfield{shorthand}% + \printtext[cmshyper]{% \setunit{\nameyeardelim}% \usebibmacro{cmscitesortdate}}% \savefield{fullhash}{\cbx@lasthash}}}% @@ -936,11 +978,11 @@ citation style] \newbibmacro*{cite:shorthand+title}{% \iftoggle{cms@los}% {\iffieldequals{fullhash}{\cbx@lasthash}% - {\printtext[bibhyperref]{% + {\printtext[cmshyper]{% \setunit{\multicitedelim}% \usebibmacro{cite:label}}}% - {\printtext[bibhyperref]{% - \printfield{shorthand}% + {\printfield{shorthand}% + \printtext[cmshyper]{% \setunit{\cms@testspace}% FIXME \usebibmacro{cite:label}}% \savefield{fullhash}{\cbx@lasthash}}}% @@ -966,12 +1008,12 @@ citation style] togl {cms@bibjtabb}% )) }% - {\printtext[bibhyperref]{\printfield[shortjournal]{shortjournal}}}% - {\printtext[bibhyperref]{\printfield[journaltitle]{journaltitle}}}}% + {\printtext[cmshyper]{\printfield[shortjournal]{shortjournal}}}% + {\printtext[cmshyper]{\printfield[journaltitle]{journaltitle}}}}% {\ifentrytype{manual}% - {\printtext[bibhyperref]{\printlist{organization}}}% - {\printtext[bibhyperref]{\printfield[citetitle]{labeltitle}}}}}% - {\printtext[bibhyperref]{\printfield{label}}}}% + {\printtext[cmshyper]{\printlist{organization}}}% + {\printtext[cmshyper]{\printfield[citetitle]{labeltitle}}}}}% + {\printtext[cmshyper]{\printfield{label}}}}% \newbibmacro*{cite:labelyear+extrayear}{% \ifboolexpr{ ( @@ -1012,10 +1054,10 @@ citation style] {\iffieldundef{eventyear}% {\iffieldundef{origyear}% {\printfield{labelyear}% - \iffieldundef{extrayear}% + \iffieldundef{extradate}% {}% {\setunit*{}% - \printfield{extrayear}}% + \printfield{extradate}}% \iffieldundef{urlendyear}% {}% {\ifboolexpr{% @@ -1026,10 +1068,10 @@ citation style] {\mbox{\bibdatedash}}% {\usebibmacro{cms@test@labelend}}}}% {\printfield{labelyear}% - \iffieldundef{extrayear}% + \iffieldundef{extradate}% {}% {\setunit*{}% - \printfield{extrayear}}% + \printfield{extradate}}% \iffieldundef{origendyear}% {}% {\ifboolexpr{% @@ -1040,10 +1082,10 @@ citation style] {\mbox{\bibdatedash}}% {\usebibmacro{cms@test@labelend}}}}}% {\printfield{labelyear}% - \iffieldundef{extrayear}% + \iffieldundef{extradate}% {}% {\setunit*{}% - \printfield{extrayear}}% + \printfield{extradate}}% \iffieldundef{eventendyear}% {}% {\ifboolexpr{% @@ -1054,10 +1096,10 @@ citation style] {\mbox{\bibdatedash}}% {\usebibmacro{cms@test@labelend}}}}}% {\printfield{labelyear}% - \iffieldundef{extrayear}% + \iffieldundef{extradate}% {}% {\setunit*{}% - \printfield{extrayear}}% + \printfield{extradate}}% \iffieldundef{endyear}% DATE FIX {}% {\ifboolexpr{% @@ -1089,10 +1131,10 @@ citation style] {\iffieldundef{year}% {\iffieldundef{eventyear}% {\printfield{labelyear}% - \iffieldundef{extrayear}% + \iffieldundef{extradate}% {}% {\setunit*{}% - \printfield{extrayear}}% + \printfield{extradate}}% \iffieldundef{urlendyear}% {}% {\ifboolexpr{% @@ -1103,10 +1145,10 @@ citation style] {\mbox{\bibdatedash}}% {\usebibmacro{cms@test@labelend}}}}% {\printfield{labelyear}% - \iffieldundef{extrayear}% + \iffieldundef{extradate}% {}% {\setunit*{}% - \printfield{extrayear}}% + \printfield{extradate}}% \iffieldundef{eventendyear}% {}% {\ifboolexpr{% @@ -1117,10 +1159,10 @@ citation style] {\mbox{\bibdatedash}}% {\usebibmacro{cms@test@labelend}}}}}% {\printfield{labelyear}% - \iffieldundef{extrayear}% + \iffieldundef{extradate}% {}% {\setunit*{}% - \printfield{extrayear}}% + \printfield{extradate}}% \iffieldundef{endyear}% {}% {\ifboolexpr{% @@ -1131,10 +1173,10 @@ citation style] {\mbox{\bibdatedash}}% {\usebibmacro{cms@test@labelend}}}}}% {\printfield{labelyear}% - \iffieldundef{extrayear}% + \iffieldundef{extradate}% {}% {\setunit*{}% - \printfield{extrayear}}% + \printfield{extradate}}% \iffieldundef{origendyear}% DATE FIX {}% {\ifboolexpr{% @@ -1166,10 +1208,10 @@ citation style] {\iffieldundef{origyear}% {\iffieldundef{year}% {\printfield{labelyear}% - \iffieldundef{extrayear}% + \iffieldundef{extradate}% {}% {\setunit*{}% - \printfield{extrayear}}% + \printfield{extradate}}% \iffieldundef{urlendyear}% {}% {\ifboolexpr{% @@ -1180,10 +1222,10 @@ citation style] {\mbox{\bibdatedash}}% {\usebibmacro{cms@test@labelend}}}}% {\printfield{labelyear}% - \iffieldundef{extrayear}% + \iffieldundef{extradate}% {}% {\setunit*{}% - \printfield{extrayear}}% + \printfield{extradate}}% \iffieldundef{endyear}% {}% {\ifboolexpr{% @@ -1194,10 +1236,10 @@ citation style] {\mbox{\bibdatedash}}% {\usebibmacro{cms@test@labelend}}}}}% {\printfield{labelyear}% - \iffieldundef{extrayear}% + \iffieldundef{extradate}% {}% {\setunit*{}% - \printfield{extrayear}}% + \printfield{extradate}}% \iffieldundef{origendyear}% {}% {\ifboolexpr{% @@ -1208,10 +1250,10 @@ citation style] {\mbox{\bibdatedash}}% {\usebibmacro{cms@test@labelend}}}}}% {\printfield{labelyear}% - \iffieldundef{extrayear}% + \iffieldundef{extradate}% {}% {\setunit*{}% - \printfield{extrayear}}% + \printfield{extradate}}% \iffieldundef{eventendyear}% DATE FIX {}% {\ifboolexpr{% @@ -1263,7 +1305,7 @@ citation style] {\iftoggle{cms@bothlabelold}% {\usebibmacro{cite:bothyear+oldstyle}}% {\iftoggle{cms@fulldate}% - {\newcunit\printdate}% + {\newcunit\printtext[bibhyperref]{\printdate}}% Consistency(?) {\usebibmacro{cite:labelyear+extrayear}}}}}}% \ifcsdef{@cms@tempdate}% {\toggletrue{\@cms@tempdate}}% @@ -1288,7 +1330,7 @@ citation style] {\iffieldundef{origyear}% {\iftoggle{cms@ordate}% ??? {}% - {\clearfield{extrayear}}% + {\clearfield{extradate}}% \usebibmacro{cite:standard+labelyear+extrayear}}% {\iftoggle{cms@ordate}% {\usebibmacro{cite:origfirst+labelyear+extrayear}}% @@ -1318,7 +1360,7 @@ citation style] {\iffieldundef{origyear}% ??? {\iftoggle{cms@ordate}% {}% - {\clearfield{extrayear}}% + {\clearfield{extradate}}% \usebibmacro{cite:standard+labelyear+extrayear}}% {\iftoggle{cms@ordate}% Added test for year field ??? {\iffieldundef{year}% @@ -1333,7 +1375,7 @@ citation style] \bibopenparen% \usebibmacro{origyear+endyear}% \bibcloseparen% - \clearfield{extrayear}\addspace% + \clearfield{extradate}\addspace% \usebibmacro{cite:standard+labelyear+extrayear}}}}}}}% \newbibmacro*{cite:save}{% @@ -1401,6 +1443,571 @@ citation style] {}% {\usebibmacro{postnote}} +%%% Commands, macros and formats for the Legal entry types %%% + +\DeclareCiteCommand{\footfullcite}[\mkbibfootnote] + {\usebibmacro{prenote}}%\bibsentence + {\usebibmacro{citeindex}% + \toggletrue{cms@fullnote}% + \togglefalse{cms@shortnote}% + \usebibmacro{cite:full}% + \usebibmacro{footcite:save}% + \usebibmacro{cite:save}} + {\multicitedelim} + {} + +\DeclareCiteCommand{\fullcite} + {\usebibmacro{prenote}}%\bibsentence + {\usebibmacro{citeindex}% + \toggletrue{cms@fullnote}% + \togglefalse{cms@shortnote}% + \usebibmacro{cite:full}% + \usebibmacro{footcite:save}% + \usebibmacro{cite:save}} + {\multicitedelim} + {} + +\DeclareCiteCommand{\parenfullcite}[\mkbibparens] + {\usebibmacro{prenote}}%\bibsentence + {\usebibmacro{citeindex}% + \toggletrue{cms@fullnote}% + \togglefalse{cms@shortnote}% + \usebibmacro{cite:full}% + \usebibmacro{footcite:save}% + \usebibmacro{cite:save}} + {\multicitedelim} + {} + +\newbibmacro*{cite:full}{% + \iftoggle{cms@noneshort}% + {\ifboolexpr{% + test {\ifciteibid}% + and + not test {\iffirstonpage}% + and + not togl {cms@noibid}% + }% + {\togglefalse{cms@fullnote}% + \toggletrue{cms@shortnote}% + \usebibmacro{legal:ibid}}% + {\usebibmacro{cite:driver}}}% + {\ifboolexpr{% + test {\ifciteseen}% + or + togl {cms@allshort}% + }% + {\togglefalse{cms@fullnote}% + \toggletrue{cms@shortnote}% + \ifboolexpr{% + test {\ifciteibid}% + and + not test {\iffirstonpage}% + and + not togl {cms@noibid}% + }% + {\usebibmacro{legal:ibid}}% + {\usebibmacro{cite:short}}}% + {\usebibmacro{cite:driver}}}} + +\newbibmacro*{cite:driver}{% + \printtext[bibhypertarget]{% + \usedriver + {\DeclareNameAlias{sortname}{default}\frenchspacing}% + {\thefield{entrytype}}}}% + +\newbibmacro*{cite:short}{% + \iffieldundef{shorthand}% + {\ifentrytype{jurisdiction}% + {\usebibmacro{cite:short:jurisdiction}}% + {\ifentrytype{legal}% + {\usebibmacro{cite:short:legal}}% + {\ifentrytype{legislation}% + {\usebibmacro{cite:short:legislation}}% + {\usebibmacro{cite}}}}} + {\usebibmacro{cite:shorthand:legal}}}% + +\newbibmacro*{cite:short:jurisdiction}{% + \iffieldundef{labeltitle}% + {}% + {\ifboolexpr{% + togl {cms@allshort}% + or + test {\ifbibliography}% + }% + {\printtext[bibhyperref]{% + \printfield[citetitle]{labeltitle}}}% + {\printtext[cmshyperlink]{% + \printfield[citetitle]{labeltitle}}}}% + \newcunit% Fixme: giving us a duplicate comma + \printfield[jourvol]{volume}% + \setunit*{\addnbspace}% + \iffieldundef{shortjournal}% Test eliminates spurious comma + {}% + {\printtext[shortjournal]{% + \printfield[jtsnoformat]{shortjournal}}}% + \iffieldundef{issue}% + {\printfield[jurisdictionser]{series}}% + {\setunit{\addspace}% + \printfield{issue}}% Better ideas? + \usebibmacro{juridpostnote}}% + +\newbibmacro*{cite:short:legal}{% + \iffieldundef{labeltitle}% + {}% + {\ifboolexpr{% + togl {cms@allshort}% + or + test {\ifbibliography}% + }% + {\printtext[bibhyperref]{% + \printfield[citetitle]{labeltitle}}}% + {\printtext[cmshyperlink]{% + \printfield[citetitle]{labeltitle}}}}% + \newcunit% Fixme: giving us a duplicate comma + \printfield[jourvol]{volume}% + \setunit*{\addnbspace}% + \iffieldundef{shortjournal}% Test eliminates spurious comma + {}% + {\printtext[shortjournal]{% + \printfield[jtsnoformat]{shortjournal}}}% + \printfield[legalser]{series}% + \setunit{\addspace}% + \printfield{issue}% + \ifboolexpr{% + togl {cms@supranotes}% + and + test {\iffootnote}% + }% + {\newcunit% + \printtext{\bibstring{supranote}\addnbspace% + \ref{cbx@\csuse{cbx@f@\thefield{entrykey}}}}}% ?? + {}% + \usebibmacro{juridpostnote}}% + +\newbibmacro*{cite:short:legislation}{% + \iffieldequalstr{entrysubtype}{constitution}% + {\usebibmacro{clegis+news+title}% + \setunit{\addspace}% + \printfield[juridnum]{number}% + \newcunit% + \printfield{part}% + \newcunit% + \printfield{chapter}}% + {\iffieldequalstr{labeltitlesource}{shorttitle}% + {\ifboolexpr{% + togl {cms@allshort}% + or + test {\ifbibliography}% + }% + {\printtext[bibhyperref]{% + \printfield[citetitle]{labeltitle}}}% + {\printtext[cmshyperlink]{% + \printfield[citetitle]{labeltitle}}}}% + {\ifboolexpr{% + test {\iffieldundef{shortjournal}}% + or + ( + not test {\iffieldundef{volume}}% + and + not test {\iffieldint{volume}}% + ) + }% + {\ifboolexpr{% + test {\iffieldundef{entrysubtype}}% + and + not test {\iflistundef{location}} + }% + {\printlist{location}% + \setunit{\addspace}}% + {}% + \ifboolexpr{% + togl {cms@allshort}% + or + test {\ifbibliography}% + }% + {\printtext[bibhyperref]{% + \printfield[citetitle]{labeltitle}}}% + {\printtext[cmshyperlink]{% + \printfield[citetitle]{labeltitle}}}% + \setunit{\addspace}% + \printfield[juridnum]{number}% + \newcunit% + \printfield{part}% + \newcunit% + \printfield{chapter}}% + {\printfield{note}% + \newcunit% + \printfield[jourvol]{volume}% + \setunit*{\addnbspace}% + \iffieldundef{shortjournal}% Test eliminates spurious comma + {}% + {\printtext[shortjournal]{% + \printfield[jtsnoformat]{shortjournal}}}% + \printfield[legislationser]{series}% + \setunit{\addspace}% + \printfield{issue}% + \newcunit% + \printfield{part}% + \newcunit% + \printfield{chapter}% + }}}% + \newcunit% + \ifboolexpr{% + togl {cms@supranotes}% + and + test {\iffootnote}% + and + ( + test {\iffieldequalstr{entrysubtype}{un}}% + or + test {\iffieldequalstr{entrysubtype}{hearing}}% + ) + }% + {\newcunit% + \printtext{\bibstring{supranote}\addnbspace% + \ref{cbx@\csuse{cbx@f@\thefield{entrykey}}}}}% ?? + {}% + \usebibmacro{juridpostnote}}% + +\newbibmacro*{cite:shorthand:legal}{% + \iftoggle{cms@allshort}% + {\printtext[bibhyperref]{% + \printfield{shorthand}}}% + {\printtext[cmshyperlink]{% + \printfield{shorthand}}}% + \ifboolexpr{% + test {\iffootnote}% + and + ( + test {\ifentrytype{legal}}% + or + ( + test {\ifentrytype{legislation}}% + and + ( + test {\iffieldequalstr{entrysubtype}{un}}% + or + test {\iffieldequalstr{entrysubtype}{hearing}}% + ))) + }% + {\newcunit% + \printtext{\bibstring{supranote}\addnbspace% + \ref{cbx@\csuse{cbx@f@\thefield{entrykey}}}% + \newcunit}}% ?? + {\newcunit}% ?? + \iffieldundef{postnote}% + {\global\togglefalse{cms@fullnote}% + \global\togglefalse{cms@shortnote}}% + {\usebibmacro{semel:postnote}% + \global\togglefalse{cms@fullnote}% + \global\togglefalse{cms@shortnote}}}% + +\newbibmacro*{cms:shorthandintro}{% For changing the citedas phrase + \iffieldundef{shorthand}% + {}% + {\iffieldundef{shorthandintro}% + {\ifthenelse{\ifentrytype{jurisdiction}\OR\ifentrytype{legal}\OR% + \ifentrytype{legislation}}% + {\printtext[brackets]{% + \bibstring{hereinafter}\addspace% + \printfield{shorthand}}}% + {\printtext[parens]{% + \bibstring{citedas}\addspace% + \printfield{shorthand}}}}% + {%\addspace%\setunit{\addspace}% Ditto + \printfield{shorthandintro}}}} + +\newbibmacro*{footcite:save}{% + \ifboolexpr{% + test {\iffootnote}% + and + ( + test {\ifentrytype{legal}}% + or + ( + test {\ifentrytype{legislation}}% + and + ( + test {\iffieldequalstr{entrysubtype}{un}}% + or + test {\iffieldequalstr{entrysubtype}{hearing}}% + ))) + }% + {\csxdef{cbx@f@\thefield{entrykey}}{\the\value{instcount}}% + \label{cbx@\the\value{instcount}}}% + {}}% + +\newbibmacro*{legal:ibid}{% + \ifboolexpr{% + togl {cms@noibid}% + or + test {\ifbibliography}% Needed for inheritshorthand option + }% + {\global\toggletrue{cms@shortnote}% + \global\togglefalse{cms@fullnote}% + \usebibmacro{cite:short}% + \usebibmacro{cite:save}}% + {\printtext[bibhyperlink]{% + \bibsstring[\mkbibemph]{ibidem}}%\bibstring[\mkibid]{ibidem} + \ifboolexpr{% + test {\ifloccit}% + or + ( + test {\ifciteibid}% + and + test {\iffieldequalcs{postnote}{cms@pnsaved}}% + and + not test {\ifdefvoid{\blx@loccittracker}}% Package option=false + ) + }% + {\global\toggletrue{cms@loccit}}% + {}}\usebibmacro{postnote}}% FIXME? + +\newbibmacro*{clegis+news+title}{% + \ifthenelse{\iffieldundef{title}\AND\iffieldundef{subtitle}\AND% + \iffieldundef{titleaddon}}% + {}% + {\printtext[title]{%:\thefield{entrytype}]{%(Changed for 0.7 to work) + \printfield[noformat]{title}% + \setunit{\subtitlepunct}% + \printfield[noformat]{subtitle}}% + \setunit{\ctitleaddonpunct}% + \printfield{titleaddon}% + }}%\newcunit\newblock} + +\newbibmacro*{cpart+editor+translator}{% + \ifnameundef{namea}% + {\ifnameundef{nameb}% + {}% + {\bibstring{cbytranslator}\addspace% + \printnames[bytranslator]{nameb}}}% + {\ifthenelse{\iffieldundef{nameatype}\OR% + \iffieldequalstr{nameatype}{editor}}% + {\ifnamesequal{namea}{nameb}% + {\bibstring{cbyeditortr}\addspace% + \printnames[byeditor]{namea}}% + {\bibstring{cbyeditor}\addspace% Need this \space here? + \printnames[byeditor]{namea}% + \ifnameundef{nameb}% + {}% + {\newcunit% + \bibstring{cbytranslator}\addspace% + \printnames[bytranslator]{nameb}}}}% + {\usebibmacro{cbytypestrg}{namea}{editor}% + \setunit{\addspace}% + \printnames[byeditor]{namea}% + \ifnameundef{nameb}% + {}% + {\newunit% + \bibstring{cbytranslator}\addspace% + \printnames[bytranslator]{nameb}}}}} + +\newbibmacro*{juridpostnote}{% + \iftoggle{cms@fullnote}% + {\iffieldundef{issue}% + {\iffieldundef{shortjournal}% + {\setunit{\addcomma\addspace}}% + {\ifthenelse{\iffieldundef{part}\AND\iffieldundef{chapter}}% + {\setunit{\addspace}}% + {\ifpunctmark{*}{\setunit{\addspace}}{\newcunit}}}% + \printfield{pages}% + \iffieldundef{postnote}% + {}% + {\ifthenelse{\ifentrytype{legislation}\OR\ifentrytype{legal}}% + {\newcunit}% + {\setunit*{\addcomma\addspace}}% + \usebibmacro{semel:postnote}}}% + {\iffieldundef{postnote}% + {\iffieldundef{pages}% + {}% + {\newcunit% + \printfield{pages}}}% + {\newcunit% + \usebibmacro{semel:postnote}}}}% + {\iffieldundef{issue}% + {\iffieldundef{postnote}% + {\iffieldundef{pages}% + {}% + {\iffieldundef{shortjournal}% + {\setunit{\addcomma\addspace}}% + {\ifthenelse{\iffieldundef{part}\AND\iffieldundef{chapter}}% + {\setunit{\addspace}}% + {\ifpunctmark{*}{\setunit{\addspace}}{\newcunit}}}% + \printfield{pages}}}% + {\iffieldundef{shortjournal}% + {\setunit{\addcomma\addspace}}% + {\ifthenelse{\iffieldundef{part}\AND\iffieldundef{chapter}}% + {\setunit{\addspace}}% + {\ifpunctmark{*}{\setunit{\addspace}}{\newcunit}}}% + \usebibmacro{semel:postnote}}}% See below for alternate test here + {\iffieldundef{postnote}% + {\iffieldundef{pages}% + {}% + {\newcunit% + \printfield{pages}}}% + {\newcunit% + \usebibmacro{semel:postnote}}}% + \global\togglefalse{cms@fullnote}% + \global\togglefalse{cms@shortnote}}}% + +\newbibmacro*{semel:postnote}{% Fix to print postnote only once + \printfield{postnote}% Old form broke \ifloccit + \global\let\cms@pnsaved\abx@field@postnote% + \global\let\abx@field@postnote\undefined% + \AtNextCitekey{\ifciteibid{}{\global\let\cms@pnsaved\undefined}}}% + +\newbibmacro*{cite+doi+url}{% 16th ed. + \ifboolexpr{% + togl {cms@url}% + and + not test {\iffieldundef{urlyear}}% + }% + {\printurldate}% Date fix + {}% + \newcunit\newblock + \iftoggle{cms@doionly}% + {\iffieldundef{doi}% + {}% + {\printfield{doi}% + \clearfield{url}}}% + {\ifboolexpr{% + togl {cms@doi}% + and + not test {\iffieldundef{doi}}% + }% + {\printfield{doi}}% + {}}% + \newcunit\newblock + \ifboolexpr{% + togl {cms@eprint}% + and + not test {\iffieldundef{eprint}}% + }% + {\usebibmacro{eprint}}% + {}% + \newcunit\newblock + \ifboolexpr{% + togl {cms@url}% + and + not test {\iffieldundef{url}}% + }% + {\printfield{url}}% + {}}% + +\DeclareListFormat[jurisdiction]{location}{% + \iffieldundef{entrysubtype}% + {\usebibmacro{list:delim}{#1}% + #1\isdot% + \usebibmacro{list:andothers}}% + {\ifthenelse{\value{listcount}<\value{listtotal}}% + {\mkbibparens{#1}\addspace}% + {\mkbibparens{#1\isdot}}}}% + +\DeclareListFormat[jurisdiction]{origlocation}{% + \ifthenelse{\value{listcount}<\value{listtotal}}% + {#1\isdot\addcomma\addspace}% + {#1\isdot}} + +\DeclareListFormat[jurisdiction]{origpublisher}{% + \ifthenelse{\value{listcount}<\value{listtotal}}% + {\mkbibparens{#1}\addspace}% + {\mkbibparens{#1\isdot}}} + +\newrobustcmd*{\mkjuridprefix}[1]{% + \ifboolexpr{% FIXME: Is this always right? + test {\iftoggle{cms@fullnote}}% + and + test {\ifentrytype{jurisdiction}}% + }% + {\iffieldundef{issue}% + {#1}% + {\printtext{at}\addspace *#1}}% + {\iffieldundef{issue}% + {\printtext{at}\addspace #1}% FIXME: Make it a bibstring? + {\ifentrytype{jurisdiction}% + {\printtext{at}\addspace *#1}% + {\printtext{at}\addspace #1}}}}% + +\DeclareFieldFormat[jurisdiction,legal,legislation]{postnote}{% + \iftoggle{cms@comprange}% + {\iffieldundef{pagination}% + {\mkcomprange[\mkjuridprefix]{#1}}% + {\mkcomprange[{\mkpageprefix[pagination]}]{#1}}}% + {\iffieldundef{pagination}% + {\mkjuridprefix{#1}}% + {\mkpageprefix[pagination]{#1}}}}% + +\DeclareFieldFormat[jurisdiction,legal]{title}{#1\isdot} + +\DeclareFieldFormat[legislation]{title}{% + \iffieldequalstr{entrysubtype}{hearing}% + {\mkbibemph{#1}\isdot}% + {#1\isdot}} + +\DeclareFieldFormat[jurisdiction]{citetitle}{\mkbibemph{#1}\isdot} + +\DeclareFieldFormat[jurisdiction,legal]{lostitle}{#1\isdot} + +\DeclareFieldFormat[legislation]{lostitle}{% + \iffieldequalstr{entrysubtype}{hearing}% + {\mkbibemph{#1}\isdot}% + {#1\isdot}} + +\DeclareFieldFormat[legal]{citetitle}{#1\isdot} + +\DeclareFieldFormat[legislation]{citetitle}{% + \iffieldequalstr{entrysubtype}{hearing}% + {\mkbibemph{#1}\isdot}% + {#1\isdot}} + +\DeclareFieldFormat[jurisdiction,legal,legislation]{journaltitle}{% + \iffieldundef{shortjournal}% + {#1\isdot}% + {\mkbibemph{#1}\isdot}} + +\DeclareFieldFormat[jurisdiction,legal,legislation]{shortjournal}{#1\isdot} + +\DeclareFieldFormat{jurisdictionser}{% + \ifinteger{#1}% + {\mkjuridordinal{#1}}% + {\ifbibstring{#1}{\bibstring{#1}}{#1}}}% + +\DeclareFieldFormat{legislationser}{% + \iffieldequalstr{entrysubtype}{hansard}% + {\ifinteger{#1}% + {\addspace\mkbibparens{\mkjuridordinal{#1}\addspace\bibsstring{jourser}}}% + {\ifbibstring{#1}% + {\addspace\mkbibparens{\bibstring{#1}}}% + {\addspace\mkbibparens{#1}}}}% + {\iffieldequalstr{entrysubtype}{uk}% + {\addspace #1\isdot}% + {\addcomma\addspace #1\isdot}}}% + +\DeclareFieldFormat{legalser}{\addspace #1\isdot}% + +\DeclareFieldFormat{hansardser}{% + \ifinteger{#1}% + {\mkbibparens{\mkjuridordinal{#1}\addspace\bibsstring{jourser}}}% + {\ifbibstring{#1}{\mkbibparens{\bibstring{#1}}}{\mkbibparens{#1}}}}% + +\DeclareFieldFormat{juridnum}{\bibcpstring{number}\addspace #1}% + +\DeclareFieldFormat{jourvol}{#1} + +\DeclareFieldFormat[jurisdiction,legal,legislation]{addendum}{% + \ifcapital{\mkbibparens{\MakeCapital{#1\isdot}}}{\mkbibparens{#1\isdot}}} + +\DeclareFieldFormat[legal,legislation]{part}{% + \ifnumerals{#1}% + {\bibsstring{part}~#1}% + {#1\isdot}}% + +\DeclareFieldFormat[legal,legislation]{chapter}{% + \ifthenelse{\iffieldequalstr{entrysubtype}{uk}\OR% + \iffieldequalstr{entrysubtype}{hansard}}% + {c\adddotspace #1}% + {\bibsstring{chapter}~#1}}% + %%% Textcite commands taken verbatim from authoryear-comp.cbx %%% \DeclareCiteCommand{\cbx@textcite} @@ -1611,9 +2218,9 @@ citation style] \DeclareListFormat{lista}{% \ifthenelse{\value{listtotal}<2}% - {s\adddot v\adddot\addspace\mkbibquote{#1\isdot}}% + {\bibsstring{subverbo}\addspace\mkbibquote{#1\isdot}}% {\ifthenelse{\value{listcount}=1}% - {s\adddot vv\adddot\addspace \mkbibquote{#1\isdot}\addcomma}% + {\bibsstring{subverbis}\addspace\mkbibquote{#1\isdot}\addcomma}% {\ifthenelse{\value{listcount}<\value{listtotal}}% {\addspace\mkbibquote{#1\isdot}\addcomma}% {\addspace\mkbibquote{#1\isdot}}}}} @@ -1645,10 +2252,10 @@ citation style] \DeclareFieldFormat[inreference]{postnote}{% \iftoggle{cms@comprange}% {\iffieldundef{pagination}% - {s\adddot v\adddot\addnbspace\mkbibquote{#1}}% + {\bibsstring{subverbo}\addnbspace\mkbibquote{#1}}% {\mkcomprange[{\mkpageprefix[pagination]}]{#1}}}% {\iffieldundef{pagination}% - {s\adddot v\adddot\addnbspace\mkbibquote{#1}}% + {\bibsstring{subverbo}\addnbspace\mkbibquote{#1}}% {\mkpageprefix[pagination]{#1}}}}% \DeclareFieldFormat{pages}{% @@ -1662,12 +2269,26 @@ citation style] \DeclareFieldFormat{bibnote}{\MakeCapital{#1}} -\DeclareFieldFormat{edlang}{% +% \DeclareFieldFormat{edlang}{% +% \ifbibstring{#1}% +% {\bibstring{#1}}% +% {\ifbibstring{ed#1}% +% {\bibstring{ed#1}}% +% {\ifcapital{\MakeCapital{#1}}{#1}}}} + +\DeclareListFormat{edlang}{% Required for feminine forms in some + \usebibmacro{list:delim}{% languages + \ifbibstring{#1}% + {\bibxstring{#1}}% + {\ifbibstring{ed#1}% + {\bibxstring{ed#1}}% + {\ifcapital{\MakeCapital{#1}}{#1}}}}% \ifbibstring{#1}% {\bibstring{#1}}% {\ifbibstring{ed#1}% {\bibstring{ed#1}}% - {\ifcapital{\MakeCapital{#1}}{#1}}}} + {\ifcapital{\MakeCapital{#1}}{#1}}}% + \usebibmacro{list:andothers}} \DeclareFieldFormat[customc]{title}{% \iffieldundef{nameaddon}% @@ -1760,12 +2381,12 @@ citation style] \iftoggle{cms@reprint}% Date fix {#1}% {\ifthenelse{\iffieldundef{userd}\OR\NOT\iffieldundef{eventyear}}% - {\bibstring{recorded}\space #1}% + {\bibstring{discrecorded}\space #1}% {\printfield{userd}\addspace #1}}} \DeclareFieldFormat[music]{eventdate}{% 16th ed. \iffieldundef{userd}% - {\bibstring{recorded}\space #1}% + {\bibstring{songrecorded}\space #1}% {\printfield{userd}\addspace #1}} \DeclareFieldFormat[video]{eventdate}{% 16th ed. @@ -1838,6 +2459,19 @@ citation style] \DeclareFieldAlias[suppperiodical]{volume}[article]{volume} +\DeclareFieldFormat{cmshyper}{% Control the number of elements hyperlinked. + \ifboolexpr{% + ( + not test {\iffieldequalstr{entrysubtype}{classical}}% + or + togl {blx@skipbib}% + ) + and + not togl {cms@linkit}% + }% + {#1}% + {\bibhyperref{#1}}}% + %%%% Related field formats from biblatex.def %%%% \DeclareFieldFormat{related:origpubas}{#1}% This and next remove parens @@ -1854,7 +2488,9 @@ citation style] {\ifcapital% {\MakeCapital{#1}}% {#1}}% - \printunit{\relatedpunct}}% + \ifentrytype{jurisdiction}% + {\newcunit}% + {\printunit{\relatedpunct}}}% \DeclareFieldFormat{relatedstring:reprintfrom}{% For notes + bib \ifboolexpr{% @@ -1909,6 +2545,17 @@ citation style] {\setunit*{\addspace}}% {\setunit*{\addcomma\addspace}}} +\renewcommand*{\subtitlepunct}{% Follows CMS16 spec. + \ifboolexpr{% + test {\ifterm}% + and + not test {\ifcsdef{@cmsst}}% + }% + {\addspace}% + {\addcolon\addspace% + \global\csundef{@cmsst}}% +} + \newcommand{\postvolpunct}{\addcolon}% \newcommand{\parttrans}{% @@ -1987,18 +2634,30 @@ citation style] {\addcomma\addspace}% {\addcomma\addspace\bibstring{and}\addspace}}} -\renewcommand*{\postnotedelim}{% - \iftoggle{cms@inlineibid}% - {\togglefalse{cms@inlineibid}% - \iffieldundef{prenote}% Bug fix - {}% - {\cms@testspace}}% - {\iffieldequalstr{entrysubtype}{classical}% For Notes+Bib, too? - {\NumCheckSetup{\DeclareNumChars*{abcdeABCDE}}% - \iffieldpages{postnote}% - {\cms@testspace}% - {\addcomma\addspace}}% - {\addcomma\addspace}}} +\renewcommand*{\postnotedelim}{% Cf. N&B style + \ifboolexpr{% + test {\ifciteibid}% + and + ( + test {\ifentrytype{jurisdiction}}% + or + test {\ifentrytype{legal}}% + or + test {\ifentrytype{legislation}}% + ) + }% + {\addspace}% + {\iftoggle{cms@inlineibid}% + {\togglefalse{cms@inlineibid}% + \iffieldundef{prenote}% Bug fix + {}% + {\cms@testspace}}% + {\iffieldequalstr{entrysubtype}{classical}% For Notes+Bib, too? + {\NumCheckSetup{\DeclareNumChars*{abcdeABCDE}}% + \iffieldpages{postnote}% + {\cms@testspace}% + {\addcomma\addspace}}% + {\addcomma\addspace}}}} \newcommand*{\postnotewrapper}{% \iftoggle{cms@modpostnote}% @@ -2038,46 +2697,67 @@ citation style] {\addperiod\addspace}% {\addcomma\addspace}} -\newcommand*{\lbx@cfromlang}{% +\DeclareListFormat{cfromoriglanguage}{% Needed for notes, to provide + \begingroup% final {by}. + \blx@bibstringnormal% + \usebibmacro{list:delim}{% + \ifbibstring{from#1}% + {\bibxlstring{cfrom#1}}% + {\ifbibstring{clang#1}% + {\bibxlstring{lang#1}}% + {#1}}}% + \ifbibstring{cfrom#1}% + {\ifboolexpr{% + test {\ifnumless{\value{listcount}}{\value{liststop}}}% + or + test \ifmoreitems% + }% + {\bibstring{from#1}}% + {\bibstring{cfrom#1}}}% + {\ifbibstring{lang#1}% + {\biblstring{lang#1}}% + {#1}}% + \usebibmacro{list:andotherlangs}% + \endgroup} + +\newbibmacro*{list:andotherlangs}{% Final {by} after {andmore} + \ifboolexpr{% + test {\ifnumequal{\value{listcount}}{\value{liststop}}}% + and + test \ifmoreitems% + }% + {\ifnumgreater{\value{liststop}}{1}% + {\finalandcomma}% + {}% + \printdelim{andmoredelim}\bibstring{andmore}\addspace\bibstring{by}}% + {}} + +\newcommand*{\lbx@cfromlang}{% Because the cbytranslator string can't + \iffieldundef{userf}% have {by} in it unless there's an origlanguage. + {\iflistundef{origlanguage}% + {\unspace}% + {\printlist[cfromoriglanguage]{origlanguage}}}% + {\unspace}}% + +\renewcommand*{\lbx@fromlang}{% \iffieldundef{userf}% - {\iffieldundef{origlanguage}% + {\iflistundef{origlanguage}% {\unspace}% - {\bibstring{cfrom\thefield{origlanguage}}}}% - {\unspace}} - -\@ifpackagelater{biblatex}{2011/11/12}% -{\renewcommand*{\lbx@fromlang}{% - \iffieldundef{userf}% - {\iffieldundef{origlanguage}% - {\unspace}% - {\bibstring{from\thefield{origlanguage}}}}% - {\unspace}}}% -{\@ifpackagelater{biblatex}{2011/07/28}% - {\newcommand*{\lbx@fromlang}{% - \iffieldundef{userf}% - {\iffieldundef{origlanguage}% - {\unspace}% - {\bibstring{from\thefield{origlanguage}}}}% - {\unspace}}}% - {\renewcommand*{\lbx@fromlang}{% - \iffieldundef{userf}% - {\iffieldundef{origlanguage}% - {\unspace}% - {\bibstring{from\thefield{origlanguage}}}}% - {\unspace}}}}% + {\printlist[lfromoriglanguage]{origlanguage}}}% + {\unspace}}% \renewcommand*{\lbx@lfromlang}{% \iffieldundef{userf}% - {\iffieldundef{origlanguage}% + {\iflistundef{origlanguage}% {\unspace}% - {\biblstring{from\thefield{origlanguage}}}}% + {\printlist[lfromoriglanguage]{origlanguage}}}% {\unspace}}% \renewcommand*{\lbx@sfromlang}{% \iffieldundef{userf}% - {\iffieldundef{origlanguage}% + {\iflistundef{origlanguage}% {\unspace}% - {\bibsstring{from\thefield{origlanguage}}}}% + {\printlist[sfromoriglanguage]{origlanguage}}}% {\unspace}}% %%%% Formatting macros, called both by cbx and bbx %%%% @@ -2546,7 +3226,7 @@ citation style] \usebibmacro{endrelated}% \newunit}}% {\usebibmacro{begrelated}% - \iffieldundef{origlanguage}% + \iflistundef{origlanguage}% {\bibstring{origpub}% \origfullcite{\thefield{userf}}% \usebibmacro{endrelated}% @@ -2554,12 +3234,12 @@ citation style] {\iftoggle{cms@postposit}% {\bibstring{origedition}% \setunit{\addspace}% - \printfield[edlang]{origlanguage}% + \printlist[edlang]{origlanguage}% \addcolon% \origfullcite{\thefield{userf}}% \usebibmacro{endrelated}% \newunit}% - {\printfield[edlang]{origlanguage}% + {\printlist[edlang]{origlanguage}% \setunit{\addspace}% \bibstring{origedition}% \origfullcite{\thefield{userf}}% @@ -2685,7 +3365,7 @@ citation style] \printfield[jtsnoformat]{shortjournal}}}% {\printtext[journaltitle]{% \printfield[jtnoformat]{journaltitle}% - \setunit{\addcolon\addspace}% + \setunit{\subtitlepunct}% \printfield[sjtnoformat]{journalsubtitle}}}}}% \newbibmacro*{chap+pag}{% @@ -2759,7 +3439,7 @@ citation style] \printfield[tnoformat]{shorttitle}}}% {\printtext[title]{% \printfield[tnoformat]{title}% - \setunit{\addcolon\addspace}% + \setunit{\subtitlepunct}% \printfield[stnoformat]{subtitle}}}}% \setunit*{\addspace}% \printlist[periodplace]{location}% @@ -2801,7 +3481,7 @@ citation style] \printfield[tnoformat]{shorttitle}}}% {\printtext[title]{% \printfield[tnoformat]{title}% - \setunit{\addcolon\addspace}% + \setunit{\subtitlepunct}% \printfield[stnoformat]{subtitle}}}}% \setunit*{\addspace}% \printlist[periodplace]{location}% |