diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/biblatex-chicago/chicago-notes.cbx')
-rw-r--r-- | Master/texmf-dist/tex/latex/biblatex-chicago/chicago-notes.cbx | 5381 |
1 files changed, 4157 insertions, 1224 deletions
diff --git a/Master/texmf-dist/tex/latex/biblatex-chicago/chicago-notes.cbx b/Master/texmf-dist/tex/latex/biblatex-chicago/chicago-notes.cbx index 2839e02015b..82f4a000d69 100644 --- a/Master/texmf-dist/tex/latex/biblatex-chicago/chicago-notes.cbx +++ b/Master/texmf-dist/tex/latex/biblatex-chicago/chicago-notes.cbx @@ -1,23 +1,27 @@ -% $Id: chicago-notes.cbx,v 0.11.1.33 2018/01/10 16:41:54 dfussner Exp $ +% This is a biblatex citation style file, originally adapted from +% Lehman's authortitle-cverb.cbx. It is heavily modified, with the +% intention of providing footnote citations and a bibliography +% formatted according to the specifications of the Chicago Manual of +% Style. -% This is a biblatex citation style file, adapted from Lehman's -% authortitle-cverb.cbx. It is heavily modified, with the intention -% of providing footnote citations and a bibliography formatted -% according to the specifications of the Chicago Manual of Style. - -\ProvidesFile{chicago-notes.cbx}[2018/01/10 v 3.10 biblatex citation style] +\ProvidesFile{chicago-notes.cbx}[2020/04/20 v 3.14 biblatex citation style] %%%% Biblatex initialization + Chicago options + Toggles %%%% +\newbool{cms:bracket}% Date-handling booleans +\newbool{cms:extraparens} +\newbool{cms:comma} +\newbool{cms:nd} + \providecommand*{\mkibid}[1]{#1} \providetoggle{cms@oneyear}% Needed for author-date -\providetoggle{cms@reprint}% ditto \providetoggle{cms@switchdates}% ditto \providetoggle{cms@jrcomma}% For comma before Jr./Sr. \providetoggle{cms@url}% These are for the field-exclusion options +\providetoggle{cms@urltime}% 17th ed. \providetoggle{cms@doi} \providetoggle{cms@doionly} \providetoggle{cms@eprint} @@ -25,14 +29,27 @@ \providetoggle{cms@numbermonth} \providetoggle{cms@bookpages} \providetoggle{cms@hidevolumes}% Modify volume fix +\providetoggle{cms@mtvolpunct} \providetoggle{cms@bookseries} +\providetoggle{cms@citeshser}% For shortseries +\providetoggle{cms@bibshser} \providetoggle{cms@notefield} \providetoggle{cms@addendum} \providetoggle{cms@comprange} +\providetoggle{cms@compyears} \providetoggle{cms@modpostnote} \providetoggle{cms@url@innotes} \providetoggle{cms@ukord} +\providetoggle{cms@bc}% Attempt to provide correct dateera handling +\providetoggle{cms@alwaysrange}% Turns off decade and century handling +\providetoggle{cms@decaderange}% Only turns off decade handling +\providetoggle{cms@centuryrange}% Only turns off century handling +\providetoggle{cms@nodatebrackets}% For brackets in uncertain & circa +\providetoggle{cms@noyearbrackets}% +\providetoggle{cms@nodates}% + +\providetoggle{cms@strict} \providetoggle{cms@headlessnote} \providetoggle{cms@origcite} \providetoggle{cms@fullnote} @@ -40,6 +57,8 @@ \providetoggle{cms@allshort} \providetoggle{cms@noibid} \providetoggle{cms@noidem} +\providetoggle{cms@namedash} +\providetoggle{cms@useibid} \providetoggle{cms@usecompiler} \providetoggle{cms@shorthandibid} \providetoggle{cms@printshhand} @@ -53,6 +72,15 @@ \providetoggle{cms@legalnotes}% For legal types \providetoggle{cms@supranotes}% Ditto \providetoggle{cms@noneshort}% Ditto +\providetoggle{cms@running@text}% For Jurisdiction entries +\providetoggle{cms@noterefs}% Backrefs inside notes +\providetoggle{cms@forcenoteref}% For shortrefcite command +\providetoggle{cms@zeropages}% For replacing zero sections +\providetoggle{cms@hidezeros}% Ditto, but differently +\providetoggle{cms@fullrefs}% Force printing of sec. no. w/in same sec. +\providetoggle{cms@ensplit}% Split endnotes w/o cmsendnotes +\providetoggle{cms@endnote}% Distinguish foot- and endnotes +\providetoggle{cms@relreview}% \providetoggle{cms@vol} \providetoggle{cms@postvol} \providetoggle{cms@usedvol} @@ -64,6 +92,7 @@ \providetoggle{cms@xrefpart} \providetoggle{cms@omitxrefdate} \providetoggle{cms@xrefurl} +\providetoggle{cms@blogurl}% For 17th ed. blogs w/ comments \providetoggle{cms@related} \providetoggle{cms@citerel} \providetoggle{cms@gencite} @@ -75,9 +104,6 @@ {\nocite{\thefield{userc}}}% \global\togglefalse{cms@loccit}% \global\csundef{@cmsst}% - \iffieldequalstr{pubstate}{reprint}% - {\toggletrue{cms@reprint}}% - {\togglefalse{cms@reprint}}% \ifboolexpr{% test {\iffieldundef{origyear}}% or @@ -108,47 +134,703 @@ \PackageWarningNoLine{biblatex-chicago}{#1}% \endgroup} -\DeclareBibliographyOption[boolean]{genallnames}[true]{% - \settoggle{cms@genallnames}{#1}} +%% These are options for extended date attributes + +\DeclareBiblatexOption{global,entry}[boolean]{alwaysrange}[true]{% + \settoggle{cms@alwaysrange}{#1}}% + +\DeclareBiblatexOption{global,entry}[boolean]{decaderange}[true]{% + \settoggle{cms@decaderange}{#1}}% + +\DeclareBiblatexOption{global,entry}[boolean]{centuryrange}[true]{% + \settoggle{cms@centuryrange}{#1}}% + +\DeclareBiblatexOption{global,type,entry}[boolean]{nodatebrackets}[true]{% + \settoggle{cms@nodatebrackets}{#1}}% + +\DeclareBiblatexOption{global,type,entry}[boolean]{noyearbrackets}[true]{% + \settoggle{cms@noyearbrackets}{#1}}% -\DeclareEntryOption[boolean]{genallnames}[true]{% +\DeclareBiblatexOption{global,type,entry}[boolean]{nodates}[true]{% + \settoggle{cms@nodates}{#1}}% + +\DeclareBiblatexOption{global,entry}[boolean]{genallnames}[true]{% \settoggle{cms@genallnames}{#1}} \DeclareBibliographyOption{annotation}[true]{% \global\toggletrue{cms@annotation}} -\DeclareBibliographyOption{noibid}[true]{% +\DeclareBibliographyOption[boolean]{noibid}[true]{% \global\toggletrue{cms@noibid}} +\DeclareBibliographyOption[boolean]{useibid}[true]{% + \global\toggletrue{cms@useibid}} + +\DeclareBibliographyOption[boolean]{dashed}[true]{% + \settoggle{cms@namedash}{#1}} + \DeclareBibliographyOption[boolean]{short}[true]{% \global\settoggle{cms@allshort}{#1}} +\DeclareBibliographyOption[boolean]{hidezeros}[true]{% + \global\settoggle{cms@hidezeros}{#1}} + +\DeclareEntryOption[boolean]{hidezeros}[true]{% + \settoggle{cms@hidezeros}{#1}} + +\DeclareBibliographyOption[boolean]{pagezeros}[true]{% + \global\settoggle{cms@zeropages}{#1}} + +\DeclareEntryOption[boolean]{pagezeros}[true]{% + \settoggle{cms@zeropages}{#1}} + +\DeclareBibliographyOption[boolean]{endnotesplit}[true]{% + \global\settoggle{cms@ensplit}{#1}} + +\DeclareBibliographyOption[integer]{noterefinterval}[0]{% + \gdef\cms@note@distance{#1}}% + +\DeclareBibliographyOption[string]{noterefintro}[preface]{% + \def\cms@note@introname{#1}}% + +\DeclareBiblatexOption{global}[boolean]{fullnoterefs}[true]{% + \global\settoggle{cms@fullrefs}{#1}}% + +\DeclareBibliographyOption[string]{noteref}[none]{% + \global\toggletrue{cms@noterefs}% + \ifcsdef{cms@opt@noterefs@#1}% + {\letcs\cms@noteref@casenum{cms@opt@noterefs@#1}% + \def\cms@noteref@interval{#1}% + \def\cms@note@distance{0}}% + {\blx@err@invopt{noteref=#1}{}}}% +\def\cms@opt@noterefs@none{0}% +\def\cms@opt@noterefs@part{1}% +\def\cms@opt@noterefs@chapter{2}% +\def\cms@opt@noterefs@section{3}% +\def\cms@opt@noterefs@subsection{4}% +\def\cms@opt@noterefs@page{5}% + +\newbibmacro*{noteref+interval}{% + \ifcase\cms@noteref@casenum% 0 + \cms@noteref{none}% + \or % 1 + \cms@noteref{part}% + \or % 2 + \cms@noteref{chapter}% + \or % 3 + \cms@noteref{section}% + \or % 4 + \cms@noteref{subsection}% + \or % 5 + \cms@noteref{page}% + \fi} + +\newrobustcmd*{\cms@noteref}[1]{% + \ifcsundef{cms@recent@\thefield{entrykey}}% + {\cms@warning@noline% + {I can't find a long citation of\MessageBreak + the entry \thefield{entrykey}.\MessageBreak + Most likely the initial citation\MessageBreak + did not occur inside a note, or\MessageBreak + perhaps you used a \citejournal\MessageBreak + command for it. Biblatex-chicago\MessageBreak + won't be able to generate a back\MessageBreak + reference to it}}% + {\ifboolexpr{% + (( + test {\iffieldequalstr{relatedtype}{reviewof}}% + or + test {\iffieldequalstr{relatedtype}{commenton}}% 17th ed. + ) + and + ( + test {\ifentrytype{review}}% + or + test {\ifentrytype{suppperiodical}}% + or + ( + test {\ifentrytype{online}}% 17th ed. + and + test {\IfBeginWith{\thefield{title}}{CCCCCC}}% + ))) + or + ( + test {\IfBeginWith{\thefield{relatedtype}}{maintitl}}% + and + test {\IfBeginWith{\thefield{entrytype}}{mv}}% + ) + }% + {\csdef{cms@tempcounta}{\value{cms@reviewcount}}}% + {\csdef{cms@tempcounta}{\value{instcount}}}% + \ifboolexpr{% + test {\ifsamepage{\csuse{cms@tempcounta}}%{\the\value{instcount}} + {\csuse{cms@recent@\thefield{entrykey}}}}% Replaces cbx@f@... + and + not togl {cms@forcenoteref}% + }% + {}% + {\ifboolexpr{% + test {\ifnumless{\csuse{cms@tempcounta} - + \csuse{cms@recent@\thefield{entrykey}}}% + {\csuse{cms@note@distance}}}% + and + not togl {cms@forcenoteref}% + }% + {}% + {\ifnumequal{\csuse{cms@opt@noterefs@#1}}{0}% + {\setunit{\addspace\bibopenparen}% + \bibsstring{seenote}\addnbspace + \printtext{\ref{cbx@\csuse{cbx@f@\thefield{entrykey}}}}% + \bibcloseparen}% + {\ifboolexpr{% + ( + not test {\ifcsvoid{cms@end@split}}% + and + togl {cms@endnote}% + ) + or + togl {cms@ensplit}% + or + test {\ifnumequal{\csuse{cms@opt@noterefs@#1}}{5}}% + }% + {\ifnumequal{\csuse{cms@opt@noterefs@#1}}{5}% + {\setunit{\addspace\bibopenparen}% + \bibstring{see}\addnbspace\bibsstring{page}\addnbspace% + \pageref{cbx@\csuse{cbx@f@\thefield{entrykey}}}% + \newcunit% + \bibsstring{note}\addnbspace% + \ref{cbx@\csuse{cbx@f@\thefield{entrykey}}}% + \bibcloseparen}% + {\iftoggle{cms@ensplit}% + {\setunit{\addspace\bibopenparen}% + \bibstring{see}\addnbspace% + \getrefbykeydefault{cbx@\csuse{cbx@f@\thefield{entrykey}}}% + {name}{}% + \newcunit% + \bibsstring{note}\addnbspace% + \ref{cbx@\csuse{cbx@f@\thefield{entrykey}}}% + \bibcloseparen}% + {\setunit{\addspace\bibopenparen}% + \bibstring{see}\addnbspace% + \StrCut{% + \getrefbykeydefault{cbx@\csuse{cbx@f@\thefield{entrykey}}}% + {name}{}}{\ }{\cms@AA}{\cms@BB}% + \ifcsvoid{cms@BB}% + {}% + {\StrLeft{\expandafter\string\cms@BB}{5}[\cms@CC]% + \StrGobbleLeft{\expandafter\string\cms@CC}{1}[\cms@CC]}% + \ifboolexpr{% + test {\ifcsvoid{cms@BB}}% + or + test {\ifdefstring{\cms@CC}{zeri}}% + }% + {\ifcsvoid{cms@BB}% + {\ifbibxstring{\csuse{cms@note@introname}}% + {\bibsstring{\csuse{cms@note@introname}}}% + {\csuse{cms@note@introname}}}% + {\ifbibxstring{\csuse{cms@note@introname}}% + {\bibsstring{\csuse{cms@note@introname}}% + \addcomma\addspace\cms@BB}% + {\csuse{cms@note@introname}% + \addcomma\addspace\cms@BB}}}% + {\ifcsvoid{cms@end@subheadername}% + {\ifbibxstring{\csuse{cms@end@split}}% + {\bibsstring{\csuse{cms@end@split}}\addnbspace\cms@BB}% + {\csuse{cms@end@split}\addnbspace\cms@BB}}% + {\ifbibxstring{\csuse{cms@end@subheadername}}% + {\bibsstring{\csuse{cms@end@subheadername}}% + \addnbspace\cms@BB}% + {\csuse{cms@end@subheadername}\addnbspace\cms@BB}}}% + \newcunit% + \bibsstring{note}\addnbspace% + \ref{cbx@\csuse{cbx@f@\thefield{entrykey}}}% + \bibcloseparen}}}% + {\ifnumless{\csuse{cms@opt@noterefs@#1}}{3}% + {\ifboolexpr{% + test {\ifnumcomp{\value{\csuse{cms@noteref@interval}}}{>}% + {\csuse{cms@invl@\thefield{entrykey}}}}% + or + togl {cms@fullrefs}% + }% + {\ifnumequal{\csuse{cms@invl@\thefield{entrykey}}}{0}% + {\ifcsundef{cms@note@introname}% + {\iftoggle{cms@zeropages}% + {\setunit{\addspace\bibopenparen}% + \bibstring{see}\addnbspace\bibsstring{page}% + \addnbspace% + \pageref{cbx@\csuse{cbx@f@\thefield{entrykey}}}% + \newcunit% + \bibsstring{note}\addnbspace% + \ref{cbx@\csuse{cbx@f@\thefield{entrykey}}}% + \bibcloseparen}% + {\setunit{\addspace\bibopenparen}% + \bibstring{see}\addnbspace% + \bibsstring{\csuse{cms@noteref@interval}}\addnbspace% + \printtext{\csuse{cms@invl@\thefield{entrykey}}}% + \newcunit% + \bibsstring{note}\addnbspace% + \ref{cbx@\csuse{cbx@f@\thefield{entrykey}}}% + \bibcloseparen}}% + {\setunit{\addspace\bibopenparen}% + \bibstring{see}\addnbspace% + \cms@ifcsstring{cms@note@introname}\newcunit% + \bibsstring{note}\addnbspace% + \ref{cbx@\csuse{cbx@f@\thefield{entrykey}}}% + \bibcloseparen}}% + {\setunit{\addspace\bibopenparen}% + \bibstring{see}\addnbspace% + \printtext[nr#1]{\csuse{cms@invl@\thefield{entrykey}}}% + \newcunit% + \bibsstring{note}\addnbspace% + \ref{cbx@\csuse{cbx@f@\thefield{entrykey}}}% + \bibcloseparen}}% + {\setunit{\addspace\bibopenparen}% + \printtext{\bibsstring{seenote}\addnbspace% + \ref{cbx@\csuse{cbx@f@\thefield{entrykey}}}}% + \bibcloseparen}}% + {\ifnumequal{\csuse{cms@opt@noterefs@#1}}{3}% + {\ifundef{\chapter}% + {\ifboolexpr{% + test {\ifnumcomp{\value{\csuse{cms@noteref@interval}}}{>}% + {\csuse{cms@invl@\thefield{entrykey}}}}% + or + togl {cms@fullrefs}% + }% + {\ifnumequal{\csuse{cms@invl@\thefield{entrykey}}}{0}% + {\ifcsundef{cms@note@introname}% + {\iftoggle{cms@zeropages}% + {\setunit{\addspace\bibopenparen}% + \bibstring{see}\addnbspace\bibsstring{page}% + \addnbspace% + \pageref{cbx@\csuse{cbx@f@\thefield{entrykey}}}% + \newcunit% + \bibsstring{note}\addnbspace% + \ref{cbx@\csuse{cbx@f@\thefield{entrykey}}}% + \bibcloseparen}% + {\setunit{\addspace\bibopenparen}% + \bibstring{see}\addnbspace% + \bibsstring{section}\addnbspace% + \printtext{\csuse{cms@invl@\thefield{entrykey}}}% + \newcunit% + \bibsstring{note}\addnbspace% + \ref{cbx@\csuse{cbx@f@\thefield{entrykey}}}% + \bibcloseparen}}% + {\setunit{\addspace\bibopenparen}% + \bibstring{see}\addnbspace% + \cms@ifcsstring{cms@note@introname}\newcunit% + \bibsstring{note}\addnbspace% + \ref{cbx@\csuse{cbx@f@\thefield{entrykey}}}% + \bibcloseparen}}% + {\setunit{\addspace\bibopenparen}% + \bibstring{see}\addnbspace% + \bibsstring{section}\addnbspace% + \printtext{\csuse{cms@invl@\thefield{entrykey}}}% + \newcunit% + \bibsstring{note}\addnbspace% + \ref{cbx@\csuse{cbx@f@\thefield{entrykey}}}% + \bibcloseparen}}% + {\setunit{\addspace\bibopenparen}% + \printtext{\bibsstring{seenote}\addnbspace% + \ref{cbx@\csuse{cbx@f@\thefield{entrykey}}}}% + \bibcloseparen}}% + {\ifboolexpr{% + test {\ifnumcomp{\value{\csuse{cms@noteref@interval}}}{>}% + {\csuse{cms@invl@\thefield{entrykey}}}}% + or + test {\ifnumcomp{\value{chapter}}{>}% + {\csuse{cms@chap@\thefield{entrykey}}}}% + or + togl {cms@fullrefs}% + }% + {\ifnumequal{\csuse{cms@chap@\thefield{entrykey}}}{0}% + {\ifcsundef{cms@note@introname}% + {\iftoggle{cms@zeropages}% + {\setunit{\addspace\bibopenparen}% + \bibstring{see}\addnbspace\bibsstring{page}% + \addnbspace% + \pageref{cbx@\csuse{cbx@f@\thefield{entrykey}}}% + \newcunit% + \bibsstring{note}\addnbspace% + \ref{cbx@\csuse{cbx@f@\thefield{entrykey}}}% + \bibcloseparen}% + {\setunit{\addspace\bibopenparen}% + \bibstring{see}\addnbspace% + \bibsstring{section}\addnbspace% + \printtext{\csuse{cms@chap@\thefield{entrykey}}.% + \csuse{cms@invl@\thefield{entrykey}}}% + \newcunit% + \bibsstring{note}\addnbspace% + \ref{cbx@\csuse{cbx@f@\thefield{entrykey}}}% + \bibcloseparen}}% + {\ifnumequal{\csuse{cms@invl@\thefield{entrykey}}}{0}% + {\setunit{\addspace\bibopenparen}% + \bibstring{see}\addnbspace% + \cms@ifcsstring{cms@note@introname}\newcunit% + \bibsstring{note}\addnbspace% + \ref{cbx@\csuse{cbx@f@\thefield{entrykey}}}% + \bibcloseparen}% + {\setunit{\addspace\bibopenparen}% + \bibstring{see}\addnbspace% + \cms@ifcsstring{cms@note@introname}\newcunit% + \bibsstring{section}\addnbspace% + \printtext{\csuse{cms@invl@\thefield{entrykey}}}% + \newcunit% + \bibsstring{note}\addnbspace% + \ref{cbx@\csuse{cbx@f@\thefield{entrykey}}}% + \bibcloseparen}}}% + {\ifnumequal{\csuse{cms@invl@\thefield{entrykey}}}{0}% + {\iftoggle{cms@zeropages}% + {\setunit{\addspace\bibopenparen}% + \bibstring{see}\addnbspace\bibsstring{page}% + \addnbspace% + \pageref{cbx@\csuse{cbx@f@\thefield{entrykey}}}% + \newcunit% + \bibsstring{note}\addnbspace% + \ref{cbx@\csuse{cbx@f@\thefield{entrykey}}}% + \bibcloseparen}% + {\iftoggle{cms@hidezeros}% + {\setunit{\addspace\bibopenparen}% + \bibstring{see}\addnbspace% + \bibsstring{section}\addnbspace% + \printtext{% + \csuse{cms@chap@\thefield{entrykey}}.% + 1\addnbspace\mkbibparens{\cmspref}}% + \newcunit% + \bibsstring{note}\addnbspace% + \ref{cbx@\csuse{cbx@f@\thefield{entrykey}}}% + \bibcloseparen}% + {\setunit{\addspace\bibopenparen}% + \bibstring{see}\addnbspace% + \bibsstring{section}\addnbspace% + \printtext{\csuse{cms@chap@\thefield{entrykey}}.% + \csuse{cms@invl@\thefield{entrykey}}}% + \newcunit% + \bibsstring{note}\addnbspace% + \ref{cbx@\csuse{cbx@f@\thefield{entrykey}}}% + \bibcloseparen}}}% + {\setunit{\addspace\bibopenparen}% + \bibstring{see}\addnbspace% + \bibsstring{section}\addnbspace% + \printtext{\csuse{cms@chap@\thefield{entrykey}}.% + \csuse{cms@invl@\thefield{entrykey}}}% + \newcunit% + \bibsstring{note}\addnbspace% + \ref{cbx@\csuse{cbx@f@\thefield{entrykey}}}% + \bibcloseparen}}}% + {\setunit{\addspace\bibopenparen}% + \printtext{\bibsstring{seenote}\addnbspace% + \ref{cbx@\csuse{cbx@f@\thefield{entrykey}}}}% + \bibcloseparen}}}% + {\ifundef{\chapter}% + {\ifboolexpr{% + test {\ifnumcomp{\value{\csuse{cms@noteref@interval}}}{>}% + {\csuse{cms@invl@\thefield{entrykey}}}}% + or + test {\ifnumcomp{\value{section}}{>}% + {\csuse{cms@sec@\thefield{entrykey}}}}% + or + togl {cms@fullrefs}% + }% + {\ifnumequal{\csuse{cms@sec@\thefield{entrykey}}}{0}% + {\ifcsundef{cms@note@introname}% + {\iftoggle{cms@zeropages}% + {\setunit{\addspace\bibopenparen}% + \bibstring{see}\addnbspace\bibsstring{page}% + \addnbspace% + \pageref{cbx@\csuse{cbx@f@\thefield{entrykey}}}% + \newcunit% + \bibsstring{note}\addnbspace% + \ref{cbx@\csuse{cbx@f@\thefield{entrykey}}}% + \bibcloseparen}% + {\setunit{\addspace\bibopenparen}% + \bibstring{see}\addnbspace% + \bibsstring{section}\addnbspace% + \printtext{\csuse{cms@sec@\thefield{entrykey}}.% + \csuse{cms@invl@\thefield{entrykey}}}% + \newcunit% + \bibsstring{note}\addnbspace% + \ref{cbx@\csuse{cbx@f@\thefield{entrykey}}}% + \bibcloseparen}}% + {\ifnumequal{\csuse{cms@invl@\thefield{entrykey}}}{0}% + {\setunit{\addspace\bibopenparen}% + \bibstring{see}\addnbspace% + \cms@ifcsstring{cms@note@introname}\newcunit% + \bibsstring{note}\addnbspace% + \ref{cbx@\csuse{cbx@f@\thefield{entrykey}}}% + \bibcloseparen}% + {\setunit{\addspace\bibopenparen}% + \bibstring{see}\addnbspace% + \cms@ifcsstring{cms@note@introname}\newcunit% + \bibsstring{section}\addnbspace% + \printtext{\csuse{cms@invl@\thefield{entrykey}}}% + \newcunit% + \bibsstring{note}\addnbspace% + \ref{cbx@\csuse{cbx@f@\thefield{entrykey}}}% + \bibcloseparen}}}% + {\ifnumequal{\csuse{cms@invl@\thefield{entrykey}}}{0}% + {\iftoggle{cms@zeropages}% + {\setunit{\addspace\bibopenparen}% + \bibstring{see}\addnbspace\bibsstring{page}% + \addnbspace% + \pageref{cbx@\csuse{cbx@f@\thefield{entrykey}}}% + \newcunit% + \bibsstring{note}\addnbspace% + \ref{cbx@\csuse{cbx@f@\thefield{entrykey}}}% + \bibcloseparen}% + {\iftoggle{cms@hidezeros}% + {\setunit{\addspace\bibopenparen}% + \bibstring{see}\addnbspace% + \bibsstring{section}\addnbspace% + \printtext{% + \csuse{cms@sec@\thefield{entrykey}}.% + 1\addnbspace\mkbibparens{\cmspref}}% + \newcunit% + \bibsstring{note}\addnbspace% + \ref{cbx@\csuse{cbx@f@\thefield{entrykey}}}% + \bibcloseparen}% + {\setunit{\addspace\bibopenparen}% + \bibstring{see}\addnbspace% + \bibsstring{section}\addnbspace% + \printtext{\csuse{cms@sec@\thefield{entrykey}}.% + \csuse{cms@invl@\thefield{entrykey}}}% + \newcunit% + \bibsstring{note}\addnbspace% + \ref{cbx@\csuse{cbx@f@\thefield{entrykey}}}% + \bibcloseparen}}}% + {\setunit{\addspace\bibopenparen}% + \bibstring{see}\addnbspace% + \bibsstring{section}\addnbspace% + \printtext{\csuse{cms@sec@\thefield{entrykey}}.% + \csuse{cms@invl@\thefield{entrykey}}}% + \newcunit% + \bibsstring{note}\addnbspace% + \ref{cbx@\csuse{cbx@f@\thefield{entrykey}}}% + \bibcloseparen}}}% + {\setunit{\addspace\bibopenparen}% + \printtext{\bibsstring{seenote}\addnbspace% + \ref{cbx@\csuse{cbx@f@\thefield{entrykey}}}}% + \bibcloseparen}}% + {\ifboolexpr{% + test {\ifnumcomp{\value{\csuse{cms@noteref@interval}}}{>}% + {\csuse{cms@invl@\thefield{entrykey}}}}% + or + test {\ifnumcomp{\value{chapter}}{>}% + {\csuse{cms@chap@\thefield{entrykey}}}}% + or + test {\ifnumcomp{\value{section}}{>}% + {\csuse{cms@sec@\thefield{entrykey}}}}% + or + togl {cms@fullrefs}% + }% + {\ifnumequal{\csuse{cms@chap@\thefield{entrykey}}}{0}% + {\ifcsundef{cms@note@introname}% + {\iftoggle{cms@zeropages}% + {\setunit{\addspace\bibopenparen}% + \bibstring{see}\addnbspace\bibsstring{page}% + \addnbspace% + \pageref{cbx@\csuse{cbx@f@\thefield{entrykey}}}% + \newcunit% + \bibsstring{note}\addnbspace% + \ref{cbx@\csuse{cbx@f@\thefield{entrykey}}}% + \bibcloseparen}% + {\setunit{\addspace\bibopenparen}% + \bibstring{see}\addnbspace% + \bibsstring{section}\addnbspace% + \printtext{\csuse{cms@chap@\thefield{entrykey}}.% + \csuse{cms@sec@\thefield{entrykey}}.% + \csuse{cms@invl@\thefield{entrykey}}}% + \newcunit% + \bibsstring{note}\addnbspace% + \ref{cbx@\csuse{cbx@f@\thefield{entrykey}}}% + \bibcloseparen}}% + {\ifboolexpr{% + test + {\ifnumequal{\csuse{cms@sec@\thefield{entrykey}}}% + {0}}% + and + test + {\ifnumequal{\csuse{cms@invl@\thefield{entrykey}}}% + {0}}% + }% + {\setunit{\addspace\bibopenparen}% + \bibstring{see}\addnbspace% + \cms@ifcsstring{cms@note@introname}\newcunit% + \bibsstring{note}\addnbspace% + \ref{cbx@\csuse{cbx@f@\thefield{entrykey}}}% + \bibcloseparen}% + {\ifboolexpr{% + togl {cms@zeropages}% + and + ( + test + {\ifnumequal{\csuse{cms@sec@\thefield{entrykey}}}% + {0}}% + or + test + {\ifnumequal{\csuse{cms@invl@\thefield{entrykey}}}% + {0}}% + ) + }% + {\setunit{\addspace\bibopenparen}% + \bibstring{see}\addnbspace% + \cms@ifcsstring{cms@note@introname}\newcunit% + \bibsstring{page}% + \addnbspace% + \pageref{cbx@\csuse{cbx@f@\thefield{entrykey}}}% + \newcunit% + \bibsstring{note}\addnbspace% + \ref{cbx@\csuse{cbx@f@\thefield{entrykey}}}% + \bibcloseparen}% + {\setunit{\addspace\bibopenparen}% + \bibstring{see}\addnbspace% + \cms@ifcsstring{cms@note@introname}\newcunit% + \bibsstring{section}\addnbspace% + \printtext{\csuse{cms@sec@\thefield{entrykey}}.% + \csuse{cms@invl@\thefield{entrykey}}}% + \newcunit% + \bibsstring{note}\addnbspace% + \ref{cbx@\csuse{cbx@f@\thefield{entrykey}}}% + \bibcloseparen}}}}% + {\ifboolexpr{% + test + {\ifnumequal{\csuse{cms@sec@\thefield{entrykey}}}{0}}% + or + test + {\ifnumequal{\csuse{cms@invl@\thefield{entrykey}}}{0}}% + }% + {\iftoggle{cms@zeropages}% + {\setunit{\addspace\bibopenparen}% + \bibstring{see}\addnbspace\bibsstring{page}% + \addnbspace% + \pageref{cbx@\csuse{cbx@f@\thefield{entrykey}}}% + \newcunit% + \bibsstring{note}\addnbspace% + \ref{cbx@\csuse{cbx@f@\thefield{entrykey}}}% + \bibcloseparen}% + {\iftoggle{cms@hidezeros}% + {\ifnumequal{\csuse{cms@sec@\thefield{entrykey}}}% + {0}% + {\ifnumequal{\csuse{cms@invl@\thefield{entrykey}}}% + {0}% + {\setunit{\addspace\bibopenparen}% + \bibstring{see}\addnbspace% + \bibsstring{section}\addnbspace% + \printtext{% + \csuse{cms@chap@\thefield{entrykey}}.% + 1\addnbspace\mkbibparens{\cmspref}}% + \newcunit% + \bibsstring{note}\addnbspace% + \ref{cbx@\csuse{cbx@f@\thefield{entrykey}}}% + \bibcloseparen}% + {\setunit{\addspace\bibopenparen}% + \bibstring{see}\addnbspace% + \bibsstring{section}\addnbspace% + \printtext{% + \csuse{cms@chap@\thefield{entrykey}}.% + \cmspref\adddot% + \csuse{cms@invl@\thefield{entrykey}}}% + \newcunit% + \bibsstring{note}\addnbspace% + \ref{cbx@\csuse{cbx@f@\thefield{entrykey}}}% + \bibcloseparen}}% + {\setunit{\addspace\bibopenparen}% + \bibstring{see}\addnbspace% + \bibsstring{section}\addnbspace% + \printtext{% + \csuse{cms@chap@\thefield{entrykey}}.% + \csuse{cms@sec@\thefield{entrykey}}.% + 1\addnbspace\mkbibparens{\cmspref}}% + \newcunit% + \bibsstring{note}\addnbspace% + \ref{cbx@\csuse{cbx@f@\thefield{entrykey}}}% + \bibcloseparen}}% + {\setunit{\addspace\bibopenparen}% + \bibstring{see}\addnbspace% + \bibsstring{section}\addnbspace% + \printtext{\csuse{cms@chap@\thefield{entrykey}}.% + \csuse{cms@sec@\thefield{entrykey}}.% + \csuse{cms@invl@\thefield{entrykey}}}% + \newcunit% + \bibsstring{note}\addnbspace% + \ref{cbx@\csuse{cbx@f@\thefield{entrykey}}}% + \bibcloseparen}}}% + {\setunit{\addspace\bibopenparen}% + \bibstring{see}\addnbspace% + \bibsstring{section}\addnbspace% + \printtext{\csuse{cms@chap@\thefield{entrykey}}.% + \csuse{cms@sec@\thefield{entrykey}}.% + \csuse{cms@invl@\thefield{entrykey}}}% + \newcunit% + \bibsstring{note}\addnbspace% + \ref{cbx@\csuse{cbx@f@\thefield{entrykey}}}% + \bibcloseparen}}}% + {\setunit{\addspace\bibopenparen}% + \printtext{\bibsstring{seenote}\addnbspace% + \ref{cbx@\csuse{cbx@f@\thefield{entrykey}}}}% + \bibcloseparen}}}}}}% + \ifnumequal{\csuse{cms@tempcounta}}{\value{cms@reviewcount}}% + {\csxdef{cms@recent@\thefield{entrykey}}% + {\the\value{cms@reviewcount}}}% + {\csxdef{cms@recent@\thefield{entrykey}}{\the\value{instcount}}}}}}}% + +\newrobustcmd*{\cmspref}{pref.\@}% +\newrobustcmd*{\cmsintrosection}{\S}% + +\newrobustcmd*{\cms@ifcsstring}[1]{% + \ifbibxstring{\csuse{#1}}% + {\bibsstring{\csuse{#1}}}% + {\csuse{#1}}} + +\newrobustcmd*{\cms@save@locdata}[1]{% + \iftoggle{cms@noterefs}% + {\csxdef{cbx@f@\thefield{#1}}{\the\value{instcount}}% + \csxdef{cms@recent@\thefield{#1}}{\the\value{instcount}}% + \ifcase\cms@noteref@casenum% + \or% 1 + \csxdef{cms@invl@\thefield{#1}}% + {\the\value{\csuse{cms@noteref@interval}}}% + \or% 2 + \csxdef{cms@invl@\thefield{#1}}% + {\the\value{\csuse{cms@noteref@interval}}}% + \or% 3 + \ifundef{\chapter}% + {\csxdef{cms@invl@\thefield{#1}}% + {\the\value{\csuse{cms@noteref@interval}}}}% + {\csxdef{cms@invl@\thefield{#1}}% + {\the\value{\csuse{cms@noteref@interval}}}% + \csxdef{cms@chap@\thefield{#1}}{\the\value{chapter}}}% + \or% 4 + \ifundef{\chapter}% + {\csxdef{cms@invl@\thefield{#1}}% + {\the\value{\csuse{cms@noteref@interval}}}% + \csxdef{cms@sec@\thefield{#1}}{\the\value{section}}}% + {\csxdef{cms@invl@\thefield{#1}}% + {\the\value{\csuse{cms@noteref@interval}}}% + \csxdef{cms@sec@\thefield{#1}}{\the\value{section}}% + \csxdef{cms@chap@\thefield{#1}}{\the\value{chapter}}}% + \or% 5 + \csxdef{cms@invl@\thefield{#1}}% + {\the\value{\csuse{cms@noteref@interval}}}% + \fi}% + {}} + \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}} +\DeclareBiblatexOption{global,entry}[boolean]{supranotes}[true]{% + \settoggle{cms@supranotes}{#1}} -\DeclareBibliographyOption[boolean]{noneshort}[true]{% - \global\settoggle{cms@noneshort}{#1}} - -\DeclareTypeOption[boolean]{noneshort}[true]{% +\DeclareBiblatexOption{global,type,entry}[boolean]{noneshort}[true]{% \settoggle{cms@noneshort}{#1}} -\DeclareEntryOption[boolean]{noneshort}[true]{% - \settoggle{cms@noneshort}{#1}} - -\DeclareBibliographyOption{shorthandibid}[true]{% +\DeclareBibliographyOption[boolean]{shorthandibid}[true]{% \global\toggletrue{cms@shorthandibid}} -\DeclareBibliographyOption{shorthandfull}[true]{% +\DeclareBibliographyOption[boolean]{shorthandfull}[true]{% \settoggle{cms@fullshhand}{#1}} -\DeclareBibliographyOption{inheritshorthand}[true]{% - \settoggle{cms@inheritshhand}{#1} +\DeclareBibliographyOption[boolean]{inheritshorthand}[true]{% + \settoggle{cms@inheritshhand}{#1}% \iftoggle{cms@inheritshhand}% {\DeclareDataInheritance{*}{*}{% \inherit{shorthand}{shorthand} @@ -156,24 +838,16 @@ }}% {}}% -\DeclareBibliographyOption[boolean]{shorthandfirst}[true]{% +\DeclareBiblatexOption{global,entry}[boolean]{shorthandfirst}[true]{% \settoggle{cms@firstshort}{#1}} -\DeclareEntryOption[boolean]{shorthandfirst}[true]{% - \settoggle{cms@firstshort}{#1}} +\DeclareBibliographyOption[boolean]{compresspages}[true]{% + \global\settoggle{cms@comprange}{#1}}% -\DeclareBibliographyOption{compresspages}[true]{% - \ifcsdef{cms@opt@crange@#1}% - {\csuse{cms@opt@crange@#1}}% - {\blx@err@invopt{compresspages=#1}{}}}% -\def\cms@opt@crange@true{% - \global\toggletrue{cms@comprange}% - \setcounter{mincomprange}{100}% - \setcounter{mincompwidth}{10}% -}% -\def\cms@opt@crange@false{}% +\DeclareBibliographyOption[boolean]{compressyears}[true]{% + \global\settoggle{cms@compyears}{#1}}% -\DeclareBibliographyOption{postnotepunct}[true]{% +\DeclareBibliographyOption[string]{postnotepunct}[true]{% \ifcsdef{cms@opt@ppunct@#1}% {\csuse{cms@opt@ppunct@#1}}% {\blx@err@invopt{postnotepunct=#1}{}}}% @@ -181,25 +855,16 @@ \global\toggletrue{cms@modpostnote}}% \def\cms@opt@ppunct@false{}% -\DeclareBibliographyOption[boolean]{usecompiler}[true]{% - \settoggle{blx@usenamec}{#1}} - -\DeclareEntryOption[boolean]{usecompiler}[true]{% +\DeclareBiblatexOption{global,entry}[boolean]{usecompiler}[true]{% \settoggle{blx@usenamec}{#1}} -\DeclareBibliographyOption{juniorcomma}[true]{% +\DeclareBiblatexOption{global,entry}[boolean]{juniorcomma}[true]{% \settoggle{cms@jrcomma}{#1}} -\DeclareEntryOption{juniorcomma}[true]{% - \settoggle{cms@jrcomma}{#1}} - -\DeclareBibliographyOption{delayvolume}[true]{% - \settoggle{cms@postvol}{#1}} - -\DeclareEntryOption{delayvolume}[true]{% +\DeclareBiblatexOption{global,entry}[boolean]{delayvolume}[true]{% \settoggle{cms@postvol}{#1}} -\DeclareBibliographyOption{longcrossref}[false]{% +\DeclareBiblatexOption{global,entry}[string]{longcrossref}[false]{% \ifcsdef{cms@opt@lxref@#1}% {\csuse{cms@opt@lxref@#1}}% {\blx@err@invopt{longcrossref=#1}{}}}% @@ -221,12 +886,7 @@ \togglefalse{cms@citecrossref}% \toggletrue{cms@bibcrossref}}% -\DeclareEntryOption{longcrossref}[false]{% - \ifcsdef{cms@opt@lxref@#1}% - {\csuse{cms@opt@lxref@#1}}% - {\blx@err@invopt{longcrossref=#1}{}}}% - -\DeclareBibliographyOption{booklongxref}[true]{% +\DeclareBiblatexOption{global,entry}[string]{booklongxref}[true]{% \ifcsdef{cms@opt@bklxref@#1}% {\csuse{cms@opt@bklxref@#1}}% {\blx@err@invopt{booklongxref=#1}{}}}% @@ -243,24 +903,16 @@ \togglefalse{cms@bookcitexref}% \toggletrue{cms@bookbibxref}}% -\DeclareEntryOption{booklongxref}[true]{% - \ifcsdef{cms@opt@bklxref@#1}% - {\csuse{cms@opt@bklxref@#1}}% - {\blx@err@invopt{booklongxref=#1}{}}}% - -\DeclareBibliographyOption{omitxrefdate}[true]{% - \settoggle{cms@omitxrefdate}{#1}}% - -\DeclareEntryOption{omitxrefdate}[true]{% +\DeclareBiblatexOption{global,entry}[boolean]{omitxrefdate}[true]{% \settoggle{cms@omitxrefdate}{#1}}% -\DeclareBibliographyOption[boolean]{xrefurl}[true]{% +\DeclareBiblatexOption{global,entry}[boolean]{xrefurl}[true]{% \settoggle{cms@xrefurl}{#1}}% -\DeclareEntryOption[boolean]{xrefurl}[true]{% - \settoggle{cms@xrefurl}{#1}}% +\DeclareBibliographyOption[boolean]{blogurl}[true]{% + \settoggle{cms@blogurl}{#1}}% -\DeclareBibliographyOption[string]{journalabbrev}[false]{% +\DeclareBiblatexOption{global,entry}[string]{journalabbrev}[false]{% \ifcsdef{cms@opt@jtabb@#1}% {\csuse{cms@opt@jtabb@#1}}% {\csuse{cms@opt@jtabb@false}\cms@warning@noline% @@ -281,31 +933,43 @@ \togglefalse{cms@citejtabb}% \toggletrue{cms@bibjtabb}}% -\DeclareEntryOption[string]{journalabbrev}[false]{% - \ifcsdef{cms@opt@jtabb@#1}% - {\csuse{cms@opt@jtabb@#1}}% - {\csuse{cms@opt@jtabb@false}\cms@warning@noline% - {'journalabbrev=#1' isn't a valid option.\MessageBreak +\DeclareBiblatexOption{global,type,entry}[string]{seriesabbrev}[false]{% + \ifcsdef{cms@opt@shser@#1}% + {\csuse{cms@opt@shser@#1}}% + {\csuse{cms@opt@shser@false}\cms@warning@noline% + {'seriesabbrev=#1' isn't a valid option.\MessageBreak The default - 'false' - has been set.\MessageBreak Please see biblatex-chicago.pdf for valid\MessageBreak option keys}}}% +\def\cms@opt@shser@true{% + \toggletrue{cms@citeshser}% + \toggletrue{cms@bibshser}}% +\def\cms@opt@shser@false{% + \togglefalse{cms@citeshser}% + \togglefalse{cms@bibshser}}% +\def\cms@opt@shser@notes{% + \toggletrue{cms@citeshser}% + \togglefalse{cms@bibshser}}% +\def\cms@opt@shser@bib{% + \togglefalse{cms@citeshser}% + \toggletrue{cms@bibshser}}% \DeclareBibliographyOption[boolean]{ordinalgb}[true]{% \settoggle{cms@ukord}{#1}}% % The field-exclusion options % -\DeclareBibliographyOption[boolean]{urlnotes}[true]{% +\DeclareBiblatexOption{global,type,entry}[boolean]{urlnotes}[true]{% \settoggle{cms@url@innotes}{#1}}% -\DeclareEntryOption[boolean]{urlnotes}[true]{% - \settoggle{cms@url@innotes}{#1}}% +\DeclareBiblatexOption{global,type,entry}[boolean]{urlstamp}[true]{% + \settoggle{cms@urltime}{#1}}% -\DeclareBibliographyOption{isbn}[true]{% +\DeclareBiblatexOption{global,type,entry}[boolean]{isbn}[true]{% \settoggle{cms@isbn}{#1}}% -\DeclareBibliographyOption{url}[true]{% +\DeclareBiblatexOption{global,type,entry}[boolean]{url}[true]{% \settoggle{cms@url}{#1}}% -\DeclareBibliographyOption{doi}[true]{% +\DeclareBiblatexOption{global,type,entry}[string]{doi}[true]{% \ifcsdef{cms@opt@doi@#1}% {\csuse{cms@opt@doi@#1}}% {\blx@err@invopt{doi=#1}{}}}% @@ -315,64 +979,35 @@ \togglefalse{cms@doi}}% \def\cms@opt@doi@only{% \toggletrue{cms@doionly}}% -\DeclareBibliographyOption{eprint}[true]{% +\DeclareBiblatexOption{global,type,entry}[boolean]{eprint}[true]{% \settoggle{cms@eprint}{#1}}% -\DeclareBibliographyOption{numbermonth}[true]{% +\DeclareBiblatexOption{global,type,entry}[boolean]{numbermonth}[true]{% \settoggle{cms@numbermonth}{#1}}% -\DeclareBibliographyOption{bookpages}[true]{% +\DeclareBiblatexOption{global,type,entry}[boolean]{bookpages}[true]{% \settoggle{cms@bookpages}{#1}}% -\DeclareBibliographyOption{includeall}[true]{% +\DeclareBiblatexOption{global,type,entry}[boolean]{includeall}[true]{% \settoggle{cms@isbn}{#1}% \settoggle{cms@url}{#1}% + \settoggle{cms@urltime}{#1}% 17th ed. \settoggle{cms@doi}{#1}% \settoggle{cms@eprint}{#1}% \settoggle{cms@numbermonth}{#1}% \settoggle{cms@bookpages}{#1}}% -\DeclareBibliographyOption{hidevolumes}[true]{% +\DeclareBiblatexOption{global,type,entry}[boolean]{hidevolumes}[true]{% \settoggle{cms@hidevolumes}{#1}}% -\DeclareBibliographyOption{addendum}[true]{% +\DeclareBiblatexOption{global,type,entry}[boolean]{addendum}[true]{% \settoggle{cms@addendum}{#1}}% -\DeclareBibliographyOption{bookseries}[true]{% +\DeclareBiblatexOption{global,type,entry}[boolean]{bookseries}[true]{% \settoggle{cms@bookseries}{#1}}% -\DeclareBibliographyOption{notefield}[true]{% +\DeclareBiblatexOption{global,type,entry}[boolean]{notefield}[true]{% \settoggle{cms@notefield}{#1}}% \DeclareBibliographyOption{completenotes}[true]{% \settoggle{cms@addendum}{#1}% \settoggle{cms@bookseries}{#1}% \settoggle{cms@notefield}{#1}}% -\DeclareEntryOption{isbn}[true]{% - \settoggle{cms@isbn}{#1}}% -\DeclareEntryOption{url}[true]{% - \settoggle{cms@url}{#1}}% -\DeclareEntryOption{doi}[true]{% - \ifcsdef{cms@opt@doi@#1}% - {\iftoggle{cms@doi}% - {\togglefalse{cms@doi}% - \iftoggle{cms@doionly}% - {\togglefalse{cms@doionly}}% !! - {}}% - {\toggletrue{cms@doi}}% !! - \csuse{cms@opt@doi@#1}}% - {\blx@err@invopt{doi=#1}{}}}% -\DeclareEntryOption{eprint}[true]{% - \settoggle{cms@eprint}{#1}}% -\DeclareEntryOption{numbermonth}[true]{% - \settoggle{cms@numbermonth}{#1}}% -\DeclareEntryOption{bookpages}[true]{% - \settoggle{cms@bookpages}{#1}}% -\DeclareEntryOption{hidevolumes}[true]{% - \settoggle{cms@hidevolumes}{#1}}% - -\DeclareEntryOption{addendum}[true]{% - \settoggle{cms@addendum}{#1}}% -\DeclareEntryOption{bookseries}[true]{% - \settoggle{cms@bookseries}{#1}}% -\DeclareEntryOption{notefield}[true]{% - \settoggle{cms@notefield}{#1}}% - -\DeclareBibliographyOption[string]{related}[bib]{% +\DeclareBiblatexOption{global,type,entry}[string]{related}[bib]{% \ifcsdef{cms@opt@rel@#1}% {\csuse{cms@opt@rel@#1}}% {\csuse{cms@opt@rel@bib}\cms@warning@noline% @@ -393,39 +1028,18 @@ \settoggle{cms@citerel}{true}% \settoggle{cms@related}{false}}% -\DeclareEntryOption[string]{related}[bib]{% - \ifcsdef{cms@opt@rel@#1}% - {\csuse{cms@opt@rel@#1}}% - {\csuse{cms@opt@rel@bib}\cms@warning@noline% - {'related=#1' is not a valid option.\MessageBreak - The default - 'bib' - has been set.\MessageBreak - Please see biblatex-chicago.pdf for valid\MessageBreak - option keys}}}% - % Adding a disambiguating field to short notes otherwise identical % -\DeclareBibliographyOption[string]{shortextrafield}{% - \def\cms@xfield{#1}}% - -\DeclareTypeOption[string]{shortextrafield}{% - \def\cms@xfield{#1}}% - -\DeclareEntryOption[string]{shortextrafield}{% +\DeclareBiblatexOption{global,type,entry}[string]{shortextrafield}{% \def\cms@xfield{#1}}% -\DeclareBibliographyOption[string]{shortextraformat}{% - \def\cms@xformat{#1}}% - -\DeclareTypeOption[string]{shortextraformat}{% - \def\cms@xformat{#1}}% - -\DeclareEntryOption[string]{shortextraformat}{% +\DeclareBiblatexOption{global,type,entry}[string]{shortextraformat}{% \def\cms@xformat{#1}}% -\DeclareBibliographyOption[string]{shortextrapunct}[comma]{% +\DeclareBiblatexOption{global,type,entry}[string]{shortextrapunct}[comma]{% \ifcsdef{cms@opt@shxp@#1}% {\csuse{cms@opt@shxp@#1}}% - {\csuse{cms@opt@shxp@period}\cms@warning@noline% + {\csuse{cms@opt@shxp@comma}\cms@warning@noline% {'shortextrapunct=#1' is not a valid option.\MessageBreak The default - 'comma' - has been set.\MessageBreak Please see biblatex-chicago.pdf for valid\MessageBreak @@ -443,27 +1057,9 @@ \def\cms@opt@shxp@period{% \def\shortextrapunct{\addperiod\addspace}}% -\DeclareTypeOption[string]{shortextrapunct}[comma]{% - \ifcsdef{cms@opt@shxp@#1}% - {\csuse{cms@opt@shxp@#1}}% - {\csuse{cms@opt@shxp@period}\cms@warning@noline% - {'shortextrapunct=#1' is not a valid option.\MessageBreak - The default - 'comma' - has been set.\MessageBreak - Please see biblatex-chicago.pdf for valid\MessageBreak - option keys}}}% - -\DeclareEntryOption[string]{shortextrapunct}[comma]{% - \ifcsdef{cms@opt@shxp@#1}% - {\csuse{cms@opt@shxp@#1}}% - {\csuse{cms@opt@shxp@period}\cms@warning@noline% - {'shortextrapunct=#1' is not a valid option.\MessageBreak - The default - 'comma' - has been set.\MessageBreak - Please see biblatex-chicago.pdf for valid\MessageBreak - option keys}}}% - % Controlling punctuation before titleaddon fields % -\DeclareBibliographyOption[string]{ptitleaddon}[period]{% +\DeclareBiblatexOption{global,type,entry}[string]{ptitleaddon}[period]{% \ifcsdef{cms@opt@ptao@#1}% {\csuse{cms@opt@ptao@#1}}% {\csuse{cms@opt@ptao@period}\cms@warning@noline% @@ -484,16 +1080,7 @@ \def\cms@opt@ptao@period{% \def\ptitleaddonpunct{\addperiod\addspace}}% -\DeclareEntryOption[string]{ptitleaddon}[period]{% - \ifcsdef{cms@opt@ptao@#1}% - {\csuse{cms@opt@ptao@#1}}% - {\csuse{cms@opt@ptao@period}\cms@warning@noline% - {'ptitleaddon=#1' is not a valid option.\MessageBreak - The default - 'period' - has been set.\MessageBreak - Please see biblatex-chicago.pdf for valid\MessageBreak - option keys}}}% - -\DeclareBibliographyOption[string]{ctitleaddon}[comma]{% +\DeclareBiblatexOption{global,type,entry}[string]{ctitleaddon}[comma]{% \ifcsdef{cms@opt@ctao@#1}% {\csuse{cms@opt@ctao@#1}}% {\csuse{cms@opt@ctao@comma}\cms@warning@noline% @@ -514,18 +1101,9 @@ \def\cms@opt@ctao@period{% \def\ctitleaddonpunct{\addperiod\addspace}}% -\DeclareEntryOption[string]{ctitleaddon}[comma]{% - \ifcsdef{cms@opt@ctao@#1}% - {\csuse{cms@opt@ctao@#1}}% - {\csuse{cms@opt@ctao@comma}\cms@warning@noline% - {'ctitleaddon=#1' is not a valid option.\MessageBreak - The default - 'comma' - has been set.\MessageBreak - Please see biblatex-chicago.pdf for valid\MessageBreak - option keys}}}% - % Controlling punctuation before shorthand in notes % -\DeclareBibliographyOption[string]{shorthandpunct}[space]{% +\DeclareBiblatexOption{global,type,entry}[string]{shorthandpunct}[space]{% \ifcsdef{cms@opt@shp@#1}% {\csuse{cms@opt@shp@#1}}% {\csuse{cms@opt@shp@space}\cms@warning@noline% @@ -550,18 +1128,11 @@ \def\cms@opt@shp@endash{% \def\shorthandpunct{\addspace\textendash\addspace}}% -\DeclareEntryOption[string]{shorthandpunct}[space]{% - \ifcsdef{cms@opt@shp@#1}% - {\csuse{cms@opt@shp@#1}}% - {\csuse{cms@opt@shp@space}\cms@warning@noline% - {'shorthandpunct=#1' isn't a valid option.\MessageBreak - The default - 'space' - has been set.\MessageBreak - Please see biblatex-chicago.pdf for valid\MessageBreak - option keys}}}% - \ExecuteBibliographyOptions{includeall,completenotes,hidevolumes,% related,booklongxref,ptitleaddon,ctitleaddon,shorthandpunct,urlnotes,% - legalnotes,supranotes,shortextrapunct} + legalnotes,supranotes,shortextrapunct,dashed} + +\ExecuteBibliographyOptions[standard]{useeditor=false,usenamec=false}% \iftoggle{cms@legalnotes}% {\ExecuteBibliographyOptions[jurisdiction,legal,legislation]{skipbib}}% @@ -569,33 +1140,38 @@ % For author-date compatibility % -\DeclareEntryOption{switchdates}[true]{% +\DeclareEntryOption[boolean]{switchdates}[true]{% \settoggle{cms@switchdates}{#1}}% \DeclareEntryOption{cmsdate}{}% \DeclareBibliographyOption{cmsdate}{}% -\DeclareBibliographyOption{strict}[true]{% - \let\splitfootnoterule\footnoterule - \renewcommand\footnoterule{}% - \advance\skip\footins 4\p@\@plus2\p@\relax - \gdef\split@prev{0} - \let\pagefootnoterule\footnoterule - % \def\splitfootnoterule{\kern-3\p@ \hrule \kern2.6\p@} - \def\footnoterule{\relax - \ifnum\split@prev=\z@ - \pagefootnoterule - \else - \splitfootnoterule - \fi - \xdef\split@prev{\the\insertpenalties}% - }} +\DeclareBibliographyOption[boolean]{strict}[true]{% + \settoggle{cms@strict}{#1}% + \iftoggle{cms@strict}% + {\let\splitfootnoterule\footnoterule + \renewcommand\footnoterule{}% + \advance\skip\footins 4\p@\@plus2\p@\relax + \gdef\split@prev{0} + \let\pagefootnoterule\footnoterule + % \def\splitfootnoterule{\kern-3\p@ \hrule \kern2.6\p@} + \def\footnoterule{\relax + \ifnum\split@prev=\z@ + \pagefootnoterule + \else + \splitfootnoterule + \fi + \xdef\split@prev{\the\insertpenalties}% + }}% + {}} \protected\def\blx@newcunit{% - \global\let\blx@unitpunct\newcunitpunct - \global\toggletrue{blx@unit}}% + \iftoggle{blx@keepunit}% + {}% + {\global\let\blx@unitpunct\newcunitpunct + \global\toggletrue{blx@unit}}}% \appto\blx@blxinit{% \let\newcunit\blx@newcunit} @@ -670,7 +1246,7 @@ \usebibmacro{cite:save}}% {\global\toggletrue{cms@shortnote}% \global\togglefalse{cms@fullnote}% - \usebibmacro{cite:short}% + \usebibmacro{cite:short}{\thefield{entrytype}}% \usebibmacro{cite:save}}}% {\iftoggle{cms@shorthandibid}% {\ifthenelse{\ifciteibid\AND\NOT\iffirstonpage}% @@ -694,12 +1270,12 @@ {\global\toggletrue{cms@shortnote}% \global\togglefalse{cms@fullnote}% \global\toggletrue{cms@printshhand}% - \usebibmacro{cite:short}% + \usebibmacro{cite:short}{\thefield{entrytype}}% \usebibmacro{cite:save}}% {\global\toggletrue{cms@fullnote}% \global\togglefalse{cms@shortnote}% - \usebibmacro{cite:full}% \usebibmacro{footcite:save}% FIXME!! + \usebibmacro{cite:full}% \usebibmacro{cite:save}}}}}% \newbibmacro*{cite:full}{% @@ -708,17 +1284,14 @@ {\DeclareNameAlias{sortname}{default}\frenchspacing}% {cite:\thefield{entrytype}}}}% -\newbibmacro*{cite:short}{% - \ifentrytype{jurisdiction}% - {\usebibmacro{cite:short:jurisdiction}}% - {\ifentrytype{legal}% - {\usebibmacro{cite:short:legal}}% - {\ifentrytype{legislation}% - {\usebibmacro{cite:short:legislation}}% - {\usebibmacro{cite:short:cms}}}}}% - -\newbibmacro*{cite:short:cms}{% was cite:short - \usebibmacro{allshort+firstcite+xref}% +% {<entrytype>} +\newbibmacro*{cite:short}[1]{% + \global\let\cms@pnsaved\undefined% + \ifcsundef{cite:short:#1}% + {\csuse{cite:short:book}}% + {\csuse{cite:short:#1}}} + +\newbibmacro*{cite:short:ibid}{% For 17th edition \ifthenelse{\ifnameundef{labelname}\OR% \ifentrytype{inreference}\OR% \ifentrytype{reference}\OR% @@ -741,77 +1314,41 @@ togl {cms@bibjtabb}% )) }% - {\printfield[shortjournal]{shortjournal}\newcunit}% - {\printfield[journaltitle]{journaltitle}\newcunit}}% + {\cmshyper{\printfield[shortjournal]{shortjournal}}\newcunit}% + {\cmshyper{\printfield[journaltitle]{journaltitle}}\newcunit}}% {}}% {\ifentrytype{manual}% - {\printlist{organization}\isdot\newcunit}% - {}}}% - {\ifboolexpr{% - test {\ifciteidem}% - and - not test {\ifbibliography}% - and - not test {\iffirstonpage}% - and - not togl {cms@noidem}% - and - not togl {cms@headlessnote}% - }% - {\bibstring[\mkibid]{idem\thefield{gender}}% - \classicpunct}% - {\iffieldequalstr{authortype}{anon}% - {\bibleftbracket\printnames{labelname}% + {\cmshyper{\printlist{organization}\isdot}\newcunit}% + {\ifboolexpr{% + test {\iffieldequalstr{entrysubtype}{tvepisode}}% + and + not test {\iffieldundef{title}}% + and + not test {\iffieldundef{booktitle}}% + and + test {\iffieldundef{shorttitle}}% + }% + {\cmshyper{\printtext[booktitle]{% + \printfield[btnoformat]{booktitle}% + \setunit{\subtitlepunct}% + \printfield[sbtnoformat]{booksubtitle}}% + \setunit{\ctitleaddonpunct}% + \printfield{booktitleaddon}}}% + {\cmshyper{\printfield[citetitle]{labeltitle}}}}}}% + {\iffieldequalstr{authortype}{anon}% + {\bibleftbracket\cmshyper{\printnames{labelname}}% + \bibrightbracket\classicpunct}% + {\iffieldequalstr{authortype}{anon?}% + {\bibleftbracket\cmshyper{\printnames{labelname}?}% \bibrightbracket\classicpunct}% - {\iffieldequalstr{authortype}{anon?}% - {\bibleftbracket\printnames{labelname}?% - \bibrightbracket\classicpunct}% - {\printnames{labelname}%\usebibmacro{choose+labelname}% - \isdot\classicpunct}}}}% - \ifboolexpr{% - ( - test {\ifentrytype{review}}% - or - test {\ifentrytype{suppperiodical}}% - ) - and - test {\iffieldequalstr{relatedtype}{reviewof}}% - and - togl {cms@citerel}% - }% - {\usebibmacro{related:init}% - \usebibmacro{related}}% - {\ifboolexpr{% - togl {cms@allshort}% - or - test {\ifbibliography}% - }% - {\printtext[bibhyperref]{% - \printfield[citetitle]{labeltitle}}}% - {\printtext[cmshyperlink]{% - \printfield[citetitle]{labeltitle}}}% - \ifboolexpr{% - test {\ifuniquework}% - or - test {\ifcsundef{cms@xfield}}% - }% - {}% - {\setunit{\shortextrapunct}% - \usebibmacro{shortnote+extrafield}}}}%:\thefield{entrytype}? + {\cmshyper{\printnames{labelname}}%\usebibmacro{choose+labelname}% + \isdot\classicpunct}}}}% \newbibmacro*{shortnote+extrafield}{% Disambiguate otherwise identical \iffieldundef{\csuse{cms@xfield}}% short notes {\iflistundef{\csuse{cms@xfield}}% {\ifnameundef{\csuse{cms@xfield}}% - {\ifcsstring{cms@xfield}{date}% - {\printtext[\csuse{cms@xformat}]{\printdate}}% - {\ifcsstring{cms@xfield}{origdate}% - {\printtext[\csuse{cms@xformat}]{\printorigdate}}% - {\ifcsstring{cms@xfield}{eventdate}% - {\printtext[\csuse{cms@xformat}]{\printeventdate}}% - {\ifcsstring{cms@xfield}{urldate}% - {\printtext[\csuse{cms@xformat}]{\printurldate}}% - {\printtext[\csuse{cms@xformat}]{\cms@xfield}}}}}}% + {\cms@xtime}% See below; stops spurious parentheses appearing {\printtext[\csuse{cms@xformat}]{% \printnames[default]{\csuse{cms@xfield}}}}}% {\printtext[\csuse{cms@xformat}]{% @@ -838,41 +1375,135 @@ }% {\printtext[\csuse{cms@xformat}]{% \printfield[letterday]{\csuse{cms@xfield}}}}% + {\ifboolexpr{% + test {\ifcsstring{cms@xfield}{season}}% + or + test {\ifcsstring{cms@xfield}{origseason}}% + or + test {\ifcsstring{cms@xfield}{eventseason}}% + or + test {\ifcsstring{cms@xfield}{urlseason}}% + }% + {\printtext[\csuse{cms@xformat}]{% + \mkbibseason{\thefield{\csuse{cms@xfield}}}}}% + {\IfSubStr{\cms@xfield}{year}% + {\StrCut{\cms@xfield}{year}\cms@yeartype\cms@tempnull% + \iffieldundef{\csuse{cms@yeartype}year}% + {}% + {\printtext[\csuse{cms@xformat}]{% + \csuse{print\cms@yeartype dateextra}}}}% + {\printtext[\csuse{cms@xformat}]{% + \printfield{\csuse{cms@xfield}}}}}}}}}% + +\newrobustcmd*{\cms@xtime}{% Tests for presence of field before printing + \IfSubStr{\cms@xfield}{time}% + {\StrCut{\cms@xfield}{time}\cms@timetype\cms@tempnull% + \iffieldundef{\csuse{cms@timetype}hour}% + {}% + {\printtext[\csuse{cms@xformat}]{% + \csuse{print\cms@timetype date}% + \newcunit\csuse{print\cms@timetype time}}}}% + {\IfSubStr{\cms@xfield}{date}% + {\StrCut{\cms@xfield}{date}\cms@datetype\cms@tempnull% + \ifthenelse{\iffieldundef{\csuse{cms@datetype}year}\AND% + \iffieldundef{\csuse{cms@datetype}month}\AND% + \iffieldundef{\csuse{cms@datetype}season}}% + {}% {\printtext[\csuse{cms@xformat}]{% - \printfield{\csuse{cms@xfield}}}}}}}% + \csuse{print\cms@datetype date}}}}% + {}}} \newbibmacro*{footcite:save}{% + \iffootnote% + {\ifthenelse{\ifentrytype{jurisdiction}\OR\ifentrytype{legal}\OR% + \ifentrytype{legislation}}% + {\ifboolexpr{% + 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}}}% + {}}% + {\cms@save@locdata{entrykey}% + \label{cbx@\the\value{instcount}}}}% + {}} + +\newbibmacro*{print+noteref}{% \ifboolexpr{% - test {\iffootnote}% + togl {cms@noterefs}% + and + test {\ifbool{citetracker}}% For non-tracked citation commands and + not togl {cms@allshort}% + and + test {\iffootnote}% + and not ( + test {\ifentrytype{jurisdiction}}% + or 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}}}% - {}}% + {\usebibmacro{noteref+interval}}% + {}} -\newbibmacro*{cite:short:jurisdiction}{% +%%% The cite:short per-type macros, with helper macros %%% + +\csdef{cite:short:article}{% + \usebibmacro{allshort+firstcite+xref}% + \ifnameundef{labelname}% + {\iffieldequalstr{entrysubtype}{magazine}% + {\ifuseauthor% + {\ifboolexpr{% + not test {\iffieldundef{shortjournal}}% + and + (( + test {\ifcitation}% + and + togl {cms@citejtabb}% + ) + or + ( + test {\ifbibliography}% + and + togl {cms@bibjtabb}% + )) + }% + {\printfield[shortjournal]{shortjournal}\newcunit}% + {\printfield[journaltitle]{journaltitle}\newcunit}}% + {}}% + {}}% + {\usebibmacro{cms+name+idem}}% + \cmshyper{\printfield[citetitle]{labeltitle}}% + \usebibmacro{cms+extra+test}}% + +\csdef{cite:short:book}{% + \usebibmacro{allshort+firstcite+xref}% + \ifnameundef{labelname}% + {}% + {\usebibmacro{cms+name+idem}}% + \cmshyper{\printfield[citetitle]{labeltitle}}% + \usebibmacro{cms+extra+test}}% + +\csdef{cite:short:inreference}{% + \usebibmacro{allshort+firstcite+xref}% + \cmshyper{\printfield[citetitle]{labeltitle}}% + \usebibmacro{cms+extra+test}}% + +\csdef{cite:short:jurisdiction}{% \iffieldundef{labeltitle}% {}% - {\ifboolexpr{% - togl {cms@allshort}% - or - test {\ifbibliography}% - }% - {\printtext[bibhyperref]{% - \printfield[citetitle]{labeltitle}}}% - {\printtext[cmshyperlink]{% - \printfield[citetitle]{labeltitle}}}}% + {\cmshyper{\printfield[citetitle]{labeltitle}}}% \newcunit% Fixme: giving us a duplicate comma \printfield[jourvol]{volume}% \setunit*{\addnbspace}% @@ -887,18 +1518,10 @@ % \newcunit% \usebibmacro{juridpostnote}}% -\newbibmacro*{cite:short:legal}{% +\csdef{cite:short:legal}{% \iffieldundef{labeltitle}% {}% - {\ifboolexpr{% - togl {cms@allshort}% - or - test {\ifbibliography}% - }% - {\printtext[bibhyperref]{% - \printfield[citetitle]{labeltitle}}}% - {\printtext[cmshyperlink]{% - \printfield[citetitle]{labeltitle}}}}% + {\cmshyper{\printfield[citetitle]{labeltitle}}}% \newcunit% Fixme: giving us a duplicate comma \printfield[jourvol]{volume}% \setunit*{\addnbspace}% @@ -921,7 +1544,7 @@ {}% \usebibmacro{juridpostnote}}% -\newbibmacro*{cite:short:legislation}{% +\csdef{cite:short:legislation}{% \iffieldequalstr{entrysubtype}{constitution}% {\usebibmacro{clegis+news+title}% \setunit{\addspace}% @@ -931,15 +1554,7 @@ \newcunit% \printfield{chapter}}% {\iffieldequalstr{labeltitlesource}{shorttitle}% - {\ifboolexpr{% - togl {cms@allshort}% - or - test {\ifbibliography}% - }% - {\printtext[bibhyperref]{% - \printfield[citetitle]{labeltitle}}}% - {\printtext[cmshyperlink]{% - \printfield[citetitle]{labeltitle}}}}% + {\cmshyper{\printfield[citetitle]{labeltitle}}}% {\ifboolexpr{% test {\iffieldundef{shortjournal}}% or @@ -957,15 +1572,7 @@ {\printlist{location}% \setunit{\addspace}}% {}% - \ifboolexpr{% - togl {cms@allshort}% - or - test {\ifbibliography}% - }% - {\printtext[bibhyperref]{% - \printfield[citetitle]{labeltitle}}}% - {\printtext[cmshyperlink]{% - \printfield[citetitle]{labeltitle}}}% + \cmshyper{\printfield[citetitle]{labeltitle}}% \setunit{\addspace}% \printfield[juridnum]{number}% \newcunit% @@ -1006,7 +1613,185 @@ {}% \usebibmacro{juridpostnote}}% +\csdef{cite:short:manual}{% + \usebibmacro{allshort+firstcite+xref}% + \ifnameundef{labelname}% + {\ifboolexpr{% + test {\iflistundef{organization}}% + or + togl {cms@headlessnote}% + }% + {}% + {\printlist{organization}\isdot\newcunit}}% + {\usebibmacro{cms+name+idem}}% + \cmshyper{\printfield[citetitle]{labeltitle}}% + \usebibmacro{cms+extra+test}}% + +\csletcs{cite:short:mvreference}{cite:short:inreference}% + +\csdef{cite:short:online}{% + \usebibmacro{allshort+firstcite+xref}% + \ifnameundef{labelname}% + {}% + {\usebibmacro{cms+name+idem}}% + \ifboolexpr{% + test {\IfBeginWith{\thefield{title}}{CCCCCC}}% + and + test {\iffieldequalstr{relatedtype}{commenton}}% + and + togl {cms@citerel}% + }% + {\setcounter{cms@reviewcount}{\value{instcount}}% + \usebibmacro{related:init}% + \usebibmacro{related}}% + {\cmshyper{\printfield[citetitle]{labeltitle}}}% + \usebibmacro{cms+extra+test}}% + +\csdef{cite:short:periodical}{% + \usebibmacro{allshort+firstcite+xref}% + \ifnameundef{labelname}% + {}% + {\usebibmacro{cms+name+idem}}% + \iffieldundef{issuetitle}% + {\cmshyper{\printfield[citetitle]{labeltitle}}}% + {\printfield{issuetitle}} + \usebibmacro{cms+extra+test}}% + +\csletcs{cite:short:reference}{cite:short:inreference}% + +\csdef{cite:short:review}{% + \usebibmacro{allshort+firstcite+xref}% + \ifnameundef{labelname}% + {\iffieldequalstr{entrysubtype}{magazine}% + {\ifuseauthor% + {\ifboolexpr{% + not test {\iffieldundef{shortjournal}}% + and + (( + test {\ifcitation}% + and + togl {cms@citejtabb}% + ) + or + ( + test {\ifbibliography}% + and + togl {cms@bibjtabb}% + )) + }% + {\printfield[shortjournal]{shortjournal}\newcunit}% + {\printfield[journaltitle]{journaltitle}\newcunit}}% + {}}% + {}}% + {\usebibmacro{cms+name+idem}}% + \ifboolexpr{% + ( + test {\iffieldequalstr{relatedtype}{reviewof}}% + or + test {\iffieldequalstr{relatedtype}{commenton}}% + ) + and + togl {cms@citerel}% + }% + {\setcounter{cms@reviewcount}{\value{instcount}}% + \usebibmacro{related:init}% + \usebibmacro{related}}% + {\cmshyper{\printfield[citetitle]{labeltitle}}}% + \usebibmacro{cms+extra+test}}% + +\csdef{cite:short:standard}{% + \usebibmacro{allshort+firstcite+xref}% + \ifboolexpr{% + ( + togl {cms@allshort}% + and + not test {\ifciteseen}% + ) + or + not test {\iffieldundef{entrysubtype}}% + }% + {\ifnameundef{labelname}% + {\ifboolexpr{% + test {\iflistundef{organization}}% + or + togl {cms@headlessnote}% + }% + {}% + {\printlist{organization}\isdot\newcunit}}% + {\iffieldequalstr{authortype}{anon}% + {\bibleftbracket\printnames{labelname}% + \bibrightbracket\classicpunct}% + {\iffieldequalstr{authortype}{anon?}% + {\bibleftbracket\printnames{labelname}?% + \bibrightbracket\classicpunct}% + {\printnames{labelname}% + \isdot\classicpunct}}}}% + {}% + \cmshyper{\printfield[citetitle]{labeltitle}}% + \usebibmacro{cms+extra+test}} + +\csletcs{cite:short:suppperiodical}{cite:short:review}% + +\csdef{cite:short:video}{% + \usebibmacro{allshort+firstcite+xref}% + \ifnameundef{labelname}% + {}% + {\usebibmacro{cms+name+idem}}% + \ifboolexpr{% + test {\iffieldequalstr{entrysubtype}{tvepisode}}% + and + not test {\iffieldundef{title}}% + and + not test {\iffieldundef{booktitle}}% + }% + {\iffieldundef{shorttitle}% + {\cmshyper{\printtext[booktitle]{% + \printfield[btnoformat]{booktitle}% + \setunit{\subtitlepunct}% + \printfield[sbtnoformat]{booksubtitle}}% (?) + \setunit{\ctitleaddonpunct}% + \printfield{booktitleaddon}}}% + {\cmshyper{\printfield[citetitle]{labeltitle}}% + \setunit{\ctitleaddonpunct}% + \printfield{booktitleaddon}}}% + {\cmshyper{\printfield[citetitle]{labeltitle}}}% + \usebibmacro{cms+extra+test}}% + +\newbibmacro*{cms+extra+test}{% Used in previous defs + \ifboolexpr{% + test {\iffieldundef{extratitle}}% Most reliable test + or + test {\ifcsundef{cms@xfield}}% + }% + {}% + {\setunit{\shortextrapunct}% + \usebibmacro{shortnote+extrafield}}} + +\newbibmacro*{cms+name+idem}{% Used in previous defs + \ifboolexpr{% + test {\ifciteidem}% + and + not test {\ifbibliography}% + and + not test {\iffirstonpage}% + and + not togl {cms@noidem}% + and + not togl {cms@headlessnote}% + }% + {\bibstring[\mkibid]{idem\thefield{gender}}% + \classicpunct}% + {\iffieldequalstr{authortype}{anon}% + {\bibleftbracket\printnames{labelname}% + \bibrightbracket\classicpunct}% + {\iffieldequalstr{authortype}{anon?}% + {\bibleftbracket\printnames{labelname}?% + \bibrightbracket\classicpunct}% + {\printnames{labelname}% + \isdot\classicpunct}}}} + \newbibmacro*{cite:shorthand}{% + \global\let\cms@pnsaved\undefined% \ifthenelse{\ifentrytype{jurisdiction}\OR\ifentrytype{legal}\OR% \ifentrytype{legislation}}% {\usebibmacro{cite:shorthand:legal}}% @@ -1014,22 +1799,16 @@ \newbibmacro*{cite:shorthand:cms}{% \usebibmacro{allshort+firstcite+xref}% - \iftoggle{cms@allshort}% - {\printtext[bibhyperref]{% - \printfield{shorthand}}}% - {\printtext[cmshyperlink]{% - \printfield{shorthand}}}} + \cmshyper{\printfield{shorthand}}} \newbibmacro*{cite:shorthand:legal}{% \usebibmacro{allshort+firstcite+xref}% - \iftoggle{cms@allshort}% - {\printtext[bibhyperref]{% - \printfield{shorthand}}}% - {\printtext[cmshyperlink]{% - \printfield{shorthand}}}% + \cmshyper{\printfield{shorthand}}% \ifboolexpr{% test {\iffootnote}% and + togl {cms@supranotes}% + and ( test {\ifentrytype{legal}}% or @@ -1063,13 +1842,13 @@ {%\addspace%\setunit{\addspace}% Ditto \printfield{shorthandintro}}}} -\newbibmacro*{choose:ibidstring}{% +\newbibmacro*{cite:ibid}{% \ifthenelse{\ifentrytype{jurisdiction}\OR\ifentrytype{legal}\OR% \ifentrytype{legislation}}% - {\bibsstring[\mkbibemph]{ibidem}}% - {\bibstring[\mkibid]{ibidem}}} + {\usebibmacro{cite:ibid:legal}}% + {\usebibmacro{cite:ibid:cms}}} -\newbibmacro*{cite:ibid}{% +\newbibmacro*{cite:ibid:legal}{% \ifboolexpr{% togl {cms@noibid}% or @@ -1077,13 +1856,9 @@ }% {\global\toggletrue{cms@shortnote}% \global\togglefalse{cms@fullnote}% - \usebibmacro{cite:short}% + \usebibmacro{cite:short:legal}% \usebibmacro{cite:save}}% - {\iftoggle{cms@allshort}% - {\printtext[bibhyperref]{% - \usebibmacro{choose:ibidstring}}}%\bibstring[\mkibid]{ibidem} - {\printtext[cmshyperlink]{% - \usebibmacro{choose:ibidstring}}}%\bibstring[\mkibid]{ibidem} + {\cmshyper{\bibsstring[\mkbibemph]{ibidem}}% \ifboolexpr{% test {\ifloccit}% or @@ -1098,6 +1873,33 @@ {\global\toggletrue{cms@loccit}}% {}}}% +\newbibmacro*{cite:ibid:cms}{% + \iftoggle{cms@useibid}% + {\ifbibliography% + {\global\toggletrue{cms@shortnote}% + \global\togglefalse{cms@fullnote}% + \usebibmacro{cite:short}{\thefield{entrytype}}% + \usebibmacro{cite:save}}% + {\cmshyper{\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}% + \global\let\cms@pnsaved\undefined}% + {\global\let\cms@pnsaved\undefined}}}% + {\global\toggletrue{cms@shortnote}% + \global\togglefalse{cms@fullnote}% + \usebibmacro{cite:short:ibid}% + \usebibmacro{cite:save}}}% + \newbibmacro*{cite:journal}{% \ifthenelse{\ifciteibid\AND\NOT\iffirstonpage}% {\iffieldundef{prenote}% @@ -1105,7 +1907,7 @@ {\usebibmacro{cite:ibid}}% \usebibmacro{cite:save}}% {\iffieldundef{journaltitle}% - {\usebibmacro{cite:short}% + {\usebibmacro{cite:short}{\thefield{entrytype}}% \usebibmacro{cite:save}}% {\ifboolexpr{% test {\ifciteidem}% @@ -1257,7 +2059,7 @@ not test {\iffieldundef{shorthand}}% }% {\usebibmacro{cite}}% - {\usebibmacro{cite:short}}}% Would {cite} be better? + {\usebibmacro{cite:short}{\thefield{entrytype}}}}% Would {cite} be better? {}% {\usebibmacro{crossref:volume+postnote}}% Volume fix @@ -1283,7 +2085,7 @@ not test {\iffieldundef{shorthand}}% }% {\usebibmacro{cite}}% - {\usebibmacro{cite:short}}}% + {\usebibmacro{cite:short}{\thefield{entrytype}}}}% {}% {\usebibmacro{crossref:volume+postnote}}% Volume fix @@ -1326,8 +2128,8 @@ {\usebibmacro{citeindex}% \toggletrue{cms@fullnote}% \togglefalse{cms@shortnote}% - \usebibmacro{cite:full}% \usebibmacro{footcite:save}% + \usebibmacro{cite:full}% \usebibmacro{cite:save}} {\multicitedelim} {} @@ -1337,8 +2139,8 @@ {\usebibmacro{citeindex}% \toggletrue{cms@fullnote}% \togglefalse{cms@shortnote}% - \usebibmacro{cite:full}% \usebibmacro{footcite:save}% + \usebibmacro{cite:full}% \usebibmacro{cite:save}} {\multicitedelim} {} @@ -1348,7 +2150,7 @@ \ifhyperref% {\hypertarget{cite.\the\c@refsection @\abx@field@entrykey}{}}% {}% - \nopunct\unspace}% Put \nopunct and \unspace here for 0.8e. + \nopunct}% Remove \unspace for v. 2.0 {\usedriver {\DeclareNameAlias{sortname}{default}\clearfield{postnote}% \usebibmacro{clearorigin}\clearfield{userf}\clearfield{shorthand}% @@ -1383,29 +2185,30 @@ {\finentry} \DeclareCiteCommand{\headlessfullcite} - {\usebibmacro{hlprenote}}% + {\usebibmacro{prenote}}% {\printtext[bibhypertarget]{% \usedriver - {\DeclareNameAlias{sortname}{default}\usebibmacro{cite:save}% - \toggletrue{cms@fullnote}\toggletrue{cms@headlessnote}% - \usebibmacro{clear+labelname}\global\toggletrue{cms@noidem}}% + {\DeclareNameAlias{sortname}{default}\toggletrue{cms@fullnote}% + \toggletrue{cms@headlessnote}\usebibmacro{footcite:save}% + \usebibmacro{cite:save}\usebibmacro{clear+labelname}% + \global\toggletrue{cms@noidem}}% {cite:\thefield{entrytype}}}}% {\multicitedelim}% {}%\usebibmacro{finentry}} \DeclareCiteCommand{\headlesscite} - {\usebibmacro{hlcprenote}} + {\usebibmacro{prenote}} {\usebibmacro{citeindex}% \toggletrue{cms@headlessnote}% \usebibmacro{clear+labelname}% \clearname{labelname}% \usebibmacro{cite}% - \global\toggletrue{cms@noidem}} + \global\toggletrue{cms@noidem}}% {\multicitedelim} {\usebibmacro{cite:postnote}} \DeclareCiteCommand{\headlessparencite}[\mkbibparens] - {\usebibmacro{hlcprenote}} + {\usebibmacro{prenote}} {\usebibmacro{citeindex}% \toggletrue{cms@headlessnote}% \usebibmacro{clear+labelname}% @@ -1428,7 +2231,7 @@ \toggletrue{cms@shortnote}% \togglefalse{cms@fullnote}% \clearname{labelname}% - \usebibmacro{cite:short}}% + \usebibmacro{cite:short}{\thefield{entrytype}}}% \global\toggletrue{cms@noidem}} {\multicitedelim} {\usebibmacro{cite:postnote}} @@ -1445,12 +2248,12 @@ and not togl {cms@noneshort}% }% - {\usebibmacro{cite:short}} + {\usebibmacro{cite:short}{\thefield{entrytype}}}% {\renewbibmacro*{author/editor}{\usebibmacro{choose+surname}}% \renewbibmacro*{editor}{\usebibmacro{choose+surname}}% \renewbibmacro*{author}{\usebibmacro{choose+surname}}% - \usebibmacro{cite}}} - {\multicitedelim} + \usebibmacro{cite}}}% + {\multicitedelim}% {\usebibmacro{cite:postnote}} \DeclareMultiCiteCommand{\surnamecites}{surnamecite}{\multicitedelim} @@ -1460,11 +2263,35 @@ {\toggletrue{cms@shortnote}% \togglefalse{cms@fullnote}% \usebibmacro{citeindex}% - \usebibmacro{cite:short}% + \usebibmacro{cite:short}{\thefield{entrytype}}% + \usebibmacro{cite:save}} + {\multicitedelim} + {\usebibmacro{postnote}} + +\DeclareCiteCommand*{\shortcite} + {\boolfalse{citetracker}% + \boolfalse{pagetracker}% + \usebibmacro{prenote}}% + {\toggletrue{cms@shortnote}% + \togglefalse{cms@fullnote}% + \usebibmacro{citeindex}% + \usebibmacro{cite:short}{\thefield{entrytype}}% \usebibmacro{cite:save}} {\multicitedelim} {\usebibmacro{postnote}} +\DeclareCiteCommand{\shortrefcite} + {\usebibmacro{prenote}} + {\toggletrue{cms@shortnote}% + \togglefalse{cms@fullnote}% + \usebibmacro{citeindex}% + \usebibmacro{cite:short}{\thefield{entrytype}}% + \usebibmacro{cite:save}}% + {\multicitedelim} + {\toggletrue{cms@forcenoteref}% + \usebibmacro{postnote}% + \togglefalse{cms@forcenoteref}}% + \DeclareCiteCommand{\shorthandcite} {\usebibmacro{prenote}} {\usebibmacro{citeindex}% @@ -1481,6 +2308,42 @@ {\multicitedelim} {\usebibmacro{postnote}} +\DeclareCiteCommand*{\shorthandcite} + {\boolfalse{citetracker}% + \boolfalse{pagetracker}% + \usebibmacro{prenote}} + {\usebibmacro{citeindex}% + \iftoggle{cms@shorthandibid}% + {\ifthenelse{\ifciteibid\AND\NOT\iffirstonpage}% + {\usebibmacro{cite:ibid}% + \usebibmacro{cite:save}}% + {\usebibmacro{cite:shorthand}% + \usebibmacro{cite:save}% + \global\toggletrue{cms@noidem}}}% + {\usebibmacro{cite:shorthand}% + \usebibmacro{cite:save}% + \global\toggletrue{cms@noidem}}} + {\multicitedelim} + {\usebibmacro{postnote}} + +\DeclareCiteCommand{\shorthandrefcite} + {\usebibmacro{prenote}} + {\usebibmacro{citeindex}% + \iftoggle{cms@shorthandibid}% + {\ifthenelse{\ifciteibid\AND\NOT\iffirstonpage}% + {\usebibmacro{cite:ibid}% + \usebibmacro{cite:save}}% + {\usebibmacro{cite:shorthand}% + \usebibmacro{cite:save}% + \global\toggletrue{cms@noidem}}}% + {\usebibmacro{cite:shorthand}% + \usebibmacro{cite:save}% + \global\toggletrue{cms@noidem}}} + {\multicitedelim} + {\toggletrue{cms@forcenoteref}% + \usebibmacro{postnote}% + \togglefalse{cms@forcenoteref}} + \DeclareCiteCommand{\citejournal}% Name? {\usebibmacro{prenote}} {\toggletrue{cms@shortnote}% @@ -1494,6 +2357,15 @@ {}% {\usebibmacro{fullpostnote}}} +\DeclareCiteCommand{\runcite}% 17th ed. + {\usebibmacro{prenote}} + {\usebibmacro{citeindex}% + \toggletrue{cms@running@text}% + \usebibmacro{cite}% + \togglefalse{cms@running@text}} + {\multicitedelim} + {\usebibmacro{cite:postnote}} + \DeclareCiteCommand{\citeauthor} {\boolfalse{citetracker}% \boolfalse{pagetracker}% @@ -1507,10 +2379,21 @@ {\multicitedelim} {\usebibmacro{postnote}} +\newrobustcmd*{\Shortcite}{% + \@ifstar{\bibsentence\shortcite*}{\bibsentence\shortcite}}% + +\newrobustcmd*{\Shortrefcite}{\bibsentence\shortrefcite}% + +\newrobustcmd*{\Headlesscite}{\bibsentence\headlesscite} + +\newrobustcmd*{\Headlesscites}{\bibsentence\headlesscites} + \DeclareMultiCiteCommand{\citetitles}{citetitle}{\multicitedelim} \DeclareMultiCiteCommand{\headlesscites}{headlesscite}{\multicitedelim} +\DeclareMultiCiteCommand{\headlessfullcites}{headlessfullcite}{\multicitedelim} + \DeclareMultiCiteCommand{\headlessparencites}[\mkbibparens]% {headlessparencite}{\multicitedelim} @@ -1694,9 +2577,7 @@ \iffieldequalstr{entrysubtype}{magazine}% {\usebibmacro{bibindex}% \usebibmacro{cmag+news+author}% - \setunit{\addspace}% - \printfield{nameaddon}% - \newcunit\newblock + \usebibmacro{hlpunct}%\newcunit\newblock \usebibmacro{cmag+news+title}% \setunit{\addspace}% \usebibmacro{language+transtitle}% @@ -1710,8 +2591,9 @@ \printfield{note}% \setunit{\addcomma\addspace}\newblock \usebibmacro{mag+news+date}% - \usebibmacro{fullpostnote}% \newcunit\newblock + \printfield{type}% + \usebibmacro{fullpostnote}% \usebibmacro{caddendum}% \newcunit\newblock \iftoggle{cms@isbn}% @@ -1728,17 +2610,18 @@ togl {cms@citerel}% and not test {\iffieldequalstr{relatedtype}{reviewof}}% + and + not test {\iffieldundef{related}}% }% - {\usebibmacro{related:init}% - \usebibmacro{related}% - \newcunit}% - {}% - \usebibmacro{finentry}} + {\usebibmacro{related:init}% + \usebibmacro{related:noterefhelper}% + \usebibmacro{related}% + \newcunit}% + {}% + \usebibmacro{finentry}}% {\usebibmacro{bibindex}% \usebibmacro{author/editor}% - \setunit{\addspace}% - \printfield{nameaddon}% - \newcunit\newblock + \usebibmacro{hlpunct}%\newcunit\newblock \usebibmacro{cmag+news+title}% \setunit{\addspace}% \usebibmacro{language+transtitle}% @@ -1754,8 +2637,9 @@ \printfield{note}% \setunit{\addcomma\addspace}% \usebibmacro{cjournal+issue+year+pages}% - \usebibmacro{fullpostnote}% + \usebibmacro{eid+fullpostnote}% \newcunit\newblock + \printfield{eid}% \usebibmacro{caddendum}% \newcunit\newblock \iftoggle{cms@isbn}% @@ -1772,40 +2656,49 @@ togl {cms@citerel}% and not test {\iffieldequalstr{relatedtype}{reviewof}}% + and + not test {\iffieldundef{related}}% }% - {\usebibmacro{related:init}% - \usebibmacro{related}% - \newcunit}% - {}% + {\usebibmacro{related:init}% + \usebibmacro{related:noterefhelper}% + \usebibmacro{related}% + \newcunit}% + {}% \usebibmacro{finentry}}} \DeclareBibliographyDriver{cite:artwork}{% \usebibmacro{bibindex}% \usebibmacro{author/editor}% - \setunit{\addspace}% - \printfield{nameaddon}% - \setunit{\addcomma\addspace}\newblock + \usebibmacro{hlpunct}%\setunit{\addcomma\addspace}\newblock \usebibmacro{citaltitle+stitle}% \newcunit\newblock - \usebibmacro{date}% + \iffieldundef{origyear}% 17th ed. + {\printdate}% + {\usebibmacro{cmsorigdate}}% \newcunit \usebibmacro{byauthor}% \newcunit\newblock \usebibmacro{cbyeditor+others}% \newcunit\newblock - \printfield{howpublished}% + \ifthenelse{\iffieldundef{origyear}\OR\iffieldundef{year}}% 17th ed. + {}% + {\usebibmacro{date}}% \newcunit\newblock \printfield{type}% \newcunit\newblock - \printfield{version}% + \printfield[type]{version}% \newcunit\newblock \usebibmacro{cnotefield}% \newcunit\newblock \usebibmacro{institution+organization}% \newcunit\newblock \printlist{location}% - \usebibmacro{caddendum}% + \newcunit\newblock + \printfield{howpublished}% + \setunit*{\addspace}% + \usebibmacro{music+eventdate}% \usebibmacro{fullpostnote}% + \usebibmacro{caddendum}% \newcunit\newblock \usebibmacro{cite+doi+url}% \setunit{\shorthandpunct}% @@ -1813,8 +2706,13 @@ \newcunit\newblock \usebibmacro{pageref}% \newcunit\newblock - \iftoggle{cms@citerel}% + \ifboolexpr{% + togl {cms@citerel}% + and + not test {\iffieldundef{related}}% + }% {\usebibmacro{related:init}% + \usebibmacro{related:noterefhelper}% \usebibmacro{related}% \newcunit}% {}% @@ -1823,9 +2721,7 @@ \DeclareBibliographyDriver{cite:audio}{% \usebibmacro{bibindex}% \usebibmacro{author/editor}% - \setunit{\addspace}% - \printfield{nameaddon}% - \newcunit\newblock + \usebibmacro{hlpunct}%\newcunit\newblock \usebibmacro{ctitle+stitle}% \setunit{\addspace}\newblock% \usebibmacro{language+transtitle}% @@ -1834,6 +2730,8 @@ \newcunit \usebibmacro{cpart+editor+translator}% \newcunit + \usebibmacro{music+eventdate}% + \newcunit \usebibmacro{chapinscore}% \usebibmacro{btitle+bstitle}% \newcunit @@ -1878,7 +2776,6 @@ \newcunit \printfield{type}% \usebibmacro{volfullpostnote}% - \newcunit\newblock \usebibmacro{caddendum}% \newcunit\newblock \iftoggle{cms@isbn}% @@ -1893,8 +2790,13 @@ \newcunit\newblock \usebibmacro{pageref}% \newcunit\newblock - \iftoggle{cms@citerel}% + \ifboolexpr{% + togl {cms@citerel}% + and + not test {\iffieldundef{related}}% + }% {\usebibmacro{related:init}% + \usebibmacro{related:noterefhelper}% \usebibmacro{related}% \newcunit}% {}% @@ -1903,9 +2805,7 @@ \DeclareBibliographyDriver{cite:book}{% \usebibmacro{bibindex}% \usebibmacro{author/editor}% - \setunit{\addspace}% - \printfield{nameaddon}% - \newcunit\newblock + \usebibmacro{hlpunct}%\newcunit\newblock \usebibmacro{citaltitle+stitle}% \setunit{\addspace}% \usebibmacro{cite:xref+date}% @@ -1913,13 +2813,15 @@ \iffieldundef{maintitle}% {\iffieldundef{edition}% {}% - {\usebibmacro{edition}}}% + {\usebibmacro{edition}}% + \newcunit + \usebibmacro{version}}% 17th ed. {}% \newcunit \usebibmacro{byauthor}% \newcunit \usebibmacro{cpart+editor+translator}% - \newcunit + \newcunit% \ifboolexpr{% test {\iffieldundef{crossref}}% or @@ -1934,69 +2836,110 @@ or togl {cms@bookcitexref}% }% - {\usebibmacro{cmtitle+mstitle+vol+part+title+stitle}% - \newcunit\newblock - \iffieldundef{edition}% - {}% - {\usebibmacro{edition}}% - \newcunit - \usebibmacro{cbyeditor+others}% - \newcunit - \usebibmacro{volume+or+volumes}% - \newcunit\newblock - \usebibmacro{cser+num}% - \newcunit\newblock - \usebibmacro{cnotefield}% - \newcunit\newblock - \usebibmacro{cpubl+loc+year}% - \iftoggle{cms@bookpages}% - {}% - {\clearfield{pages}}% - \usebibmacro{caddendum}% - \usebibmacro{volfullpostnote}% - \newcunit\newblock - \printlist[][-\value{listtotal}]{lista}% - \newcunit\newblock - \iftoggle{cms@isbn}% - {\printfield{isbn}}% - {}% - \newcunit\newblock - \usebibmacro{cite+doi+url}% - \setunit{\shorthandpunct}% - \usebibmacro{cms:shorthandintro}% - \newcunit\newblock - \usebibmacro{pageref}% - \newcunit\newblock - \iftoggle{cms@citerel}% - {\usebibmacro{related:init}% - \usebibmacro{related}% - \newcunit}% - {}% - \usebibmacro{finentry}% - \usebibmacro{book:xref+finentry}}% - {\ifpunctmark{.}% This seems to work. + {\usebibmacro{cmtitle+mstitle+vol+part+title+stitle}% + \newcunit\newblock + \iffieldundef{edition}% + {}% + {\usebibmacro{edition}}% + \newcunit + \iffieldundef{version}% 17th ed. + {}% + {\usebibmacro{version}}% + \newcunit + \usebibmacro{cbyeditor+others}% + \newcunit + \usebibmacro{volume+or+volumes}% + \newcunit\newblock + \usebibmacro{cser+num}% + \newcunit\newblock + \usebibmacro{cnotefield}% + \newcunit\newblock + \usebibmacro{cpubl+loc+year}% + \iftoggle{cms@bookpages}% + {}% + {\clearfield{pages}}% + \usebibmacro{volfullpostnote}% + \newcunit\newblock + \printlist[][-\value{listtotal}]{lista}% + \newcunit\newblock + \printfield{type}% + \usebibmacro{caddendum}% + \newcunit\newblock + \iftoggle{cms@isbn}% + {\printfield{isbn}}% + {}% + \newcunit\newblock + \usebibmacro{cite+doi+url}% + \setunit{\shorthandpunct}% + \usebibmacro{cms:shorthandintro}% + \newcunit\newblock + \usebibmacro{pageref}% + \newcunit\newblock + \ifboolexpr{% + togl {cms@citerel}% + and + not test {\iffieldundef{related}}% + }% + {\usebibmacro{book:xref+finentry}% + \usebibmacro{related:init}% + \usebibmacro{related:noterefhelper}% + \usebibmacro{related}% + \newcunit}% + {\usebibmacro{book:xref+finentry}}% + \usebibmacro{finentry}}% + {\ifboolexpr{% + togl {cms@citerel}% + and + not test {\iffieldundef{related}}% + }% + {\usebibmacro{related:noterefhelper}}% + {}% + \ifpunctmark{.}% This seems to work. {\ifbibliography% {\setunit{\bibsentence}}{\addspace\bibsentence}}% {\ifbibliography{\unspace}{\addcomma\addspace}}% ?!? \usebibmacro{xrefprenote}% Volume fix \bookbibxrefcite{\thefield{xref}}% Removed \addspace from each. \usebibmacro{xrefpostnote}% + \ifboolexpr{% + togl {cms@citerel}% + and + not test {\iffieldundef{related}}% + }% + {\usebibmacro{related:init}% + \usebibmacro{related}% + \newcunit}% + {}% \usebibmacro{finentry}}}% - {\ifpunctmark{.}% This seems to work. - {\ifbibliography% - {\setunit{\bibsentence}}{\addspace\bibsentence}}% - {\ifbibliography{\unspace}{\addcomma\addspace}}% ?!? + {\ifboolexpr{% + togl {cms@citerel}% + and + not test {\iffieldundef{related}}% + }% + {\usebibmacro{related:noterefhelper}}% + {}% + \ifpunctmark{.}% This seems to work. + {\ifbibliography% + {\setunit{\bibsentence}}{\addspace\bibsentence}}% + {\ifbibliography{\unspace}{\addcomma\addspace}}% ?!? \usebibmacro{xrefprenote}% Volume fix \bookbibxrefcite{\thefield{crossref}}% \usebibmacro{xrefpostnote}% + \ifboolexpr{% + togl {cms@citerel}% + and + not test {\iffieldundef{related}}% + }% + {\usebibmacro{related:init}% + \usebibmacro{related}% + \newcunit}% + {}% \usebibmacro{finentry}}} \DeclareBibliographyDriver{cite:bookinbook}{% \usebibmacro{bibindex}% \usebibmacro{author/editor}% - \setunit{\addspace}% - \printfield{nameaddon}% - \newcunit\newblock + \usebibmacro{hlpunct}%\newcunit\newblock \usebibmacro{citaltitle+stitle}% \setunit{\addspace}% \usebibmacro{cite:xref+date}% @@ -2006,6 +2949,17 @@ \usebibmacro{cpart+editor+translator}% \setunit*{\addcomma\addspace}% \ifboolexpr{% + not togl {cms@citerel}% + or + ( + not test {\iffieldequalstr{relatedtype}{maintitle}}% + and + not test {\iffieldequalstr{relatedtype}{maintitlenc}}% + ) + or + test {\iffieldundef{related}}% + }% + {\ifboolexpr{% test {\iffieldundef{crossref}}% or not test {\ifentryseen{\thefield{crossref}}}% @@ -2019,65 +2973,126 @@ or togl {cms@bookcitexref}% }% - {\usebibmacro{cmtitle+mstitle+vol+part+btitle+bstitle}% - \newcunit - \iffieldundef{edition}% - {}% - {\usebibmacro{edition}}% - \newcunit - \usebibmacro{bybookauthor}% - \usebibmacro{cbyeditor+others}% - \newcunit - \usebibmacro{volume+or+volumes}% - \newcunit\newblock - \usebibmacro{cser+num}% - \newcunit\newblock - \usebibmacro{cnotefield}% - \newcunit\newblock - \usebibmacro{cpubl+loc+year}% - \usebibmacro{caddendum}% - \usebibmacro{volfullpostnote}% - \newcunit\newblock - \iftoggle{cms@isbn}% - {\printfield{isbn}}% - {}% - \newcunit\newblock - \usebibmacro{cite+doi+url}% - \setunit{\shorthandpunct}% - \usebibmacro{cms:shorthandintro}% - \newcunit\newblock - \usebibmacro{pageref}% - \newcunit\newblock - \iftoggle{cms@citerel}% - {\usebibmacro{related:init}% - \usebibmacro{related}% - \newcunit}% - {}% - \usebibmacro{finentry}% - \usebibmacro{book:xref+finentry}}% - {\ifpunctmark{.}% This seems to work. + {\usebibmacro{cmtitle+mstitle+vol+part+btitle+bstitle}% + \newcunit + \iffieldundef{edition}% + {}% + {\usebibmacro{edition}}% + \newcunit + \usebibmacro{bybookauthor}% + \usebibmacro{cbyeditor+others}% + \newcunit + \usebibmacro{volume+or+volumes}% + \newcunit\newblock + \usebibmacro{cser+num}% + \newcunit\newblock + \usebibmacro{cnotefield}% + \newcunit\newblock + \usebibmacro{cpubl+loc+year}% + \usebibmacro{volfullpostnote}% + \usebibmacro{caddendum}% + \newcunit\newblock + \iftoggle{cms@isbn}% + {\printfield{isbn}}% + {}% + \newcunit\newblock + \usebibmacro{cite+doi+url}% + \setunit{\shorthandpunct}% + \usebibmacro{cms:shorthandintro}% + \newcunit\newblock + \usebibmacro{pageref}% + \newcunit\newblock + \ifboolexpr{% + togl {cms@citerel}% + and + not test {\iffieldundef{related}}% + }% + {\usebibmacro{book:xref+finentry}% + \usebibmacro{related:init}% + \usebibmacro{related:noterefhelper}% + \usebibmacro{related}% + \newcunit}% + {\usebibmacro{book:xref+finentry}}% + \usebibmacro{finentry}}% + {\ifboolexpr{% + togl {cms@citerel}% + and + not test {\iffieldundef{related}}% + }% + {\usebibmacro{related:noterefhelper}}% + {}% + \ifpunctmark{.}% This seems to work. {\ifbibliography% {\setunit{\bibsentence}}{\addspace\bibsentence}}% {\ifbibliography{\unspace}{\addcomma\addspace}}% ?!? \usebibmacro{xrefprenote}% Volume fix \bookbibxrefcite{\thefield{xref}}% Removed \addspace from each. \usebibmacro{xrefpostnote}% + \ifboolexpr{% + togl {cms@citerel}% + and + not test {\iffieldundef{related}}% + }% + {\usebibmacro{related:init}% + \usebibmacro{related}% + \newcunit}% + {}% \usebibmacro{finentry}}}% - {\ifpunctmark{.}% This seems to work. - {\ifbibliography% - {\setunit{\bibsentence}}{\addspace\bibsentence}}% - {\ifbibliography{\unspace}{\addcomma\addspace}}% ?!? + {\ifboolexpr{% + togl {cms@citerel}% + and + not test {\iffieldundef{related}}% + }% + {\usebibmacro{related:noterefhelper}}% + {}% + \ifpunctmark{.}% This seems to work. + {\ifbibliography% + {\setunit{\bibsentence}}{\addspace\bibsentence}}% + {\ifbibliography{\unspace}{\addcomma\addspace}}% ?!? \usebibmacro{xrefprenote}% Volume fix \bookbibxrefcite{\thefield{crossref}}% \usebibmacro{xrefpostnote}% - \usebibmacro{finentry}}} + \ifboolexpr{% + togl {cms@citerel}% + and + not test {\iffieldundef{related}}% + }% + {\usebibmacro{related:init}% + \usebibmacro{related}% + \newcunit}% + {}% + \usebibmacro{finentry}}}% +{\entrydata{\thefield{related}}{% + \ifboolexpr{% + test {\ifentryseen{\thefield{clonesourcekey}}}% + and + not togl {cms@bookcitexref}% + }% + {\savefield{clonesourcekey}{\cms@shortmtkey}}% + {}}% + \iftoggle{cms@noterefs}{\addtocounter{instcount}{-1}}{}% Alternatives? + \ifcsundef{cms@shortmtkey}% + {\unspace% Needed for entries with langid (?) + \usebibmacro{related:init}% + \usebibmacro{related:noterefhelper}% + \usebibmacro{related:mtsave}% + \usebibmacro{related}% + \newcunit% + \usebibmacro{finentry}}% + {\ifpunctmark{.}% This seems to work. + {\ifbibliography% + {\setunit{\bibsentence}}{\addspace\bibsentence}}% + {\ifbibliography{\unspace}{\addcomma\addspace}}% ?!? + \usebibmacro{xrefprenote}% Volume fix + \bookbibxrefcite{\csuse{cms@shortmtkey}}% + \usebibmacro{xrefpostnote}% + \csgundef{cms@shortmtkey}% + \usebibmacro{finentry}}}} \DeclareBibliographyDriver{cite:booklet}{% \usebibmacro{bibindex}% \usebibmacro{author/editor}% - \setunit{\addspace}% - \printfield{nameaddon}% - \setunit{\addcomma\addspace}\newblock + \usebibmacro{hlpunct}%\setunit{\addcomma\addspace}\newblock \usebibmacro{citaltitle+stitle}% \newcunit\newblock \usebibmacro{byauthor}% @@ -2086,8 +3101,8 @@ \setunit{\addspace}\newblock% \printtext[parens]{% \usebibmacro{howpubl+loc+year}}% - \usebibmacro{caddendum}% \usebibmacro{fullpostnote}% + \usebibmacro{caddendum}% \newcunit\newblock \usebibmacro{cite+doi+url}% \setunit{\shorthandpunct}% @@ -2095,8 +3110,13 @@ \newcunit\newblock \usebibmacro{pageref}% \newcunit\newblock - \iftoggle{cms@citerel}% + \ifboolexpr{% + togl {cms@citerel}% + and + not test {\iffieldundef{related}}% + }% {\usebibmacro{related:init}% + \usebibmacro{related:noterefhelper}% \usebibmacro{related}% \newcunit}% {}% @@ -2105,9 +3125,7 @@ \DeclareBibliographyDriver{cite:collection}{% \usebibmacro{bibindex}% \usebibmacro{editor}% - \setunit{\addspace}% - \printfield{nameaddon}% - \setunit{\addcomma\addspace}\newblock + \usebibmacro{hlpunct}%\setunit{\addcomma\addspace}\newblock% \usebibmacro{citaltitle+stitle}% \setunit{\addspace} \usebibmacro{cite:xref+date}% @@ -2128,94 +3146,210 @@ or togl {cms@bookcitexref}% }% - {\usebibmacro{cmtitle+mstitle+vol+part+title+stitle}% - \newcunit\newblock - \iffieldundef{edition}% - {}% - {\usebibmacro{edition}}% - \newcunit - \usebibmacro{cbyeditor+others}% - \newcunit\newblock - \usebibmacro{volume+or+volumes}% - \newcunit\newblock - \usebibmacro{cser+num}% - \newcunit\newblock - \usebibmacro{cnotefield}% - \newcunit\newblock - \usebibmacro{cpubl+loc+year}% - \usebibmacro{caddendum}% - \usebibmacro{volfullpostnote}% - \newcunit\newblock - \iftoggle{cms@isbn}% - {\printfield{isbn}}% - {}% - \newcunit\newblock - \usebibmacro{cite+doi+url}% - \setunit{\shorthandpunct}% - \usebibmacro{cms:shorthandintro}% - \newcunit\newblock - \usebibmacro{pageref}% - \newcunit\newblock - \iftoggle{cms@citerel}% - {\usebibmacro{related:init}% - \usebibmacro{related}% - \newcunit}% - {}% - \usebibmacro{finentry}% - \usebibmacro{book:xref+finentry}}% - {\ifpunctmark{.}% This seems to work. + {\usebibmacro{cmtitle+mstitle+vol+part+title+stitle}% + \newcunit\newblock + \iffieldundef{edition}% + {}% + {\usebibmacro{edition}}% + \newcunit + \usebibmacro{cbyeditor+others}% + \newcunit\newblock + \usebibmacro{volume+or+volumes}% + \newcunit\newblock + \usebibmacro{cser+num}% + \newcunit\newblock + \usebibmacro{cnotefield}% + \newcunit\newblock + \usebibmacro{cpubl+loc+year}% + \usebibmacro{volfullpostnote}% + \usebibmacro{caddendum}% + \newcunit\newblock + \iftoggle{cms@isbn}% + {\printfield{isbn}}% + {}% + \newcunit\newblock + \usebibmacro{cite+doi+url}% + \setunit{\shorthandpunct}% + \usebibmacro{cms:shorthandintro}% + \newcunit\newblock + \usebibmacro{pageref}% + \newcunit\newblock + \ifboolexpr{% + togl {cms@citerel}% + and + not test {\iffieldundef{related}}% + }% + {\usebibmacro{book:xref+finentry}% + \usebibmacro{related:init}% + \usebibmacro{related:noterefhelper}% + \usebibmacro{related}% + \newcunit}% + {\usebibmacro{book:xref+finentry}}% + \usebibmacro{finentry}}% + {\ifboolexpr{% + togl {cms@citerel}% + and + not test {\iffieldundef{related}}% + }% + {\usebibmacro{related:noterefhelper}}% + {}% + \ifpunctmark{.}% This seems to work. {\ifbibliography% {\setunit{\bibsentence}}{\addspace\bibsentence}}% {\ifbibliography{\unspace}{\addcomma\addspace}}% ?!? \usebibmacro{xrefprenote}% Volume fix \bookbibxrefcite{\thefield{xref}}% Removed \addspace from each. \usebibmacro{xrefpostnote}% + \ifboolexpr{% + togl {cms@citerel}% + and + not test {\iffieldundef{related}}% + }% + {\usebibmacro{related:init}% + \usebibmacro{related}% + \newcunit}% + {}% \usebibmacro{finentry}}}% - {\ifpunctmark{.}% This seems to work. Only with Vol? + {\ifboolexpr{% + togl {cms@citerel}% + and + not test {\iffieldundef{related}}% + }% + {\usebibmacro{related:noterefhelper}}% + {}% + \ifpunctmark{.}% This seems to work. Only with Vol? {\ifbibliography% {\setunit{\bibsentence}}{\addspace\bibsentence}}% {\ifbibliography{\unspace}{\addcomma\addspace}}% ?!? \usebibmacro{xrefprenote}% Volume fix \bookbibxrefcite{\thefield{crossref}}% \usebibmacro{xrefpostnote}% + \ifboolexpr{% + togl {cms@citerel}% + and + not test {\iffieldundef{related}}% + }% + {\usebibmacro{related:init}% + \usebibmacro{related}% + \newcunit}% + {}% \usebibmacro{finentry}}} \DeclareBibliographyDriver{cite:customc}{% \usebibmacro{bibindex}% + \usebibmacro{justauthor}% + \iffieldundef{nameaddon}% + {\newcunit} + {\setunit{\addspace}}% + \usebibmacro{italtitle+stitle}% + \usebibmacro{finentry}} + +\DeclareBibliographyDriver{cite:dataset}{% + \usebibmacro{bibindex}% \usebibmacro{author/editor}% + \iftoggle{cms@headlessnote}{}{\setunit{\addspace}\newblock}% + \printtext[parens]{% + \printfield{title}% + \setunit{\subtitlepunct}% + \printfield[noformat]{subtitle}% + \setunit{\ctitleaddonpunct}% + \printfield{titleaddon}% + \setunit{\addspace}% + \usebibmacro{language+transtitle}% + \newcunit + \usebibmacro{byauthor}% + \newcunit\newblock + \usebibmacro{cbyeditor+others}% + \setunit{\addspace}\newblock% + \ifthenelse{\iffieldundef{howpublished}\AND% + \iffieldundef{number}\AND\iffieldundef{type}}% + {}% + {\printtext[parens]{% + \printfield{howpublished}% + \newcunit + \printfield{type}% + \setunit{\addspace}% + \printfield{number}}}% + \newcunit\newblock + \printfield{version}% + \newcunit\newblock + \printfield{note}% + \newcunit\newblock + \usebibmacro{institution+organization}% + \newcunit\newblock + \printlist{location}% + \setunit{\addsemicolon\addspace}% + \printurldate% + \ifboolexpr{% + togl {cms@urltime}% + and + not test {\iffieldundef{urlhour}}% + }% + {\newcunit\printurltime}% + {}}% + \usebibmacro{fullpostnote}% \newcunit\newblock - \printfield{nameaddon}% - \setunit*{\addspace}% - \usebibmacro{italtitle+stitle}% + \iffieldundef{pubstate}% + {}% + {\iffieldbibstring{pubstate}% + {\bibsstring{\thefield{pubstate}}}% + {\printfield[prenote]{pubstate}}% + \setunit{\addspace}}% + \usebibmacro{date}% + \clearfield{urlyear}% + \usebibmacro{caddendum}% + \newcunit\newblock + \usebibmacro{cite+doi+url}% + \setunit{\shorthandpunct}% + \usebibmacro{cms:shorthandintro}% + \newcunit\newblock + \usebibmacro{pageref}% + \newcunit\newblock + \ifboolexpr{% + togl {cms@citerel}% + and + not test {\iffieldundef{related}}% + }% + {\usebibmacro{related:init}% + \usebibmacro{related:noterefhelper}% + \usebibmacro{related}% + \newcunit}% + {}% \usebibmacro{finentry}} \DeclareBibliographyDriver{cite:image}{% \usebibmacro{bibindex}% \usebibmacro{author/editor}% - \setunit{\addspace}% - \printfield{nameaddon}% - \setunit{\addcomma\addspace}\newblock + \usebibmacro{hlpunct}%\setunit{\addcomma\addspace}\newblock \usebibmacro{citaltitle+stitle}% \newcunit%\setunit{\addcomma\addspace}% - \usebibmacro{date}% + \iffieldundef{origyear}% 17th ed. + {\printdate}% + {\usebibmacro{cmsorigdate}}% \newcunit \usebibmacro{byauthor}% \newcunit\newblock \usebibmacro{cbyeditor+others}% \newcunit\newblock - \printfield{howpublished}% + \ifthenelse{\iffieldundef{origyear}\OR\iffieldundef{year}}% 17th ed. + {}% + {\usebibmacro{date}}% \newcunit\newblock \printfield{type}% \newcunit\newblock - \printfield{version}% + \printfield[type]{version}% \newcunit\newblock \usebibmacro{cnotefield}% \newcunit\newblock \usebibmacro{institution+organization}% \newcunit\newblock \printlist{location}% - \usebibmacro{caddendum}% + \newcunit\newblock + \printfield{howpublished}% 17th ed. + \setunit*{\addspace}% + \usebibmacro{music+eventdate}% \usebibmacro{fullpostnote}% + \usebibmacro{caddendum}% \newcunit\newblock \usebibmacro{cite+doi+url}% \setunit{\shorthandpunct}% @@ -2223,8 +3357,13 @@ \newcunit\newblock \usebibmacro{pageref}% \newcunit\newblock - \iftoggle{cms@citerel}% + \ifboolexpr{% + togl {cms@citerel}% + and + not test {\iffieldundef{related}}% + }% {\usebibmacro{related:init}% + \usebibmacro{related:noterefhelper}% \usebibmacro{related}% \newcunit}% {}% @@ -2233,9 +3372,7 @@ \DeclareBibliographyDriver{cite:inbook}{% \usebibmacro{bibindex}% \usebibmacro{author/editor}% - \setunit{\addspace}% - \printfield{nameaddon}% - \newcunit\newblock + \usebibmacro{hlpunct}%\newcunit\newblock \usebibmacro{ctitle+stitle}% \setunit{\addspace}\newblock% \usebibmacro{language+transtitle}% @@ -2245,6 +3382,17 @@ \usebibmacro{cpart+editor+translator}% \setunit{\addcomma\addspace}% \ifboolexpr{% + not togl {cms@citerel}% + or + ( + not test {\iffieldequalstr{relatedtype}{maintitle}}% + and + not test {\iffieldequalstr{relatedtype}{maintitlenc}}% + ) + or + test {\iffieldundef{related}}% + }% + {\ifboolexpr{% test {\iffieldundef{crossref}}% or not test {\ifentryseen{\thefield{crossref}}}% @@ -2258,62 +3406,113 @@ or togl {cms@citecrossref}% }% - {\usebibmacro{chapincoll}% - \usebibmacro{cmtitle+mstitle+vol+part+btitle+bstitle}% - \newcunit - \iffieldundef{edition}% - {}% - {\usebibmacro{edition}}% - \newcunit - \usebibmacro{bybookauthor}% - \usebibmacro{cbyeditor+others}% - \newcunit - \usebibmacro{volume+or+volumes}% - \newcunit\newblock - \usebibmacro{cser+num}% - \newcunit\newblock - \usebibmacro{cnotefield}% - \newcunit\newblock - \usebibmacro{cpubl+loc+year}% - \usebibmacro{caddendum}% - \usebibmacro{volfullpostnote}% - \newcunit\newblock - \iftoggle{cms@isbn}% - {\printfield{isbn}}% - {}% - \newcunit\newblock - \usebibmacro{cite+doi+url}% - \setunit{\shorthandpunct}% - \usebibmacro{cms:shorthandintro}% - \newcunit\newblock - \usebibmacro{pageref}% - \newcunit\newblock - \iftoggle{cms@citerel}% - {\usebibmacro{related:init}% - \usebibmacro{related}% - \newcunit}% - {}% - \usebibmacro{finentry}% - \usebibmacro{cite:xref+finentry}}% -{\ifpunctmark{.}{\setunit{\addspace\bibsentence}}{\newcunit}% 16th ed. + {\usebibmacro{chapincoll}% + \usebibmacro{cmtitle+mstitle+vol+part+btitle+bstitle}% + \newcunit + \iffieldundef{edition}% + {}% + {\usebibmacro{edition}}% + \newcunit + \usebibmacro{bybookauthor}% + \usebibmacro{cbyeditor+others}% + \newcunit + \usebibmacro{volume+or+volumes}% + \newcunit\newblock + \usebibmacro{cser+num}% + \newcunit\newblock + \usebibmacro{cnotefield}% + \newcunit\newblock + \usebibmacro{cpubl+loc+year}% + \usebibmacro{volfullpostnote}% + \usebibmacro{caddendum}% + \newcunit\newblock + \iftoggle{cms@isbn}% + {\printfield{isbn}}% + {}% + \newcunit\newblock + \usebibmacro{cite+doi+url}% + \setunit{\shorthandpunct}% + \usebibmacro{cms:shorthandintro}% + \newcunit\newblock + \usebibmacro{pageref}% + \newcunit\newblock + \ifboolexpr{% + togl {cms@citerel}% + and + not test {\iffieldundef{related}}% + }% + {\usebibmacro{cite:xref+finentry}% + \usebibmacro{related:init}% + \usebibmacro{related:noterefhelper}% + \usebibmacro{related}% + \newcunit}% + {\usebibmacro{cite:xref+finentry}}% + \usebibmacro{finentry}}% + {\ifboolexpr{% + togl {cms@citerel}% + and + not test {\iffieldundef{related}}% + }% + {\usebibmacro{related:noterefhelper}}% + {}% + \ifpunctmark{.}{\setunit{\addspace\bibsentence}}{\newcunit}% 16th ed. \usebibmacro{xrefprenote}% Volume fix \usebibmacro{xrefchapincoll}% \bibxrefcite{\thefield{xref}}% Removed \addspace from each. \usebibmacro{xrefpostnote}% + \ifboolexpr{% + togl {cms@citerel}% + and + not test {\iffieldundef{related}}% + }% + {\usebibmacro{related:init}% + \usebibmacro{related}% + \newcunit}% + {}% \usebibmacro{finentry}}}% - {\ifpunctmark{.}{\setunit{\addspace\bibsentence}}{\newcunit}% 16th ed. + {\ifboolexpr{% + togl {cms@citerel}% + and + not test {\iffieldundef{related}}% + }% + {\usebibmacro{related:noterefhelper}}% + {}% + \ifpunctmark{.}{\setunit{\addspace\bibsentence}}{\newcunit}% 16th ed. \usebibmacro{xrefprenote}% Volume fix \usebibmacro{xrefchapincoll}% \bibxrefcite{\thefield{crossref}}% \usebibmacro{xrefpostnote}% - \usebibmacro{finentry}}} + \ifboolexpr{% + togl {cms@citerel}% + and + not test {\iffieldundef{related}}% + }% + {\usebibmacro{related:init}% + \usebibmacro{related}% + \newcunit}% + {}% + \usebibmacro{finentry}}}% +{\usebibmacro{extract+clonekey+note}% + \ifcsundef{cms@shortmtkey}% + {\unspace% Needed for entries with langid (?) + \usebibmacro{related:init}% + \usebibmacro{related:noterefhelper}% + \usebibmacro{related:mtsave}% + \usebibmacro{related}% + \newcunit% + \usebibmacro{finentry}}% + {\ifpunctmark{.}{\setunit{\addspace\bibsentence}}{\newcunit}% 16th ed. + \usebibmacro{xrefprenote}% Volume fix + \usebibmacro{xrefchapincoll}% + \bibxrefcite{\csuse{cms@shortmtkey}}% + \usebibmacro{xrefpostnote}% + \csgundef{cms@shortmtkey}% + \usebibmacro{finentry}}}} \DeclareBibliographyDriver{cite:incollection}{% \usebibmacro{bibindex}% \usebibmacro{author/editor}% - \setunit{\addspace}% - \printfield{nameaddon}% - \newcunit\newblock% + \usebibmacro{hlpunct}%\newcunit\newblock% \usebibmacro{ctitle+stitle}% \setunit{\addspace}\newblock% \usebibmacro{language+transtitle}% @@ -2323,6 +3522,17 @@ \usebibmacro{cpart+editor+translator}% \setunit{\addcomma\addspace}% \ifboolexpr{% + not togl {cms@citerel}% + or + ( + not test {\iffieldequalstr{relatedtype}{maintitle}}% + and + not test {\iffieldequalstr{relatedtype}{maintitlenc}}% + ) + or + test {\iffieldundef{related}}% + }% + {\ifboolexpr{% test {\iffieldundef{crossref}}% or not test {\ifentryseen{\thefield{crossref}}}% @@ -2353,8 +3563,8 @@ \usebibmacro{cnotefield}% \newcunit\newblock \usebibmacro{cpubl+loc+year}% - \usebibmacro{caddendum}% \usebibmacro{volfullpostnote}% + \usebibmacro{caddendum}% \newcunit\newblock \iftoggle{cms@isbn}% {\printfield{isbn}}% @@ -2366,32 +3576,83 @@ \newcunit\newblock \usebibmacro{pageref}% \newcunit\newblock - \iftoggle{cms@citerel}% - {\usebibmacro{related:init}% + \ifboolexpr{% + togl {cms@citerel}% + and + not test {\iffieldundef{related}}% + }% + {\usebibmacro{cite:xref+finentry}% + \usebibmacro{related:init}% + \usebibmacro{related:noterefhelper}% \usebibmacro{related}% \newcunit}% + {\usebibmacro{cite:xref+finentry}}% + \usebibmacro{finentry}}% + {\ifboolexpr{% + togl {cms@citerel}% + and + not test {\iffieldundef{related}}% + }% + {\usebibmacro{related:noterefhelper}}% {}% - \usebibmacro{finentry}% - \usebibmacro{cite:xref+finentry}}% - {\ifpunctmark{.}{\setunit{\addspace\bibsentence}}{\newcunit}% 16th ed. + \ifpunctmark{.}{\setunit{\addspace\bibsentence}}{\newcunit}% 16th ed. \usebibmacro{xrefprenote}% Volume fix \usebibmacro{xrefchapincoll}% \bibxrefcite{\thefield{xref}}% Removed \addspace from each. \usebibmacro{xrefpostnote}% + \ifboolexpr{% + togl {cms@citerel}% + and + not test {\iffieldundef{related}}% + }% + {\usebibmacro{related:init}% + \usebibmacro{related}% + \newcunit}% + {}% \usebibmacro{finentry}}}% - {\ifpunctmark{.}{\setunit{\addspace\bibsentence}}{\newcunit}% 16th ed. + {\ifboolexpr{% + togl {cms@citerel}% + and + not test {\iffieldundef{related}}% + }% + {\usebibmacro{related:noterefhelper}}% + {}% + \ifpunctmark{.}{\setunit{\addspace\bibsentence}}{\newcunit}% 16th ed. \usebibmacro{xrefprenote}% Volume fix \usebibmacro{xrefchapincoll}% \bibxrefcite{\thefield{crossref}}% \usebibmacro{xrefpostnote}% - \usebibmacro{finentry}}} + \ifboolexpr{% + togl {cms@citerel}% + and + not test {\iffieldundef{related}}% + }% + {\usebibmacro{related:init}% + \usebibmacro{related}% + \newcunit}% + {}% + \usebibmacro{finentry}}}% +{\usebibmacro{extract+clonekey+note}% + \ifcsundef{cms@shortmtkey}% + {\unspace% Needed for entries with langid (?) + \usebibmacro{related:init}% + \usebibmacro{related:noterefhelper}% + \usebibmacro{related:mtsave}% + \usebibmacro{related}% + \newcunit% + \usebibmacro{finentry}}% + {\ifpunctmark{.}{\setunit{\addspace\bibsentence}}{\newcunit}% 16th ed. + \usebibmacro{xrefprenote}% Volume fix + \usebibmacro{xrefchapincoll}% + \bibxrefcite{\csuse{cms@shortmtkey}}% + \usebibmacro{xrefpostnote}% + \csgundef{cms@shortmtkey}% + \usebibmacro{finentry}}}} \DeclareBibliographyDriver{cite:inproceedings}{% \usebibmacro{bibindex}% \usebibmacro{author/editor}% - \setunit{\addspace}% - \printfield{nameaddon}% - \newcunit\newblock + \usebibmacro{hlpunct}%\newcunit\newblock \usebibmacro{ctitle+stitle}% \setunit{\addspace}\newblock% \usebibmacro{language+transtitle}% @@ -2401,6 +3662,17 @@ \usebibmacro{cpart+editor+translator}% \setunit{\addcomma\addspace}% \ifboolexpr{% + not togl {cms@citerel}% + or + ( + not test {\iffieldequalstr{relatedtype}{maintitle}}% + and + not test {\iffieldequalstr{relatedtype}{maintitlenc}}% + ) + or + test {\iffieldundef{related}}% + }% + {\ifboolexpr{% test {\iffieldundef{crossref}}% or not test {\ifentryseen{\thefield{crossref}}}% @@ -2427,8 +3699,8 @@ \setunit{\addspace}\newblock% \printtext[parens]{% \usebibmacro{org+publ+loc+year}}% - \usebibmacro{caddendum}% \usebibmacro{volfullpostnote}% + \usebibmacro{caddendum}% \newcunit\newblock \iftoggle{cms@isbn}% {\printfield{isbn}}% @@ -2440,28 +3712,82 @@ \newcunit\newblock \usebibmacro{pageref}% \newcunit\newblock - \iftoggle{cms@citerel}% - {\usebibmacro{related:init}% + \ifboolexpr{% + togl {cms@citerel}% + and + not test {\iffieldundef{related}}% + }% + {\usebibmacro{cite:xref+finentry}% + \usebibmacro{related:init}% + \usebibmacro{related:noterefhelper}% \usebibmacro{related}% \newcunit}% + {\usebibmacro{cite:xref+finentry}}% + \usebibmacro{finentry}}% + {\ifboolexpr{% + togl {cms@citerel}% + and + not test {\iffieldundef{related}}% + }% + {\usebibmacro{related:noterefhelper}}% {}% - \usebibmacro{finentry}% - \usebibmacro{cite:xref+finentry}}% - {\ifpunctmark{.}{\setunit{\addspace\bibsentence}}{\newcunit}% 16th ed. + \ifpunctmark{.}{\setunit{\addspace\bibsentence}}{\newcunit}% 16th ed. \usebibmacro{xrefprenote}% Volume fix \usebibmacro{xrefchapincoll}% \bibxrefcite{\thefield{xref}}% \usebibmacro{xrefpostnote}% + \ifboolexpr{% + togl {cms@citerel}% + and + not test {\iffieldundef{related}}% + }% + {\usebibmacro{related:init}% + \usebibmacro{related}% + \newcunit}% + {}% \usebibmacro{finentry}}}% - {\ifpunctmark{.}{\setunit{\addspace\bibsentence}}{\newcunit}% 16th ed. + {\ifboolexpr{% + togl {cms@citerel}% + and + not test {\iffieldundef{related}}% + }% + {\usebibmacro{related:noterefhelper}}% + {}% + \ifpunctmark{.}{\setunit{\addspace\bibsentence}}{\newcunit}% 16th ed. \usebibmacro{xrefprenote}% Volume fix \usebibmacro{xrefchapincoll}% \bibxrefcite{\thefield{crossref}}% \usebibmacro{xrefpostnote}% - \usebibmacro{finentry}}} + \ifboolexpr{% + togl {cms@citerel}% + and + not test {\iffieldundef{related}}% + }% + {\usebibmacro{related:init}% + \usebibmacro{related}% + \newcunit}% + {}% + \usebibmacro{finentry}}}% +{\usebibmacro{extract+clonekey+note}% + \ifcsundef{cms@shortmtkey}% + {\unspace% Needed for entries with langid (?) + \usebibmacro{related:init}% + \usebibmacro{related:noterefhelper}% + \usebibmacro{related:mtsave}% + \usebibmacro{related}% + \newcunit% + \usebibmacro{finentry}}% + {\ifpunctmark{.}{\setunit{\addspace\bibsentence}}{\newcunit}% 16th ed. + \usebibmacro{xrefprenote}% Volume fix + \usebibmacro{xrefchapincoll}% + \bibxrefcite{\csuse{cms@shortmtkey}}% + \usebibmacro{xrefpostnote}% + \csgundef{cms@shortmtkey}% + \usebibmacro{finentry}}}} \DeclareBibliographyDriver{cite:inreference}{% \usebibmacro{bibindex}% + \iffieldundef{clonesourcekey}{}{\newcunit}% \usebibmacro{citaltitle+stitle}% \newcunit\newblock \ifthenelse{\iffieldundef{maintitle}\AND\iffieldundef{booktitle}}% @@ -2485,10 +3811,7 @@ \newcunit\newblock \usebibmacro{cser+num}% \newcunit\newblock - \usebibmacro{cnotefield}% - \newcunit\newblock - \usebibmacro{cpubl+loc+year}% - \usebibmacro{caddendum}% + \usebibmacro{crefpubl+loc+year}% 17th ed. \usebibmacro{inreffullpostnote}% \newcunit\newblock%setunit{\addspace}% 16th ed \ifnameundef{author}% @@ -2497,6 +3820,7 @@ \bibstring{by}% \addspace% \printnames{author}}}% + \usebibmacro{caddendum}% \newcunit\newblock \iftoggle{cms@isbn}% {\printfield{isbn}}% @@ -2508,8 +3832,13 @@ \newcunit\newblock \usebibmacro{pageref}% \newcunit\newblock - \iftoggle{cms@citerel}% + \ifboolexpr{% + togl {cms@citerel}% + and + not test {\iffieldundef{related}}% + }% {\usebibmacro{related:init}% + \usebibmacro{related:noterefhelper}% \usebibmacro{related}% \newcunit}% {}% @@ -2567,7 +3896,11 @@ \newcunit\newblock \usebibmacro{pageref}% \newcunit\newblock - \iftoggle{cms@citerel}% + \ifboolexpr{% + togl {cms@citerel}% + and + not test {\iffieldundef{related}}% + }% {\usebibmacro{related:init}% \usebibmacro{related}% \newcunit}% @@ -2624,7 +3957,11 @@ \newcunit\newblock \usebibmacro{pageref}% \newcunit\newblock - \iftoggle{cms@citerel}% + \ifboolexpr{% + togl {cms@citerel}% + and + not test {\iffieldundef{related}}% + }% {\usebibmacro{related:init}% \usebibmacro{related}% \newcunit}% @@ -2688,7 +4025,11 @@ \newcunit\newblock \usebibmacro{pageref}% \newcunit\newblock - \iftoggle{cms@citerel}% + \ifboolexpr{% + togl {cms@citerel}% + and + not test {\iffieldundef{related}}% + }% {\usebibmacro{related:init}% \usebibmacro{related}% \newcunit}% @@ -2698,9 +4039,7 @@ \DeclareBibliographyDriver{cite:legal}{% \usebibmacro{bibindex}% \usebibmacro{author/editor}% - \setunit{\addspace}% - \printfield{nameaddon}% - \newcunit\newblock + \usebibmacro{hlpunct}%\newcunit\newblock \usebibmacro{clegis+news+title}% \setunit{\addspace}% \usebibmacro{language+transtitle}% @@ -2754,7 +4093,11 @@ \newcunit\newblock \usebibmacro{pageref}% \newcunit\newblock - \iftoggle{cms@citerel}% + \ifboolexpr{% + togl {cms@citerel}% + and + not test {\iffieldundef{related}}% + }% {\usebibmacro{related:init}% \usebibmacro{related}% \newcunit}% @@ -2765,9 +4108,7 @@ \iffieldequalstr{entrysubtype}{uk}% FIXME? {\usebibmacro{bibindex}% \usebibmacro{author/editor}% - \setunit{\addspace}% - \printfield{nameaddon}% - \newcunit\newblock + \usebibmacro{hlpunct}%\newcunit\newblock \usebibmacro{clegis+news+title}% \setunit{\addspace}% \usebibmacro{language+transtitle}% @@ -2821,7 +4162,11 @@ \newcunit\newblock \usebibmacro{pageref}% \newcunit\newblock - \iftoggle{cms@citerel}% + \ifboolexpr{% + togl {cms@citerel}% + and + not test {\iffieldundef{related}}% + }% {\usebibmacro{related:init}% \usebibmacro{related}% \newcunit}% @@ -2830,9 +4175,7 @@ {\iffieldequalstr{entrysubtype}{hansard}% FIXME? {\usebibmacro{bibindex}% \usebibmacro{author/editor}% - \setunit{\addspace}% - \printfield{nameaddon}% - \newcunit\newblock + \usebibmacro{hlpunct}%\newcunit\newblock \usebibmacro{clegis+news+title}% \setunit{\addspace}% \usebibmacro{language+transtitle}% @@ -2880,7 +4223,11 @@ \newcunit\newblock \usebibmacro{pageref}% \newcunit\newblock - \iftoggle{cms@citerel}% + \ifboolexpr{% + togl {cms@citerel}% + and + not test {\iffieldundef{related}}% + }% {\usebibmacro{related:init}% \usebibmacro{related}% \newcunit}% @@ -2888,9 +4235,7 @@ \usebibmacro{finentry}} {\usebibmacro{bibindex}% \usebibmacro{author/editor}% - \setunit{\addspace}% - \printfield{nameaddon}% - \newcunit\newblock + \usebibmacro{hlpunct}%\newcunit\newblock \usebibmacro{clegis+news+title}% \setunit{\addspace}% \usebibmacro{language+transtitle}% @@ -2952,7 +4297,11 @@ \newcunit\newblock \usebibmacro{pageref}% \newcunit\newblock - \iftoggle{cms@citerel}% + \ifboolexpr{% + togl {cms@citerel}% + and + not test {\iffieldundef{related}}% + }% {\usebibmacro{related:init}% \usebibmacro{related}% \newcunit}% @@ -2974,6 +4323,17 @@ \usebibmacro{cpart+editor+translator}% \setunit*{\addcomma\addspace}% \ifboolexpr{% + not togl {cms@citerel}% + or + ( + not test {\iffieldequalstr{relatedtype}{maintitle}}% + and + not test {\iffieldequalstr{relatedtype}{maintitlenc}}% + ) + or + test {\iffieldundef{related}}% + }% + {\ifboolexpr{% test {\iffieldundef{crossref}}% or not test {\ifentryseen{\thefield{crossref}}}% @@ -3004,8 +4364,8 @@ \usebibmacro{cnotefield}% \newcunit\newblock \usebibmacro{cpubletter+loc+year}% - \usebibmacro{caddendum}% \usebibmacro{volfullpostnote}% + \usebibmacro{caddendum}% \newcunit\newblock \iftoggle{cms@isbn}% {\printfield{isbn}}% @@ -3017,32 +4377,83 @@ \newcunit\newblock \usebibmacro{pageref}% \newcunit\newblock - \iftoggle{cms@citerel}% - {\usebibmacro{related:init}% + \ifboolexpr{% + togl {cms@citerel}% + and + not test {\iffieldundef{related}}% + }% + {\usebibmacro{cite:xref+finentry}% + \usebibmacro{related:init}% + \usebibmacro{related:noterefhelper}% \usebibmacro{related}% - \newcunit}% + \newcunit}% + {\usebibmacro{cite:xref+finentry}}% + \usebibmacro{finentry}}% + {\ifboolexpr{% + togl {cms@citerel}% + and + not test {\iffieldundef{related}}% + }% + {\usebibmacro{related:noterefhelper}}% {}% - \usebibmacro{finentry}% - \usebibmacro{cite:xref+finentry}}% - {\ifpunctmark{.}{\setunit{\addspace\bibsentence}}{\newcunit}% 16th ed. + \ifpunctmark{.}{\setunit{\addspace\bibsentence}}{\newcunit}% 16th ed. \usebibmacro{xrefprenote}% Volume fix \usebibmacro{xrefchapincoll}% \bibxrefcite{\thefield{xref}}% \usebibmacro{xrefpostnote}% + \ifboolexpr{% + togl {cms@citerel}% + and + not test {\iffieldundef{related}}% + }% + {\usebibmacro{related:init}% + \usebibmacro{related}% + \newcunit}% + {}% \usebibmacro{finentry}}}% - {\ifpunctmark{.}{\setunit{\addspace\bibsentence}}{\newcunit}% 16th ed. + {\ifboolexpr{% + togl {cms@citerel}% + and + not test {\iffieldundef{related}}% + }% + {\usebibmacro{related:noterefhelper}}% + {}% + \ifpunctmark{.}{\setunit{\addspace\bibsentence}}{\newcunit}% 16th ed. \usebibmacro{xrefprenote}% Volume fix \usebibmacro{xrefchapincoll}% \bibxrefcite{\thefield{crossref}}% \usebibmacro{xrefpostnote}% - \usebibmacro{finentry}}} + \ifboolexpr{% + togl {cms@citerel}% + and + not test {\iffieldundef{related}}% + }% + {\usebibmacro{related:init}% + \usebibmacro{related}% + \newcunit}% + {}% + \usebibmacro{finentry}}}% +{\usebibmacro{extract+clonekey+note}% + \ifcsundef{cms@shortmtkey}% + {\unspace% Needed for entries with langid (?) + \usebibmacro{related:init}% + \usebibmacro{related:noterefhelper}% + \usebibmacro{related:mtsave}% + \usebibmacro{related}% + \newcunit% + \usebibmacro{finentry}}% + {\ifpunctmark{.}{\setunit{\addspace\bibsentence}}{\newcunit}% 16th ed. + \usebibmacro{xrefprenote}% Volume fix + \usebibmacro{xrefchapincoll}% + \bibxrefcite{\csuse{cms@shortmtkey}}% + \usebibmacro{xrefpostnote}% + \csgundef{cms@shortmtkey}% + \usebibmacro{finentry}}}} \DeclareBibliographyDriver{cite:manual}{% \usebibmacro{bibindex}% \usebibmacro{author+org}% - \setunit{\addspace}% - \printfield{nameaddon}% - \setunit{\addcomma\addspace}\newblock% + \usebibmacro{hlpunct}%\setunit{\addcomma\addspace}\newblock% \usebibmacro{citaltitle+stitle}% \newcunit \usebibmacro{edition}% @@ -3057,8 +4468,8 @@ \setunit{\addspace}\newblock% \printtext[parens]{% \usebibmacro{org+publ+loc+year}}% - \usebibmacro{caddendum}% \usebibmacro{fullpostnote}% + \usebibmacro{caddendum}% \newcunit\newblock \iftoggle{cms@isbn}% {\printfield{isbn}}% @@ -3070,8 +4481,13 @@ \newcunit\newblock \usebibmacro{pageref}% \newcunit\newblock - \iftoggle{cms@citerel}% + \ifboolexpr{% + togl {cms@citerel}% + and + not test {\iffieldundef{related}}% + }% {\usebibmacro{related:init}% + \usebibmacro{related:noterefhelper}% \usebibmacro{related}% \newcunit}% {}% @@ -3080,9 +4496,7 @@ \DeclareBibliographyDriver{cite:misc}{% \usebibmacro{bibindex}% \usebibmacro{author/editor}% - \setunit{\addspace}% - \printfield{nameaddon}% - \setunit{\addcomma\addspace}\newblock + \usebibmacro{hlpunct}%\setunit{\addcomma\addspace}\newblock \iffieldundef{entrysubtype}% {\usebibmacro{citaltitle+stitle}}% {\printfield{title}% @@ -3093,7 +4507,9 @@ \setunit{\addspace}% \usebibmacro{language+transtitle}% \newcunit% - \usebibmacro{unpubl+letter+date}}% + \usebibmacro{unpubl+letter+date}% + \newcunit + \printlist{origlocation}}% 17th ed. \newcunit \usebibmacro{byauthor}% \newcunit\newblock @@ -3107,15 +4523,18 @@ \newcunit\newblock \printfield{note}% \newcunit\newblock - \usebibmacro{institution+organization}% + \iffieldundef{entrysubtype}% + {\printfield{venue}\newcunit}% + {}% + \usebibmacro{misc+institution+organization}% \newcunit\newblock \printlist{location}% \iffieldundef{entrysubtype}% {\newcunit\newblock \usebibmacro{date}}% {}% - \usebibmacro{caddendum}% \usebibmacro{fullpostnote}% + \usebibmacro{caddendum}% \newcunit\newblock \usebibmacro{cite+doi+url}% \setunit{\shorthandpunct}% @@ -3123,8 +4542,13 @@ \newcunit\newblock \usebibmacro{pageref}% \newcunit\newblock - \iftoggle{cms@citerel}% + \ifboolexpr{% + togl {cms@citerel}% + and + not test {\iffieldundef{related}}% + }% {\usebibmacro{related:init}% + \usebibmacro{related:noterefhelper}% \usebibmacro{related}% \newcunit}% {}% @@ -3133,26 +4557,31 @@ \DeclareBibliographyDriver{cite:music}{% \usebibmacro{bibindex}% \usebibmacro{author/editor}% - \setunit{\addspace}% - \printfield{nameaddon}% - \setunit{\addcomma\addspace}\newblock + \usebibmacro{hlpunct}%\setunit{\addcomma\addspace}\newblock \usebibmacro{citaltitle+stitle}% \newcunit \usebibmacro{byauthor}% \newcunit\newblock \usebibmacro{cpart+editor+translator}% \newcunit\newblock + \ifthenelse{\iffieldundef{booktitle}\AND\iffieldundef{entrysubtype}}% + {\usebibmacro{cbyeditor+others}\newcunit\newblock}{}% \usebibmacro{music+eventdate}% \newcunit\newblock - \usebibmacro{chapinscore}% + \usebibmacro{cnotefield}% + \newcunit\newblock + \printfield{howpublished}% + \newcunit\newblock + \usebibmacro{chap+as+track}%inscore% 17th ed. + \usebibmacro{music+bookauthor}% Ditto \usebibmacro{btitle+bstitle}% \newcunit \iffieldundef{edition}% {}% {\usebibmacro{edition}}% \newcunit - \usebibmacro{bybookauthor}% - \usebibmacro{cbyeditor+others}% + \ifthenelse{\iffieldundef{booktitle}\AND\iffieldundef{entrysubtype}}% + {}{\usebibmacro{cbyeditor+others}}% \iffieldundef{maintitle}% {}% {\ifthenelse{\iffieldundef{volume}\AND\iffieldundef{part}}% @@ -3182,14 +4611,14 @@ \newcunit\newblock \printfield{version}% \newcunit\newblock - \usebibmacro{cnotefield}% - \newcunit\newblock - \usebibmacro{music+origdate}%\printtext[eventdate]{\printeventdate}% + \usebibmacro{music+origdate}% Altered for 17th ed. \newcunit\newblock \printlist{publisher}% \newcunit\newblock - \printfield{series}% - \setunit{\addspace}% + \usebibmacro{series+or+shortser}% + \ifboolexpr{test {\iflistundef{publisher}} and test {\iffieldundef{series}}}% + {\newcunit}% + {\setunit{\addspace}}% \printfield{number}% \newcunit\newblock \usebibmacro{date}% @@ -3200,10 +4629,9 @@ \newcunit\newblock \printfield{type}% \usebibmacro{fullpostnote}% - \newcunit\newblock \usebibmacro{caddendum}% \newcunit\newblock - \usebibmacro{pubstate}% 16th ed. + \usebibmacro{music+pubstate}% 17th ed. \newcunit\newblock \iftoggle{cms@isbn}% {\printfield{iswc}}% @@ -3215,43 +4643,535 @@ \newcunit\newblock \usebibmacro{pageref}% \newcunit\newblock - \iftoggle{cms@citerel}% + \ifboolexpr{% + togl {cms@citerel}% + and + not test {\iffieldundef{related}}% + }% {\usebibmacro{related:init}% + \usebibmacro{related:noterefhelper}% \usebibmacro{related}% \newcunit}% {}% \usebibmacro{finentry}} -\DeclareBibliographyAlias{cite:mvbook}{cite:book} +\DeclareBibliographyDriver{cite:mvbook}{% + \usebibmacro{bibindex}% + \usebibmacro{author/editor}% + \usebibmacro{hlpunct}%\newcunit\newblock + \usebibmacro{citaltitle+stitle}% + \setunit{\addspace}% + \usebibmacro{cite:xref+date}% + \usebibmacro{mt+mvnames+save}% + \newcunit + \iffieldundef{edition}% + {}% + {\usebibmacro{edition}}% + \newcunit + \usebibmacro{byauthor}% + \newcunit + \usebibmacro{cbyeditor+others}% + \newcunit + \usebibmacro{cpart+editor+translator}% + \ifthenelse{\iffieldequalstr{relatedtype}{maintitle}\OR% + \iffieldequalstr{relatedtype}{maintitlenc}}{}% + {\newcunit + \usebibmacro{volume+or+volumes}}% + \newcunit\newblock + \usebibmacro{cser+num}% + \ifboolexpr{% + not togl {cms@citerel}% + or + ( + not test {\iffieldequalstr{relatedtype}{maintitle}}% + and + not test {\iffieldequalstr{relatedtype}{maintitlenc}}% + ) + or + test {\iffieldundef{related}}% + }% + {\ifboolexpr{% + test {\iffieldundef{crossref}}% + or + not test {\ifentryseen{\thefield{crossref}}}% + or + togl {cms@bookcitexref}% + }% + {\ifboolexpr{% + test {\iffieldundef{xref}}% + or + not test {\ifentryseen{\thefield{xref}}}% + or + togl {cms@bookcitexref}% + }% + {\usebibmacro{cmtitle+mstitle+vol+part+title+stitle}% + \newcunit\newblock + \usebibmacro{cnotefield}% + \newcunit\newblock + \usebibmacro{cpubl+loc+year}% + \iftoggle{cms@bookpages}% + {}% + {\clearfield{pages}}% + \usebibmacro{volfullpostnote}% + \newcunit\newblock + \printlist[][-\value{listtotal}]{lista}% + \usebibmacro{caddendum}% + \newcunit\newblock + \iftoggle{cms@isbn}% + {\printfield{isbn}}% + {}% + \newcunit\newblock + \usebibmacro{cite+doi+url}% + \setunit{\shorthandpunct}% + \usebibmacro{cms:shorthandintro}% + \newcunit\newblock + \usebibmacro{pageref}% + \newcunit\newblock + \ifboolexpr{% + togl {cms@citerel}% + and + not test {\iffieldundef{related}}% + }% + {\usebibmacro{book:xref+finentry}% + \usebibmacro{related:init}% + \usebibmacro{related:noterefhelper}% + \usebibmacro{related}% + \newcunit}% + {\usebibmacro{book:xref+finentry}}% + \usebibmacro{finentry}}% + {\ifboolexpr{% + togl {cms@citerel}% + and + not test {\iffieldundef{related}}% + }% + {\usebibmacro{related:noterefhelper}}% + {}% + \ifpunctmark{.}% This seems to work. + {\ifbibliography% + {\setunit{\bibsentence}}{\addspace\bibsentence}}% + {\ifbibliography{\unspace}{\addcomma\addspace}}% ?!? + \usebibmacro{xrefprenote}% Volume fix + \bookbibxrefcite{\thefield{xref}}% Removed \addspace from each. + \usebibmacro{xrefpostnote}% + \ifboolexpr{% + togl {cms@citerel}% + and + not test {\iffieldundef{related}}% + }% + {\usebibmacro{related:init}% + \usebibmacro{related}% + \newcunit}% + {}% + \usebibmacro{finentry}}}% + {\ifboolexpr{% + togl {cms@citerel}% + and + not test {\iffieldundef{related}}% + }% + {\usebibmacro{related:noterefhelper}}% + {}% + \ifpunctmark{.}% This seems to work. + {\ifbibliography% + {\setunit{\bibsentence}}{\addspace\bibsentence}}% + {\ifbibliography{\unspace}{\addcomma\addspace}}% ?!? + \usebibmacro{xrefprenote}% Volume fix + \bookbibxrefcite{\thefield{crossref}}% + \usebibmacro{xrefpostnote}% + \ifboolexpr{% + togl {cms@citerel}% + and + not test {\iffieldundef{related}}% + }% + {\usebibmacro{related:init}% + \usebibmacro{related}% + \newcunit}% + {}% + \usebibmacro{finentry}}}% +{\unspace% Needed for entries with langid (?) + \usebibmacro{related:init}% + \usebibmacro{related:noterefhelper}% + \usebibmacro{related:mtsave}% + \usebibmacro{related}% + \newcunit% + \usebibmacro{finentry}}} -\DeclareBibliographyAlias{cite:mvcollection}{cite:collection} +\DeclareBibliographyDriver{cite:mvcollection}{% + \usebibmacro{bibindex}% + \usebibmacro{editor}% + \usebibmacro{hlpunct}%\setunit{\addcomma\addspace}\newblock% + \usebibmacro{citaltitle+stitle}% + \setunit{\addspace} + \usebibmacro{cite:xref+date}% + \usebibmacro{mt+mvnames+save}% + \newcunit + \iffieldundef{edition}% + {}% + {\usebibmacro{edition}}% + \newcunit + \usebibmacro{cpart+editor+translator}% + \newcunit + \usebibmacro{cbyeditor+others}% + \newcunit\newblock + \ifthenelse{\iffieldequalstr{relatedtype}{maintitle}\OR% + \iffieldequalstr{relatedtype}{maintitlenc}}{}% + {\newcunit\newblock + \usebibmacro{volume+or+volumes}}% + \newcunit\newblock + \usebibmacro{cser+num}% + \ifboolexpr{% + not togl {cms@citerel}% + or + ( + not test {\iffieldequalstr{relatedtype}{maintitle}}% + and + not test {\iffieldequalstr{relatedtype}{maintitlenc}}% + ) + or + test {\iffieldundef{related}}% + }% + {\ifboolexpr{% + test {\iffieldundef{crossref}}% + or + not test {\ifentryseen{\thefield{crossref}}}% + or + togl {cms@bookcitexref}% + }% + {\ifboolexpr{% + test {\iffieldundef{xref}}% + or + not test {\ifentryseen{\thefield{xref}}}% + or + togl {cms@bookcitexref}% + }% + {\usebibmacro{cmtitle+mstitle+vol+part+title+stitle}% + \newcunit\newblock + \usebibmacro{cnotefield}% + \newcunit\newblock + \usebibmacro{cpubl+loc+year}% + \usebibmacro{volfullpostnote}% + \usebibmacro{caddendum}% + \newcunit\newblock + \iftoggle{cms@isbn}% + {\printfield{isbn}}% + {}% + \newcunit\newblock + \usebibmacro{cite+doi+url}% + \setunit{\shorthandpunct}% + \usebibmacro{cms:shorthandintro}% + \newcunit\newblock + \usebibmacro{pageref}% + \newcunit\newblock + \ifboolexpr{% + togl {cms@citerel}% + and + not test {\iffieldundef{related}}% + }% + {\usebibmacro{book:xref+finentry}% + \usebibmacro{related:init}% + \usebibmacro{related:noterefhelper}% + \usebibmacro{related}% + \newcunit}% + {\usebibmacro{book:xref+finentry}}% + \usebibmacro{finentry}}% + {\ifboolexpr{% + togl {cms@citerel}% + and + not test {\iffieldundef{related}}% + }% + {\usebibmacro{related:noterefhelper}}% + {}% + \ifpunctmark{.}% This seems to work. + {\ifbibliography% + {\setunit{\bibsentence}}{\addspace\bibsentence}}% + {\ifbibliography{\unspace}{\addcomma\addspace}}% ?!? + \usebibmacro{xrefprenote}% Volume fix + \bookbibxrefcite{\thefield{xref}}% Removed \addspace from each. + \usebibmacro{xrefpostnote}% + \ifboolexpr{% + togl {cms@citerel}% + and + not test {\iffieldundef{related}}% + }% + {\usebibmacro{related:init}% + \usebibmacro{related}% + \newcunit}% + {}% + \usebibmacro{finentry}}}% + {\ifboolexpr{% + togl {cms@citerel}% + and + not test {\iffieldundef{related}}% + }% + {\usebibmacro{related:noterefhelper}}% + {}% + \ifpunctmark{.}% This seems to work. Only with Vol? + {\ifbibliography% + {\setunit{\bibsentence}}{\addspace\bibsentence}}% + {\ifbibliography{\unspace}{\addcomma\addspace}}% ?!? + \usebibmacro{xrefprenote}% Volume fix + \bookbibxrefcite{\thefield{crossref}}% + \usebibmacro{xrefpostnote}% + \ifboolexpr{% + togl {cms@citerel}% + and + not test {\iffieldundef{related}}% + }% + {\usebibmacro{related:init}% + \usebibmacro{related}% + \newcunit}% + {}% + \usebibmacro{finentry}}}% + {\unspace% Needed for entries with langid (?) + \usebibmacro{related:init}% + \usebibmacro{related:noterefhelper}% + \usebibmacro{related:mtsave}% + \usebibmacro{related}% + \newcunit% + \usebibmacro{finentry}}}% -\DeclareBibliographyAlias{cite:mvproceedings}{cite:proceedings} +\DeclareBibliographyDriver{cite:mvproceedings}{% + \usebibmacro{bibindex}% + \usebibmacro{editor}% + \usebibmacro{hlpunct}%\setunit{\addcomma\addspace}\newblock% + \usebibmacro{citaltitle+stitle}% + \setunit{\addspace} + \usebibmacro{cite:xref+date}% + \usebibmacro{mt+mvnames+save}% + \newcunit + \usebibmacro{cpart+editor+translator}% + \newcunit + \usebibmacro{cbyeditor+others}% + \newcunit\newblock + \ifthenelse{\iffieldequalstr{relatedtype}{maintitle}\OR% + \iffieldequalstr{relatedtype}{maintitlenc}}{}% + {\newcunit\newblock + \usebibmacro{volume+or+volumes}}% + \newcunit\newblock + \usebibmacro{cser+num}% + \ifboolexpr{% + not togl {cms@citerel}% + or + ( + not test {\iffieldequalstr{relatedtype}{maintitle}}% + and + not test {\iffieldequalstr{relatedtype}{maintitlenc}}% + ) + or + test {\iffieldundef{related}}% + }% + {\ifboolexpr{% + test {\iffieldundef{crossref}}% + or + not test {\ifentryseen{\thefield{crossref}}}% + or + togl {cms@bookcitexref}% + }% + {\ifboolexpr{% + test {\iffieldundef{xref}}% + or + not test {\ifentryseen{\thefield{xref}}}% + or + togl {cms@bookcitexref}% + }% + {\usebibmacro{cmtitle+mstitle+vol+part+title+stitle}% + \newcunit\newblock + \usebibmacro{cnotefield}% + \setunit{\addspace}\newblock% + \printtext[parens]{% + \usebibmacro{org+publ+loc+year}}% + \usebibmacro{volfullpostnote}% + \usebibmacro{caddendum}% + \newcunit\newblock + \iftoggle{cms@isbn}% + {\printfield{isbn}}% + {}% + \newcunit\newblock + \usebibmacro{cite+doi+url}% + \setunit{\shorthandpunct}% + \usebibmacro{cms:shorthandintro}% + \newcunit\newblock + \usebibmacro{pageref}% + \newcunit\newblock + \ifboolexpr{% + togl {cms@citerel}% + and + not test {\iffieldundef{related}}% + }% + {\usebibmacro{book:xref+finentry}% + \usebibmacro{related:init}% + \usebibmacro{related:noterefhelper}% + \usebibmacro{related}% + \newcunit}% + {\usebibmacro{book:xref+finentry}}% + \usebibmacro{finentry}}% + {\ifboolexpr{% + togl {cms@citerel}% + and + not test {\iffieldundef{related}}% + }% + {\usebibmacro{related:noterefhelper}}% + {}% + \ifpunctmark{.}% This seems to work. + {\ifbibliography% + {\setunit{\bibsentence}}{\addspace\bibsentence}}% + {\ifbibliography{\unspace}{\addcomma\addspace}}% ?!? + \usebibmacro{xrefprenote}% Volume fix + \bookbibxrefcite{\thefield{xref}}% Removed \addspace from each. + \usebibmacro{xrefpostnote}% + \ifboolexpr{% + togl {cms@citerel}% + and + not test {\iffieldundef{related}}% + }% + {\usebibmacro{related:init}% + \usebibmacro{related}% + \newcunit}% + {}% + \usebibmacro{finentry}}}% + {\ifboolexpr{% + togl {cms@citerel}% + and + not test {\iffieldundef{related}}% + }% + {\usebibmacro{related:noterefhelper}}% + {}% + \ifpunctmark{.}% This seems to work. + {\ifbibliography% + {\setunit{\bibsentence}}{\addspace\bibsentence}}% + {\ifbibliography{\unspace}{\addcomma\addspace}}% ?!? + \usebibmacro{xrefprenote}% Volume fix + \bookbibxrefcite{\thefield{crossref}}% + \usebibmacro{xrefpostnote}% + \ifboolexpr{% + togl {cms@citerel}% + and + not test {\iffieldundef{related}}% + }% + {\usebibmacro{related:init}% + \usebibmacro{related}% + \newcunit}% + {}% + \usebibmacro{finentry}}}% +{\unspace% Needed for entries with langid (?) + \usebibmacro{related:init}% + \usebibmacro{related:noterefhelper}% + \usebibmacro{related:mtsave}% + \usebibmacro{related}% + \newcunit% + \usebibmacro{finentry}}} -\DeclareBibliographyAlias{cite:mvreference}{cite:reference} +\DeclareBibliographyDriver{cite:mvreference}{% + \usebibmacro{bibindex}% + \usebibmacro{citaltitle+stitle}% + \newcunit\newblock + \iffieldundef{edition}% + {}% + {\usebibmacro{edition}}% + \newcunit + \usebibmacro{bybookauthor}% + \newcunit + \usebibmacro{cpart+editor+translator}% + \newcunit + \usebibmacro{cbyeditor+others}% + \ifthenelse{\iffieldequalstr{relatedtype}{maintitle}\OR% + \iffieldequalstr{relatedtype}{maintitlenc}}{}% + {\newcunit + \usebibmacro{volume+or+volumes}}% + \newcunit\newblock + \usebibmacro{cser+num}% + \setunit*{\addcomma\addspace}% + \ifboolexpr{% + not togl {cms@citerel}% + or + ( + not test {\iffieldequalstr{relatedtype}{maintitle}}% + and + not test {\iffieldequalstr{relatedtype}{maintitlenc}}% + ) + or + test {\iffieldundef{related}}% + }% + {\usebibmacro{cmtitle+mstitle+vol+part+btitle+bstitle}% + \newcunit\newblock + \usebibmacro{crefpubl+loc+year}% + \usebibmacro{volfullpostnote}% + \usebibmacro{caddendum}% + \newcunit\newblock + \iftoggle{cms@isbn}% + {\printfield{isbn}}% + {}% + \newcunit\newblock + \usebibmacro{cite+doi+url}% + \setunit{\shorthandpunct}% + \usebibmacro{cms:shorthandintro}% + \newcunit\newblock + \usebibmacro{pageref}% + \newcunit\newblock + \ifboolexpr{% + togl {cms@citerel}% + and + not test {\iffieldundef{related}}% + }% + {\usebibmacro{related:init}% + \usebibmacro{related:noterefhelper}% + \usebibmacro{related}% + \newcunit}% + {}% + \usebibmacro{finentry}}% + {\unspace% Needed for entries with langid (?) + \usebibmacro{related:init}% + \usebibmacro{related:noterefhelper}% + \usebibmacro{related:mtsave}% + \usebibmacro{related}% + \newcunit% + \usebibmacro{finentry}}} \DeclareBibliographyDriver{cite:online}{% \usebibmacro{bibindex}% \usebibmacro{author/editor}% - \setunit{\addspace}% - \printfield{nameaddon}% - \setunit{\addcomma\addspace}\newblock - \usebibmacro{ctitle+stitle}% - \setunit{\addspace}% - \usebibmacro{language+transtitle}% - \setunit{\addcomma\addspace}% - \usebibmacro{byauthor}% - \setunit{\addcomma\addspace}% - \printlist{organization}% Rearranged for 16th ed. - \setunit{\addcomma\addspace}% - \usebibmacro{cnotefield}% - \setunit{\addcomma\addspace} + \usebibmacro{hlpunct}%\setunit{\addcomma\addspace}\newblock + \IfBeginWith{\thefield{title}}{CCCCCC}% + {}% + {\usebibmacro{ctitle+stitle}% + \setunit{\addspace}% + \usebibmacro{language+transtitle}% + \setunit{\addcomma\addspace}% + \usebibmacro{byauthor}% + \setunit{\addcomma\addspace}% + \usebibmacro{cbyeditor+others}% + \newcunit\newblock + \printlist{organization}% Rearranged for 16th ed. + \setunit{\addcomma\addspace}% + \usebibmacro{cnotefield}% + \setunit{\addcomma\addspace}}% \usebibmacro{date}% + \usebibmacro{time+stamp}% + \newcunit\newblock + \printfield{type}% 17th ed. + \ifboolexpr{% + test {\iffieldequalstr{relatedtype}{commenton}}% + and + togl {cms@citerel}% + }% + {\toggletrue{cms@relreview}% + \usebibmacro{related:init}% + \usebibmacro{related:noterefhelper}% + \usebibmacro{related}% + \togglefalse{cms@relreview}}% + {}% \usebibmacro{fullpostnote}% - \setunit{\addcomma\addspace}% + \usebibmacro{caddendum}% + \newcunit\newblock \iffieldundef{urlyear}% {}% - {\printurldate}% Date fix + {\printurldate% + \ifboolexpr{% + togl {cms@urltime}% + and + not test {\iffieldundef{urlhour}}% + }% + {\newcunit\printurltime}% + {}}% Date fix \newcunit\newblock \iftoggle{cms@doionly}% {\iffieldundef{doi}% @@ -3263,15 +5183,20 @@ \usebibmacro{eprint}% \newcunit\newblock \printfield{url}% - \newcunit\newblock - \usebibmacro{caddendum}% \setunit{\shorthandpunct}% \usebibmacro{cms:shorthandintro}% \newcunit\newblock \usebibmacro{pageref}% \newcunit\newblock - \iftoggle{cms@citerel}% + \ifboolexpr{% + togl {cms@citerel}% + and + not test {\iffieldequalstr{relatedtype}{commenton}}% + and + not test {\iffieldundef{related}}% + }% {\usebibmacro{related:init}% + \usebibmacro{related:noterefhelper}% \usebibmacro{related}% \newcunit}% {}% @@ -3280,8 +5205,15 @@ \DeclareBibliographyDriver{cite:patent}{% \usebibmacro{bibindex}% \usebibmacro{author+holder}% +holder? - \newcunit\newblock - \usebibmacro{ctitle+stitle}% + \usebibmacro{hlpunct}%\newcunit\newblock + \iffieldundef{title}% + {}% + {\printtext{% + \printfield{title}% + \setunit{\subtitlepunct}% + \printfield[subtitle]{subtitle}}% + \setunit{\ctitleaddonpunct}% + \printfield{titleaddon}}% \setunit{\addspace}% \usebibmacro{language+transtitle}% \setunit{\addcomma\addspace}\newblock% @@ -3318,8 +5250,61 @@ \newcunit\newblock \usebibmacro{pageref}% \newcunit\newblock - \iftoggle{cms@citerel}% + \ifboolexpr{% + togl {cms@citerel}% + and + not test {\iffieldundef{related}}% + }% + {\usebibmacro{related:init}% + \usebibmacro{related:noterefhelper}% + \usebibmacro{related}% + \newcunit}% + {}% + \usebibmacro{finentry}} + +\DeclareBibliographyDriver{cite:performance}{% + \usebibmacro{bibindex}% + \usebibmacro{author/editor}% + \usebibmacro{hlpunct}%\setunit{\addcomma\addspace}\newblock + \usebibmacro{citaltitle+stitle}% + \setunit{\addspace}% + \usebibmacro{language+transtitle}% + \newcunit + \usebibmacro{byauthor}% + \newcunit\newblock + \usebibmacro{cbyeditor+others}% + \newcunit\newblock + \printfield{howpublished}% + \newcunit\newblock + \printfield{type}% + \newcunit\newblock + \printfield{version}% + \newcunit\newblock + \printfield{note}% + \newcunit\newblock + \printfield{venue}% + \newcunit\newblock% + \usebibmacro{institution+organization}% + \newcunit\newblock + \printlist{location}% + \newcunit\newblock + \usebibmacro{date}% + \usebibmacro{fullpostnote}% + \usebibmacro{caddendum}% + \newcunit\newblock + \usebibmacro{cite+doi+url}% + \setunit{\shorthandpunct}% + \usebibmacro{cms:shorthandintro}% + \newcunit\newblock + \usebibmacro{pageref}% + \newcunit\newblock + \ifboolexpr{% + togl {cms@citerel}% + and + not test {\iffieldundef{related}}% + }% {\usebibmacro{related:init}% + \usebibmacro{related:noterefhelper}% \usebibmacro{related}% \newcunit}% {}% @@ -3329,9 +5314,7 @@ \iffieldequalstr{entrysubtype}{magazine}% {\usebibmacro{bibindex}% \usebibmacro{editor}% - \setunit{\addspace}% - \printfield{nameaddon}% - \newcunit\newblock + \usebibmacro{hlpunct}%\newcunit\newblock \usebibmacro{issuetitle}% \setunit{\addspace}% \usebibmacro{language+transtitle}% @@ -3342,7 +5325,6 @@ \setunit{\addcomma\addspace}\newblock \usebibmacro{periodical+date+issue}% \usebibmacro{fullpostnote}% - \newcunit\newblock \usebibmacro{caddendum}% \newcunit\newblock \iftoggle{cms@isbn}% @@ -3355,17 +5337,20 @@ \newcunit\newblock \usebibmacro{pageref}% \newcunit\newblock - \iftoggle{cms@citerel}% + \ifboolexpr{% + togl {cms@citerel}% + and + not test {\iffieldundef{related}}% + }% {\usebibmacro{related:init}% + \usebibmacro{related:noterefhelper}% \usebibmacro{related}% \newcunit}% {}% \usebibmacro{finentry}}% {\usebibmacro{bibindex}% \usebibmacro{editor}% - \setunit{\addspace}% - \printfield{nameaddon}% - \newcunit\newblock + \usebibmacro{hlpunct}%\newcunit\newblock \usebibmacro{issuetitle}% \setunit{\addspace}% \usebibmacro{language+transtitle}% @@ -3376,9 +5361,10 @@ \setunit{\addcomma\addspace}% \printfield{note}% \setunit{\addcomma\addspace}% - \usebibmacro{cperiodical+issue+year+pages}% - \usebibmacro{fullpostnote}% + \usebibmacro{cjournal+issue+year+pages}% + \usebibmacro{eid+fullpostnote}% \newcunit\newblock + \printfield{eid}% \usebibmacro{caddendum}% \newcunit\newblock \iftoggle{cms@isbn}% @@ -3391,8 +5377,13 @@ \newcunit\newblock \usebibmacro{pageref}% \newcunit\newblock - \iftoggle{cms@citerel}% + \ifboolexpr{% + togl {cms@citerel}% + and + not test {\iffieldundef{related}}% + }% {\usebibmacro{related:init}% + \usebibmacro{related:noterefhelper}% \usebibmacro{related}% \newcunit}% {}% @@ -3401,9 +5392,7 @@ \DeclareBibliographyDriver{cite:proceedings}{% \usebibmacro{bibindex}% \usebibmacro{editor}% - \setunit{\addspace}% - \printfield{nameaddon}% - \setunit{\addcomma\addspace}\newblock% + \usebibmacro{hlpunct}%\setunit{\addcomma\addspace}\newblock% \usebibmacro{citaltitle+stitle}% \setunit{\addspace} \usebibmacro{cite:xref+date}% @@ -3424,57 +5413,95 @@ or togl {cms@bookcitexref}% }% - {\usebibmacro{cmtitle+mstitle+vol+part+title+stitle}% - \newcunit - \usebibmacro{cbyeditor+others}% - \newcunit\newblock - \usebibmacro{volume+or+volumes}% - \newcunit\newblock - \usebibmacro{cser+num}% - \newcunit\newblock - \usebibmacro{cnotefield}% - \setunit{\addspace}\newblock% - \printtext[parens]{% - \usebibmacro{org+publ+loc+year}}% - \usebibmacro{caddendum}% - \usebibmacro{volfullpostnote}% - \newcunit\newblock - \iftoggle{cms@isbn}% - {\printfield{isbn}}% - {}% - \newcunit\newblock - \usebibmacro{cite+doi+url}% - \setunit{\shorthandpunct}% - \usebibmacro{cms:shorthandintro}% - \newcunit\newblock - \usebibmacro{pageref}% - \newcunit\newblock - \iftoggle{cms@citerel}% - {\usebibmacro{related:init}% - \usebibmacro{related}% - \newcunit}% - {}% - \usebibmacro{finentry}% - \usebibmacro{book:xref+finentry}}% - {\ifpunctmark{.}% This seems to work. + {\usebibmacro{cmtitle+mstitle+vol+part+title+stitle}% + \newcunit + \usebibmacro{cbyeditor+others}% + \newcunit\newblock + \usebibmacro{volume+or+volumes}% + \newcunit\newblock + \usebibmacro{cser+num}% + \newcunit\newblock + \usebibmacro{cnotefield}% + \setunit{\addspace}\newblock% + \printtext[parens]{% + \usebibmacro{org+publ+loc+year}}% + \usebibmacro{volfullpostnote}% + \usebibmacro{caddendum}% + \newcunit\newblock + \iftoggle{cms@isbn}% + {\printfield{isbn}}% + {}% + \newcunit\newblock + \usebibmacro{cite+doi+url}% + \setunit{\shorthandpunct}% + \usebibmacro{cms:shorthandintro}% + \newcunit\newblock + \usebibmacro{pageref}% + \newcunit\newblock + \ifboolexpr{% + togl {cms@citerel}% + and + not test {\iffieldundef{related}}% + }% + {\usebibmacro{book:xref+finentry}% + \usebibmacro{related:init}% + \usebibmacro{related:noterefhelper}% + \usebibmacro{related}% + \newcunit}% + {\usebibmacro{book:xref+finentry}}% + \usebibmacro{finentry}}% + {\ifboolexpr{% + togl {cms@citerel}% + and + not test {\iffieldundef{related}}% + }% + {\usebibmacro{related:noterefhelper}}% + {}% + \ifpunctmark{.}% This seems to work. {\ifbibliography% {\setunit{\bibsentence}}{\addspace\bibsentence}}% {\ifbibliography{\unspace}{\addcomma\addspace}}% ?!? \usebibmacro{xrefprenote}% Volume fix \bookbibxrefcite{\thefield{xref}}% Removed \addspace from each. \usebibmacro{xrefpostnote}% + \ifboolexpr{% + togl {cms@citerel}% + and + not test {\iffieldundef{related}}% + }% + {\usebibmacro{related:init}% + \usebibmacro{related}% + \newcunit}% + {}% \usebibmacro{finentry}}}% - {\ifpunctmark{.}% This seems to work. - {\ifbibliography% - {\setunit{\bibsentence}}{\addspace\bibsentence}}% - {\ifbibliography{\unspace}{\addcomma\addspace}}% ?!? + {\ifboolexpr{% + togl {cms@citerel}% + and + not test {\iffieldundef{related}}% + }% + {\usebibmacro{related:noterefhelper}}% + {}% + \ifpunctmark{.}% This seems to work. + {\ifbibliography% + {\setunit{\bibsentence}}{\addspace\bibsentence}}% + {\ifbibliography{\unspace}{\addcomma\addspace}}% ?!? \usebibmacro{xrefprenote}% Volume fix \bookbibxrefcite{\thefield{crossref}}% \usebibmacro{xrefpostnote}% + \ifboolexpr{% + togl {cms@citerel}% + and + not test {\iffieldundef{related}}% + }% + {\usebibmacro{related:init}% + \usebibmacro{related}% + \newcunit}% + {}% \usebibmacro{finentry}}} \DeclareBibliographyDriver{cite:reference}{% \usebibmacro{bibindex}% + \iffieldundef{clonesourcekey}{}{\newcunit}% \usebibmacro{citaltitle+stitle}% \newcunit\newblock \ifthenelse{\iffieldundef{maintitle}\AND\iffieldundef{booktitle}}% @@ -3498,11 +5525,9 @@ \newcunit\newblock \usebibmacro{cser+num}% \newcunit\newblock - \usebibmacro{cnotefield}% - \newcunit\newblock - \usebibmacro{cpubl+loc+year}% - \usebibmacro{caddendum}% + \usebibmacro{crefpubl+loc+year}% \usebibmacro{volfullpostnote}% + \usebibmacro{caddendum}% \newcunit\newblock \iftoggle{cms@isbn}% {\printfield{isbn}}% @@ -3514,8 +5539,13 @@ \newcunit\newblock \usebibmacro{pageref}% \newcunit\newblock - \iftoggle{cms@citerel}% + \ifboolexpr{% + togl {cms@citerel}% + and + not test {\iffieldundef{related}}% + }% {\usebibmacro{related:init}% + \usebibmacro{related:noterefhelper}% \usebibmacro{related}% \newcunit}% {}% @@ -3524,9 +5554,7 @@ \DeclareBibliographyDriver{cite:report}{% \usebibmacro{bibindex}% \usebibmacro{author/editor}% - \setunit{\addspace}% - \printfield{nameaddon}% - \setunit{\addcomma\addspace}\newblock + \usebibmacro{hlpunct}%\setunit{\addcomma\addspace}\newblock \iffieldequalstr{entrysubtype}{unpublished}% {\usebibmacro{ctitle+stitle}}% {\usebibmacro{citaltitle+stitle}}% @@ -3535,16 +5563,18 @@ \newcunit% \printfield{type}% \newcunit - \printfield{series}% - \setunit{\addnbspace}% + \usebibmacro{series+or+shortser}% + \ifthenelse{\iffieldundef{type}\AND\iffieldundef{series}}% + {\newcunit}% + {\setunit{\addnbspace}}% \printfield{number}% \newcunit% \usebibmacro{cnotefield}% \setunit{\addspace}\newblock% - \printtext[parens]{% + \printtext[parens]{% \usebibmacro{inst+loc+year}}% - \usebibmacro{caddendum}% \usebibmacro{fullpostnote}% + \usebibmacro{caddendum}% \newcunit\newblock \iftoggle{cms@isbn}% {\printfield{isrn}}% @@ -3556,8 +5586,13 @@ \newcunit\newblock \usebibmacro{pageref}% \newcunit\newblock - \iftoggle{cms@citerel}% + \ifboolexpr{% + togl {cms@citerel}% + and + not test {\iffieldundef{related}}% + }% {\usebibmacro{related:init}% + \usebibmacro{related:noterefhelper}% \usebibmacro{related}% \newcunit}% {}% @@ -3568,18 +5603,25 @@ \iffieldequalstr{entrysubtype}{magazine}% {\usebibmacro{cmag+news+author}}% {\usebibmacro{author/editor}}% + \usebibmacro{hlpunct}%\newcunit\newblock + \usebibmacro{music+eventdate}% 17th ed. \newcunit\newblock - \printeventdate% 16th ed. - \setunit{\addspace}% - \printfield{nameaddon}% 16th ed. + \printeventtime% \newcunit\newblock \ifboolexpr{% + ( test {\iffieldequalstr{relatedtype}{reviewof}}% + or + test {\iffieldequalstr{relatedtype}{commenton}}% + ) and togl {cms@citerel}% }% - {\usebibmacro{related:init}% - \usebibmacro{related}}% + {\toggletrue{cms@relreview}% + \usebibmacro{related:init}% + \usebibmacro{related:noterefhelper}% + \usebibmacro{related}% + \togglefalse{cms@relreview}}% {\printfield{title}% \setunit{\subtitlepunct}% \printfield[noformat]{subtitle}}% @@ -3589,22 +5631,135 @@ \usebibmacro{language+transtitle}% \setunit{\addcomma\addspace}%\newblock% \usebibmacro{cpart+editor+translator}% - \newcunit% - \usebibmacro{issuetitle}% - \setunit{\addcomma\addspace}% + \ifboolexpr{% + test {\iffieldundef{crossref}}% + or + not test {\ifentryseen{\thefield{crossref}}}% + or + togl {cms@citecrossref}% + }% + {\ifboolexpr{% + test {\iffieldundef{xref}}% + or + not test {\ifentryseen{\thefield{xref}}}% + or + togl {cms@citecrossref}% + }% + {\iffieldequalstr{relatedtype}{commenton}% + {\usebibmacro{eid+fullpostnote}% + \newcunit\newblock + \printfield{eid}% + \newcunit\newblock + \usebibmacro{caddendum}}% + {\newcunit% + \usebibmacro{issuetitle}% + \setunit{\addcomma\addspace}% + \usebibmacro{cbyeditor+others}% + \setunit{\addcomma\addspace}% + \printfield{note}% + \setunit{\addcomma\addspace}% + \iffieldequalstr{entrysubtype}{magazine}% + {\usebibmacro{mag+news+date}% + \newcunit\newblock + \printfield{type}}% + {\usebibmacro{cjournal+issue+year+pages}}% + \usebibmacro{eid+fullpostnote}% + \newcunit\newblock + \printfield{eid}% + \usebibmacro{caddendum}% + \newcunit\newblock + \iftoggle{cms@isbn}% + {\printfield{issn}}% + {}% + \usebibmacro{cite:xref+finentry}}}% + {\usebibmacro{eid+fullpostnote}% + \newcunit\newblock + \printfield{eid}% + \newcunit\newblock + \usebibmacro{caddendum}}}% + {\usebibmacro{eid+fullpostnote}% + \newcunit\newblock + \printfield{eid}% + \newcunit\newblock + \usebibmacro{caddendum}}% + \newcunit\newblock + \usebibmacro{cite+doi+url}% + \setunit{\shorthandpunct}% + \usebibmacro{cms:shorthandintro}% + \newcunit\newblock + \usebibmacro{pageref}% + \newcunit\newblock + \ifboolexpr{% + togl {cms@citerel}% + and + not test {\iffieldequalstr{relatedtype}{reviewof}}% + and + not test {\iffieldequalstr{relatedtype}{commenton}}% + and + not test {\iffieldundef{related}}% + }% + {\usebibmacro{related:init}% + \usebibmacro{related:noterefhelper}% + \usebibmacro{related}% + \newcunit}% + {}% + \usebibmacro{finentry}} + +\DeclareBibliographyDriver{cite:standard}{% + \usebibmacro{bibindex}% + \iffieldundef{entrysubtype}% + {}% + {\ifnameundef{author}% + {\iflistundef{organization}% + {}% + {\printlist{organization}}}% + {\usebibmacro{justauthor}}% + \usebibmacro{hlpunct}}%\setunit{\addcomma\addspace}\newblock% + \usebibmacro{citaltitle+stitle}% + \newcunit + \usebibmacro{edition}% + \newcunit + \usebibmacro{byauthor}% + \newcunit\newblock \usebibmacro{cbyeditor+others}% - \setunit{\addcomma\addspace}% - \printfield{note}% - \setunit{\addcomma\addspace}% - \iffieldequalstr{entrysubtype}{magazine}% - {\usebibmacro{mag+news+date}}% - {\usebibmacro{cjournal+issue+year+pages}}% - \usebibmacro{fullpostnote}% \newcunit\newblock + \usebibmacro{series+or+shortser}% + \setunit*{\addnbspace}% + \printfield{number}% + \newcunit\newblock + \printfield{type}% + \newcunit + \usebibmacro{cnotefield}% + \setunit{\addspace}\newblock% + \printtext[parens]{% + \usebibmacro{origpubl+loc+year}%{cmsorigdate}% 16th ed. + \reprintpunct% + \iffieldundef{pubstate}% + {}% + {\iffieldbibstring{pubstate}% + {\bibsstring{\thefield{pubstate}}}% + {\printfield[prenote]{pubstate}}% + \newcunit}% + \printlist{location}% + \iflistundef{organization}% + {\iflistundef{publisher}% + {\setunit*{\addcomma\addspace}}% + {\setunit*{\addcolon\addspace}% + \printlist{publisher}% + \setunit*{\addcomma\addspace}}}% + {\setunit*{\addcolon\addspace}% + \printlist{organization}% + \setunit*{\addcomma\addspace}}% + \usebibmacro{date}% + \setunit{\addsemicolon\addspace}% + \printfield{howpublished}% + \setunit*{\addspace}% + \usebibmacro{music+eventdate}}% + \usebibmacro{fullpostnote}% \usebibmacro{caddendum}% \newcunit\newblock \iftoggle{cms@isbn}% - {\printfield{issn}}% + {\printfield{isbn}}% {}% \newcunit\newblock \usebibmacro{cite+doi+url}% @@ -3616,9 +5771,10 @@ \ifboolexpr{% togl {cms@citerel}% and - not test {\iffieldequalstr{relatedtype}{reviewof}}% - }% + not test {\iffieldundef{related}}% + }% {\usebibmacro{related:init}% + \usebibmacro{related:noterefhelper}% \usebibmacro{related}% \newcunit}% {}% @@ -3627,9 +5783,7 @@ \DeclareBibliographyDriver{cite:suppbook}{% \usebibmacro{bibindex}% \usebibmacro{author}% - \setunit{\addspace}% - \printfield{nameaddon}% - \newcunit\newblock + \usebibmacro{hlpunct}%\newcunit\newblock \usebibmacro{inforaft}% \setunit{\addspace}\newblock \usebibmacro{citaltitle+stitle}% @@ -3642,6 +5796,8 @@ \newcunit \usebibmacro{bybookauthor}% \newcunit\newblock + \usebibmacro{cpart+editor+translator}% + \newcunit\newblock \usebibmacro{cmtitle+mstitle+vol+part+title+stitle}% \newcunit \iffieldundef{edition}% @@ -3658,8 +5814,8 @@ \newcunit\newblock \usebibmacro{cpubl+loc+year}% \clearfield{pages}% ?? For 16th ed. - \usebibmacro{caddendum}% \usebibmacro{volfullpostnote}% + \usebibmacro{caddendum}% \newcunit\newblock \iftoggle{cms@isbn}% {\printfield{isbn}}% @@ -3671,8 +5827,13 @@ \newcunit\newblock \usebibmacro{pageref}% \newcunit\newblock - \iftoggle{cms@citerel}% + \ifboolexpr{% + togl {cms@citerel}% + and + not test {\iffieldundef{related}}% + }% {\usebibmacro{related:init}% + \usebibmacro{related:noterefhelper}% \usebibmacro{related}% \newcunit}% {}% @@ -3685,9 +5846,7 @@ \DeclareBibliographyDriver{cite:thesis}{% \usebibmacro{bibindex}% \usebibmacro{author/editor}% - \setunit{\addspace}% - \printfield{nameaddon}% - \setunit{\addcomma\addspace}\newblock + \usebibmacro{hlpunct}%\setunit{\addcomma\addspace}\newblock \usebibmacro{ctitle+stitle}% \setunit{\addspace}\newblock% \usebibmacro{language+transtitle}% @@ -3698,8 +5857,8 @@ \setunit{\addspace}% \printtext[parens]{% \usebibmacro{type+inst+year}}% - \usebibmacro{caddendum}% \usebibmacro{fullpostnote}% + \usebibmacro{caddendum}% \newcunit\newblock \usebibmacro{cite+doi+url}% \setunit{\shorthandpunct}% @@ -3707,8 +5866,13 @@ \newcunit\newblock \usebibmacro{pageref}% \newcunit\newblock - \iftoggle{cms@citerel}% + \ifboolexpr{% + togl {cms@citerel}% + and + not test {\iffieldundef{related}}% + }% {\usebibmacro{related:init}% + \usebibmacro{related:noterefhelper}% \usebibmacro{related}% \newcunit}% {}% @@ -3717,9 +5881,7 @@ \DeclareBibliographyDriver{cite:unpublished}{% \usebibmacro{bibindex}% \usebibmacro{author/editor}% - \setunit{\addspace}% - \printfield{nameaddon}% - \setunit{\addcomma\addspace}\newblock + \usebibmacro{hlpunct}%\setunit{\addcomma\addspace}\newblock \usebibmacro{ctitle+stitle}% \setunit{\addspace}% \usebibmacro{language+transtitle}% @@ -3744,8 +5906,8 @@ \iffieldundef{eventyear}% {\usebibmacro{date}}% {\printeventdate}}% - \usebibmacro{caddendum}% \usebibmacro{fullpostnote}% + \usebibmacro{caddendum}% \newcunit\newblock \usebibmacro{cite+doi+url}% \setunit{\shorthandpunct}% @@ -3753,8 +5915,13 @@ \newcunit\newblock \usebibmacro{pageref}% \newcunit\newblock - \iftoggle{cms@citerel}% + \ifboolexpr{% + togl {cms@citerel}% + and + not test {\iffieldundef{related}}% + }% {\usebibmacro{related:init}% + \usebibmacro{related:noterefhelper}% \usebibmacro{related}% \newcunit}% {}% @@ -3762,20 +5929,38 @@ \DeclareBibliographyDriver{cite:video}{% \usebibmacro{bibindex}% - \usebibmacro{author/editor}% - \setunit{\addspace}% - \printfield{nameaddon}% - \newcunit\newblock - \usebibmacro{ctitle+stitle}% - \setunit{\addspace}\newblock% - \usebibmacro{language+transtitle}% - \newcunit - \usebibmacro{byauthor}% - \newcunit - \usebibmacro{cpart+editor+translator}% - \newcunit - \usebibmacro{chapinscore}% - \usebibmacro{btitle+bstitle}% + \ifboolexpr{% + test {\iffieldequalstr{entrysubtype}{tvepisode}}% + and + ( + not test {\iffieldundef{title}}% + and + not test {\iffieldundef{booktitle}}% + ) + }% + {\usebibmacro{author/editor}% + \usebibmacro{hlpunct}%\newcunit\newblock + \usebibmacro{btitle+bstitle}% + \newcunit\newblock + \usebibmacro{ctitle+stitle}% + \setunit{\addspace}\newblock% + \usebibmacro{language+transtitle}% + \newcunit + \usebibmacro{byauthor}% + \newcunit + \usebibmacro{cpart+editor+translator}}% + {\usebibmacro{author/editor}% + \usebibmacro{hlpunct}%\newcunit\newblock + \usebibmacro{ctitle+stitle}% + \setunit{\addspace}\newblock% + \usebibmacro{language+transtitle}% + \newcunit + \usebibmacro{byauthor}% + \newcunit + \usebibmacro{cpart+editor+translator}% + \newcunit + \usebibmacro{chapinscore}% + \usebibmacro{btitle+bstitle}}% \newcunit \iffieldundef{edition}% {}% @@ -3812,15 +5997,16 @@ \newcunit\newblock \usebibmacro{cser+num}% \newcunit\newblock + \usebibmacro{cnotefield}% + \newcunit\newblock \usebibmacro{music+eventdate}% \newcunit\newblock - \usebibmacro{cnotefield}% + \printfield{usera}% \newcunit\newblock \usebibmacro{cpubl+loc+year}% \newcunit\newblock \printfield{type}% Order of this and next? \usebibmacro{volfullpostnote}% - \newcunit\newblock \usebibmacro{caddendum}% \newcunit\newblock \iftoggle{cms@isbn}% @@ -3833,8 +6019,13 @@ \newcunit\newblock \usebibmacro{pageref}% \newcunit\newblock - \iftoggle{cms@citerel}% + \ifboolexpr{% + togl {cms@citerel}% + and + not test {\iffieldundef{related}}% + }% {\usebibmacro{related:init}% + \usebibmacro{related:noterefhelper}% \usebibmacro{related}% \newcunit}% {}% @@ -3897,7 +6088,7 @@ \DeclareListFormat{periodplace}{\mkbibparens{#1}} -\DeclareListFormat{lista}{% +\DeclareListFormat{lista}{% \ifthenelse{\value{listtotal}<2}% {\bibsstring{subverbo}\addspace\mkbibquote{#1\isdot}}% {\ifthenelse{\value{listcount}=1}% @@ -3935,42 +6126,43 @@ {#1\isdot}% {\mkbibquote{#1\isdot}}} -\DeclareFieldFormat[artwork,image]{title}{% +\DeclareFieldFormat[artwork,image,inreference]{title}{% \iffieldundef{entrysubtype}% {\mkbibemph{#1}\isdot}% {#1\isdot}} -\DeclareFieldFormat[artwork,image]{citetitle}{% +\DeclareFieldFormat[artwork,image,inreference]{citetitle}{% \iffieldundef{entrysubtype}% {\mkbibemph{#1}\isdot}% {#1\isdot}} -\DeclareFieldFormat[artwork,image]{lostitle}{% +\DeclareFieldFormat[artwork,image,inreference]{lostitle}{% \iffieldundef{entrysubtype}% {\mkbibemph{#1}\isdot}% {#1\isdot}} -\DeclareFieldFormat[letter,patent]{title}{#1\isdot} +\DeclareFieldFormat[letter]{title}{#1\isdot} + +\DeclareFieldFormat[patent]{title}{\MakeSentenceCase*{#1}\isdot} + +\DeclareFieldFormat[letter]{citetitle}{#1\isdot} -\DeclareFieldFormat[letter,patent]{citetitle}{#1\isdot} +\DeclareFieldFormat[patent]{citetitle}{\MakeSentenceCase*{#1}\isdot} -\DeclareFieldFormat[letter,patent]{lostitle}{#1\isdot} +\DeclareFieldFormat[letter]{lostitle}{#1\isdot} + +\DeclareFieldFormat[patent]{lostitle}{\MakeSentenceCase*{#1}\isdot} \DeclareFieldFormat{prenote}{\ifcapital{\MakeCapital{#1}}{#1}\isdot} -\iftoggle{cms@comprange}% Audrey Boruvka's code from StackExchange -{\patchcmd{\blx@comprange@check}% - {\blx@comprange@comp{#1}{#2}}% - {\blx@tempcnta=#1% - \divide\blx@tempcnta100% - \multiply\blx@tempcnta100% - \ifnumequal{\blx@tempcnta}{#1}% - {\blx@range@out@value{#1\bibrangedash#2}}% - {\blx@comprange@comp{#1}{#2}}}% - {}{}}{}% +%% comprange code moved to .sty \DeclareFieldFormat{postnote}{% Changed for page compression option - \iftoggle{cms@comprange}% + \ifboolexpr{% + togl {cms@comprange}% + and + test {\ifpages{#1}}% + }% {\iffieldundef{pagination}% {\mkcomprange{#1}}% {\mkcomprange[{\mkpageprefix[pagination]}]{#1}}}% @@ -3979,7 +6171,11 @@ {\mkpageprefix[pagination]{#1}}}}% \DeclareFieldFormat[inreference]{postnote}{% - \iftoggle{cms@comprange}% + \ifboolexpr{% + togl {cms@comprange}% + and + test {\ifpages{#1}}% + }% {\iffieldundef{pagination}% {\bibsstring{subverbo}\addspace\mkbibquote{#1}}% {\mkcomprange[{\mkpageprefix[pagination]}]{#1}}}% @@ -4003,7 +6199,11 @@ {\printtext{at}\addspace #1}}}}% \DeclareFieldFormat[jurisdiction,legal,legislation]{postnote}{% - \iftoggle{cms@comprange}% + \ifboolexpr{% + togl {cms@comprange}% + and + test {\ifpages{#1}}% + }% {\iffieldundef{pagination}% {\mkcomprange[\mkjuridprefix]{#1}}% {\mkcomprange[{\mkpageprefix[pagination]}]{#1}}}% @@ -4012,7 +6212,11 @@ {\mkpageprefix[pagination]{#1}}}}% \DeclareFieldFormat{pages}{% - \iftoggle{cms@comprange}% + \ifboolexpr{% + togl {cms@comprange}% + and + test {\ifpages{#1}}% + }% {\iffieldundef{bookpagination}% {\mkcomprange{#1}\isdot}% {\mkcomprange[{\mkpageprefix[bookpagination]}]{#1}}}% @@ -4020,13 +6224,6 @@ {#1\isdot}% {\mkpageprefix[bookpagination]{#1}}}}% -% \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}% @@ -4067,6 +6264,8 @@ #1}% {\printfield{nameaddon}\addspace #1}} +\DeclareFieldAlias[customc]{lostitle}[customc]{title} + \DeclareFieldFormat[misc]{title}{% \iffieldundef{entrysubtype}% {\mkbibemph{#1}\isdot}% @@ -4082,6 +6281,15 @@ {\mkbibemph{#1}\isdot}% {\ifcapital{\MakeCapital{#1\isdot}}{#1\isdot}}} +\DeclareFieldFormat[dataset]{title}{% + \ifcapital{\MakeCapital{#1\isdot}}{#1\isdot}} + +\DeclareFieldFormat[dataset]{citetitle}{% + \mkbibparens{\ifcapital{\MakeCapital{#1\isdot}}{#1\isdot}}} + +\DeclareFieldFormat[dataset]{lostitle}{% + \mkbibparens{\ifcapital{\MakeCapital{#1\isdot}}{#1\isdot}}} + \DeclareFieldFormat[review,suppperiodical]{title}{% \ifcapital{\MakeCapital{#1\isdot}}{#1\isdot}} @@ -4106,22 +6314,52 @@ {\mkbibquote{#1\isdot}}% {\mkbibemph{#1}\isdot}} -\DeclareFieldFormat[audio,music,video]{title}{% - \iffieldundef{booktitle}% +\DeclareFieldFormat[audio,music]{title}{% + \ifthenelse{\iffieldundef{booktitle}\AND\iffieldundef{entrysubtype}}% {\mkbibemph{#1}\isdot}% {\mkbibquote{#1\isdot}}} -\DeclareFieldFormat[audio,music,video]{citetitle}{% - \iffieldundef{booktitle}% +\DeclareFieldFormat[audio,music]{citetitle}{% + \ifthenelse{\iffieldundef{booktitle}\AND\iffieldundef{entrysubtype}}% {\mkbibemph{#1}\isdot}% {\mkbibquote{#1\isdot}}} -\DeclareFieldFormat[audio,music,video]{lostitle}{% - \iffieldundef{booktitle}% +\DeclareFieldFormat[audio,music]{lostitle}{% + \ifthenelse{\iffieldundef{booktitle}\AND\iffieldundef{entrysubtype}}% {\mkbibemph{#1}\isdot}% {\mkbibquote{#1\isdot}}} -\DeclareFieldFormat[jurisdiction,legal]{title}{#1\isdot} +\DeclareFieldFormat[video]{title}{% + \ifthenelse{\iffieldundef{booktitle}\AND\iffieldundef{entrysubtype}}% + {\mkbibemph{#1}\isdot}% + {\mkbibquote{#1\isdot}}} + +\DeclareFieldFormat[video]{citetitle}{% + \ifthenelse{\iffieldundef{booktitle}\AND\iffieldundef{entrysubtype}}% + {\mkbibemph{#1}\isdot}% + {\ifboolexpr{% + test {\iffieldequalstr{entrysubtype}{tvepisode}}% + and + not test {\iffieldundef{title}}% + and + not test {\iffieldundef{booktitle}}% + and + not test {\iffieldundef{shorttitle}}% + }% + {\mkbibemph{#1}\isdot}% + {\mkbibquote{#1\isdot}}}} + +\DeclareFieldFormat[video]{lostitle}{% + \ifthenelse{\iffieldundef{booktitle}\AND\iffieldundef{entrysubtype}}% + {\mkbibemph{#1}\isdot}% + {\mkbibquote{#1\isdot}}} + +\DeclareFieldFormat[jurisdiction]{title}{% + \iftoggle{cms@running@text}% + {\mkbibemph{#1}\isdot}% + {#1\isdot}} + +\DeclareFieldFormat[legal]{title}{#1\isdot} \DeclareFieldFormat[legislation]{title}{% \iffieldequalstr{entrysubtype}{hearing}% @@ -4146,8 +6384,6 @@ %%%% Other Field Formats %%%% -\DeclareNumChars*{:}% For proper ibidem with multi-volume works. - \DeclareFieldFormat{letterday}{\mkbibcurdinal{#1}} \DeclareFieldFormat{note}{% @@ -4162,18 +6398,26 @@ {\MakeCapital{#1\isdot}}% {#1\isdot}}} -\DeclareFieldFormat[artwork,image]{type}{% +\DeclareFieldFormat[artwork,image,online,article,review,suppperiodical,book] +{type}{% + \ifcapital% + {\MakeCapital{#1}}% + {#1}} + +\DeclareFieldFormat[artwork,image,music]{howpublished}{% \ifcapital% {\MakeCapital{#1}}% {#1}} +\DeclareFieldFormat[video]{usera}{% + \bibstring{on}\addspace #1} + +\DeclareFieldFormat{version}{\bibsstring{version}\addspace #1}% + \DeclareFieldFormat{url}{\url{#1}} \DeclareFieldFormat{doi}{% - \textrm{doi}\addcolon - \ifhyperref - {\href{http://dx.doi.org/#1}{\nolinkurl{#1}}} - {\nolinkurl{#1}}} + \url{https://doi.org/#1}} \DeclareFieldFormat[music]{date}{% Generalize userd ??? \ifthenelse{\iffieldundef{userd}\OR\NOT\iffieldundef{urlyear}% @@ -4187,6 +6431,37 @@ {#1}% {\printfield{userd}\addspace #1}} +\DeclareFieldFormat[artwork,image]{date}{% + \iffieldundef{origyear}% + {#1}% + {\iftoggle{cms@switchdates}% + {#1}% + {\iffieldundef{userd}% + {\bibstring{printed}\addspace #1}% + {\printfield{userd}\addspace #1}}}} + +\DeclareFieldFormat[artwork,image]{origdate}{% + \iffieldundef{year}% + {#1}% + {\iftoggle{cms@switchdates}% + {\iffieldundef{userd}% + {\bibstring{printed}\addspace #1}% + {\printfield{userd}\addspace #1}}% + {#1}}} + +\DeclareFieldFormat[artwork,image]{urldate}{% + \ifboolexpr{% + test {\iffieldundef{userd}}% + or + ( + not test {\iffieldundef{year}}% + and + not test {\iffieldundef{origyear}}% + ) + }% + {\bibstring{urlseen}\addspace #1}% + {\printfield{userd}\addspace #1}} + \DeclareFieldFormat{date}{% Generalize userd ??? \ifthenelse{\iffieldundef{userd}\OR\NOT\iffieldundef{urlyear}}% {#1}% @@ -4209,7 +6484,7 @@ {\printfield{userd}\addspace #1}} \DeclareFieldFormat[music]{origdate}{% 16th ed. - \iftoggle{cms@reprint}% Date fix + \iffieldequalstr{pubstate}{reprint}% Date fix {#1}% {\ifthenelse{\iffieldundef{userd}\OR\NOT\iffieldundef{eventyear}}% {\bibstring{discrecorded}\addspace #1}% Can now match gender @@ -4229,7 +6504,12 @@ \DeclareFieldFormat{nameaddon}{\mkbibbrackets{#1\bibsentence}}% ?! -\DeclareFieldFormat[review,suppperiodical]{nameaddon}{#1\bibsentence} +\DeclareFieldFormat[online,review,suppperiodical]{nameaddon}{#1\bibsentence} + +\DeclareFieldFormat[misc]{nameaddon}{% + \iffieldundef{entrysubtype}% + {\mkbibbrackets{#1\bibsentence}}% + {#1\bibsentence}} \DeclareFieldFormat[customc]{nameaddon}{% For cross-refs \ifbibstring{#1}% @@ -4264,7 +6544,7 @@ \DeclareFieldFormat{usere}{[#1]} % Better than mkbibbrackets? \DeclareFieldFormat{titleaddon}{% - \ifcapital{\MakeCapital{#1\isdot}}{#1\isdot}}%\custpunctc? + \ifcapital{\MakeCapital{#1\isdot}}{#1\isdot}}% \DeclareFieldAlias{booktitleaddon}{titleaddon} @@ -4335,6 +6615,8 @@ \DeclareFieldFormat{series}{#1\isdot} +\DeclareFieldFormat{shortseries}{#1\isdot} + \DeclareFieldFormat{addendum}{% \ifcapital{\MakeCapital{#1\isdot}}{#1\isdot}} @@ -4351,6 +6633,10 @@ {\addcomma\addspace\bibstring{partvolume}~#1}% {\addcomma\addspace\ifcapital{\MakeCapital{#1}}{#1}}} +\global\let\cmsnrpart\RN +\DeclareFieldFormat{nrpart}{\bibsstring{part}~\cmsnrpart{#1}}% Noterefs +\DeclareFieldFormat{nrchapter}{\bibsstring{chapter}~#1}% + \DeclareFieldFormat{xrefpart}{% xref revision ??? \ifnumerals{#1}% {\bibstring{partvolume}~#1}% @@ -4361,16 +6647,14 @@ {\bibsstring{part}~#1}% {#1\isdot}}% -\DeclareFieldFormat[legal,legislation]{chapter}{% - \ifthenelse{\iffieldequalstr{entrysubtype}{uk}\OR% - \iffieldequalstr{entrysubtype}{hansard}}% - {c\adddotspace #1}% - {\bibsstring{chapter}~#1}}% +\DeclareFieldFormat[legal,legislation]{chapter}{c\adddotspace #1}% + +\DeclareFieldFormat[music]{chapter}{\bibstring{track}~#1} %% This tries to get hyperlinks from shortened cross-ref'd notes to %% %% long notes working properly. Used in short and shorthand cites. %% -\DeclareFieldFormat{cmshyperlink}{% +\DeclareFieldFormat{cmshyperlink}{% Obsolete? \iffieldundef{crossref}% {\iffieldundef{xref}% {\bibhyperlink{\thefield{entrykey}}{#1}}% @@ -4431,6 +6715,34 @@ {\bibhyperlink{\thefield{crossref}}{#1}}% {\bibhyperlink{\thefield{entrykey}}{#1}}}} +\newrobustcmd*{\cmshyper}[1]{% + \ifbibliography% + {\ifboolexpr{% + test {\ifentryinbib{\thefield{entrykey}}}% + and + not togl {blx@skipbib}% + }% + {\printtext[bibhyperref]{#1}}% + {#1}}% + {\iftoggle{cms@allshort}% + {\iftoggle{blx@skipbib}{#1}{\printtext[bibhyperref]{#1}}}% + {\printtext[bibhyperlink]{#1}}}}% + +\newrobustcmd*{\cmsshhyper}[1]{% + \iffootnote% + {\iftoggle{cms@allshort}% + {\iftoggle{blx@skipbib}{#1}{\printtext[bibhyperref]{#1}}}% + {\printtext[bibhyperlink]{#1}}}% + {\ifboolexpr{% + test {\ifentryinbib{\thefield{entrykey}}}% + and + not togl {blx@skipbib}% + }% + {\printtext[bibhyperref]{#1}}% + {\iftoggle{cms@allshort}% + {#1}% + {\printtext[bibhyperlink]{#1}}}}}% + \DeclareFieldAlias[review]{volume}[article]{volume} \DeclareFieldAlias[suppperiodical]{volume}[article]{volume} @@ -4453,7 +6765,7 @@ {#1}}% \ifentrytype{jurisdiction}% {\newcunit}% - {\printunit{\relatedpunct}}}% + {\printunit{\relatedpunct}}}% Issue w/ printunit. Our bug? \DeclareFieldFormat{relatedstring:reprintfrom}{% For notes + bib \ifboolexpr{% @@ -4469,11 +6781,6 @@ %%%% Commands, for users and internal %%%% -\newcommand*{\cbytypeeditor}{% - \iffieldundef{editortype}% - {\bibstring{cbytypeeditor}}% - {\bibstring{cbytype\thefield{editortype}}}}% - \renewcommand*{\multicitedelim}{\addsemicolon\addspace} \renewcommand*{\iffinalcitedelim}{% @@ -4490,45 +6797,27 @@ \global\csundef{@cmsst}}% } -\newcommand{\custpunct}{% - \iftoggle{cms@fullnote}% - {\iffieldequalstr{type}{plain}% - {}% - {\addcomma}}% - {\iftoggle{cms@shortnote}% - {\iffieldundef{postnote}% - {\ifthenelse{\value{multicitecount} < \value{multicitetotal}}% - {}% - {\addperiod}}% - {\addcomma}}% - {\addperiod}}} - -\newcommand{\custpunctb}{% - \iftoggle{cms@fullnote}% - {\iffieldequalstr{userb}{plain}% - {}% - {\addcomma}}% - {\iftoggle{cms@shortnote}% - {\iffieldundef{postnote}% - {\ifthenelse{\value{multicitecount} < \value{multicitetotal}}% - {}% - {\addperiod}}% - {\addcomma}}% - {\addperiod}}} - -\newcommand{\classicpunct}{% 16th ed. - \ifthenelse{\(\iffieldequalstr{entrysubtype}{classical}\AND% - \iffieldundef{labeltitle}\)\OR - \ifentrytype{letter}}% +\newcommand*{\classicpunct}{% 17th ed. + \ifboolexpr{% + ( + test {\iffieldequalstr{entrysubtype}{classical}}% + and + test {\iffieldundef{labeltitle}}% + ) + or + test {\ifentrytype{letter}}% + or + test {\ifentrytype{dataset}}% + }% {\setunit*{\addspace}}% {\setunit*{\addcomma\addspace}}} -\newcommand{\reprintpunct}{% +\newcommand*{\reprintpunct}{% \iftoggle{cms@fullnote}% {\setunit*{\addsemicolon\addspace}}% {\setunit*{\addperiod\addspace}}} -\newcommand{\encypunct}{% for named entries in an encyclopedia +\newcommand*{\encypunct}{% for named entries in an encyclopedia \iftoggle{cms@fullnote}% {\ifentrytype{book}% {\ifthenelse{\iffieldundef{addendum}\AND\iffieldundef{doi}\AND @@ -4551,22 +6840,13 @@ {\addperiod}% {}}}}% -\newcommand{\postvolpunct}{\addcolon}% For vol:page customization +\newcommand*{\postvolpunct}{\addcolon}% For vol:page customization -\newcommand{\parttrans}{% +\newcommand*{\parttrans}{% \iftoggle{cms@fullnote}% {\bibstring{cbytranslator}\addspace}% {\bibstring{bytranslator}\addspace}}% -% \newcommand{\partedit}{% -% \iftoggle{cms@postposit}% Kludge to make it work in French. -% {\iftoggle{cms@fullnote}% -% {\bibstring{cbyeditoralt}\addspace}% -% {\bibstring{byeditoralt}\addspace}}% -% {\iftoggle{cms@fullnote}% -% {\bibstring{cbyeditor}\addspace}% -% {\bibstring{byeditor}\addspace}}}% - \protected\def\partedit#1{% \ifcat\noexpand~\noexpand#1% \ifundef{\cms@tempb}{}{\appto{\cms@tempb}{#1}}% @@ -4598,37 +6878,37 @@ \cms@tempa% }% -\newcommand{\part@edit@i}{% +\newcommand*{\part@edit@i}{% \iftoggle{cms@fullnote}% {\bibstring{cbyeditor}\addspace}% {\bibstring{byeditor}\addspace}}% -\newcommand{\partcomp}{% +\newcommand*{\partcomp}{% \iftoggle{cms@fullnote}% {\bibstring{cbycompiler}\addspace}% {\bibstring{bycompiler}\addspace}}% -\newcommand{\parteditandcomp}{% +\newcommand*{\parteditandcomp}{% \iftoggle{cms@fullnote}% {\bibstring{cbyeditorcp}\addspace}% {\bibstring{byeditorcp}\addspace}}% -\newcommand{\parttransandcomp}{% +\newcommand*{\parttransandcomp}{% \iftoggle{cms@fullnote}% {\bibstring{cbytranslatorcp}\addspace}% {\bibstring{bytranslatorcp}\addspace}}% -\newcommand{\partedittransandcomp}{% +\newcommand*{\partedittransandcomp}{% \iftoggle{cms@fullnote}% {\bibstring{cbyeditortrcp}\addspace}% {\bibstring{byeditortrcp}\addspace}}% -\newcommand{\parteditandtrans}{% +\newcommand*{\parteditandtrans}{% \iftoggle{cms@fullnote}% {\bibstring{cbyeditortr}\addspace}% {\bibstring{byeditortr}\addspace}}% -\newcommand{\reprint}{% +\newcommand*{\reprint}{% \iftoggle{cms@fullnote}% {\bibsstring{reprint}}% {\bibstring{reprint}}}% @@ -4666,10 +6946,10 @@ {\addspace}% {\iftoggle{cms@shortnote}% {\iffieldequalstr{entrysubtype}{classical}% - {\NumCheckSetup{\DeclareNumChars*{abcdeABCDE}}% Makes classical + {\DeclareNumChars*{abcdeABCDE:}% Makes classical \iffieldpages{postnote}% test more accurate. See 17.253. {\addspace}% - {\addcomma\addspace}}% + {\addcomma\addspace}\DeclareNumChars{.}}% {\addcomma\addspace}}% 16th ed -- no more volumes test. {\iftoggle{cms@fullnote}% {\ifthenelse{\(\ifentrytype{article}\OR @@ -4715,8 +6995,8 @@ and not togl {cms@fullnote}% }% - {\addperiod\addspace}% - {\addcomma\addspace}} + {\newunit}%\addperiod\addspace + {\newcunit}}%\addcomma\addspace \newcommand*{\nameadelim}{% \ifboolexpr{% @@ -4724,8 +7004,11 @@ and not togl {cms@fullnote}% }% - {\addperiod\addspace}% - {\addcomma\addspace}} + {\newunit}%\addperiod\addspace + {\newcunit}}%\addcomma\addspace + +\DeclareDelimFormat{dateeradelim}{\addnbspace}% +\DeclareDelimFormat{dateaddelim}{\addnbspace}% \DeclareListFormat{cfromoriglanguage}{% Needed for notes, to provide \begingroup% final {by}. @@ -4740,7 +7023,7 @@ {\ifboolexpr{% test {\ifnumless{\value{listcount}}{\value{liststop}}}% or - test \ifmoreitems% + test {\ifmoreitems}% }% {\bibstring{from#1}}% {\bibstring{cfrom#1}}}% @@ -4754,7 +7037,7 @@ \ifboolexpr{% test {\ifnumequal{\value{listcount}}{\value{liststop}}}% and - test \ifmoreitems% + test {\ifmoreitems}% }% {\ifnumgreater{\value{liststop}}{1}% {\finalandcomma}% @@ -4830,7 +7113,7 @@ ( togl {cms@citecrossref}% and - togl {cms@bookcitexref}% + togl {cms@bookcitexref}% ) or not togl {cms@allshort}% @@ -4844,21 +7127,31 @@ {\cms@citetracker@xref}}% {\cms@citetracker@crossref}}}}% - \def\cms@citetracker@crossref{% cf. \blx@citetracker@global \ifbool{citetracker}% {\xifinlistcs\abx@field@crossref{blx@bsee@\the\c@refsection}% {}% - {\listcsxadd{blx@bsee@\the\c@refsection}\abx@field@crossref}}% + {\listcsxadd{blx@bsee@\the\c@refsection}\abx@field@crossref% + \iffieldundef{clonesourcekey}% + {\cms@save@locdata{crossref}}{}}}% {}}% \def\cms@citetracker@xref{% cf. \blx@citetracker@global \ifbool{citetracker}% {\xifinlistcs\abx@field@xref{blx@bsee@\the\c@refsection}% {}% - {\listcsxadd{blx@bsee@\the\c@refsection}\abx@field@xref}}% + {\listcsxadd{blx@bsee@\the\c@refsection}\abx@field@xref% + \iffieldundef{clonesourcekey}% + {\cms@save@locdata{xref}}{}}}% {}}% +\def\cms@citetracker@clonesourcekey{% + \ifbool{citetracker}% + {\xifinlistcs\abx@field@clonesourcekey{blx@bsee@\the\c@refsection}% + {}% + {\listcsxadd{blx@bsee@\the\c@refsection}\abx@field@clonesourcekey% + \cms@save@locdata{clonesourcekey}}}% + {}}% \newbibmacro*{entrytail}{% From reading.bbx, for annotated bibliography \newunit\newblock @@ -4877,12 +7170,17 @@ {\setunit{\addspace}% \printtext[parens]{\printnames{holder}}}}} -\renewbibmacro*{byauthor}{% - \ifthenelse{\ifuseauthor\OR% - \ifnameundef{author}}% +\renewbibmacro*{byauthor}{% MT fix + \ifnameundef{author}% + {}% + {\ifboolexpr{% + test {\ifuseauthor}% + and not + test {\ifcsempty{abx@macro@author/editor}}% + }% {}% - {\bibstring{by}\addspace% - \printnames[byauthor]{author}}} + {\bibstring{byauthor}\addspace% + \printnames[byauthor]{author}}}} \newbibmacro*{byauthorpunct}{% \ifthenelse{\ifuseauthor\OR\ifnameundef{author}}% @@ -4894,7 +7192,15 @@ {}% {\ifnamesequal{author}{bookauthor}% {}% - {\bibstring{by}\addspace\printnames[default]{bookauthor}% + {\bibstring{byauthor}\addspace\printnames[default]{bookauthor}% + \newcunit\newblock}}} + +\newbibmacro*{music+bookauthor}{% + \ifnameundef{bookauthor}% + {}% + {\ifnamesequal{author}{bookauthor}% + {}% + {\printnames[default]{bookauthor}% \newcunit\newblock}}} \newbibmacro*{editorpunct}{% @@ -4902,14 +7208,22 @@ \iffieldundef{maintitle}\AND\iffieldundef{issuetitle}\)% \OR\iffieldsequal{booktitle}{title}% Changed these for crossrefed \OR\iffieldsequal{maintitle}{title}}% entries. Create problems? - {\ifentrytype{video}% Change for Video type? Appears + {\ifboolexpr{% + test {\ifentrytype{video}}% Change for Video type? Appears + or + togl {cms@mtvolpunct}% + }% {\newcunit\newblock}% to treat italicized title as booktitle in {\newunit\newblock}}% available examples. Added issuetitle 0.9.9c. {\newcunit\newblock}} \newbibmacro*{edition}{% \printfield{edition}% - \clearfield{edition}}% + \clearfield{edition}}% + +\newbibmacro*{version}{% + \printfield{version}% + \clearfield{version}}% \newbibmacro*{inforaft}{% \ifnameundef{introduction}% @@ -4932,9 +7246,14 @@ \newbibmacro*{mag+news+author}{% \ifnameundef{author}% - {\ifthenelse{\iffieldequals{journaltitle}{\bbx@lasthash}\AND\NOT - \iffirstonpage}% - {\bibnamedash\addperiod\addspace}% + {\ifboolexpr{% + test {\iffieldequals{journaltitle}{\bbx@lasthash}}% + and + not test {\iffirstonpage}% + and + togl {cms@namedash}% + }% + {\printtext{\bibnamedash}}% {\usebibmacro{journal+sub}% \setunit*{\addspace}% \printlist[periodplace]{location}% @@ -4955,7 +7274,7 @@ \newcunit \printlist{institution}% \setunit*{\addcomma\addspace}% - \usebibmacro{cmsyear}} + \usebibmacro{date}}% Instead of cmsyear \newbibmacro*{institution+organization}{% \iflistundef{organization}% @@ -4966,6 +7285,35 @@ \newcunit% \printlist{institution}}} +\newbibmacro*{misc+institution+organization}{% 17th ed. + \iffieldundef{number}% + {\iflistundef{organization}% + {\iflistundef{institution}% + {}% + {\printlist{institution}}}% + {\printlist{organization}% + \newcunit% + \printlist{institution}}}% + {\iflistundef{organization}% + {\iflistundef{institution}% + {\newcunit\printfield{number}}% + {\newcunit\printfield{number}% + \iftoggle{cms@fullnote}% + {\newcunit}% + {\newunit}% + \printlist{institution}}}% + {\iflistundef{institution}% + {\newcunit\printfield{number}% + \iftoggle{cms@fullnote}% + {\newcunit}% + {\newunit}% + \printlist{organization}}% + {\printlist{organization}% + \newcunit% + \printfield{number}% + \newcunit% + \printlist{institution}}}}} + \newbibmacro*{bibauthor+org}{% \ifnameundef{author}% {\ifnameundef{editor}% @@ -4975,8 +7323,10 @@ test {\iflistequals{organization}{\bbx@lasthash}}% and not test {\iffirstonpage}% + and + togl {cms@namedash}% }% - {\bibnamedash\addperiod\addspace}% + {\printtext{\bibnamedash}}% {\printlist{organization}% \savelist{organization}{\bbx@lasthash}}}}% {\usebibmacro{editor}}}% @@ -4991,10 +7341,19 @@ {\usebibmacro{editor}}}% {\usebibmacro{author/editor}}} +\renewbibmacro*{bytypestrg}[2]{% From biblatex.def + \iffieldundef{#1type}% + {\bibstring{by#2}}% + {\ifbibxstring{by\thefield{#1type}}% + {\bibstring{by\thefield{#1type}}}% + {\printtext[note]{\thefield{#1type}}}}}% + \newbibmacro*{cbytypestrg}[2]{% \iffieldundef{#1type}% {\bibstring{cby#2}}% - {\bibstring{cby\thefield{#1type}}}}% + {\ifbibxstring{cby\thefield{#1type}}% + {\bibstring{cby\thefield{#1type}}}% + {\printtext[note]{\thefield{#1type}}}}}% \newbibmacro*{cbyeditor}{% \ifnameundef{editor}% @@ -5104,7 +7463,7 @@ {\edef\@tempa{\@tempa af}% \clearname{afterword}}% {}}}% - \bibstring{\@tempa}\addspace% + \bibstring{\@tempa}\addspace% \setunit here? \printnames[byeditor]{editor}% \clearname{editor}% \newcunit% @@ -5202,7 +7561,7 @@ \printnames[byeditor]{namea}% \ifnameundef{nameb}% {}% - {\newunit% + {\usebibmacro{related:mtpunct}%\newunit% MT fix \bibstring{bytranslator}\addspace% \printnames[bytranslator]{nameb}}}}% {\usebibmacro{bytypestrg}{namea}{editor}% @@ -5210,7 +7569,7 @@ \printnames[byeditor]{namea}% \ifnameundef{nameb}% {}% - {\newunit% + {\usebibmacro{related:mtpunct}%\newunit% MT fix \bibstring{bytranslator}\addspace% \printnames[bytranslator]{nameb}}}}} @@ -5237,7 +7596,7 @@ \printnames[byeditor]{namea}% \ifnameundef{nameb}% {}% - {\newunit% + {\newcunit% \bibstring{cbytranslator}\addspace% \printnames[bytranslator]{nameb}}}}} @@ -5254,8 +7613,11 @@ \ifcsdef{cbx@incollpart}% {\restorefield{part}{\cbx@incollpart}}% {}% - \ifthenelse{\ifentrytype{mvbook}\OR\ifentrytype{mvcollection}\OR% - \ifentrytype{mvproceedings}\OR\ifentrytype{mvreference}}% + \ifboolexpr{% + test {\IfBeginWith{\thefield{entrytype}}{mv}}% + and + not test {\IfBeginWith{\thefield{relatedtype}}{maintitl}}% + }% {\printfield{volume}% \clearfield{volume}% \global\let\cbx@incollvol\undefined% Volume fix @@ -5271,8 +7633,11 @@ {\restorefield{part}{\cbx@incollpart}\toggletrue{cms@xrefpart}}% {}}% {}% - \ifthenelse{\ifentrytype{mvbook}\OR\ifentrytype{mvcollection}\OR% - \ifentrytype{mvproceedings}\OR\ifentrytype{mvreference}}% + \ifboolexpr{% + test {\IfBeginWith{\thefield{entrytype}}{mv}}% + and + not test {\IfBeginWith{\thefield{relatedtype}}{maintitl}}% + }% {\printfield[xrefpart]{part}% \clearfield{part}% \global\let\cbx@incollpart\undefined% Volume fix @@ -5313,19 +7678,35 @@ \newbibmacro*{chapinscore}{% \iffieldundef{chapter}% {\ifboolexpr{% - test {\ifentrytype{music}}% 16th ed. + not test {\iffieldundef{eventyear}}% and not test {\iffieldundef{booktitle}}% and + test {\ifentrytype{audio}}% + and not togl {cms@origpublished}% }% - {\bibstring{on}\setunit{\addspace}}% + {\bibstring{in}\setunit{\addspace}}% {}}% {\printfield{chapter}\clearfield{chapter}% \iffieldundef{booktitle}% {}% {\addspace\bibstring{of}\setunit{\addspace}}}}% +\newbibmacro*{chap+as+track}{% + \iffieldundef{chapter}% + {\ifboolexpr{% + not test {\iffieldundef{booktitle}}% + and + not togl {cms@origpublished}% + }% + {\bibstring{on}\setunit{\addspace}}% + {}}% + {\printfield{chapter}\clearfield{chapter}% + \iffieldundef{booktitle}% + {}% + {\addspace\bibstring{on}\setunit{\addspace}}}}% + \newbibmacro*{caddendum}{% New macros for 16th ed. field exclusion \ifboolexpr{% togl {cms@addendum}% @@ -5342,20 +7723,51 @@ \newbibmacro*{cser+num}{% \iftoggle{cms@bookseries}% - {\printfield{series}% + {\usebibmacro{series+or+shortser}% \printfield[sernum]{number}}% {}}% \newbibmacro*{ser+num}{% - \printfield{series}% + \usebibmacro{series+or+shortser}% \printfield[sernum]{number}} +\newbibmacro*{series+or+shortser}{% + \iffieldundef{shortseries}% + {\printfield{series}}% + {\ifboolexpr{% + ( + test {\ifcitation}% + and + togl {cms@citeshser}% + ) + or + ( + test {\ifbibliography}% + and + togl {cms@bibshser}% + ) + }% + {\printfield{shortseries}}% + {\printfield{series}}}} + \newbibmacro*{music+origdate}{% - \iftoggle{cms@reprint}% 16th ed. + \iffieldequalstr{pubstate}{reprint}% 17th ed. {}% {\iffieldundef{origyear}% {}% - {\usebibmacro{cmsorigdate}}}}% Date fix + {\usebibmacro{cmsorigdate}}% + \iffieldundef{pubstate}% + {}% + {\iffieldbibstring{pubstate}% + {\iftoggle{cms@fullnote}% + {\newcunit + \bibsstring{\thefield{pubstate}}}% + {\newunit + \biblstring{\thefield{pubstate}}}}% + {\iftoggle{cms@fullnote}% + {\newcunit}% + {\newunit}% + \printfield[prenote]{pubstate}}}}}% Date fix \newbibmacro*{music+eventdate}{% \iffieldundef{eventyear}% @@ -5365,20 +7777,17 @@ \newbibmacro*{ctitle+stitle}{% New test here for related entries. \iffieldundef{title}% {}% - {\printtext[title]{%:\thefield{entrytype}]{%(Changed for 0.7 to work) + {\printtext[title]{% \printfield[tnoformat]{title}% \setunit{\subtitlepunct}% \printfield[stnoformat]{subtitle}}}% \setunit{\ctitleaddonpunct}% \printfield{titleaddon}}% -% \setunit{\addspace}}% -% \usebibmacro{language+transtitle}% -% \setunit*{\addcomma}\newblock} \newbibmacro*{citaltitle+stitle}{% New test, as above. \iffieldundef{title}% {}% - {\printtext[title]{%:\thefield{entrytype}]{%(Changed for 0.7 to work) + {\printtext[title]{% \printfield[tnoformat]{title}% \setunit{\subtitlepunct}% \printfield[stnoformat]{subtitle}}}% @@ -5389,18 +7798,15 @@ \newcunit\newblock} \newbibmacro*{title+stitle}{% - \printtext[title]{%:\thefield{entrytype}]{%(Changed for 0.7 to work) + \printtext[title]{% \printfield[noformat]{title}% \setunit{\subtitlepunct}% \printfield[noformat]{subtitle}}% \setunit{\ptitleaddonpunct}% \printfield{titleaddon}}% -% \setunit{\addspace}}% -% \usebibmacro{language+transtitle}% -% \newunit\newblock} \newbibmacro*{italtitle+stitle}{% - \printtext[title]{%:\thefield{entrytype}]{%(Changed for 0.7 to work) + \printtext[title]{% \printfield[noformat]{title}% \setunit{\subtitlepunct}% \printfield[noformat]{subtitle}}% @@ -5411,7 +7817,7 @@ \newunit\newblock} \newbibmacro*{mag+news+title}{% - \printtext[title]{%:\thefield{entrytype}]{%(Changed for 0.7 to work) + \printtext[title]{% \printfield[noformat]{title}% \setunit{\subtitlepunct}% \printfield[noformat]{subtitle}}% @@ -5424,12 +7830,12 @@ {\usebibmacro{related:init}% \usebibmacro{related}}% {\printfield{titleaddon}}% - }%\newcunit\newblock} + }% \newbibmacro*{cmag+news+title}{% - \printtext[title]{%:\thefield{entrytype}]{%(Changed for 0.7 to work) + \printtext[title]{% \printfield[noformat]{title}% - \setunit{\subtitlepunct}%{\addcolon\addspace}% + \setunit{\subtitlepunct}% \printfield[noformat]{subtitle}}% \setunit{\ctitleaddonpunct}% \ifboolexpr{% @@ -5437,22 +7843,25 @@ and togl {cms@citerel}% }% - {\usebibmacro{related:init}% - \usebibmacro{related}}% + {\toggletrue{cms@relreview}% + \usebibmacro{related:init}% + \usebibmacro{related:noterefhelper}% + \usebibmacro{related}% + \togglefalse{cms@relreview}}% {\printfield{titleaddon}}% - }%\newcunit\newblock} + }% \newbibmacro*{clegis+news+title}{% \ifthenelse{\iffieldundef{title}\AND\iffieldundef{subtitle}\AND% \iffieldundef{titleaddon}}% {}% - {\printtext[title]{%:\thefield{entrytype}]{%(Changed for 0.7 to work) + {\printtext[title]{% \printfield[noformat]{title}% \setunit{\subtitlepunct}% \printfield[noformat]{subtitle}}% \setunit{\ctitleaddonpunct}% \printfield{titleaddon}% - }}%\newcunit\newblock} + }}% \newbibmacro*{language+transtitle}{% \iffieldundef{usere}% @@ -5484,18 +7893,21 @@ \setunit{\subtitlepunct}% \printfield[sbtnoformat]{booksubtitle}}% \setunit{\ctitleaddonpunct}% - \printfield{booktitleaddon}% - \setunit*{\addcomma\addspace}}} + \printfield{booktitleaddon}}}% -\newbibmacro*{publ+loc+year}{% Revised for reprint - \ifboolexpr{% - togl {cms@reprint}% - and - not test {\ifentrytype{video}}% - }% - {\bibstring{reprint}% - \newcunit}% +\newbibmacro*{publ+loc+year}{% Revised for reprint (17th ed.) + \iffieldundef{pubstate}% {}% + {\iffieldequalstr{pubstate}{reprint}% + {\ifentrytype{video}% + {}% + {\bibstring{reprint}% + \newcunit}}% + {\iffieldbibstring{pubstate}% + {\bibstring{\thefield{pubstate}}% + \newcunit}% + {\printfield[prenote]{pubstate}% + \newcunit}}}% \printlist{location}% \iflistundef{publisher}% {\setunit*{\addcomma\addspace}}% @@ -5515,12 +7927,17 @@ \usebibmacro{cmsorigdate}% } -\newbibmacro*{howpubl+loc+year}{% Revised for reprint +\newbibmacro*{howpubl+loc+year}{% Revised for reprint (17th ed) \usebibmacro{cmsorigdate}% \reprintpunct% - \iftoggle{cms@reprint}% - {\reprint\newcunit}% + \iffieldundef{pubstate}% {}% + {\iffieldbibstring{pubstate}% + {\iftoggle{cms@fullnote}% + {\bibsstring{\thefield{pubstate}}}% + {\biblstring{\thefield{pubstate}}}}% + {\printfield[prenote]{pubstate}}% + \newcunit}% \printlist{location}% \iffieldundef{howpublished}% {\setunit*{\addcomma\addspace}}% @@ -5530,12 +7947,17 @@ \usebibmacro{date}% } -\newbibmacro*{inst+loc+year}{% Revised for reprint - \usebibmacro{origpubl+loc+year}%{cmsorigdate}% 16th ed. +\newbibmacro*{inst+loc+year}{% Revised for reprint (17th ed) + \usebibmacro{origpubl+loc+year}% 16th ed. \reprintpunct% - \iftoggle{cms@reprint}% - {\reprint\newcunit}% + \iffieldundef{pubstate}% {}% + {\iffieldbibstring{pubstate}% + {\iftoggle{cms@fullnote}% + {\bibsstring{\thefield{pubstate}}}% + {\biblstring{\thefield{pubstate}}}}% + {\printfield[prenote]{pubstate}}% + \newcunit}% \printlist{location}% \iflistundef{institution}% {\setunit*{\addcomma\addspace}}% @@ -5553,21 +7975,64 @@ and test {\iffieldundef{year}}% and - not togl {cms@reprint}% + test {\iffieldundef{pubstate}}% 17th ed }% {}% {\setunit{\addspace}% \printtext[parens]{% - \usebibmacro{origpubl+loc+year}%{cmsorigdate}%\printfield{origyear}% + \usebibmacro{origpubl+loc+year}% \setunit*{\addsemicolon\addspace}% - \ifboolexpr{% - togl {cms@reprint}% - and - not test{\ifentrytype{video}}% - }% - {\bibsstring{reprint}% - \newcunit}% + \iffieldundef{pubstate}% 17th ed + {}% + {\iffieldequalstr{pubstate}{reprint}% + {\ifentrytype{video}% + {}% + {\bibsstring{reprint}% + \newcunit}}% + {\iffieldbibstring{pubstate}% + {\bibsstring{\thefield{pubstate}}% + \newcunit}% + {\printfield[prenote]{pubstate}% + \newcunit}}}% + \printlist{location}% + \iflistundef{publisher}% + {\setunit*{\addspace}}% + {\setunit*{\addcolon\addspace}}% + \printlist{publisher}% + \setunit{\addcomma\addspace}% + \usebibmacro{date}}}}% + +\newbibmacro*{crefpubl+loc+year}{% 17th ed. + \ifboolexpr{% + test {\iflistundef{location}}% + and + test {\iflistundef{publisher}}% + and + test {\iffieldundef{year}}% + and + test {\iffieldundef{pubstate}}% + and + test {\iffieldundef{note}}% + }% + {}% + {\setunit{\addspace}% + \printtext[parens]{% + \usebibmacro{origpubl+loc+year}% + \setunit*{\addsemicolon\addspace}% + \iffieldundef{pubstate}% {}% + {\iffieldequalstr{pubstate}{reprint}% + {\ifentrytype{video}% + {}% + {\bibsstring{reprint}% + \newcunit}}% + {\iffieldbibstring{pubstate}% + {\bibsstring{\thefield{pubstate}}% + \newcunit}% + {\printfield[prenote]{pubstate}% + \newcunit}}}% + \usebibmacro{cnotefield}% + \setunit*{\addcomma\addspace}% \printlist{location}% \iflistundef{publisher}% {\setunit*{\addspace}}% @@ -5595,8 +8060,8 @@ \setunit{\addcomma\addspace}% \usebibmacro{date}}}}% Changed for 0.9 -\newbibmacro*{originally+published+as}{% Punctuation fix now in - \iffieldundef{userf}% \origfullcite for 0.8e. +\newbibmacro*{originally+published+as}{% Punctuation fix now in + \iffieldundef{userf}% \origfullcite for 0.8e. {\iffieldundef{reprinttitle}% {}% {\usebibmacro{begrelated}% @@ -5628,9 +8093,14 @@ \newbibmacro*{org+publ+loc+year}{% What was wrong with \ifthenelse here? \usebibmacro{origpubl+loc+year}%{cmsorigdate}% 16th ed. \reprintpunct% - \iftoggle{cms@reprint}% Revised for reprint - {\reprint\newcunit}% + \iffieldundef{pubstate}% {}% + {\iffieldbibstring{pubstate}% + {\iftoggle{cms@fullnote}% + {\bibsstring{\thefield{pubstate}}}% + {\biblstring{\thefield{pubstate}}}}% + {\printfield[prenote]{pubstate}}% + \newcunit}% \printlist{location}% \iflistundef{organization}% {\iflistundef{publisher}% @@ -5643,44 +8113,10 @@ \setunit*{\addcomma\addspace}% \usebibmacro{date}} -\newbibmacro*{year+in+parens}{% - \iffieldundef{volume}% - {noformat}% - {parens}} - \newbibmacro*{cjournal+issue+year+pages}{% - \usebibmacro{cjournal+ser+vol+num}% - \ifboolexpr{% 16th ed. - test {\iffieldundef{issue}}% - and - test {\iffieldundef{year}}% - and - not togl {cms@switchdates}% - }% - {\iffieldundef{number}% - {\ifthenelse{\iffieldundef{pagination}\AND% - \iffieldundef{bookpagination}}% - {\setunit{\postvolpunct}}% - {\setunit{\addcolon\addspace}}}% - {\addcomma\addspace}}% - {\ifthenelse{\iffieldundef{volume}\AND\iffieldundef{number}}% 16th ed. - {\newcunit% - \iffieldundef{issue}% - {\usebibmacro{number+or+month}}% - {\printfield{issue}% - \setunit{\addspace}% - \usebibmacro{cmsyear}}% - \addcomma\addspace}% - {\setunit{\addspace}% - \printtext[parens]{% parens is the default here - \iffieldundef{issue}% - {\usebibmacro{number+or+month}}% - {\printfield{issue}% - \setunit{\addspace}% - \usebibmacro{cmsyear}}}}}} - -\newbibmacro*{cperiodical+issue+year+pages}{% For periodicals, - \usebibmacro{cperiodical+ser+vol+num}% subtype article + \ifentrytype{periodical}% + {\usebibmacro{cperiodical+ser+vol+num}}% + {\usebibmacro{cjournal+ser+vol+num}}% \ifboolexpr{% 16th ed. test {\iffieldundef{issue}}% and @@ -5690,7 +8126,7 @@ }% {\iffieldundef{number}% {\ifthenelse{\iffieldundef{pagination}\AND% - \iffieldundef{bookpagination}}% + \iffieldundef{bookpagination}\AND\iffieldundef{eid}}% {\setunit{\postvolpunct}}% {\setunit{\addcolon\addspace}}}% {\addcomma\addspace}}% @@ -5716,28 +8152,32 @@ {\printlist{origlocation}% \newcunit\newblock}% \iftoggle{cms@switchdates}% - {\ifthenelse{\iffieldundef{year}\AND\iffieldundef{month}}% + {\ifthenelse{\iffieldundef{year}\AND\iffieldundef{month}\AND% + \iffieldundef{season}}% {}% - {\cms@datelongalt}}% - {\ifthenelse{\iffieldundef{origyear}\AND\iffieldundef{origmonth}}% + {\cms@datelong{}}}% + {\ifthenelse{\iffieldundef{origyear}\AND\iffieldundef{origmonth}\AND% + \iffieldundef{origseason}}% {}% - {\cms@datelong}}} + {\cms@datelong{orig}}}} \newbibmacro*{unpubl+letter+date}{% For Misc entries - \iflistundef{origlocation}% + \iffieldundef{venue}% {}% - {\printlist{origlocation}% + {\printfield{venue}% \newcunit\newblock}% \iftoggle{cms@switchdates}% - {\ifthenelse{\iffieldundef{year}\AND\iffieldundef{month}}% + {\ifthenelse{\iffieldundef{year}\AND\iffieldundef{month}\AND% + \iffieldundef{season}}% {}% - {\cms@datelongalt}}% - {\ifthenelse{\iffieldundef{origyear}\AND\iffieldundef{origmonth}}% + {\cms@datelong{}}}% + {\ifthenelse{\iffieldundef{origyear}\AND\iffieldundef{origmonth}\AND% + \iffieldundef{origseason}}% {\printdate}% For interviews and other dated non-letters. - {\cms@datelong}}} + {\cms@datelong{orig}}}} -\newbibmacro*{pubstate}{% - \iftoggle{cms@reprint}% +\newbibmacro*{music+pubstate}{% + \iffieldequalstr{pubstate}{reprint}% {\iftoggle{cms@switchdates}% {\iffieldundef{year}% {}% @@ -5762,6 +8202,15 @@ {\printorigdate}% {\printdate}} +\newbibmacro*{time+stamp}{% 17th ed. + \iftoggle{cms@switchdates}% + {\iffieldundef{orighour}% + {}% + {\newcunit\printorigtime}}% + {\iffieldundef{hour}% + {}% + {\newcunit\printtime}}} + \newbibmacro{cite:xref+date}{% \ifboolexpr{% togl {cms@omitxrefdate}% @@ -5818,8 +8267,8 @@ \newbibmacro*{cmsyear}{% \iftoggle{cms@switchdates}% - {\printfield{origyear}}% - {\printfield{year}}} + {\printorigdateextra}% \printfield{origyear} + {\printdateextra}}% \printfield{year} \newbibmacro*{number+or+month}{% \iffieldundef{number}% @@ -5828,36 +8277,37 @@ {\usebibmacro{date}}% {\usebibmacro{cmsyear}}}} -\newcommand*{\cms@datelong}{% Modified for 0.9 - \iffieldundef{origmonth}% - {\printfield{origyear}}% - {\printfield[letterday]{origday}\setunit*{\nobreakspace}% Bug fix - \mkbibmonth{\thefield{origmonth}}\setunit{\nobreakspace}% - \printfield{origyear}}}% - -\newcommand*{\cms@datelongalt}{% Modified for 0.9 - \iffieldundef{month}% - {\printfield{year}}% - {\printfield[letterday]{day}\setunit*{\nobreakspace}% - \mkbibmonth{\thefield{month}}\setunit{\nobreakspace}% - \printfield{year}}}% - -\newcommand*{\letterdatelong}{% Modified for 0.9 - \iftoggle{cms@switchdates}% This one for users - {\iffieldundef{year}% Previous two for internal use +\newcommand*{\cms@datelong}[1]{% Modified for 17th ed. + \begingroup + \protected\def\mkbibdatelong##1##2##3{% + \iffieldundef{##3}% {}% - {\iffieldundef{month}% - {\printfield{year}}% - {\printfield[letterday]{day}\setunit*{\nobreakspace}% - \mkbibmonth{\thefield{month}}\setunit{\nobreakspace}% - \printfield{year}}}}% - {\iffieldundef{origyear}% + {\iftoggle{cms@ukord}% + {\mkbibordinal{\thefield{##3}}}% + {\stripzeros{\thefield{##3}}}% + \iffieldundef{##2}{}{\nobreakspace}}% + \iffieldundef{##2}% {}% - {\iffieldundef{origmonth}% - {\printfield{origyear}}% - {\printfield[letterday]{origday}\setunit*{\nobreakspace}% - \mkbibmonth{\thefield{origmonth}}\setunit{\nobreakspace}% - \printfield{origyear}}}}}% + {\mkbibmonth{\thefield{##2}}% + \iffieldundef{##1}{}{\space}}% + \iffieldbibstring{##1}% + {\bibstring{\thefield{##1}}}% + {\cmsdateeraprintpre{##1}\stripzeros{\thefield{##1}}}}% + \cms@mkbibrangetrunc{long}{#1}% + \endgroup}% + +\newrobustcmd*{\letterdatelong}{% For users: 17th ed. + \ifboolexpr{% + test {\ifdefstring{\blx@languagename}{american}}% + or + test {\ifdefstring{\blx@languagename}{english}}% i.e., no babel + }% + {\iftoggle{cms@switchdates}% + {\cms@datelong{}}% + {\cms@datelong{orig}}}% + {\iftoggle{cms@switchdates}% + {\printdate}% + {\printorigdate}}}% \newbibmacro*{cjournal+ser+vol+num}{% \usebibmacro{journal+sub}% @@ -5871,10 +8321,7 @@ \newcunit}%\setunit*{\addspace}? \printfield[jourvol]{volume}% \setunit{\addcomma\addspace}% need * here? - \printfield[journum]{number}% - \setunit{\addcomma\addspace}% - \printfield{eid}% - \newunit}% + \printfield[journum]{number}}% Moved eid for 17th ed. \newbibmacro*{cperiodical+ser+vol+num}{% For periodical entries, \ifboolexpr{% article subtype @@ -5908,10 +8355,7 @@ \newcunit}%\setunit*{\addspace}? \printfield[jourvol]{volume}% \setunit{\addcomma\addspace}% need * here? - \printfield[journum]{number}% - \setunit{\addcomma\addspace}% - \printfield{eid}% - \newunit} + \printfield[journum]{number}}% Move eid field for 17th ed. \newbibmacro*{journal+sub}{% \iffieldundef{journaltitle}% @@ -5944,8 +8388,15 @@ togl {cms@url}% and not test {\iffieldundef{urlyear}}% + }% + {\printurldate% + \ifboolexpr{% 17th ed. + togl {cms@urltime}% + and + not test {\iffieldundef{urlhour}}% }% - {\printurldate}% Date fix + {\newcunit\printurltime}% + {}}% Date fix {}% \newcunit\newblock \iftoggle{cms@doionly}% @@ -5983,17 +8434,29 @@ \setunit*{\addcomma\addspace}% \printfield{pages}} -\newbibmacro*{mag+news+date}{% 16th ed. +\newbibmacro*{mag+news+date}{% 17th ed. \iftoggle{cms@fullnote}% - {\usebibmacro{mag+date+issue}}% + {\usebibmacro{cmag+date+issue}}% {\ifnameundef{author}% - {\usebibmacro{date+issue}}% + {\iffieldundef{maintitle}% + {\newunit\newblock}% Punctuation differs after title and jtitle + {\printtext[maintitle]{% + \printfield[mtnoformat]{maintitle}% + \setunit{\subtitlepunct}% + \printfield[smtnoformat]{mainsubtitle}}% + \setunit{\ctitleaddonpunct}% + \printfield{maintitleaddon}% + \newcunit\newblock}% + \printfield{usera}% + \setunit*{\addcomma\addspace}\newblock% + \usebibmacro{date+issue}}% {\usebibmacro{mag+date+issue}}}} \newbibmacro*{date+issue}{% \iffieldundef{issue}% {\iffieldundef{number}% - {\usebibmacro{date}}% + {\usebibmacro{date}% + \usebibmacro{time+stamp}}% 17th ed. {\iftoggle{cms@numbermonth}% For exclusion of month {\usebibmacro{date}}% {\usebibmacro{cmsyear}}% @@ -6003,10 +8466,37 @@ \setunit{\addspace}% \usebibmacro{cmsyear}}} +\newbibmacro*{cmag+date+issue}{% + \usebibmacro{journal+sub}% + \setunit*{\addspace}% + \printlist[periodplace]{location}% + \newcunit\newblock + \iffieldundef{maintitle}% + {}% + {\printtext[maintitle]{% + \printfield[mtnoformat]{maintitle}% + \setunit{\subtitlepunct}% + \printfield[smtnoformat]{mainsubtitle}}% + \setunit{\ctitleaddonpunct}% + \printfield{maintitleaddon}} + \newcunit\newblock + \printfield{usera}% For network ID and possible section of newspaper. + \newcunit\newblock + \usebibmacro{date+issue}} + \newbibmacro*{mag+date+issue}{% \usebibmacro{journal+sub}% \setunit*{\addspace}% \printlist[periodplace]{location}% + \newunit\newblock + \iffieldundef{maintitle}% + {}% + {\printtext[maintitle]{% + \printfield[mtnoformat]{maintitle}% + \setunit{\subtitlepunct}% + \printfield[smtnoformat]{mainsubtitle}}% + \setunit{\ctitleaddonpunct}% + \printfield{maintitleaddon}} \newcunit\newblock \printfield{usera}% For network ID and possible section of newspaper. \newcunit\newblock @@ -6036,6 +8526,15 @@ \printfield[stnoformat]{subtitle}}}% \setunit*{\addspace}% \printlist[periodplace]{location}% + \iftoggle{cms@fullnote}{\newcunit}{\newunit}% + \iffieldundef{maintitle}% + {}% + {\printtext[maintitle]{% + \printfield[mtnoformat]{maintitle}% + \setunit{\subtitlepunct}% + \printfield[smtnoformat]{mainsubtitle}}% + \setunit{\ctitleaddonpunct}% + \printfield{maintitleaddon}} \newcunit\newblock \printfield{usera}% For network ID and possible section of newspaper. \newcunit\newblock @@ -6069,6 +8568,7 @@ \newbibmacro*{cmtitle+mstitle+vol+part+btitle+bstitle}{% \usebibmacro{btitle+bstitle}% + \newcunit% MT Fix \iffieldundef{maintitle}% {}% {\ifthenelse{\(\iffieldundef{volume}\AND\iffieldundef{part}\)\OR% @@ -6116,37 +8616,41 @@ \iftoggle{cms@fullnote}% {\global\togglefalse{cms@shortnote}% \global\togglefalse{cms@fullnote}}% - {\iftoggle{cms@printshhand}% - {\iffieldundef{postnote}% - {\iffieldundef{shorthand}% - {\global\togglefalse{cms@printshhand}% - \global\togglefalse{cms@shortnote}% - \global\togglefalse{cms@fullnote}}% - {\setunit{\shorthandpunct}% - \usebibmacro{cms:shorthandintro}% - \global\togglefalse{cms@printshhand}% - \global\togglefalse{cms@shortnote}% - \global\togglefalse{cms@fullnote}}}% - {\iffieldundef{shorthand}% - {\postnotewrapper%delim% - \usebibmacro{semel:postnote}% - \global\togglefalse{cms@printshhand}% + {\IfBeginWith{\thefield{entrytype}}{mv}% + {\usebibmacro{crossref:volume+postnote}}% + {\iftoggle{cms@printshhand}% + {\iffieldundef{postnote}% + {\iffieldundef{shorthand}% + {\global\togglefalse{cms@printshhand}% + \global\togglefalse{cms@shortnote}% + \global\togglefalse{cms@fullnote}}% + {\setunit{\shorthandpunct}% + \usebibmacro{cms:shorthandintro}% + \global\togglefalse{cms@printshhand}% + \global\togglefalse{cms@shortnote}% + \global\togglefalse{cms@fullnote}}}% + {\iffieldundef{shorthand}% + {\postnotewrapper%delim% + \usebibmacro{semel:postnote}% + \global\togglefalse{cms@printshhand}% + \global\togglefalse{cms@shortnote}% + \global\togglefalse{cms@fullnote}}% + {\postnotewrapper%delim% + \usebibmacro{semel:postnote}% + \setunit{\shorthandpunct}% + \usebibmacro{cms:shorthandintro}% + \global\togglefalse{cms@printshhand}% + \global\togglefalse{cms@shortnote}% + \global\togglefalse{cms@fullnote}}}}% + {\iffieldundef{postnote}% + {\usebibmacro{print+noteref}% \global\togglefalse{cms@shortnote}% \global\togglefalse{cms@fullnote}}% {\postnotewrapper%delim% \usebibmacro{semel:postnote}% - \setunit{\shorthandpunct}% - \usebibmacro{cms:shorthandintro}% - \global\togglefalse{cms@printshhand}% + \usebibmacro{print+noteref}% \global\togglefalse{cms@shortnote}% - \global\togglefalse{cms@fullnote}}}}% - {\iffieldundef{postnote}% - {\global\togglefalse{cms@shortnote}% - \global\togglefalse{cms@fullnote}}% - {\postnotewrapper%delim% - \usebibmacro{semel:postnote}% - \global\togglefalse{cms@shortnote}% - \global\togglefalse{cms@fullnote}}}}}% + \global\togglefalse{cms@fullnote}}}}}}% \newbibmacro*{fullpostnote}{% \iffieldundef{postnote}% @@ -6160,6 +8664,22 @@ {\postnotewrapper%delim% Don't need \ifbibliography test w/ following \usebibmacro{semel:postnote}}} +\newbibmacro*{eid+fullpostnote}{% + \iffieldundef{postnote}% + {\iffieldundef{chapter}% + {\iffieldundef{pages}% + {\iffieldundef{eid}% + {}% + {\postnotedelim% + \printfield{eid}% + \clearfield{eid}}}% + {\postnotedelim% + \printfield{pages}}}% + {\postnotedelim% + \printfield{chapter}}}% + {\postnotewrapper% + \usebibmacro{semel:postnote}}} + \newbibmacro*{juridpostnote}{% \iftoggle{cms@fullnote}% {\iffieldundef{issue}% @@ -6289,6 +8809,9 @@ \printfield{volumes}}}} \newbibmacro*{crossref:volume+postnote}{% + \IfBeginWith{\thefield{entrytype}}{mv}% + {\usebibmacro{extract+mt+vol}}% + {}% \ifcsdef{cbx@incollpgn}% {\restorefield{pagination}{\cbx@incollpgn}}% {}% @@ -6395,7 +8918,8 @@ {\ifcsdef{cbx@incollpages}% {\restorefield{pages}{\cbx@incollpages}% \usebibmacro{fullpostnote}}% - {\usebibmacro{fullpostnote}}}}}}}% + {\usebibmacro{fullpostnote}}}}}}% + \usebibmacro{print+noteref}}% \newbibmacro*{pages+cref+print}{% Reusable chunk for above \iffieldundef{part}% @@ -6442,6 +8966,12 @@ \usebibmacro{semel:postnote}}} \newbibmacro*{xrefprenote}{% + \ifboolexpr{% Kludgy fix for spurious idem + test {\ifdefvoid{\blx@idemtracker}}% + or + test {\ifbibliography}% + }% + {}{\blx@idemtracker}% \iffieldundef{volume}{}{\savefield{volume}{\cbx@incollvol}}% \iffieldundef{pages}{}{\savefield{pages}{\cbx@incollpages}}% \iffieldundef{part}{}{\savefield{part}{\cbx@incollpart}}% @@ -6471,23 +9001,10 @@ \global\let\cbx@incollpgn\undefined% \global\let\cbx@incollbkpgn\undefined}% -\newbibmacro*{hlprenote}{% Removes spurious comma after prenote in - \iffieldundef{prenote}% \headlessfullnote citations. - {}% - {\printfield{prenote}% - \nopunct}}% Do we need \unspace here? - -\newbibmacro*{hlcprenote}{% As previous, but for generalized \headlesscite - \iffieldundef{prenote}% command, rather than \headlessfullcite. - {\bibsentence}% Needed for Ibid to be capitalized. - {\printfield{prenote}% - \ifboolexpr{% - test {\ifciteseen}% - or - togl {cms@allshort}% - }% - {\addspace}% - {\nopunct}}}% Do we need \unspace here? +\newbibmacro*{hlpunct}{% + \iftoggle{cms@headlessnote}% + {}% + {\newcunit\newblock}} \newbibmacro*{journalprenote}{% \iffieldundef{prenote}% @@ -6587,6 +9104,29 @@ \noinherit{indexsorttitle} } +\DeclareDataInheritance{mvcollection}{book}{% MT revision + \inherit{title}{maintitle} + \inherit{subtitle}{mainsubtitle} + \inherit{titleaddon}{maintitleaddon} + \noinherit{shorttitle} + \noinherit{sorttitle} + \noinherit{indextitle} + \noinherit{indexsorttitle} +} + +\AtEndPreamble{% + \iftoggle{cms@blogurl}% 17th ed. blogs w/ comments + {\DeclareDataInheritance{article}{review,suppperiodical}{% + \inherit{url}{url}% + }}{}% + \@ifpackageloaded{endnotes}% + {\patchcmd\theendnotes + {\enoteformat} + {\toggletrue{cms@endnote}\enoteformat} + {} + {\blx@err@patch{'endnotes' package}}}% + {}}% + \DeclareDataInheritance{*}{*}{% \noinherit{namea} \noinherit{nameb} @@ -6597,6 +9137,9 @@ \noinherit{urlyear} \noinherit{urlmonth} \noinherit{urlday} + \noinherit{urlseason} + \noinherit{urlhour} + \noinherit{urlminute} \noinherit{doi} \noinherit{eprint} \noinherit{eprinttype} @@ -6607,15 +9150,19 @@ \noinherit{year} \noinherit{month} \noinherit{day} + \noinherit{season} \noinherit{endyear} \noinherit{endmonth} \noinherit{endday} + \noinherit{endseason} \noinherit{origyear} \noinherit{origmonth} \noinherit{origday} + \noinherit{origseason} \noinherit{origendyear} \noinherit{origendmonth} - \noinherit{origendday}} + \noinherit{origendday} + \noinherit{origendseason}} \DeclareSortingTemplate{cms}{% Updated for biblatex > 3.7 \sort{ @@ -6651,12 +9198,22 @@ } } +\DeclareSortExclusion{misc,online}{organization} +\DeclareSortExclusion{inreference,mvreference,reference}{% + author,editor,namea,nameb,namec,translator} + \DeclareSortingTemplate{shortjournal}{% \sort{ \field{shortjournal} } } +\DeclareSortingTemplate{shortseries}{% + \sort{ + \field{shortseries} + } +} + \newbibmacro*{compilestrg}{% \ifthenelse{\value{namec}>1\OR\ifandothers{namec}}% {\bibstring{compilers}}% @@ -6715,9 +9272,11 @@ {\bibstring{editortranslator}% \clearname{translator}}% {\bibstring{editor}}}}}}% - {\ifthenelse{\value{editor}>1\OR\ifandothers{editor}}% - {\bibstring{\thefield{editortype}s}}% - {\bibstring{\thefield{editortype}}}}% + {\ifbibxstring{\thefield{editortype}}% + {\ifthenelse{\value{editor}>1\OR\ifandothers{editor}}% + {\bibstring{\thefield{editortype}s}}% + {\bibstring{\thefield{editortype}}}}% + {\printtext[note]{\thefield{editortype}}}}% \clearname{editor}}% \newbibmacro*{parteditstrg}{% @@ -6748,9 +9307,11 @@ {\bibstring{editortranslator}% \clearname{nameb}}% {\bibstring{editor}}}}}}% - {\ifthenelse{\value{namea}>1\OR\ifandothers{namea}}% - {\bibstring{\thefield{nameatype}s}}% - {\bibstring{\thefield{nameatype}}}}% + {\ifbibxstring{\thefield{nameatype}}% + {\ifthenelse{\value{namea}>1\OR\ifandothers{namea}}% + {\bibstring{\thefield{nameatype}s}}% + {\bibstring{\thefield{nameatype}}}}% + {\printtext[note]{\thefield{nameatype}}}}% \clearname{namea}}% \newbibmacro*{clearorigin}{% @@ -6792,17 +9353,22 @@ \ifentrytype{proceedings}\OR\ifentrytype{reference}\OR% \ifentrytype{suppbook}\OR\ifentrytype{suppcollection}\)\OR% \(\(\ifentrytype{audio}\OR\ifentrytype{music}\OR% - \ifentrytype{video}\)\AND\iffieldundef{booktitle}\)}% + \ifentrytype{video}\)\AND\(\iffieldundef{booktitle}\AND% + \iffieldundef{entrysubtype}\)\)}% Song w/o album? {}% {\clearfield{title}% \clearfield{subtitle}% \clearfield{titleaddon}% \clearfield{usere}% - \clearlist{language}}% + \clearlist{language}% + \ifentrytype{music}% + {\clearfield{note}\clearfield{howpublished}\clearfield{eventyear}% + \clearfield{eventmonth}}% + {}}% \ifentrytype{letter}% {\iftoggle{cms@switchdates}% - {\clearfield{year}\clearfield{month}}% - {\clearfield{origyear}\clearfield{origmonth}}% + {\clearfield{year}\clearfield{month}\clearfield{season}}% + {\clearfield{origyear}\clearfield{origmonth}\clearfield{origseason}}% \clearfield{origlocation}}% {}% \clearfield{reprinttitle}% @@ -6810,40 +9376,168 @@ %%%% Related macros from biblatex.def %%%% +\renewcommand*{\begrelateddelim}{% + \ifcitation{\newcunitpunct}% + {\ifboolexpr{% + togl {cms@fullnote}% + or + togl {cms@shortnote}% + }% + {\newcunitpunct}% + {\newunitpunct}}}% + +\newcommand*{\begrelateddelimreviewof}{% + \ifcitation{\newcunitpunct}% + {\ifboolexpr{% + togl {cms@fullnote}% + or + togl {cms@shortnote}% + }% + {\newcunitpunct}% + {\newunitpunct}}} + \newbibmacro*{related:reviewof}[1]{% \iftoggle{cms@shortnote}% - {\entrydata{#1}{% + {\entrydata*{#1}{% + \cmsrelhyper{\printfield[citetitle]{labeltitle}}}}% + {\entrydata*{#1}{% + \printtext[cmsdefrelhypertarget]{% + \let\newunit\newcunit% + \iffieldundef{title}% + {}% + {\printtext[title]{% + \printfield[tnoformat]{title}% + \setunit{\subtitlepunct}% + \printfield[stnoformat]{subtitle}}}% + \newcunit% + \ifnameundef{author}% + {\newcunit% + \ifbibliography% + {\usebibmacro{byeditor+others}}% + {\usebibmacro{cbyeditor+others}}}% + {\bibstring{byauthor}\addspace% + \printnames[byauthor]{author}% + \ifbibliography% + {\newcunit\usebibmacro{byeditor+others}}% + {\newcunit\usebibmacro{cbyeditor+others}}}% + \setunit{\ctitleaddonpunct}% + \printfield{titleaddon}}}}}% + +\newbibmacro*{related:commenton}[1]{% + \iftoggle{cms@shortnote}% + {\entrydata*{#1}{% + \iffieldequalstr{authortype}{anon}% + {\bibleftbracket\printnames{labelname}% + \bibrightbracket\classicpunct}% + {\iffieldequalstr{authortype}{anon?}% + {\bibleftbracket\printnames{labelname}?% + \bibrightbracket\classicpunct}% + {\cmsrelnamehyper{\printnames{labelname}}% + \isdot\classicpunct}}% + \usebibmacro{cms+relextra+test}}}% + {\ifbibliography% + {\entrydata*{#1}{% + \ifentryinbib{\strfield{clonesourcekey}}% + {\iffieldequalstr{authortype}{anon}% + {\bibleftbracket\printnames{labelname}% + \bibrightbracket\classicpunct}% + {\iffieldequalstr{authortype}{anon?}% + {\bibleftbracket\printnames{labelname}?% + \bibrightbracket\classicpunct}% + {\printnames{labelname}% + \isdot\classicpunct}}% + \usebibmacro{cms+relextra+test}}% + {\usebibmacro{at+every+item}\toggletrue{cms@fullnote}% + \iffieldundef{savedyear}{}{\clearfield{year}}% + \iffieldundef{savedmonth}{}{\clearfield{month}}% + \iffieldundef{savedseason}{}{\clearfield{season}}% + \iffieldundef{savedurl}{}{\clearfield{url}}% + \iffieldundef{savedaddendum}{}{\clearfield{addendum}}% + \usebibmacro{bib:related:full}}}}% + {\entrydata*{#1}{% + \ifentryseen{\thefield{clonesourcekey}}% + {\iffieldequalstr{authortype}{anon}% + {\bibleftbracket\printnames{labelname}% + \bibrightbracket\classicpunct}% + {\iffieldequalstr{authortype}{anon?}% + {\bibleftbracket\printnames{labelname}?% + \bibrightbracket\classicpunct}% + {\cmsrelnamehyper{\printnames{labelname}}% + \isdot\classicpunct}}% + \usebibmacro{cms+relextra+test}}% + {\usebibmacro{at+every+item}% + \iffieldundef{savedurl}{}{\clearfield{url}}% + \iffieldundef{savedaddendum}{}{\clearfield{addendum}}% + \listcsxadd{blx@bsee@\the\c@refsection}{\strfield{clonesourcekey}}% + \usebibmacro{cite:related:full}}}}}} + +% Used inside previous to allow chains of relatedtype "commenton" +% entries to mimic online thread structure. In particular it stops +% the printing of auto-generated title fields. + +\newbibmacro*{cms+relextra+test}{% + \ifboolexpr{% + test {\iffieldequalstr{relatedtype}{commenton}}% + and + ( + test {\ifentrytype{review}}% + or + test {\ifentrytype{suppperiodical}}% + or + ( + test {\ifentrytype{online}}% + and + test {\IfBeginWith{\thefield{title}}{CCCCCC}}% + )) + }% + {\entrydata{\thefield{clonesourcekey}}{% \ifboolexpr{% - togl {cms@allshort}% - or - test {\ifbibliography}% + test {\iffieldundef{extratitle}}% + and + test {\iffieldundef{extraname}}% }% - {\printtext[bibhyperref]{% - \printfield[citetitle]{labeltitle}}}% - {\printtext[cmshyperlink]{% - \printfield[citetitle]{labeltitle}}}}}% - {\entrydata*{#1}{% - \let\newunit\newcunit% - % \bibstring{reviewof}% - \iffieldundef{title}% {}% - {\printtext[title]{% - \printfield[tnoformat]{title}% - \setunit{\subtitlepunct}% - \printfield[stnoformat]{subtitle}}}% - \newcunit% - \ifnameundef{author}% - {\newcunit% - \ifbibliography% - {\usebibmacro{byeditor+others}}% - {\usebibmacro{cbyeditor+others}}}% - {\bibstring{by}\addspace% - \printnames[byauthor]{author}% - \ifbibliography% - {\newcunit\usebibmacro{byeditor+others}}% - {\newcunit\usebibmacro{cbyeditor+others}}}% - \setunit{\ctitleaddonpunct}% - \printfield{titleaddon}}}}% + {\ifcsundef{cms@xfield}% + {\ifentrytype{online}% + {\setunit{\addspace}% + \printtext[parens]{% + \printdate% + \iffieldundef{hour}% + {}% + {\newcunit\printtime}}}% + {\setunit{\addspace}% + \printtext[parens]{% + \printeventdate% + \iffieldundef{eventhour}% + {}% + {\newcunit\printeventtime}}}}% + {\setunit{\shortextrapunct}% + \usebibmacro{shortnote+extrafield}}}}}% + {\cmsrelhyper{\printfield[citetitle]{labeltitle}}}} + +\newrobustcmd*{\cmsrelnamehyper}[1]{% + \ifhyperref% + {\ifboolexpr{% + test {\iffieldequalstr{relatedtype}{commenton}}% + and + ( + test {\ifentrytype{review}}% + or + test {\ifentrytype{suppperiodical}}% + or + ( + test {\ifentrytype{online}}% + and + test {\IfBeginWith{\thefield{title}}{CCCCCC}}% + )) + }% + {\iffieldequalstr{savedrelatedtype}{commenton}% + {\iftoggle{cms@allshort}% + {#1}% + {\bibhyperlink{\strfield{clonesourcekey}}{#1}}}% + {\cmsrelhyper{#1}}}% + {#1}}% + {#1}} \renewbibmacro*{related:origpubas}[1]{% \entrydata*{#1}{% @@ -6873,23 +9567,187 @@ \renewbibmacro*{related:default}[1]{% \entrydata*{#1}{% - \usedriver% + \printtext[cmsdefrelhypertarget]{% + \usedriver% {\ifnameundef{savedauthor}% - {\ifnameundef{savededitor}% + {\ifnameundef{savededitor}% + {}% + {\ifnamesequal{editor}{savededitor}% + {\iftoggle{cms@headlessnote}% + {}% + {\clearname{editor}}}% + {}}}% + {\ifnamesequal{author}{savedauthor}% + {\iftoggle{cms@headlessnote}% {}% + {\clearname{author}}}% + {}}% + \usebibmacro{at+every+item}% + \renewbibmacro*{related:init}{}% + \DeclareNameAlias{sortname}{default}% + \renewbibmacro*{pageref}{}% + \toggletrue{cms@fullnote}% + \togglefalse{cms@shortnote}}%\nopunct + {cite:\thefield{entrytype}}}}}% + +\newbibmacro*{related:maintitle}[1]{% + \entrydata*{#1}{% + \ifthenelse{\ifentrytype{mvbook}\OR\ifentrytype{mvcollection}\OR% + \ifentrytype{mvproceedings}\OR\ifentrytype{mvreference}}% + {\iffieldundef{volumes}{}{\savefield*{volumes}{\cms@mtvolumes}}% + \bibstring{in}\nopunct}% + {\ifcsdef{cms@mtvolumes}{\restorefield{savedvolumes}{\cms@mtvolumes}}{}% + \ifthenelse{\iffieldundef{volume}\AND\iffieldundef{part}}% + {\ifthenelse{\iffieldundef{volumes}\AND\iffieldundef{savedvolumes}}% + {\bibsstring{thiscite}\nopunct}% + {\iffieldundef{volumes}% + {\printfield[volumes]{savedvolumes}}% + {\printfield{volumes}\clearfield{volumes}}% + \newcunit\bibsstring{thiscite}% + \nopunct}}% + {\iffieldundef{volume}% + {\printfield[xrefpart]{part}\usebibmacro{mt:ofvols}}% + {\iffieldundef{part}% + {\printfield{volume}\usebibmacro{mt:ofvols}}% + {\printfield{volume}\usebibmacro{mt:ofvols}\printfield{part}}}}% + \ifcsdef{cms@mtpages}{\restorefield{pages}{\cms@mtpages}}{}% + \ifcsdef{cms@mtpagination}{\restorefield{bookpagination}% + {\cms@mtpagination}}{}% + \ifcsdef{cms@mtchapter}{\restorefield{chapter}{\cms@mtchapter}}{}% + \ifcsdef{cms@mtauthor}% + {\savename*{author}{\cms@mtsecauthor}% + \ifcsequal{cms@mtauthor}{cms@mtsecauthor}% + {\clearname{author}}% + {}}% + {}% + \ifcsdef{cms@mteditor}% + {\savename*{editor}{\cms@mtseceditor}% + \ifcsequal{cms@mteditor}{cms@mtseceditor}% + {\clearname{editor}}% + {}}% + {}% + \ifcsdef{cms@mttranslator}% + {\savename*{translator}{\cms@mtsectranslator}% + \ifcsequal{cms@mttranslator}{cms@mtsectranslator}% + {\clearname{translator}}% + {}}% + {}% + \ifcsdef{cms@mtnamec}% + {\savename*{namec}{\cms@mtsecnamec}% + \ifcsequal{cms@mtnamec}{cms@mtsecnamec}% + {\clearname{namec}}% + {}}% + {}}% + \ifbibliography% + {\printtext[cmsdefrelhypertarget]{% + \usedriver% + {\ifnameundef{savedauthor}% + {\ifnameundef{savededitor}% + {\ifnameundef{savedtranslator}% + {\ifnameundef{savednamec}% + {}% + {\ifnamesequal{namec}{savednamec}% + {\clearname{namec}}% + {}}}% + {\ifnamesequal{translator}{savedtranslator}% + {\clearname{translator}}% + {}}}% {\ifnamesequal{editor}{savededitor}% - {\clearname{editor}}% - {}}}% - {\ifnamesequal{author}{savedauthor}% + {\clearname{editor}}% + {}}}% + {\ifnamesequal{author}{savedauthor}% {\clearname{author}}% {}}% + \clearfield{volume}\clearfield{part}% + \clearfield{maintitle}%\clearfield{volumes}% + \clearfield{crossref}\clearfield{xref}% \usebibmacro{at+every+item}% \renewbibmacro*{related:init}{}% \DeclareNameAlias{sortname}{default}% \renewbibmacro*{pageref}{}% + \renewbibmacro*{editor}{}% + \renewbibmacro*{author/editor}{}% + \clearfield{nameaddon}% + \toggletrue{cms@mtvolpunct}}% + {\thefield{entrytype}}}}% + {\printtext[cmsdefrelhypertarget]{% + \usedriver% + {\ifnameundef{savedauthor}% + {\ifnameundef{savededitor}% + {\ifnameundef{savedtranslator}% + {\ifnameundef{savednamec}% + {}% + {\ifnamesequal{namec}{savednamec}% + {\clearname{namec}}% + {}}}% + {\ifnamesequal{translator}{savedtranslator}% + {\clearname{translator}}% + {}}}% + {\ifnamesequal{editor}{savededitor}% + {\clearname{editor}}% + {}}}% + {\ifnamesequal{author}{savedauthor}% + {\clearname{author}}% + {}}% + \clearfield{volume}\clearfield{part}% + \clearfield{maintitle}%\clearfield{volumes}% + \clearfield{crossref}\clearfield{xref}% + \usebibmacro{at+every+item}% + \renewbibmacro*{related:init}{}% + \DeclareNameAlias{sortname}{default}% + \renewbibmacro*{pageref}{}% + \renewbibmacro*{editor}{}% + \renewbibmacro*{author/editor}{}% + \clearfield{nameaddon}% \toggletrue{cms@fullnote}% \togglefalse{cms@shortnote}}% - {cite:\thefield{entrytype}}}}% + {cite:\thefield{entrytype}}}}}}% + +\newbibmacro*{mt:ofvols}{% MT -- used by previous + \iftoggle{cms@hidevolumes}% + {\clearfield{volumes}}% + {\ifthenelse{\iffieldundef{volumes}\AND\iffieldundef{savedvolumes}}% + {}% + {\addspace\bibstring{of}\addspace% + \iffieldundef{volumes}% + {\printfield[default]{savedvolumes}}% + {\printfield[default]{volumes}\clearfield{volumes}}}}}% + +\newbibmacro*{extract+mt+vol}{% MT fix + \ifthenelse{\iffieldequalstr{relatedtype}{maintitle}\OR% + \iffieldequalstr{relatedtype}{maintitlenc}}% + {\setcounter{cms@reviewcount}{\value{instcount}}% + \ifthenelse{\iffieldundef{volume}\AND\iffieldundef{part}}% + {\entrydata{\thefield{related}}{% + \iffieldundef{volume}{}{\savefield{volume}{\cms@mtvolume}}% + \iffieldundef{part}{}{\savefield{part}{\cms@mtpart}}}}% + {}% + \ifcsundef{cms@mtvolume}{}{\restorefield{volume}{\cms@mtvolume}}% + \ifcsundef{cms@mtpart}{}{\restorefield{part}{\cms@mtpart}}% + \csgundef{cms@mtvolume}\csgundef{cms@mtpart}}% + {}} + +\newbibmacro*{extract+clonekey+note}{% + \entrydata{\thefield{related}}{% + \ifboolexpr{% + test {\ifentryseen{\thefield{clonesourcekey}}}% + and + not togl {cms@citecrossref}% + }% + {\savefield{clonesourcekey}{\cms@shortmtkey}}% + {}}\iftoggle{cms@noterefs}{\addtocounter{instcount}{-1}}{}}% + +\newbibmacro*{extract+clonekey+bib}{% + \entrydata{\thefield{related}}{% + \ifboolexpr{% + test {\ifentryinbib{\strfield{clonesourcekey}}}% + and + not togl {cms@bibcrossref}% + }% + {\savefield{clonesourcekey}{\cms@shortmtkey}}% + {}}}% + +\letbibmacro*{related:maintitlenc}{related:maintitle}% MT fix \renewbibmacro*{related:multivolume}[1]{% \entrydata*{#1}{% @@ -6962,6 +9820,11 @@ not test {\iffieldundef{langid}}% }% {\unspace}{}% + \ifdefstring{\blx@main@language}{french}% + {}% + {\iftoggle{smartof}% + {\let\lbx@inittitlehook\lbx@fr@smartof}% + {}}% \lbx@inittitlehook{#1}% \endgroup \mkbibemph{#1}} @@ -6975,6 +9838,11 @@ not test {\iffieldundef{langid}}% }% {\unspace}{}% + \ifdefstring{\blx@main@language}{french}% + {}% + {\iftoggle{smartof}% + {\let\lbx@inittitlehook\lbx@fr@smartof}% + {}}% \lbx@inittitlehook{#1}% \endgroup \mkbibquote{#1}} @@ -6988,6 +9856,11 @@ not test {\iffieldundef{langid}}% }% {\unspace}{}% + \ifdefstring{\blx@main@language}{french}% + {}% + {\iftoggle{smartof}% + {\let\lbx@inittitlehook\lbx@fr@smartof}% + {}}% \lbx@inittitlehook{\bibstring{chapter}}% \endgroup \bibstring{chapter}~#1\addspace\bibstring{in}}% @@ -7001,10 +9874,33 @@ not test {\iffieldundef{langid}}% }% {\unspace}{}% + \ifdefstring{\blx@main@language}{french}% + {}% + {\iftoggle{smartof}% + {\let\lbx@inittitlehook\lbx@fr@smartof}% + {}}% \lbx@inittitlehook{\bibstring{chapter}}% \endgroup \bibstring{chapter}~#1}% +\DeclareFieldFormat{muschapter:hook}{% + \begingroup + \mkrelatedstring% + \ifboolexpr{% + togl {cms@otherlang}% + and + not test {\iffieldundef{langid}}% + }% + {\unspace}{}% + \ifdefstring{\blx@main@language}{french}% + {}% + {\iftoggle{smartof}% + {\let\lbx@inittitlehook\lbx@fr@smartof}% + {}}% + \lbx@inittitlehook{\bibstring{track}}% + \endgroup + \bibstring{track}~#1}% + \DeclareFieldFormat{sitnoformat}{#1} \DeclareFieldFormat{sjtnoformat}{#1} \DeclareFieldFormat{stnoformat}{#1} @@ -7035,17 +9931,17 @@ {\iffieldundef{issuetitle}% {\iffieldundef{title}% {\iffieldundef{booktitle}% - {\iffieldundef{maintitle}% - {\iffieldundef{journaltitle}% + {\iffieldundef{journaltitle}% Switched order for 17th ed. + {\iffieldundef{maintitle}% {}% - {\DeclareFieldAlias{jtnoformat}{title:hook}% - \DeclareFieldAlias{sjtnoformat}{title}% - \DeclareFieldAlias{journaltitle}{default}% - \DeclareFieldAlias{shortjournal}{series}% - \DeclareFieldAlias{jtsnoformat}{title:hook}}}% - {\DeclareFieldAlias{mtnoformat}{title:hook}% - \DeclareFieldAlias{smtnoformat}{title}% - \DeclareFieldAlias{maintitle}{default}}}% + {\DeclareFieldAlias{mtnoformat}{title:hook}% + \DeclareFieldAlias{smtnoformat}{title}% + \DeclareFieldAlias{maintitle}{default}}}% + {\DeclareFieldAlias{jtnoformat}{title:hook}% + \DeclareFieldAlias{sjtnoformat}{title}% + \DeclareFieldAlias{journaltitle}{default}% + \DeclareFieldAlias{shortjournal}{series}% + \DeclareFieldAlias{jtsnoformat}{title:hook}}}% {\DeclareFieldAlias{btnoformat}{title:hook}% \DeclareFieldAlias{sbtnoformat}{title}% \DeclareFieldAlias{booktitle}{default}}}% @@ -7063,7 +9959,9 @@ {\ifthenelse{\ifentrytype{audio}\OR\ifentrytype{music}\OR% \ifentrytype{video}}% {\iffieldundef{title}% - {\DeclareFieldAlias{chapter}{avchapter:hook}}% + {\ifentrytype{music}% + {\DeclareFieldAlias[music]{chapter}{muschapter:hook}}% + {\DeclareFieldAlias{chapter}{avchapter:hook}}}% {\DeclareFieldAlias{tnoformat}{title:hook}% \DeclareFieldAlias{stnoformat}{citetitle}% \DeclareFieldAlias[video]{title}{default}% @@ -7072,7 +9970,7 @@ {\DeclareFieldAlias{chapter}{chapter:hook}}}}% \newbibmacro*{cite:origfull}{% - \printtext[cmshypertarget]{% + \printtext[cmsdefrelhypertarget]{% \usedriver {\DeclareNameAlias{sortname}{default}\clearfield{postnote}% \clearname{author}\clearfield{userf}\clearfield{shorthand}% @@ -7081,7 +9979,7 @@ {cite:\thefield{entrytype}}}} \newbibmacro*{cite:origpubl}{% - \printtext[cmshypertarget]{% + \printtext[cmsdefrelhypertarget]{% \usedriver {\DeclareNameAlias{sortname}{default}\clearfield{postnote}% \usebibmacro{clearpublin}\clearfield{shorthand}% @@ -7090,10 +9988,45 @@ \usebibmacro{cms:titlehook}}% {cite:\thefield{entrytype}}}} +\newbibmacro*{cite:related:full}{% + \printtext[cmsdefrelhypertarget]{% + \usedriver + {\DeclareNameAlias{sortname}{default}\frenchspacing}% + {cite:\thefield{entrytype}}}}% + +\newbibmacro*{bib:related:full}{% + \printtext[cmsdefrelhypertarget]{% + \usedriver + {\DeclareNameAlias{sortname}{default}\frenchspacing}% + {\thefield{entrytype}}}}% + +\DeclareFieldFormat{cmsdefrelhypertarget}{% + \ifhyperref% + {\ifbibliography% + {\ifentryinbib{\strfield{clonesourcekey}}% + {#1}% + {\hypertarget{cite.\the\c@refsection @\thefield{clonesourcekey}}{#1}}}% + {\bibhypertarget{\thefield{clonesourcekey}}{#1}}}% + {#1}} + +\newrobustcmd*{\cmsrelhyper}[1]{% + \ifhyperref% + {\ifbibliography% + {\ifentryinbib{\strfield{clonesourcekey}}% + {\bibhyperref[\strfield{clonesourcekey}]{#1}}% + {#1}}% + {\iftoggle{cms@allshort}% + {\IfSubStr{\thefield{savedoptions}}{skipbib}% + {\bibhyperref[\strfield{clonesourcekey}]{#1}}%% + {\bibhyperref[\thefield{savedentrykey}]{#1}}}% + {\iftoggle{cms@fullnote}% + {\ifentryseen{\thefield{clonesourcekey}}% + {\bibhyperlink{\strfield{clonesourcekey}}{#1}}% + {#1}}% + {\bibhyperlink{\thefield{savedentrykey}}{#1}}}}}% + {#1}}% + \newbibmacro*{at+every+item}{% - \iffieldequalstr{pubstate}{reprint}% - {\toggletrue{cms@reprint}}% - {\togglefalse{cms@reprint}}% \ifboolexpr{% test {\iffieldundef{origyear}}% or |