diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/biblatex-chicago/chicago-authordate.cbx')
-rw-r--r-- | Master/texmf-dist/tex/latex/biblatex-chicago/chicago-authordate.cbx | 264 |
1 files changed, 205 insertions, 59 deletions
diff --git a/Master/texmf-dist/tex/latex/biblatex-chicago/chicago-authordate.cbx b/Master/texmf-dist/tex/latex/biblatex-chicago/chicago-authordate.cbx index 08a623d20db..5b865d75d64 100644 --- a/Master/texmf-dist/tex/latex/biblatex-chicago/chicago-authordate.cbx +++ b/Master/texmf-dist/tex/latex/biblatex-chicago/chicago-authordate.cbx @@ -1,10 +1,11 @@ -% $Id: chicago-authordate.cbx,v 0.8.1.57 2013/10/29 14:04:11 dfussner Exp $ +% $Id: chicago-authordate.cbx,v 0.8.2.5 2014/08/15 09:45:07 dfussner Exp $ % This is a biblatex citation style file, adapted from Lehman's % authoryear-comp.cbx. It is heavily modified, with the intention of % providing inline citations (and a reference list) for the % author-date style of the Chicago Manual of Style, 16th edition. -\ProvidesFile{chicago-authordate.cbx}[2013/10/29 v 2.8 biblatex citation style] +\ProvidesFile{chicago-authordate.cbx}[2014/08/15 v 2.9a biblatex +citation style] %%%% Biblatex initialization + Chicago options + Toggles %%%% @@ -25,6 +26,8 @@ \providetoggle{cms@ordate} \providetoggle{cms@nodates} \providetoggle{cms@authorparens} +\providetoggle{cms@datedash} +\providetoggle{cms@modpostnote} \providetoggle{cms@url}% These are for the field-exclusion options \providetoggle{cms@doi} @@ -34,6 +37,7 @@ \providetoggle{cms@numbermonth} \providetoggle{cms@bookpages} \providetoggle{cms@hidevolumes}% Modify Volume fix +\providetoggle{cms@comprange} \providetoggle{cms@jrcomma}% Comma after Jr./Sr. @@ -146,6 +150,25 @@ \DeclareBibliographyOption{noibid}[true]{% \global\toggletrue{cms@noibid}} +\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{postnotepunct}[true]{% + \ifcsdef{cms@opt@ppunct@#1}% + {\csuse{cms@opt@ppunct@#1}}% + {\blx@err@invopt{postnotepunct=#1}{}}}% +\def\cms@opt@ppunct@true{% + \global\toggletrue{cms@modpostnote}}% +\def\cms@opt@ppunct@false{}% + \DeclareBibliographyOption{usecompiler}[true]{% \settoggle{cms@usecompiler}{#1}} @@ -264,6 +287,10 @@ {\ExecuteBibliographyOptions{labeldate=true}}% {\ExecuteBibliographyOptions{labelyear=true}}% +\@ifpackagelater{biblatex}{2014/02/20}% For biblatex 2.9 ff. +{\global\toggletrue{cms@datedash}}% +{\global\togglefalse{cms@datedash}}% + \DeclareDataInheritance{collection}{suppcollection}{% \inherit{title}{title} \inherit{subtitle}{subtitle} @@ -279,6 +306,16 @@ \noinherit{indexsorttitle} } +\DeclareDataInheritance{book}{incollection}{% + \inherit{title}{booktitle} + \inherit{subtitle}{booksubtitle} + \inherit{titleaddon}{booktitleaddon} + \noinherit{shorttitle} + \noinherit{sorttitle} + \noinherit{indextitle} + \noinherit{indexsorttitle} +} + \DeclareDataInheritance{book,collection}{letter}{% \inherit{title}{booktitle} \inherit{subtitle}{booksubtitle} @@ -436,6 +473,11 @@ \global\undef\cbx@lasthash \global\undef\cbx@lastyear} +\newbibmacro*{backref+check}{% + \ifbibliography% + {\backtrackerfalse}% + {}} + \newbibmacro*{cite}{% \ifthenelse{\ifciteibid\AND\NOT\iffirstonpage} {\usebibmacro{cite:ibid}}% @@ -667,7 +709,7 @@ \iffieldundef{postnote}% {}% {\savefield{namehash}{\cbx@lastyear}% - \setunit{\postnotedelim}% + \setunit{\postnotewrapper}%delim}% \printfield{postnote}}% \ifthenelse{\value{multicitecount}=\value{multicitetotal}}% {\setunit{}% @@ -739,15 +781,15 @@ \ifthenelse{\iffieldundef{labelyear}\OR% \iffieldequalstr{labelyear}{nodate}}% {\ifboolexpr{ - test {\ifentrytype{misc}} + test {\ifentrytype{misc}}% or - test {\ifentrytype{inreference}} + test {\ifentrytype{inreference}}% or - test {\ifentrytype{reference}} + test {\ifentrytype{reference}}% or - test {\ifentrytype{mvreference}} + test {\ifentrytype{mvreference}}% or - not togl {cms@nodates} + not togl {cms@nodates}% }% {}% {\printtext[bibhyperref]{\bibstring{nodate}}}}% For CMS? @@ -762,7 +804,11 @@ \printfield{extrayear}}% \iffieldundef{urlendyear}% {}% - {\iffieldequalstr{urlendyear}{}% + {\ifboolexpr{ + test {\iffieldequalstr{urlendyear}{}}% + and + not togl {cms@datedash}% + } {\mbox{\bibdatedash}}% {}}}% {\printfield{labelyear}% @@ -772,7 +818,11 @@ \printfield{extrayear}}% \iffieldundef{origendyear}% {}% - {\iffieldequalstr{origendyear}{}% + {\ifboolexpr{ + test {\iffieldequalstr{origendyear}{}}% + and + not togl {cms@datedash}% + } {\mbox{\bibdatedash}}% {}}}} {\printfield{labelyear}% @@ -782,7 +832,11 @@ \printfield{extrayear}}% \iffieldundef{eventendyear}% {}% - {\iffieldequalstr{eventendyear}{}% + {\ifboolexpr{ + test {\iffieldequalstr{eventendyear}{}}% + and + not togl {cms@datedash}% + } {\mbox{\bibdatedash}}% {}}}} {\printfield{labelyear}% @@ -792,7 +846,11 @@ \printfield{extrayear}}% \iffieldundef{endyear}% DATE FIX {}% - {\iffieldequalstr{endyear}{}% + {\ifboolexpr{ + test {\iffieldequalstr{endyear}{}}% + and + not togl {cms@datedash}% + } {\mbox{\bibdatedash}}% {}}}}}} @@ -800,15 +858,15 @@ \ifthenelse{\iffieldundef{labelyear}\OR% \iffieldequalstr{labelyear}{nodate}}% {\ifboolexpr{ - test {\ifentrytype{misc}} + test {\ifentrytype{misc}}% or - test {\ifentrytype{inreference}} + test {\ifentrytype{inreference}}% or - test {\ifentrytype{reference}} + test {\ifentrytype{reference}}% or - test {\ifentrytype{mvreference}} + test {\ifentrytype{mvreference}}% or - not togl {cms@nodates} + not togl {cms@nodates}% }% {}% {\printtext[bibhyperref]{\bibstring{nodate}}}}% For CMS? @@ -823,7 +881,11 @@ \printfield{extrayear}}% \iffieldundef{urlendyear}% {}% - {\iffieldequalstr{urlendyear}{}% + {\ifboolexpr{ + test {\iffieldequalstr{urlendyear}{}}% + and + not togl {cms@datedash}% + } {\mbox{\bibdatedash}}% {}}}% {\printfield{labelyear}% @@ -833,7 +895,11 @@ \printfield{extrayear}}% \iffieldundef{eventendyear}% {}% - {\iffieldequalstr{eventendyear}{}% + {\ifboolexpr{ + test {\iffieldequalstr{eventendyear}{}}% + and + not togl {cms@datedash}% + } {\mbox{\bibdatedash}}% {}}}} {\printfield{labelyear}% @@ -843,7 +909,11 @@ \printfield{extrayear}}% \iffieldundef{endyear}% {}% - {\iffieldequalstr{endyear}{}% + {\ifboolexpr{ + test {\iffieldequalstr{endyear}{}}% + and + not togl {cms@datedash}% + } {\mbox{\bibdatedash}}% {}}}} {\printfield{labelyear}% @@ -853,7 +923,11 @@ \printfield{extrayear}}% \iffieldundef{origendyear}% DATE FIX {}% - {\iffieldequalstr{origendyear}{}% + {\ifboolexpr{ + test {\iffieldequalstr{origendyear}{}}% + and + not togl {cms@datedash}% + } {\mbox{\bibdatedash}}% {}}}}}} @@ -861,15 +935,15 @@ \ifthenelse{\iffieldundef{labelyear}\OR% \iffieldequalstr{labelyear}{nodate}}% {\ifboolexpr{ - test {\ifentrytype{misc}} + test {\ifentrytype{misc}}% or - test {\ifentrytype{inreference}} + test {\ifentrytype{inreference}}% or - test {\ifentrytype{reference}} + test {\ifentrytype{reference}}% or - test {\ifentrytype{mvreference}} + test {\ifentrytype{mvreference}}% or - not togl {cms@nodates} + not togl {cms@nodates}% }% {}% {\printtext[bibhyperref]{\bibstring{nodate}}}}% For CMS? @@ -884,7 +958,11 @@ \printfield{extrayear}}% \iffieldundef{urlendyear}% {}% - {\iffieldequalstr{urlendyear}{}% + {\ifboolexpr{ + test {\iffieldequalstr{urlendyear}{}}% + and + not togl {cms@datedash}% + } {\mbox{\bibdatedash}}% {}}}% {\printfield{labelyear}% @@ -894,7 +972,11 @@ \printfield{extrayear}}% \iffieldundef{endyear}% {}% - {\iffieldequalstr{endyear}{}% + {\ifboolexpr{ + test {\iffieldequalstr{endyear}{}}% + and + not togl {cms@datedash}% + } {\mbox{\bibdatedash}}% {}}}} {\printfield{labelyear}% @@ -904,7 +986,11 @@ \printfield{extrayear}}% \iffieldundef{origendyear}% {}% - {\iffieldequalstr{origendyear}{}% + {\ifboolexpr{ + test {\iffieldequalstr{origendyear}{}}% + and + not togl {cms@datedash}% + } {\mbox{\bibdatedash}}% {}}}} {\printfield{labelyear}% @@ -914,22 +1000,26 @@ \printfield{extrayear}}% \iffieldundef{eventendyear}% DATE FIX {}% - {\iffieldequalstr{eventendyear}{}% + {\ifboolexpr{ + test {\iffieldequalstr{eventendyear}{}}% + and + not togl {cms@datedash}% + } {\mbox{\bibdatedash}}% {}}}}}} \newbibmacro*{cmscitesortdate}{% Attempt to solve date-related problems \ifboolexpr{% - test {\iffieldundef{origyear}} + test {\iffieldundef{origyear}}% or - not test {\iffieldint{origyear}} + not test {\iffieldint{origyear}}% }% {\usebibmacro{cmsciteyear}}% {\iffieldint{year}% {\ifboolexpr{% Needed for date ranges test {\iffieldundef{endyear}}% or - not test {\iffieldnum{endyear}} + not test {\iffieldnum{endyear}}% }% {\ifthenelse{\thefield{origyear}>\thefield{year}}% {\toggletrue{cms@switchdates}% @@ -1134,7 +1224,8 @@ {\footcitetext}{\setunit{\multicitedelim}} \DeclareCiteCommand{\bibxrefcite} - {\usebibmacro{cite:init}}%\usebibmacro{clearalmostall}} (?) + {\usebibmacro{cite:init}% + \usebibmacro{backref+check}}%\usebibmacro{clearalmostall}} (?) {\usebibmacro{xref-in:}% \blx@ibidreset% For authordate style \usebibmacro{cite}} @@ -1142,19 +1233,22 @@ {} \DeclareCiteCommand{\origfullcite} - {\nopunct\unspace% - \savebibmacro{cmsbibsortdate}% - \renewbibmacro*{cmsbibsortdate}{}}% + {\usebibmacro{backref+check}% + \nopunct\unspace% + \savebibmacro{cmsbibsortdate}% + \renewbibmacro*{cmsbibsortdate}{}}% {\usedriver {\DeclareNameAlias{sortname}{default}\clearfield{postnote} \clearname{author}\clearfield{userf}%\toggletrue{cms@fullnote}% \toggletrue{cms@headlessnote}\frenchspacing}% - {\thefield{entrytype}}}% + {\thefield{entrytype}}% + \iflistundef{pageref}{}{\newunit\usebibmacro{pageref}}}% {\multicitedelim}% {\restorebibmacro{cmsbibsortdate}} \DeclareCiteCommand{\origpublcite}% Similar to above, w/o title. - {\nopunct\unspace% + {\usebibmacro{backref+check}% + \nopunct\unspace% \savebibmacro{cmsbibsortdate}% \renewbibmacro*{cmsbibsortdate}{}}% {\usedriver @@ -1162,7 +1256,8 @@ \usebibmacro{clearpublin}% \toggletrue{cms@headlessnote}%\toggletrue{cms@fullnote}% \toggletrue{cms@origpublished}\frenchspacing}% - {\thefield{entrytype}}}% + {\thefield{entrytype}}% + \iflistundef{pageref}{}{\newunit\usebibmacro{pageref}}}% {\multicitedelim}% {\restorebibmacro{cmsbibsortdate}} @@ -1263,20 +1358,43 @@ \DeclareFieldFormat{prenote}{\ifcapital{\MakeCapital{#1}}{#1}} -\DeclareFieldFormat{postnote}{% Removed \isdots -- required - \iffieldundef{pagination}% elsewhere also? - {#1}% - {\mkpageprefix[pagination]{#1}}} +\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}}}% + {}{}}{}% + +\DeclareFieldFormat{postnote}{% Changed for page compression option + \iftoggle{cms@comprange}% + {\iffieldundef{pagination}% + {\mkcomprange{#1}}% + {\mkcomprange[{\mkpageprefix[pagination]}]{#1}}}% + {\iffieldundef{pagination}% + {#1}% + {\mkpageprefix[pagination]{#1}}}}% \DeclareFieldFormat[inreference]{postnote}{% - \iffieldundef{pagination}% - {s\adddot v\adddot\addspace\mkbibquote{#1}} - {\mkpageprefix[pagination]{#1}}}% Removed \isdots here, also. + \iftoggle{cms@comprange}% + {\iffieldundef{pagination}% + {s\adddot v\adddot\addspace\mkbibquote{#1}}% + {\mkcomprange[{\mkpageprefix[pagination]}]{#1}}}% + {\iffieldundef{pagination}% + {s\adddot v\adddot\addspace\mkbibquote{#1}}% + {\mkpageprefix[pagination]{#1}}}}% \DeclareFieldFormat{pages}{% - \iffieldundef{bookpagination}% - {#1\isdot}% - {\mkpageprefix[bookpagination]{#1}}}% Removed \isdot. + \iftoggle{cms@comprange}% + {\iffieldundef{bookpagination}% + {\mkcomprange{#1}\isdot}% + {\mkcomprange[{\mkpageprefix[bookpagination]}]{#1}}}% + {\iffieldundef{bookpagination}% + {#1\isdot}% + {\mkpageprefix[bookpagination]{#1}}}}% \DeclareFieldFormat{bibnote}{\MakeCapital{#1}} @@ -1478,9 +1596,9 @@ \DeclareFieldFormat{journum}{% Revised for 0.9.5 \ifboolexpr{% - test {\ifnumerals{#1}} + test {\ifnumerals{#1}}% and - not test {\ifnumeral{#1}} + not test {\ifnumeral{#1}}% }% {\bibstring{numbers}\addspace #1}% {\bibstring{number}\addspace #1}} @@ -1596,6 +1714,34 @@ {\addcomma\addspace}}% {\addcomma\addspace}}} +\newcommand*{\postnotewrapper}{% + \iftoggle{cms@modpostnote}% + {\ifboolexpr{% + test {\iffieldstart{postnote}{,}}% + or + test {\iffieldstart{postnote}{\bibrangessep}}% + }% + {\addcomma}% w/ or w/o \addspace? + {\ifboolexpr{% + test {\iffieldstart{postnote}{;}}% + or + test {\iffieldstart{postnote}{:}}% + or + test {\iffieldstart{postnote}{.}}% + }% + {}{\postnotedelim}}}% + {\postnotedelim}}% + +\newrobustcmd*{\iffieldstart}[2]{% Philipp Lehman's code, from + \begingroup% comp.text.tex + \edef\@tempa{% + \long\def\noexpand\iffieldstart@i####1\detokenize{#2}####2}% + \@tempa\@nil{\endgroup\ifblank{##1}}% + \savefield*{#1}{\@tempa}% + \expandafter\iffieldstart@i\detokenize + \expandafter\expandafter\expandafter{% + \expandafter\@tempa\detokenize{#2}}\@nil} + \newcommand*{\editordelim}{% Otherwise you get an inaccurate comma. \iffieldequalstr{editortype}{none}% {\addperiod\addspace}% @@ -1768,9 +1914,9 @@ {\iflistundef{organization}% {\let\bbx@lasthash\undefined}% {\ifboolexpr{ - test {\iflistequals{organization}{\bbx@lasthash}} + test {\iflistequals{organization}{\bbx@lasthash}}% and - not test {\iffirstonpage} + not test {\iffirstonpage}% }% {\bibnamedash\addperiod\addspace}% {\iftoggle{cms@authorparens}% @@ -2215,14 +2361,14 @@ \newcommand*{\cms@datelong}{% Modified for 0.9 \iffieldundef{origmonth}% {\printfield{origyear}}% - {\printfield[letterday]{origday}\setunit{\nobreakspace}% + {\printfield[letterday]{origday}\setunit*{\nobreakspace}% \mkbibmonth{\thefield{origmonth}}\setunit{\nobreakspace}% \printfield{origyear}}}% \newcommand*{\cms@datelongalt}{% Modified for 0.9 \iffieldundef{month}% {\printfield{year}}% - {\printfield[letterday]{day}\setunit{\nobreakspace}% + {\printfield[letterday]{day}\setunit*{\nobreakspace}% \mkbibmonth{\thefield{month}}\setunit{\nobreakspace}% \printfield{year}}}% @@ -2232,14 +2378,14 @@ {}% {\iffieldundef{month}% {\printfield{year}}% - {\printfield[letterday]{day}\setunit{\nobreakspace}% + {\printfield[letterday]{day}\setunit*{\nobreakspace}% \mkbibmonth{\thefield{month}}\setunit{\nobreakspace}% \printfield{year}}}}% {\iffieldundef{origyear}% {}% {\iffieldundef{origmonth}% {\printfield{origyear}}% - {\printfield[letterday]{origday}\setunit{\nobreakspace}% + {\printfield[letterday]{origday}\setunit*{\nobreakspace}% \mkbibmonth{\thefield{origmonth}}\setunit{\nobreakspace}% \printfield{origyear}}}}}% @@ -2332,7 +2478,7 @@ \renewbibmacro*{postnote}{% \iffieldundef{postnote}% {}% - {\setunit{\postnotedelim}% + {\setunit{\postnotewrapper}%delim}% \printfield{postnote}}} \newbibmacro*{part+editor+translator}{% |