summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/biblatex/bbx/authoryear.bbx
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/biblatex/bbx/authoryear.bbx')
-rw-r--r--Master/texmf-dist/tex/latex/biblatex/bbx/authoryear.bbx103
1 files changed, 53 insertions, 50 deletions
diff --git a/Master/texmf-dist/tex/latex/biblatex/bbx/authoryear.bbx b/Master/texmf-dist/tex/latex/biblatex/bbx/authoryear.bbx
index 11184cb886e..5dc44a07b22 100644
--- a/Master/texmf-dist/tex/latex/biblatex/bbx/authoryear.bbx
+++ b/Master/texmf-dist/tex/latex/biblatex/bbx/authoryear.bbx
@@ -1,16 +1,6 @@
\ProvidesFile{authoryear.bbx}
[\abx@bbxid]
-% authoryear styles are special in the following way:
-
-% The citation labels are "labelname (labelyear)" and since citation
-% labels are the keys into the references section, the fact that the
-% citation uses labelyear means that the references must also. This
-% means we use a special \printdate[extra]label macro to generate the
-% references section main date for an entry. Otherwise, if labeldate selects
-% anything other than DATE (or equivalently, YEAR/MONTH), then the
-% citation won't match the reference.
-
\RequireBibliographyStyle{standard}
\DeclareBibliographyOption{dashed}[true]{%
@@ -31,38 +21,46 @@
\def\bbx@opt@mergedate@true{\bbx@opt@mergedate@compact}
+% merge date/issue with date label
\def\bbx@opt@mergedate@maximum{%
\renewbibmacro*{date+extrayear}{%
- \iffieldundef{labelyear}
+ \iffieldundef{\thefield{datelabelsource}year}
{}
{\printtext[parens]{%
\printfield{issue}%
- \setunit*{\addspace}%
- \printdateextralabel}}}%
+ \setunit*{\addspace}%
+ \iffieldsequal{year}{\thefield{datelabelsource}year}
+ {\printdateextralabel}%
+ {\printfield{labelyear}%
+ \printfield{extrayear}}}}}%
\renewbibmacro*{date}{}%
- \renewbibmacro*{issue+date}{}%
-}
+ \renewbibmacro*{issue+date}{}}
+% merge date with date label
\def\bbx@opt@mergedate@compact{%
\renewbibmacro*{date+extrayear}{%
- \iffieldundef{labelyear}
+ \iffieldundef{\thefield{datelabelsource}year}
{}
- {\printtext[parens]{\printdateextralabel}}}%
+ {\printtext[parens]{%
+ \iffieldsequal{year}{\thefield{datelabelsource}year}
+ {\printdateextralabel}%
+ {\printfield{labelyear}%
+ \printfield{extrayear}}}}}%
\renewbibmacro*{date}{}%
\renewbibmacro*{issue+date}{%
\iffieldundef{issue}
{}
{\printtext[parens]{\printfield{issue}}}%
- \newunit}%
-}
+ \newunit}}
+% merge year-only date with date label
\def\bbx@opt@mergedate@basic{%
\renewbibmacro*{date+extrayear}{%
- \iffieldundef{labelyear}
+ \iffieldundef{\thefield{datelabelsource}year}
{}
{\printtext[parens]{%
- \printfield{labelyear}%
- \printfield{extrayear}}}}%
+ \printfield{\thefield{datelabelsource}year}%
+ \printfield{extrayear}}}}%
\renewbibmacro*{date}{%
\iffieldundef{month}
{}
@@ -75,19 +73,19 @@
}
{}
{\printtext[parens]{%
- \printfield{issue}%
- \setunit*{\addspace}%
- \printdate}}%
- \newunit}%
-}
+ \printfield{issue}%
+ \setunit*{\addspace}%
+ \printdate}}%
+ \newunit}}
+% merge year-only date with year-only date label
\def\bbx@opt@mergedate@minimum{%
\renewbibmacro*{date+extrayear}{%
- \iffieldundef{labelyear}
+ \iffieldundef{\thefield{datelabelsource}year}
{}
{\printtext[parens]{%
- \printfield{labelyear}%
- \printfield{extrayear}}}}%
+ \printfield{\thefield{datelabelsource}year}%
+ \printfield{extrayear}}}}%
\renewbibmacro*{date}{%
\ifboolexpr{
test {\iffieldundef{month}}
@@ -106,28 +104,28 @@
}
{}
{\printtext[parens]{%
- \printfield{issue}%
- \setunit*{\addspace}%
- \printdate}}%
- \newunit}%
-}
+ \printfield{issue}%
+ \setunit*{\addspace}%
+ \printdate}}%
+ \newunit}}
+% don't merge date/issue with date label
\def\bbx@opt@mergedate@false{%
\renewbibmacro*{date+extrayear}{%
- \iffieldundef{labelyear}
+ \iffieldundef{\thefield{datelabelsource}year}
{}
{\printtext[parens]{%
- \printfield{labelyear}%
- \printfield{extrayear}}}}%
+ \printfield{\thefield{datelabelsource}year}%
+ \printfield{extrayear}}}}%
\renewbibmacro*{date}{\printdate}%
\renewbibmacro*{issue+date}{%
\printtext[parens]{%
\printfield{issue}%
\setunit*{\addspace}%
\printdate}%
- \newunit}%
-}
+ \newunit}}
+% n.b. the default datelabel=year overrides merging of months and days
\ExecuteBibliographyOptions{labeldate,sorting=nyt,pagetracker,mergedate}
\DeclareFieldFormat{shorthandwidth}{#1}
@@ -160,8 +158,7 @@
{\endlist}
{\item}
-\InitializeBibliographyStyle{%
- \global\undef\bbx@lasthash}
+\InitializeBibliographyStyle{\global\undef\bbx@lasthash}
\newbibmacro*{bbx:savehash}{%
\savefield{fullhash}{\bbx@lasthash}}
@@ -174,6 +171,12 @@
\usebibmacro{setpageref}%
\finentry}
+\renewbibmacro*{begrelated}{%
+ \booltrue{bbx@inset}}
+
+\renewbibmacro*{endrelated}{%
+ \usebibmacro*{bbx:savehash}}
+
\renewbibmacro*{author}{%
\ifboolexpr{
test \ifuseauthor
@@ -184,13 +187,13 @@
{\bibnamedash}
{\usebibmacro{bbx:savehash}%
\printnames{author}%
- \iffieldundef{authortype}
- {\setunit{\addspace}}
- {\setunit{\addcomma\space}}}%
+ \iffieldundef{authortype}
+ {\setunit{\addspace}}
+ {\setunit{\addcomma\space}}}%
\iffieldundef{authortype}
{}
{\usebibmacro{authorstrg}%
- \setunit{\addspace}}}%
+ \setunit{\addspace}}}%
{\global\undef\bbx@lasthash
\usebibmacro{labeltitle}%
\setunit*{\addspace}}%
@@ -209,8 +212,8 @@
{\usebibmacro{bbx:dashcheck}
{\bibnamedash}
{\printnames{editor}%
- \setunit{\addcomma\space}%
- \usebibmacro{bbx:savehash}}%
+ \setunit{\addcomma\space}%
+ \usebibmacro{bbx:savehash}}%
\usebibmacro{#1}%
\clearname{editor}%
\setunit{\addspace}}%
@@ -232,8 +235,8 @@
{\usebibmacro{bbx:dashcheck}
{\bibnamedash}
{\printnames{translator}%
- \setunit{\addcomma\space}%
- \usebibmacro{bbx:savehash}}%
+ \setunit{\addcomma\space}%
+ \usebibmacro{bbx:savehash}}%
\usebibmacro{translator+othersstrg}%
\clearname{translator}%
\setunit{\addspace}}%