summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/biblatex-apa/apa.cbx
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/biblatex-apa/apa.cbx')
-rw-r--r--Master/texmf-dist/tex/latex/biblatex-apa/apa.cbx86
1 files changed, 49 insertions, 37 deletions
diff --git a/Master/texmf-dist/tex/latex/biblatex-apa/apa.cbx b/Master/texmf-dist/tex/latex/biblatex-apa/apa.cbx
index f5c608ccb12..220709a82ff 100644
--- a/Master/texmf-dist/tex/latex/biblatex-apa/apa.cbx
+++ b/Master/texmf-dist/tex/latex/biblatex-apa/apa.cbx
@@ -12,7 +12,7 @@
%%
%% The Current Maintainer of this work is Philip Kime.
-\ProvidesFile{apa.cbx}[2016/03/01\space v6.8\space APA biblatex citation style]
+\ProvidesFile{apa.cbx}[2016/05/13\space v6.9\space APA biblatex citation style]
\RequireBiber[3]
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -70,44 +70,50 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% (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
+% (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
\newbibmacro*{labelname:doname}[8]{%
- \ifnumcomp{\value{listcount}}{>}{1}
+ \ifboolexpr{test {\ifnumcomp{\value{listcount}}{>}{1}}
+ or
+ test {\ifuniqueprimaryauthor}}
{\setcounter{uniquename}{0}}
{}%
\ifcase\value{uniquename}%
\ifuseprefix
- {\usebibmacro{name:family}{#1}{#3}{#5}{}}
- {\usebibmacro{name:family}{#1}{#3}{}{}}%
- \or
+ {\usebibmacro{name:family}{#1}{#3}{#5}{\relax}}
+ {\usebibmacro{name:family}{#1}{#3}{\relax}{\relax}}%
+ \or
\ifuseprefix
- {\usebibmacro{name:given-family}{#1}{#4}{#5}{}}
- {\usebibmacro{name:given-family}{#1}{#4}{}{}}%
- \or
+ {\usebibmacro{name:given-family}{#1}{#4}{#5}{\relax}}
+ {\usebibmacro{name:given-family}{#1}{#4}{\relax}{\relax}}%
+ \or
\ifuseprefix
- {\usebibmacro{name:given-family}{#1}{#3}{#5}{}}
- {\usebibmacro{name:given-family}{#1}{#3}{}{}}%
- \fi
- \usebibmacro{name:andothers}}
+ {\usebibmacro{name:given-family}{#1}{#3}{#5}{\relax}}
+ {\usebibmacro{name:given-family}{#1}{#3}{\relax}{\relax}}%
+ \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
+% 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}{%
- \nameparts{#1}%
+ % 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}%
@@ -119,9 +125,12 @@
{\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}}
- {\ifnumcomp{\value{listcount}}{<}{\cbx@min + 1}% normal name
+ % Less than the truncation point, print normally
+ {\ifnumcomp{\value{listcount}}{<}{\cbx@min + 1}
{\usebibmacro{labelname:doname}%
{\namepartfamily}%
{\namepartfamilyi}%
@@ -132,25 +141,29 @@
{\namepartsuffix}%
{\namepartsuffixi}}
{}%
- \ifnumcomp{\value{listcount}}{=}{\cbx@min + 1}% first past ul is et al
- % 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}}
- {\andothersdelim\bibstring{andothers}}
- {\usebibmacro{labelname:doname}%
- {\namepartfamily}%
- {\namepartfamilyi}%
- {\namepartgiven}%
- {\namepartgiveni}%
- {\namepartprefix}%
- {\namepartprefixi}%
- {\namepartsuffix}%
- {\namepartsuffixi}}}
- {}%
- \ifnumcomp{\value{listcount}}{>}{\cbx@min + 1}% nothing thereafter
+ % 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}}
+ {\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}%
@@ -169,7 +182,6 @@
% SHORTAUTHOR brackets in parencites
\DeclareNameFormat{sabrackets}{%
- \nameparts{#1}%
\ifciteseen
{\usebibmacro{labelname:doname}%
{\namepartfamily}%