summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/biblatex-apa/apa.cbx
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2012-07-14 23:29:42 +0000
committerKarl Berry <karl@freefriends.org>2012-07-14 23:29:42 +0000
commit9c45fe88cb4094081b2b1243cd17bcc43439c041 (patch)
tree7cc4b04347495547b4afce8a28ac028256eb69d9 /Master/texmf-dist/tex/latex/biblatex-apa/apa.cbx
parent9c2ad73f6c5870b83ac88537986c2bbb2294f7c4 (diff)
biblatex-apa (10jul12)
git-svn-id: svn://tug.org/texlive/trunk@27057 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/biblatex-apa/apa.cbx')
-rw-r--r--Master/texmf-dist/tex/latex/biblatex-apa/apa.cbx88
1 files changed, 58 insertions, 30 deletions
diff --git a/Master/texmf-dist/tex/latex/biblatex-apa/apa.cbx b/Master/texmf-dist/tex/latex/biblatex-apa/apa.cbx
index 14cee944036..13d0e397643 100644
--- a/Master/texmf-dist/tex/latex/biblatex-apa/apa.cbx
+++ b/Master/texmf-dist/tex/latex/biblatex-apa/apa.cbx
@@ -1,5 +1,4 @@
-%% apa.cbx v4.7
-%% Copyright 2011 Philip Kime
+%% Copyright 2012 Philip Kime
%%
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3
@@ -17,6 +16,7 @@
%%
%% apa.cbx (biblatex citation style)
%% apa.bbx (biblatex references style)
+%% apa.dbx (biblatex style data model)
%% *.lbx (localisation files for APA-specific strings)
%% biblatex-apa.pdf (Style documentation)
%% biblatex-apa.tex (Style documentation source)
@@ -25,8 +25,8 @@
%% biblatex-apa-test-citations.bib (Style examples - citations)
%% biblatex-apa-test-references.bib (Style examples - references)
-\ProvidesFile{apa.cbx}
-\RequireBiber[1]
+\ProvidesFile{apa.cbx}[2012/07/01\space 5.0\space APA biblatex citation style]
+\RequireBiber[3]
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% (APA 6.16) year postfix is not emphasised or italic
@@ -164,6 +164,25 @@
% (APA 6.28) If no date, use "(n.d.)"
% (APA 6.18) Cite ORIGYEAR/YEAR if ORIGYEAR present
+\newbibmacro*{cite:author}{%
+ \iffieldequals{namehash}{\cbx@lasthash}
+% Multiple cites in one command
+ {\setunit{\compcitedelim}%
+ \usebibmacro{cite:plabelyear+extrayear}}%
+% Single cite
+ {\ifthenelse{\ifnameundef{labelname}\OR\iffieldequalstr{entrytype}{patent}}
+% No author/editor
+ {\usebibmacro{cite:noname}%
+ \savefield{namehash}{\cbx@lasthash}}
+% Normal cite
+ {\ifnameundef{shortauthor}
+ {\printnames[labelname][-\value{listtotal}]{labelname}\usebibmacro{with}}%
+ {\ifciteseen
+ {\printnames{shortauthor}}
+ {\printnames[labelname][-\value{listtotal}]{author}\usebibmacro{with}\addspace\printnames[sabrackets]{shortauthor}}}%
+ \savefield{namehash}{\cbx@lasthash}}}%
+ \setunit{\multicitedelim}}
+
\newbibmacro*{cite}{%
\iffieldequals{namehash}{\cbx@lasthash}
% Multiple cites in one command
@@ -178,22 +197,33 @@
\savefield{namehash}{\cbx@lasthash}}
% Normal cite
{\ifnameundef{shortauthor}
- {\printnames[labelname][-\value{listtotal}]{labelname}}
+ {\printnames[labelname][-\value{listtotal}]{labelname}\usebibmacro{with}}%
{\ifciteseen
{\printnames{shortauthor}}
- {\printnames[labelname][-\value{listtotal}]{author}\addspace\printnames[sabrackets]{shortauthor}}}%
+ {\printnames[labelname][-\value{listtotal}]{author}\usebibmacro{with}\addspace\printnames[sabrackets]{shortauthor}}}%
\setunit{\nameyeardelim}%
\usebibmacro{cite:plabelyear+extrayear}%
\savefield{namehash}{\cbx@lasthash}}}%
\setunit{\multicitedelim}}
+\newbibmacro*{with}{%
+ \ifnameundef{with}
+ {}
+ {\setunit{}\addspace\bibopenparen\bibstring{with}\addspace
+ \printnames[labelname][-\value{listtotal}]{with}\bibcloseparen}}
+
\newbibmacro*{textcite}{%
\iffieldequals{namehash}{\cbx@lasthash}
% Compact cite - more than one thing for same author
{\setunit{\compcitedelim}%
\usebibmacro{cite:plabelyear+extrayear}}
-% Single cite
- {\ifthenelse{\ifnameundef{labelname}\OR\iffieldequalstr{entrytype}{patent}}
+% New cite
+ {%
+ \ifbool{cbx:parens}
+ {\bibcloseparen\global\boolfalse{cbx:parens}}
+ {}%
+ \setunit{\compcitedelim}%
+ \ifthenelse{\ifnameundef{labelname}\OR\iffieldequalstr{entrytype}{patent}}
% No author/editor or patent
{\iffieldundef{shorthand}%
% Cite using title
@@ -208,11 +238,11 @@
% Normal full cite
{\ifnameundef{shortauthor}%
% Normal full cite
- {\printnames[labelname][-\value{listtotal}]{labelname}}
+ {\printnames[labelname][-\value{listtotal}]{labelname}\usebibmacro{with}}
% Cite using short author
{\ifciteseen
{\printnames{shortauthor}}
- {\printnames[labelname][-\value{listtotal}]{author}}}%
+ {\printnames[labelname][-\value{listtotal}]{author}\usebibmacro{with}}}%
% Year
\setunit{\ifbool{cbx:np}
{\nameyeardelim}
@@ -224,14 +254,9 @@
{}
{\printnames{shortauthor}\setunit{\nameyeardelim}}}%
% Actual year printing
- \usebibmacro{cite:plabelyear+extrayear}%
- \savefield{namehash}{\cbx@lasthash}}}%
- \setunit{%
- \ifbool{cbx:parens}
- {\bibcloseparen\global\boolfalse{cbx:parens}}
- {}%
- % multicitedelim semi-colon doesn't make much sense for textcites
- \compcitedelim}}
+ \usebibmacro{cite:plabelyear+extrayear}%
+ % Save name hash for checks later
+ \savefield{namehash}{\cbx@lasthash}}}}
\newbibmacro*{cite:plabelyear+extrayear}{%
\iffieldundef{labelyear}
@@ -308,6 +333,8 @@
{\nameyeardelim
\printfield{postnote}}}
+
+
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -372,18 +399,9 @@
\newbibmacro*{textcite:postnote}{%
\usebibmacro{postnote}%
- \ifthenelse{\value{multicitecount}=\value{multicitetotal}}
- {\setunit{}%
- \printtext{%
- \ifbool{cbx:parens}
- {\bibcloseparen\global\boolfalse{cbx:parens}}
- {}}}
- {\setunit{%
- \ifbool{cbx:parens}
- {\bibcloseparen\global\boolfalse{cbx:parens}}
- {}%
- \multicitedelim}}}
-
+ \ifbool{cbx:parens}
+ {\bibcloseparen\global\boolfalse{cbx:parens}}
+ {}}
\newbibmacro*{cite:init}{%
\global\boolfalse{cbx:parens}%
@@ -434,6 +452,8 @@
{}
{\usebibmacro{postnote}}
+\DeclareMultiCiteCommand{\textcites}{\textcite}{\compcitedelim}
+
\DeclareCiteCommand{\textcite}
{\usebibmacro{cite:init}%
\usebibmacro{prenote}}
@@ -442,4 +462,12 @@
{}
{\usebibmacro{textcite:postnote}}
+\DeclareCiteCommand{\citeauthor}
+ {\usebibmacro{cite:init}%
+ \usebibmacro{prenote}}
+ {\usebibmacro{citeindex}%
+ \usebibmacro{cite:author}}
+ {}
+ {\usebibmacro{postnote}}
+
\endinput