From 4ce3a0d4729af1865e66c9c1cd967f42b0830d26 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Sun, 24 Nov 2019 03:00:49 +0000 Subject: CTAN sync 201911240300 --- .../contrib/biblatex-contrib/biblatex-apa/apa.cbx | 207 ++++++++------------- 1 file changed, 77 insertions(+), 130 deletions(-) (limited to 'macros/latex/contrib/biblatex-contrib/biblatex-apa/apa.cbx') diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/apa.cbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa/apa.cbx index 8750aeb35d..6989787742 100644 --- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/apa.cbx +++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/apa.cbx @@ -12,20 +12,21 @@ %% %% The Current Maintainer of this work is Philip Kime. -\ProvidesFile{apa.cbx}[2019/09/07\space v8.0\space APA biblatex citation style] +\ProvidesFile{apa.cbx}[2019/11/23\space v9.0\space APA biblatex citation style] \RequireBiber[3] %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% (APA 6.16) labelyear postfix is not emphasised or italic +% (APA 8.19) labelyear postfix is not emphasised or italic % Dashes between labelyear and non-numeric year (or pseudo-year) +\newcommand{\apashortdash}{-} \DeclareFieldFormat{extradate}{\iffieldnums{labelyear}{\mknumalph{#1}}{\apashortdash\mknumalph{#1}}} % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% (APA 6.11) requires comma separator between authors and years +% (APA 8.11) requires comma separator between authors and years \DeclareDelimFormat{nameyeardelim}{\addcomma\space} \DeclareDelimFormat[textcite]{nameyeardelim}{\addcomma\space} @@ -34,7 +35,7 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% (APA 6.12) No comma before "et al" if there is only one name +% (APA 8.17) No comma before "et al" if there is only one name % preceding it \DeclareDelimFormat{andothersdelim}{\ifnum\value{listcount}>2 \finalandcomma\fi\addspace} @@ -43,7 +44,7 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% (APA 6.12) ampersand separator in parenthetical cites +% (APA 8.17) ampersand separator in parenthetical cites \DeclareDelimFormat[parencite]{finalnamedelim} {\ifnum\value{liststop}>2 \finalandcomma\fi\addspace\&\space} @@ -70,10 +71,10 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% (APA 6.11) Suffices are not shown in citations -% (APA 6.12) 3-5 authors have "et al." after first cite -% (Blog http://blog.apastyle.org/apastyle/2014/01/when-to-use-author-initials-for-text-citations.html) Initials only for primary author and only when not unique across all *primary* authors - +% (APA 8.10) Suffices are not shown in citations +% (APA 8.17) 3+ authors have "et al." +% (APA 8.20) Initials only for primary author and only when not unique across all *primary* authors + \newbibmacro*{labelname:doname}[8]{% \ifboolexpr{test {\ifnumcomp{\value{listcount}}{>}{1}} or @@ -95,92 +96,22 @@ \fi \usebibmacro{name:andothers}} -% Can't do this with the built-in printnames format as APA requires truncation -% and disambiguation only after first cite -% We either use uniquelist or minnames for truncation. If uniquelist isn't -% defined, we fall back on minnames -% -% \printnames does different things depending on whether the format you are -% calling is the default for the name field or is a custom format: -% -% max/minnames truncation is done before calling the format so we have -% to do \printnames[format][-\value{listtotal}]{field} to ensure we get -% all of the names in the list to work on here -% -% Explicit "and others" is dealt with in labelname:doname via a custom name:andothers - \DeclareNameFormat{labelname}{% - % First set the truncation point - \ifthenelse{\value{uniquelist}>1} - {\numdef\cbx@min{\value{uniquelist}}} - {\numdef\cbx@min{\value{minnames}}}% - % Always print the first name and the second if there are only two since - % "et al" must always be plural - \ifboolexpr{test {\ifnumcomp{\value{listcount}}{=}{1}} - or test {\ifnumcomp{\value{listtotal}}{=}{2}}} - {\usebibmacro{labelname:doname}% - {\namepartfamily}% - {\namepartfamilyi}% - {\namepartgiven}% - {\namepartgiveni}% - {\namepartprefix}% - {\namepartprefixi}% - {\namepartsuffix}% - {\namepartsuffixi}} - % We are looking at name >=3 - % If the list is 6 or more names or we have seen citation before, potential truncation - {\ifboolexpr{test {\ifnumcomp{\value{listtotal}}{>}{5}} - or test {\ifciteseen}} - % Less than the truncation point, print normally - {\ifnumcomp{\value{listcount}}{<}{\cbx@min + 1} - {\usebibmacro{labelname:doname}% - {\namepartfamily}% - {\namepartfamilyi}% - {\namepartgiven}% - {\namepartgiveni}% - {\namepartprefix}% - {\namepartprefixi}% - {\namepartsuffix}% - {\namepartsuffixi}} - {}% - % At potential truncation point ... - \ifnumcomp{\value{listcount}}{=}{\cbx@min + 1} - % but enforce plurality of et al - only truncate here if there is at - % least one more element after the current potential truncation point - % so that "et al" covers at least two elements. - {\ifnumcomp{\value{listcount}}{<}{\value{listtotal}} - {\printdelim{andothersdelim}\bibstring{andothers}} - {\usebibmacro{labelname:doname}% - {\namepartfamily}% - {\namepartfamilyi}% - {\namepartgiven}% - {\namepartgiveni}% - {\namepartprefix}% - {\namepartprefixi}% - {\namepartsuffix}% - {\namepartsuffixi}}} - {}% - % After truncation point, do not print name - \ifnumcomp{\value{listcount}}{>}{\cbx@min + 1} - {\relax}% - {}}% - % We are looking at name >=3 - % Name list is < 6 names or we haven't seen this citation before, print normally - {\usebibmacro{labelname:doname}% - {\namepartfamily}% - {\namepartfamilyi}% - {\namepartgiven}% - {\namepartgiveni}% - {\namepartprefix}% - {\namepartprefixi}% - {\namepartsuffix}% - {\namepartsuffixi}}}} + \usebibmacro{labelname:doname}% + {\namepartfamily}% + {\namepartfamilyi}% + {\namepartgiven}% + {\namepartgiveni}% + {\namepartprefix}% + {\namepartprefixi}% + {\namepartsuffix}% + {\namepartsuffixi}} % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%% -% (APA 6.13) Groups as names +% (APA 8.21) Groups as names % SHORTAUTHOR brackets in parencites \DeclareNameFormat{sabrackets}{% @@ -204,12 +135,13 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% (APA 6.13) Deal with SHORTAUTHOR fields -% (APA 6.16) Multiple same author cites in a compact citation call do not +% (APA 8.21) Deal with SHORTAUTHOR fields +% (APA 8.12) Multiple same author cites in a compact citation call do not % need to be repeated but the full years must be repeated with % their extradate postfixes -% (APA 6.18) Cite ORIGYEAR/YEAR if ORIGYEAR present -% (APA 6.28) ISSUE after year when available +% (APA 8.15) Cite ORIGYEAR/YEAR if ORIGYEAR present +% (APA 10.1:11) Reprints have original year in citation + \def\citeresetapa{\global\let\cbx@apa@names\@empty} \citeresetapa \def\cbx@apa@ifnamesaved{% @@ -223,17 +155,20 @@ {\setunit{\compcitedelim}% \usebibmacro{cite:plabelyear+extradate}}% % Single cite - {\ifthenelse{\ifnameundef{labelname}\OR\iffieldequalstr{entrytype}{patent}} + {\ifnameundef{labelname} % No author/editor {\usebibmacro{cite:noname}% \savefield{fullhash}{\cbx@lasthash}} % Normal cite {\ifnameundef{shortauthor} - {\printnames[labelname][-\value{listtotal}]{labelname}}% - {\cbx@apa@ifnamesaved + {\printnames{labelname}}% + {\cbx@apa@ifnamesaved {\printnames{shortauthor}} - {\printnames[labelname][-\value{listtotal}]{author}\addspace\printnames[sabrackets]{shortauthor}}}% - \savefield{fullhash}{\cbx@lasthash}}}% + {\ifnameundef{groupauthor} + {\printnames[labelname]{author}} + {\printnames[labelname]{groupauthor}}% + \addspace\printnames[sabrackets]{shortauthor}}}% + \savefield{fullhash}{\cbx@lasthash}}}% \setunit{\multicitedelim}} % Using fullhash instead of namehash otherwise we may omit namelist for @@ -251,7 +186,7 @@ {\setunit{\compcitedelim}% \usebibmacro{cite:plabelyear+extradate}}% % Single cite - {\ifthenelse{\ifnameundef{labelname}\OR\iffieldequalstr{entrytype}{patent}} + {\ifnameundef{labelname} % No author/editor {\usebibmacro{cite:noname}% \setunit{\printdelim{nameyeardelim}}% @@ -259,11 +194,14 @@ \savefield{fullhash}{\cbx@lasthash}} % Normal cite {\ifnameundef{shortauthor} - {\printnames[labelname][-\value{listtotal}]{labelname}}% - {\cbx@apa@ifnamesaved - {\printnames{shortauthor}} - {\printnames[labelname][-\value{listtotal}]{author}\addspace\printnames[sabrackets]{shortauthor}}}% - \setunit{\printdelim{nameyeardelim}}% + {\printnames{labelname}}% + {\cbx@apa@ifnamesaved + {\printnames{shortauthor}} + {\ifnameundef{groupauthor} + {\printnames[labelname]{author}} + {\printnames[labelname]{groupauthor}}% + \addspace\printnames[sabrackets]{shortauthor}}}% + \setunit{\printdelim{nameyeardelim}}% \usebibmacro{cite:plabelyear+extradate}% \savefield{fullhash}{\cbx@lasthash}}}% \setunit{\multicitedelim}} @@ -279,8 +217,8 @@ {\bibcloseparen\global\boolfalse{cbx:parens}} {}% \setunit{\compcitedelim}% - \ifthenelse{\ifnameundef{labelname}\OR\iffieldequalstr{entrytype}{patent}} - % No author/editor or patent + \ifnameundef{labelname} + % No author/editor {\iffieldundef{shorthand}% % Cite using title {\usebibmacro{cite:noname}% @@ -294,11 +232,13 @@ % Normal full cite {\ifnameundef{shortauthor}% % Normal full cite - {\printnames[labelname][-\value{listtotal}]{labelname}} + {\printnames{labelname}} % Cite using short author {\cbx@apa@ifnamesaved {\printnames{shortauthor}} - {\printnames[labelname][-\value{listtotal}]{author}}}% + {\ifnameundef{groupauthor} + {\printnames[labelname]{author}} + {\printnames[labelname]{groupauthor}}}}% % Year \setunit{\ifbool{cbx:np} {\printdelim{nameyeardelim}} @@ -324,22 +264,22 @@ \iffieldsequal{labelyear}{labelendyear}% Don't want no-op year ranges {\clearfield{labelendyear}} {}% - \iffieldundef{origyear}{} - {\ifboolexpr{ test {\iforigdatecirca} or test {\iforigdateuncertain} } - {\mkbibbrackets{\printorigdate}} - {\printorigdate}% + \iffieldundef{origyear} + {} + {\printorigdate% \setunit*{\addslash}}% - \ifboolexpr{ test {\iflabeldatecirca} or test {\iflabeldateuncertain} } - {\mkbibbrackets{\printlabeldateextra}} - {\printlabeldateextra}}}% - \iffieldundef{issue} - {} - {\addcomma\addspace\printfield{issue}}} + \iffieldundef{related} + {} + {\iffieldequalstr{relatedtype}{reprintfrom} + {\entrydata*{\thefield{related}}{\printlabeldateextra}% + \setunit*{\addslash}} + {}}% + \printlabeldateextra}}} \newbibmacro*{cite:shorthand}{% \ifciteseen {\printfield{shorthand}} - {\printnames[labelname][-\value{listtotal}]{labelname}% + {\printnames{labelname}% \setunit{\printdelim{nameyeardelim}}% \printfield{title}\space\printfield{shorthand}}} @@ -347,15 +287,15 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% (APA 6.15) Fall back to title for citations without authors +% (APA 8.14) Fall back to title for citations without authors \DeclareFieldFormat{citetitle}{\mkbibquote{#1}} \DeclareFieldFormat[online]{citetitle}{\mkbibquote{#1}} \DeclareFieldFormat[inbook]{citetitle}{\mkbibquote{#1}} \DeclareFieldFormat[book]{citetitle}{\mkbibemph{#1}} +\DeclareFieldFormat[manual]{citetitle}{\mkbibemph{#1}} \DeclareFieldFormat[report]{citetitle}{\mkbibemph{#1}} \DeclareFieldFormat[periodical]{citetitle}{\mkbibemph{#1}} -\DeclareFieldFormat[patent]{citetitle}{#1} \newbibmacro*{cite:noname}{% \printfield[citetitle]{labeltitle}} @@ -363,8 +303,23 @@ % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% (APA 10.2:32) Raw field cite formats + +\DeclareFieldFormat{citefield}{% + \ifcurrentfield{edition} + {\ifinteger{#1} + {\mkbibordedition{#1}~\bibstring{edition}} + {#1\isdot}} + {\ifcurrentfield{shorthand} + {\mkbibemph{#1}} + {#1}}} + +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% (APA 6.21) No parens round year for cites when the cite is in +% (APA 8.11) No parens round year for cites when the cite is in % parentheses. Use new command \nptextcite for such cites. \DeclareDelimFormat[nptextcite]{finalnamedelim} @@ -416,10 +371,6 @@ {\usebibmacro{prenote}} {\usedriver {\DeclareNameAlias{sortname}{default}% - \global\boolfalse{bbx:parens}% - \global\boolfalse{bbx:volseen}% - \global\boolfalse{bbx:titleinauthpos}% - \global\boolfalse{bbx:editorinauthpos}% \global\boolfalse{bbx:in}% \global\let\blx@related@loop\@empty} {\thefield{entrytype}}% @@ -435,10 +386,6 @@ \setlength{\parsep}{\bibparsep}}\item} {\usedriver {\DeclareNameAlias{sortname}{default}% - \global\boolfalse{bbx:parens}% - \global\boolfalse{bbx:volseen}% - \global\boolfalse{bbx:titleinauthpos}% - \global\boolfalse{bbx:editorinauthpos}% \global\boolfalse{bbx:in}} {\thefield{entrytype}}% \finentry -- cgit v1.2.3