diff options
author | Karl Berry <karl@freefriends.org> | 2016-09-14 22:21:25 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2016-09-14 22:21:25 +0000 |
commit | 736bbc10d656b425590e7a4453c288fcd3fc77d4 (patch) | |
tree | 9332813d6b9927257d589fd0683b2591fe21b4af /Master/texmf-dist/tex/latex/biblatex-apa/apa.bbx | |
parent | 255f0a58d9bae0f193b4bd7d07885325f2fe8585 (diff) |
biblatex-apa (14sep16)
git-svn-id: svn://tug.org/texlive/trunk@42064 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/biblatex-apa/apa.bbx')
-rw-r--r-- | Master/texmf-dist/tex/latex/biblatex-apa/apa.bbx | 200 |
1 files changed, 111 insertions, 89 deletions
diff --git a/Master/texmf-dist/tex/latex/biblatex-apa/apa.bbx b/Master/texmf-dist/tex/latex/biblatex-apa/apa.bbx index 4944245cda7..85456ea612c 100644 --- a/Master/texmf-dist/tex/latex/biblatex-apa/apa.bbx +++ b/Master/texmf-dist/tex/latex/biblatex-apa/apa.bbx @@ -12,7 +12,7 @@ %% %% The Current Maintainer of this work is Philip Kime. -\ProvidesFile{apa.bbx}[2016/05/13\space v6.9\space APA biblatex references style] +\ProvidesFile{apa.bbx}[2016/07/01\space v7.0\space APA biblatex references style] \RequireBiber[3] \RequireBibliographyStyle{standard} \urlstyle{rm} % APA examples all have URLs in same font as text @@ -74,56 +74,71 @@ % % Date formats. Suppress end range of less specific fields - -\newcommand*{\mkbibrangeapalong}[1]{% - \ifthenelse{\equal{#1}{url}} - {\printtext{% - \mkbibdateapalongmdy{#1year}{#1month}{#1day}% - \iffieldundef{#1endyear}% - {}% - {\iffieldequalstr{#1endyear}{}% open-ended range? - {\mbox{\bibdatedash}} - {\bibdatedash% - \iffieldsequal{#1year}{#1endyear}% - {\iffieldsequal{#1month}{#1endmonth}% - {\iffieldsequal{#1day}{#1endday}% - {}% - {\mkbibdateapalongmdy{}{}{#1endday}}}% - {\mkbibdateapalongmdy{}{#1endmonth}{#1endday}}}% - {\mkbibdateapalongmdy{#1endyear}{#1endmonth}{#1endday}}}}}} - {\printtext{% - \mkbibdateapalong{#1year}{#1month}{#1day}% - \iffieldundef{#1endyear}% - {}% - {\iffieldequalstr{#1endyear}{}% open-ended range? - {\mbox{\bibdatedash}} - {\bibdatedash% - \iffieldsequal{#1year}{#1endyear}% - {\iffieldsequal{#1month}{#1endmonth}% - {\iffieldsequal{#1day}{#1endday}% - {}% - {\mkbibdateapalong{}{}{#1endday}}}% - {\mkbibdateapalong{}{#1endmonth}{#1endday}}}% - {\mkbibdateapalong{#1endyear}{#1endmonth}{#1endday}}}}}}} - +\newcommand*{\mkdaterangeapalong}[1]{% + \blx@metadateinfo{#1}% + \iffieldundef{#1year}{} + {\datecircaprint + \ifstrequal{#1}{url}% URL dates are unlikely to be BCE ... + {\printtext{% + \mkbibdateapalongmdy{#1year}{#1month}{#1day}% + \iffieldundef{#1endyear}% + {}% + {\iffieldequalstr{#1endyear}{}% open-ended range? + {\mbox{\bibdatedash}} + {\bibdatedash% + \iffieldsequal{#1year}{#1endyear}% + {\iffieldsequal{#1month}{#1endmonth}% + {\iffieldsequal{#1day}{#1endday}% + {}% + {\mkbibdateapalongmdy{}{}{#1endday}}}% + {\mkbibdateapalongmdy{}{#1endmonth}{#1endday}}}% + {\mkbibdateapalongmdy{#1endyear}{#1endmonth}{#1endday}}}}% + \dateuncertainprint}} + {\printtext{% + \mkbibdateapalong{#1year}{#1month}{#1day}% + \dateeraprint{#1year}% + \iffieldundef{#1endyear}% + {}% + {\iffieldequalstr{#1endyear}{}% open-ended range? + {\mbox{\bibdatedash}} + {\bibdatedash% + \iffieldsequal{#1year}{#1endyear}% + {\iffieldsequal{#1month}{#1endmonth}% + {\iffieldsequal{#1day}{#1endday}% + {}% + {\mkbibdateapalong{}{}{#1endday}}}% + {\mkbibdateapalong{}{#1endmonth}{#1endday}}}% + {\mkbibdateapalong{#1endyear}{#1endmonth}{#1endday}% + \dateeraprint{#1endyear}}}% + \enddateuncertainprint}}}}} % Only for DATE as only \printdateextra is used -\newcommand*{\mkbibrangeapalongextra}[1]{% - \printtext{% - \mkbibdateapalongextra{#1year}{#1month}{#1day}% - \iffieldundef{#1endyear}% - {}% - {\iffieldequalstr{#1endyear}{}% open-ended range? - {\mbox{\bibdatedash}} - {\bibdatedash% - \iffieldsequal{#1year}{#1endyear}% - {\iffieldsequal{#1month}{#1endmonth}% - {\iffieldsequal{#1day}{#1endday}% - {}% - {\mkbibdateapalongextra{}{}{#1endday}}} - {\mkbibdateapalongextra{}{#1endmonth}{#1endday}}} - {\mkbibdateapalongextra{#1endyear}{#1endmonth}{#1endday}}}}}} - +\newcommand*{\mkdaterangeapalongextra}[1]{% + \blx@metadateinfo{#1}% + \iffieldundef{#1year}{} + {\printtext{% + \datecircaprint + \mkbibdateapalongextra{#1year}{#1month}{#1day}% + \dateeraprint{#1year}% + \dateuncertainprint + \iffieldundef{#1endyear}% + {}% + {\iffieldequalstr{#1endyear}{}% open-ended range? + {\mbox{\bibdatedash}} + {\bibdatedash% + \iffieldsequal{#1year}{#1endyear}% + {\iffieldsequal{#1month}{#1endmonth}% + {\iffieldsequal{#1day}{#1endday}% + {}% + {\mkbibdateapalongextra{}{}{#1endday}}} + {\mkbibdateapalongextra{}{#1endmonth}{#1endday}}} + {\mkbibdateapalongextra{#1endyear}{#1endmonth}{#1endday}% + \dateeraprint{#1endyear}}}% + \enddateuncertainprint}}}} + +\AtEndPreamble{% + \renewcommand*{\datecircaprint}{% + \ifdatecirca{\biblcstring{circa}\printdelim{datecircadelim}}{}}} % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -146,12 +161,12 @@ % (APA 6.12) Five author max before "et al" and a one author truncation policy % However, only after the first cite, see the labelname format % in .cbx. It's also overridden per-entry by uniquelist -% (APA 6.x) citation tracking is global -% (APA 6.14) uses initials to disambiguate shared surnames -% (APA 6.16) uses year postfix to disambiguate multiple items in same year +% (APA 6.x) Citation tracking is global +% (APA 6.14) Use initials to disambiguate shared surnames +% (APA 6.16) Use year postfix to disambiguate multiple items in same year % (APA 6.10) Never reference anything not cited -% (APA 6.25) author initials only -% (APA 6.25) sorting is nyt but we need to account for PUBSTATE which comes +% (APA 6.25) Author initials only +% (APA 6.25) Sorting is nyt but we need to account for PUBSTATE which comes % after all normal cites for the same author \DeclareSortingScheme{apa}{ @@ -170,22 +185,24 @@ \field{director} \field{producer} \field{execproducer} - \field{origauthor} \field{sorttitle} \field{title} } \sort{ + \field{pubstate} + } + \sort{ \field{sortyear} \field{year} - \field{pubstate} + \literal{-2000000000}% APA has "nodates" coming first } \sort{ \field{sorttitle} \field{title} } \sort{ - \field[padside=left,padwidth=4,padchar=0]{volume} - \literal{0000} + \field{volume} + \literal{0} } } @@ -201,29 +218,33 @@ % ellipsis from 7th to n-1 in bib, there might be some really strange % edge cases which can't be handled as this needs treating in the style % after biber has finished. Very unlikely though. -\ExecuteBibliographyOptions{labeldate=true,% - sorting=apa,% +\ExecuteBibliographyOptions{% + abbreviate=true,% autocite=inline,% backref=true,% - pagetracker=true,% - useprefix=true,% - usetranslator=true,% - uniquelist=minyear,% - uniquename=full,% citetracker=true,% - maxcitenames=2,% - mincitenames=1,% + date=apalong,% + dateabbrev=false,% + datecirca=true,% + dateera=christian,% + labeldate=apalong,% + dateuncertain=true,% + eventdate=comp,% + labeldateparts=true,% maxbibnames=7,% + maxcitenames=2,% minbibnames=6,% - abbreviate=true,% + mincitenames=1,% mincrossrefs=999,% - uniqueprimaryauthor=true,% - eventdate=comp,% - date=apalong,% - datelabel=apalong,% origdate=apalong,% + pagetracker=true,% + sorting=apa,% + uniquelist=minyear,% + uniquename=full,% + uniqueprimaryauthor=true,% urldate=apalong,% - dateabbrev=false} + useprefix=true,% + usetranslator=true} % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -365,7 +386,7 @@ {\addcomma\addspace\ldots\addspace} {\ifthenelse{\value{listcount}>\maxprtauth\AND\value{listcount}<\value{listtotal}} {} - {\iffieldequalstr{doubtfulauthor}{true} + {\iffieldannotation{uncertain} {\mkbibbrackets{\usebibmacro{name:apa:family-given}% {\namepartfamily}% {\namepartgiven}% @@ -420,6 +441,7 @@ % Months and days go into parenthesis with year, if set % (APA 6.29) Issue goes where month normally goes if it % is set. +% (APA 7.10) circa or uncertain dates in brackets % Make sure endmonth gets an expansion too \DeclareFieldFormat{endmonth}{\mkbibmonth{#1}} @@ -436,13 +458,13 @@ \iffieldundef{labelyear} {\iffieldundef{origyear} {} - {\printtext[yearorunkyear]{\printfield[noformat]{origyear}}}}% - {\printtext[yearorunkyear]{\printdateextralabel}}} + {\printtext[apadate[{\printorigdate}}}% + {\printtext[apadate]{\printlabeldateextra}}} -\DeclareFieldFormat{yearorunkyear}{% - \ifthenelse{\iffieldequalstr{doubtfuldate}{true}} - {\mkbibbrackets{ca\adddot\addspace#1}} - {\mkbibparens{#1}}} +\DeclareFieldFormat{apadate}{% + \ifboolexpr{ test {\ifdatecirca} or test {\ifdateuncertain} } + {\printtext{\mkbibbrackets{#1}}} + {\printtext{\mkbibparens{#1}}}} % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -847,16 +869,17 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % (APA 7.02 Example 21) Original year -\DeclareFieldFormat{origyear}{\mkbibparens{\bibcpstring{origyear}~\thefield{origyear}}} - % Only give ORIGYEAR in references if both: % YEAR is also given % YEAR and ORIGYEAR are different \newbibmacro*{origyear}{% - \ifthenelse{\NOT\iffieldundef{labelyear}\AND\NOT\iffieldsequal{labelyear}{origyear}} - {\printfield{origyear}} - {}} + \ifboolexpr{% + not test {\iffieldundef{origyear}} + not test {\iffieldundef{labelyear}} + and not test {\iffieldsequal{labelyear}{origyear}}} + {\printtext{\mkbibparens{\bibcpstring{origyear}~\printorigdate}}} + {}} % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -1159,8 +1182,8 @@ \setunit{\addspace}% \iffieldundef{urlyear} {} - {\printurldate% - \setunit*{\addcomma\addspace}}% + {\printtext{\printurldate}% + \setunit*{\urldatecomma}}% \printtext{\bibstring{from}}% \setunit*{\addspace}% \printfield{urldescription}% @@ -1249,7 +1272,7 @@ \usebibmacro{related}}} \newbibmacro*{related:reviewof}[1]{% - \setunit{}% Sanitize this in case no author + \setunit{}% Sanitise this in case no author \entrydata*{#1}{% \ifentrytype{article} {\printtext{\printfield[apacase]{title}}} @@ -2171,7 +2194,6 @@ \newbibmacro*{bbx:savehash}{% \savefield{fullhash}{\bbx@lasthash}} - \newbool{bbx@inset} \DeclareBibliographyDriver{set}{% \booltrue{bbx@inset}% |