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.cbx49
1 files changed, 36 insertions, 13 deletions
diff --git a/Master/texmf-dist/tex/latex/biblatex-apa/apa.cbx b/Master/texmf-dist/tex/latex/biblatex-apa/apa.cbx
index aca49a9bd8f..993c3166815 100644
--- a/Master/texmf-dist/tex/latex/biblatex-apa/apa.cbx
+++ b/Master/texmf-dist/tex/latex/biblatex-apa/apa.cbx
@@ -1,4 +1,4 @@
-%% apa.cbx v2.9
+%% apa.cbx v3.0
%% Copyright 2011 Philip Kime
%%
%% This work may be distributed and/or modified under the
@@ -43,6 +43,15 @@
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% (APA 6.12) No comma before "et al" if there is only one name
+% preceding it
+
+\renewcommand*{\andothersdelim}{\ifnum\value{listcount}>2 \finalandcomma\fi\addspace}
+
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% (APA 6.12) ampersand separator in parenthetical cites
@@ -89,20 +98,34 @@
\fi
\usebibmacro{name:andothers}}
-% Can't do this with the built-in printnames as APA requires truncation
+% 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
\DeclareNameFormat{labelname}{%
- \ifthenelse{\value{listcount}=1\OR\value{listtotal}=2}
+ \ifthenelse{\value{uniquelist}>1}
+ {\numdef\cbx@min{\value{uniquelist}}}
+ {\numdef\cbx@min{\value{minnames}}}%
+ \ifboolexpr{test {\ifnumcomp{\value{listcount}}{=}{1}}
+ or test {\ifnumcomp{\value{listtotal}}{=}{2}}}
{\usebibmacro{labelname:doname}{#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}}
- {\ifthenelse{\ifciteseen\OR\value{listtotal}>5}
- {\ifnumcomp{\value{listcount}}{<}{\value{uniquelist} + 1}% normal name
- {\usebibmacro{labelname:doname}{#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}}%
+ {\ifboolexpr{test {\ifnumcomp{\value{listtotal}}{>}{5}}
+ or test {\ifciteseen}}
+ {\ifnumcomp{\value{listcount}}{<}{\cbx@min + 1}% normal name
+ {\usebibmacro{labelname:doname}{#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}}%
{}%
- \ifnumcomp{\value{listcount}}{=}{\value{uniquelist} + 1}% first past ul is et al
+ \ifnumcomp{\value{listcount}}{=}{\cbx@min + 1}% first past ul is et al
{\andothersdelim\bibstring{andothers}}%
{}%
- \ifnumcomp{\value{listcount}}{>}{\value{uniquelist} + 1}% nothing thereafter
+ \ifnumcomp{\value{listcount}}{>}{\cbx@min + 1}% nothing thereafter
{\relax}%
{}}%
{\usebibmacro{labelname:doname}{#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}}}}
@@ -151,10 +174,10 @@
\savefield{namehash}{\cbx@lasthash}}}
% Normal cite
{\ifnameundef{shortauthor}
- {\printnames{labelname}}
+ {\printnames[labelname][-\value{listtotal}]{labelname}}
{\ifciteseen
{\printnames{shortauthor}}
- {\printnames{author}\addspace\printnames[sabrackets]{shortauthor}}}%
+ {\printnames[labelname][-\value{listtotal}]{author}\addspace\printnames[sabrackets]{shortauthor}}}%
\setunit{\nameyeardelim}%
\iffieldundef{labelyear}
{\usebibmacro{cite:noyear}}
@@ -183,11 +206,11 @@
% Normal full cite
{\ifnameundef{shortauthor}%
% Normal full cite
- {\printnames{labelname}}
+ {\printnames[labelname][-\value{listtotal}]{labelname}}
% Cite using short author
{\ifciteseen
{\printnames{shortauthor}}
- {\printnames{author}}}%
+ {\printnames[labelname][-\value{listtotal}]{author}}}%
% Year
\setunit{\ifbool{cbx:np}
{\nameyeardelim}
@@ -228,7 +251,7 @@
\newbibmacro*{cite:shorthand}{%
\ifciteseen
{\printfield{shorthand}}
- {\printnames{labelname}%
+ {\printnames[labelname][-\value{listtotal}]{labelname}%
\setunit{\nameyeardelim}%
\printfield{title}\space\printfield{shorthand}}}