summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/biblatex-apa
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2010-07-11 22:46:51 +0000
committerKarl Berry <karl@freefriends.org>2010-07-11 22:46:51 +0000
commit3eee78a534fe08665e4e621b05f447c0ddf07523 (patch)
tree011f3f4922a2843ed93cd4d4550dde11da5c44ad /Master/texmf-dist/tex/latex/biblatex-apa
parent06225999a570c8450530342ebf5f7e72a2e25846 (diff)
biblatex-apa 1.5 (11jul10)
git-svn-id: svn://tug.org/texlive/trunk@19385 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/biblatex-apa')
-rw-r--r--Master/texmf-dist/tex/latex/biblatex-apa/apa.cbx55
1 files changed, 20 insertions, 35 deletions
diff --git a/Master/texmf-dist/tex/latex/biblatex-apa/apa.cbx b/Master/texmf-dist/tex/latex/biblatex-apa/apa.cbx
index 58c6832af68..de7e2f48584 100644
--- a/Master/texmf-dist/tex/latex/biblatex-apa/apa.cbx
+++ b/Master/texmf-dist/tex/latex/biblatex-apa/apa.cbx
@@ -174,7 +174,9 @@
{\iffieldundef{shorthand}
% Cite using title
{\usebibmacro{cite:noname}%
- \setunit{\global\booltrue{cbx:parens}\addspace\bibleftparen}%
+ \setunit{\ifbool{cbx:np}%
+ {\nameyeardelim}%
+ {\global\booltrue{cbx:parens}\addspace\bibleftparen}}%
\usebibmacro{cite:plabelyear+extrayear}}
% Cite using shorthand
{\usebibmacro{cite:shorthand}}}
@@ -190,7 +192,9 @@
% Year
\setunit{\iffieldundef{labelyear}
{\nameyeardelim}
- {\global\booltrue{cbx:parens}\addspace\bibleftparen}}
+ {\ifbool{cbx:np}
+ {\nameyeardelim}
+ {\global\booltrue{cbx:parens}\addspace\bibleftparen}}}%
% Put the shortauthor inside the year brackets if necessary
\ifnameundef{shortauthor}
{}
@@ -201,11 +205,13 @@
{\usebibmacro{cite:noyear}}%
{\usebibmacro{cite:plabelyear+extrayear}}%
\savefield{namehash}{\cbx@lasthash}}}%
- \gdef\cbx@tempa{\ifbool{cbx:parens}
+ \gdef\cbx@tempa{\ifboolexpr{bool {cbx:parens} and not bool {cbx:np}}
{\bibrightparen\global\boolfalse{cbx:parens}}
{}%
\multicitedelim}}
+
+
\newcommand{\apashortdash}{-}
\newbibmacro*{cite:plabelyear+extrayear}{%
@@ -265,45 +271,22 @@
% (APA 6.21) No parens round year for cites when the cite is in
% parentheses. Use new command \nptextcite for such cites.
+
+\DeclareMultiCiteCommand{\nptextcites}{\nptextcite}{\multicitedelim}
\DeclareCiteCommand{\nptextcite}
{\renewcommand{\finalnamedelim}{\ifnum\value{liststop}>2 \finalandcomma\fi\addspace\&\space}%
\usebibmacro{cite:init}%
\usebibmacro{prenote}}
{\usebibmacro{citeindex}%
- \printtext[bibhyperref]{\usebibmacro{nptextcite}}}
+ \global\booltrue{cbx:np}%
+ \printtext[bibhyperref]{\usebibmacro{textcite}}%
+ \global\boolfalse{cbx:np}}%
{}
{\iffieldundef{postnote}
{}
- {\ifbool{cbx:parens}
- {\postnotedelim}
- {\nameyeardelim}%
+ {\nameyeardelim
\printfield{postnote}}}
-\newbibmacro*{nptextcite}{%
- \iffieldequals{namehash}{\cbx@lasthash}
- {\setunit{\compcitedelim}%
- \usebibmacro{cite:plabelyear+extrayear}}
- {\cbx@tempa
- \ifthenelse{\ifnameundef{labelname}\OR\equal{\thefield{entrytype}}{patent}}
- {\usebibmacro{cite:noname}%
- \setunit{%
- \global\booltrue{cbx:parens}%
- \nameyeardelim}%
- \usebibmacro{cite:plabelyear+extrayear}}
- {\printnames{labelname}%
- \setunit{%
- \global\booltrue{cbx:parens}%
- \nameyeardelim}%
- \iffieldundef{labelyear}
- {\usebibmacro{cite:noyear}}
- {\usebibmacro{cite:plabelyear+extrayear}}}%
- \savefield{namehash}{\cbx@lasthash}}%
- \gdef\cbx@tempa{%
- \ifbool{cbx:parens}
- {\addcomma\global\boolfalse{cbx:parens}}
- {}%
- \multicitedelim}}
-
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -329,6 +312,7 @@
\newbool{cbx:parens}
+\newbool{cbx:np} % variable to say we're using a non-parentheses text cite
\newbibmacro*{cite:init}{%
\global\boolfalse{cbx:parens}%
@@ -372,19 +356,20 @@
{}
{\usebibmacro{postnote}}
+
\DeclareCiteCommand{\textcite}
{\usebibmacro{cite:init}%
\usebibmacro{prenote}}
{\usebibmacro{citeindex}%
- \printtext[bibhyperref]{\usebibmacro{textcite}}}
+ \printtext[bibhyperref]{\usebibmacro{textcite}}}%
{}
{\iffieldundef{postnote}
{\ifbool{cbx:parens}
{\bibrightparen}
- {}}
+ {}}
{\ifbool{cbx:parens}
{\postnotedelim}
- {\addspace\bibleftparen}%
+ {\addspace\bibleftparen}%
\printfield{postnote}\bibrightparen}}
\endinput