diff options
author | Karl Berry <karl@freefriends.org> | 2020-05-04 21:24:29 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2020-05-04 21:24:29 +0000 |
commit | 516e3d4f4504cebba7c955c19276fde957c037ad (patch) | |
tree | 4ec787b2ba313b3b19df72e7ce31f33cc8e5065e /Master/texmf-dist/tex/latex/biblatex-apa6/apa6.cbx | |
parent | d1beff40fcdadc8357ad31e0d8238e255f782ac5 (diff) |
biblatex-apa6 (3may20)
git-svn-id: svn://tug.org/texlive/trunk@55017 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/biblatex-apa6/apa6.cbx')
-rw-r--r-- | Master/texmf-dist/tex/latex/biblatex-apa6/apa6.cbx | 217 |
1 files changed, 141 insertions, 76 deletions
diff --git a/Master/texmf-dist/tex/latex/biblatex-apa6/apa6.cbx b/Master/texmf-dist/tex/latex/biblatex-apa6/apa6.cbx index b30b4da62ae..50815fdc3fc 100644 --- a/Master/texmf-dist/tex/latex/biblatex-apa6/apa6.cbx +++ b/Master/texmf-dist/tex/latex/biblatex-apa6/apa6.cbx @@ -1,4 +1,4 @@ -%% Copyright 2019 Philip Kime +%% Copyright 2020 Philip Kime %% %% This work may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either version 1.3 @@ -12,7 +12,7 @@ %% %% The Current Maintainer of this work is Philip Kime. -\ProvidesFile{apa6.cbx}[2019/12/02\space v8.3\space APA 6th ed. biblatex citation style] +\ProvidesFile{apa6.cbx}[2020/05/03\space v8.4\space APA 6th ed. biblatex citation style] \RequireBiber[3] %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -42,33 +42,6 @@ % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% (APA 6.12) ampersand separator in parenthetical cites - -\DeclareDelimFormat[parencite]{finalnamedelim} - {\ifnum\value{liststop}>2 \finalandcomma\fi\addspace\&\space} - -\DeclareCiteCommand{\parencite}[\mkbibparens] - {\usebibmacro{cite:init}% - \usebibmacro{prenote}} - {\usebibmacro{citeindex}% - \usebibmacro{cite}% - \usebibmacro{cite:post}} - {} - {\usebibmacro{postnote}} - -\DeclareCiteCommand*{\parencite}[\mkbibparens] - {\usebibmacro{cite:init}% - \usebibmacro{prenote}} - {\usebibmacro{citeindex}% - \usebibmacro{citeyear}% - \usebibmacro{cite:post}} - {} - {\usebibmacro{postnote}} - -% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % (APA 6.11) Suffices are not shown in citations % (APA 6.12) 3-5 authors have "et al." after first cite @@ -268,6 +241,9 @@ \savefield{fullhash}{\cbx@lasthash}}}% \setunit{\multicitedelim}} +\renewcommand*{\iffinalcitedelim}{% + \ifnumequal{\value{textcitecount}}{\value{textcitetotal}-1}} + \newbibmacro*{textcite}{% \iffieldequals{fullhash}{\cbx@lasthash} % Compact cite - more than one thing for same author @@ -275,18 +251,16 @@ \usebibmacro{cite:plabelyear+extradate}} % New cite {% - \ifbool{cbx:parens} - {\bibcloseparen\global\boolfalse{cbx:parens}} - {}% - \setunit{\compcitedelim}% + \ifbool{cbx:parens} + {\bibcloseparen\global\boolfalse{cbx:parens}} + {}% + \setunit{\textcitedelim}% \ifthenelse{\ifnameundef{labelname}\OR\iffieldequalstr{entrytype}{patent}} % No author/editor or patent {\iffieldundef{shorthand}% % Cite using title {\usebibmacro{cite:noname}% - \setunit{\ifbool{cbx:np}% - {\printdelim{nameyeardelim}}% - {\global\booltrue{cbx:parens}\addspace\bibopenparen}}% + \setunit{\global\booltrue{cbx:parens}\addspace\bibopenparen}% \usebibmacro{cite:plabelyear+extradate}} % Cite using shorthand {\usebibmacro{cite:shorthand}}} @@ -300,19 +274,22 @@ {\printnames{shortauthor}} {\printnames[labelname][-\value{listtotal}]{author}}}% % Year - \setunit{\ifbool{cbx:np} - {\printdelim{nameyeardelim}} - {\global\booltrue{cbx:parens}\addspace\bibopenparen}}% + \setunit{\global\booltrue{cbx:parens}\addspace\bibopenparen}% % Put the shortauthor inside the year brackets if necessary \ifnameundef{shortauthor} {} {\cbx@apa@ifnamesaved {} {\printnames{shortauthor}\setunit{\printdelim{nameyeardelim}}}}% + % Print prenote (belongs to first cite) + \ifnumequal{\value{citecount}}{1} + {\usebibmacro{prenote}} + {}% % Actual year printing \usebibmacro{cite:plabelyear+extradate}% % Save name hash for checks later - \savefield{fullhash}{\cbx@lasthash}}}} + \savefield{fullhash}{\cbx@lasthash}}% + \stepcounter{textcitecount}}} \newbibmacro*{cite:plabelyear+extradate}{% \iffieldundef{labelyear}{} @@ -363,29 +340,7 @@ % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% (APA 6.21) No parens round year for cites when the cite is in -% parentheses. Use new command \nptextcite for such cites. - -\DeclareDelimFormat[nptextcite]{finalnamedelim} - {\ifnum\value{liststop}>2 \finalandcomma\fi\addspace\&\space} - -\DeclareCiteCommand{\nptextcite} - {\usebibmacro{cite:init}% - \usebibmacro{prenote}} - {\usebibmacro{citeindex}% - \global\booltrue{cbx:np}% - \usebibmacro{textcite}% - \usebibmacro{cite:post}% - \global\boolfalse{cbx:np}}% - {} - {\iffieldundef{postnote} - {} - {\printdelim{nameyeardelim}% - \printfield{postnote}}} -% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % No shorthand @@ -449,7 +404,6 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \newbool{cbx:parens} % boolean to say we're inside parens -\newbool{cbx:np} % boolean to say we're using a non-parentheses text cite \newbibmacro*{textcite:postnote}{% \usebibmacro{postnote}% @@ -478,6 +432,16 @@ {\printfield{labelyear}% \printfield{extradate}}} + +\DeclareCiteCommand{\citeauthor} + {\usebibmacro{cite:init}% + \usebibmacro{prenote}} + {\usebibmacro{citeindex}% + \usebibmacro{cite:author}% + \usebibmacro{cite:post}} + {} + {\usebibmacro{postnote}} + \DeclareCiteCommand{\citeyear} {\boolfalse{citetracker}% \boolfalse{pagetracker}% @@ -486,6 +450,7 @@ {\multinamedelim} {\usebibmacro{postnote}} + \DeclareCiteCommand{\cite} {\usebibmacro{cite:init}% \usebibmacro{prenote}} @@ -495,6 +460,8 @@ {} {\usebibmacro{postnote}} +\DeclareMultiCiteCommand{\cites}{\cite}{\setunit{\multicitedelim}} + \DeclareCiteCommand*{\cite} {\usebibmacro{cite:init}% \usebibmacro{prenote}} @@ -504,9 +471,15 @@ {} {\usebibmacro{postnote}} -\DeclareCiteCommand{\footcite}[\mkbibfootnote] - {\bibsentence - \usebibmacro{cite:init}% + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% (APA 6.12) ampersand separator in parenthetical cites + +\DeclareDelimFormat[parencite]{finalnamedelim} + {\ifnum\value{liststop}>2 \finalandcomma\fi\addspace\&\space} + +\DeclareCiteCommand{\parencite}[\mkbibparens] + {\usebibmacro{cite:init}% \usebibmacro{prenote}} {\usebibmacro{citeindex}% \usebibmacro{cite}% @@ -514,35 +487,127 @@ {} {\usebibmacro{postnote}} -\DeclareCiteCommand{\textcite} +\DeclareMultiCiteCommand{\parencites}[\mkbibparens]{\parencite} + {\setunit{\multicitedelim}} + +\DeclareCiteCommand*{\parencite}[\mkbibparens] {\usebibmacro{cite:init}% \usebibmacro{prenote}} {\usebibmacro{citeindex}% - \usebibmacro{textcite}% + \usebibmacro{citeyear}% \usebibmacro{cite:post}} {} - {\usebibmacro{textcite:postnote}} + {\usebibmacro{postnote}} -\DeclareCiteCommand{\citeauthor} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% (APA 6.21) No parens round year for cites when the cite is in +% parentheses. Use new command \nptextcite for such cites. + +\DeclareDelimAlias*[nptextcite]{finalnamedelim}[parencite]{finalnamedelim} + +\DeclareCiteCommand{\nptextcite} {\usebibmacro{cite:init}% \usebibmacro{prenote}} {\usebibmacro{citeindex}% - \usebibmacro{cite:author}% + \usebibmacro{cite}% \usebibmacro{cite:post}} {} {\usebibmacro{postnote}} - -\DeclareMultiCiteCommand{\cites}{\cite}{\setunit{\multicitedelim}} -\DeclareMultiCiteCommand{\textcites}{\textcite}{\setunit{\compcitedelim}} \DeclareMultiCiteCommand{\nptextcites}{\nptextcite}{\setunit{\multicitedelim}} -\DeclareMultiCiteCommand{\parencites}[\mkbibparens]{\parencite} - {\setunit{\multicitedelim}} + +\DeclareCiteCommand*{\nptextcite} + {\usebibmacro{cite:init}% + \usebibmacro{prenote}} + {\usebibmacro{citeindex}% + \usebibmacro{citeyear}% + \usebibmacro{cite:post}} + {} + {\usebibmacro{postnote}} + +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\DeclareCiteCommand{\footcite}[\mkbibfootnote] + {\usebibmacro{cite:init}% + \usebibmacro{prenote}} + {\usebibmacro{citeindex}% + \usebibmacro{cite}% + \usebibmacro{cite:post}} + {} + {\usebibmacro{postnote}} + \DeclareMultiCiteCommand{\footcites}[\mkbibfootnote]{\footcite} {\setunit{\multicitedelim}} + +\DeclareCiteCommand{\footcitetext}[\mkbibfootnotetext] + {\usebibmacro{cite:init}% + \usebibmacro{prenote}} + {\usebibmacro{citeindex}% + \usebibmacro{cite}% + \usebibmacro{cite:post}} + {} + {\usebibmacro{postnote}} + \DeclareMultiCiteCommand{\footcitetexts}[\mkbibfootnotetext] {\footcitetext}{\setunit{\multicitedelim}} + + +\DeclareCiteCommand{\smartcite}[\iffootnote\mkbibparens\mkbibfootnote] + {\usebibmacro{cite:init}% + \usebibmacro{prenote}} + {\usebibmacro{citeindex}% + \usebibmacro{cite}} + {} + {\usebibmacro{postnote}} + \DeclareMultiCiteCommand{\smartcites}[\iffootnote\mkbibparens\mkbibfootnote] {\smartcite}{\setunit{\multicitedelim}} + +\DeclareCiteCommand{\cbx@textcite} + {\usebibmacro{cite:init}} + {\usebibmacro{citeindex}% + \usebibmacro{textcite}% + \usebibmacro{cite:post}} + {} + {\usebibmacro{textcite:postnote}} + +\DeclareCiteCommand{\textcite}[\cbx@textcite@init\cbx@textcite] + {\gdef\cbx@savedkeys{}% + \citetrackerfalse% + \pagetrackerfalse% + \DeferNextCitekeyHook% + \usebibmacro{cite:init}} + {\ifthenelse{\iffirstcitekey\AND\value{multicitetotal}>0} + {\protected@xappto\cbx@savedcites{()(\thefield{multipostnote})}% + \global\clearfield{multipostnote}} + {}% + \xappto\cbx@savedkeys{\thefield{entrykey},}% + \iffieldequals{namehash}{\cbx@lasthash} + {} + {\stepcounter{textcitetotal}% + \savefield{namehash}{\cbx@lasthash}}} + {} + {\protected@xappto\cbx@savedcites{% + [\thefield{prenote}][\thefield{postnote}]{\cbx@savedkeys}}} + +% textcite has nested \DeclareCiteCommand definitions for textcite and we want to use +% the normal textcite context +\DeclareDelimcontextAlias{cbx@textcite}{textcite} + +\newrobustcmd{\cbx@textcite@init}[2]{% + \setcounter{textcitetotal}{0}% + \setcounter{textcitecount}{0}% + \def\cbx@savedcites{#1}#2\cbx@savedcites\empty} + +\DeclareMultiCiteCommand{\cbx@textcites}{\cbx@textcite}{} +\DeclareMultiCiteCommand{\textcites}[\cbx@textcites@init\cbx@textcites]{\textcite}{} + +\let\cbx@textcites@init\cbx@textcite@init +\pretocmd{\cbx@textcites@init}{\UseNextMultiCiteHook}{}{} + \endinput |