diff options
author | Karl Berry <karl@freefriends.org> | 2019-11-27 22:04:35 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2019-11-27 22:04:35 +0000 |
commit | a928eb9724aca82d58f67dda4cdaf5f3628dbcb1 (patch) | |
tree | 22555f50f049cb13466c5a9f4a89350e5b40c0c4 /Master/texmf-dist/tex/latex/biblatex-apa/apa.cbx | |
parent | fef92f3f1563f60dd34f405b87b18616879c277a (diff) |
biblatex-apa (27nov19)
git-svn-id: svn://tug.org/texlive/trunk@52945 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.cbx | 121 |
1 files changed, 103 insertions, 18 deletions
diff --git a/Master/texmf-dist/tex/latex/biblatex-apa/apa.cbx b/Master/texmf-dist/tex/latex/biblatex-apa/apa.cbx index 6989787742a..d1b5965ca87 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}[2019/11/23\space v9.0\space APA biblatex citation style] +\ProvidesFile{apa.cbx}[2019/11/27\space v9.1\space APA biblatex citation style] \RequireBiber[3] %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -43,27 +43,33 @@ % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % (APA 8.17) ampersand separator in parenthetical cites +\newtoggle{apa:inpcite} + \DeclareDelimFormat[parencite]{finalnamedelim} {\ifnum\value{liststop}>2 \finalandcomma\fi\addspace\&\space} \DeclareCiteCommand{\parencite}[\mkbibparens] {\usebibmacro{cite:init}% - \usebibmacro{prenote}} + \usebibmacro{prenote}% + \toggletrue{apa:inpcite}} {\usebibmacro{citeindex}% \usebibmacro{cite}% \usebibmacro{cite:post}} {} - {\usebibmacro{postnote}} + {\usebibmacro{postnote}% + \togglefalse{apa:inpcite}} \DeclareCiteCommand*{\parencite}[\mkbibparens] {\usebibmacro{cite:init}% - \usebibmacro{prenote}} + \usebibmacro{prenote}% + \toggletrue{apa:inpcite}} {\usebibmacro{citeindex}% \usebibmacro{citeyear}% - \usebibmacro{cite:post}} + \usebibmacro{cite:post}% + \togglefalse{apa:inpcite}} {} {\usebibmacro{postnote}} @@ -288,18 +294,83 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % (APA 8.14) Fall back to title for citations without authors +% (APA 11) Bizarre and special rules for legal information \DeclareFieldFormat{citetitle}{\mkbibquote{#1}} -\DeclareFieldFormat[online]{citetitle}{\mkbibquote{#1}} -\DeclareFieldFormat[inbook]{citetitle}{\mkbibquote{#1}} -\DeclareFieldFormat[book]{citetitle}{\mkbibemph{#1}} -\DeclareFieldFormat[manual]{citetitle}{\mkbibemph{#1}} -\DeclareFieldFormat[report]{citetitle}{\mkbibemph{#1}} -\DeclareFieldFormat[periodical]{citetitle}{\mkbibemph{#1}} +\DeclareFieldFormat[book,manual,report,preiodical,legmaterial,jurisdiction]{citetitle}{\mkbibemph{#1}} +\DeclareFieldFormat[legislation,legadminmaterial,legal]{citetitle}{#1} \newbibmacro*{cite:noname}{% - \printfield[citetitle]{labeltitle}} - + \iffieldundef{labeltitle} + {\ifthenelse{\ifentrytype{legmaterial}\OR% + \ifentrytype{legadminmaterial}} + {\let\blx@tempa\bibcplstring% \textcite default + \let\blx@tempb\bibcplstring% \textcite default + \iftoggle{apa:inpcite} + {\iffieldequalstr{type}{execorder}{\let\blx@tempb\bibcpsstring}{}% + \iffieldequalstr{type}{resolution}{\let\blx@tempa\bibcpsstring}{}% + \iffieldequalstr{type}{report}{\let\blx@tempa\bibcpsstring\let\blx@tempb\bibcpsstring}{}} + {}% + \iffieldundef{source}{}{\blx@tempa{\thefield{source}}}% + \setunit{\addspace}% + \iffieldundef{type}{}{\blx@tempb{\thefield{type}}}% + \setunit{\addspace}% + \printfield[legmaterialnum]{number}} + {\ifentrytype{constitution}{\usebibmacro{cite:noname:const}}{}}} + {\printfield[citetitle]{labeltitle}}} + +% CONSTITUTION entrytypes are messier +\newbibmacro*{cite:noname:const}{% + \iftoggle{apa:inpcite} + {\bibcpsstring{\thefield{source}}% + \setunit{\addspace}% + \bibcpsstring{\thefield{type}}% + \setunit{\addspace}% + \iffieldundef{amendment}{}{\bibsstring{amendment}% + \setunit{\addspace}% + \printfield{amendment}% + \setunit{\addcomma\addspace}% + \ifkeyword{repealed} + {\biblcsstring{repealed}% + \setunit{\addspace}% + \printeventdate} + {}}% + \setunit{\addspace}% + \iffieldundef{article}{}{\bibsstring{article}\setunit{\addspace}\printfield{article}}% + \setunit{\addcomma\addspace}\newblock + \iffieldundef{section}{}{\bibsstring{section}\setunit{\addspace}\printfield{section}}% + \setunit{\addcomma\addspace}\newblock + \iffieldundef{part}{}{\bibsstring{paragraph}\setunit{\addspace}\printfield{part}}} + {}% + \iftoggle{apa:intcite} + {\iffieldundef{amendment}{}{\bibcplstring{amendment}% + \setunit{\addspace}% + \printfield{amendment}% + \setunit{\addspace}% + \biblcsstring{tothe}}% + \iffieldundef{article}{}{\bibcplstring{article}\setunit{\addspace}\printfield{article}}% + \setunit{\addcomma\addspace}% + \iffieldundef{part}{}{\biblstring{paragraph}% + \setunit{\addspace}% + \printfield{part}% + \setunit{\addcomma\addspace}% + \biblcsstring{ofthe}}% + \setunit{\addcomma\addspace}% + \iffieldundef{section}{}{\bibcplstring{section}% + \setunit{\addspace}% + \printfield{section}% + \setunit{\addcomma\addspace}% + \biblcsstring{ofthe}} + \setunit{\addspace}% + \bibcplstring{\thefield{source}}% + \setunit{\addspace}% + \bibcplstring{\thefield{type}}% + \setunit{\addspace}% + \ifkeyword{repealed} + {\biblclstring{repealed}\setunit{\addspace}\printeventdate} + {}} + {}} + % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -325,7 +396,8 @@ \DeclareDelimFormat[nptextcite]{finalnamedelim} {\ifnum\value{liststop}>2 \finalandcomma\fi\addspace\&\space} -\DeclareMultiCiteCommand{\nptextcites}{\nptextcite}{\multicitedelim} +\DeclareMultiCiteCommand{\nptextcites}{\nptextcite}{\setunit{\multicitedelim}} + \DeclareCiteCommand{\nptextcite} {\usebibmacro{cite:init}% \usebibmacro{prenote}} @@ -462,14 +534,27 @@ {} {\usebibmacro{postnote}} -\DeclareMultiCiteCommand{\textcites}{\textcite}{\compcitedelim} +\DeclareMultiCiteCommand{\textcites}{\textcite}{\setunit{\compcitedelim}} +\DeclareMultiCiteCommand{\cites}{\cite}{\setunit{\multicitedelim}} +\DeclareMultiCiteCommand{\parencites}[\mkbibparens]{\parencite} + {\setunit{\multicitedelim}} +\DeclareMultiCiteCommand{\footcites}[\mkbibfootnote]{\footcite} + {\setunit{\multicitedelim}} +\DeclareMultiCiteCommand{\footcitetexts}[\mkbibfootnotetext] + {\footcitetext}{\setunit{\multicitedelim}} +\DeclareMultiCiteCommand{\smartcites}[\iffootnote\mkbibparens\mkbibfootnote] +{\smartcite}{\setunit{\multicitedelim}} + +\newtoggle{apa:intcite} \DeclareCiteCommand{\textcite} {\usebibmacro{cite:init}% - \usebibmacro{prenote}} + \usebibmacro{prenote}% + \toggletrue{apa:intcite}} {\usebibmacro{citeindex}% \usebibmacro{textcite}% - \usebibmacro{cite:post}} + \usebibmacro{cite:post}% + \togglefalse{apa:intcite}} {} {\usebibmacro{textcite:postnote}} |