summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/biblatex/cbx/authoryear-comp.cbx
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/biblatex/cbx/authoryear-comp.cbx')
-rw-r--r--Master/texmf-dist/tex/latex/biblatex/cbx/authoryear-comp.cbx200
1 files changed, 200 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/biblatex/cbx/authoryear-comp.cbx b/Master/texmf-dist/tex/latex/biblatex/cbx/authoryear-comp.cbx
new file mode 100644
index 00000000000..726e64d22dc
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/biblatex/cbx/authoryear-comp.cbx
@@ -0,0 +1,200 @@
+% $Id: authoryear-comp.cbx,v 0.9 2010/02/14 15:42:33 lehman beta $
+
+\ProvidesFile{authoryear-comp.cbx}
+[\abx@cbxid $Id: authoryear-comp.cbx,v 0.9 2010/02/14 15:42:33 lehman beta $]
+
+\ExecuteBibliographyOptions{labelyear,uniquename,sortcites,autocite=inline}
+\newbool{cbx:parens}
+
+\newbibmacro*{cite:init}{%
+ \ifnumless{\value{multicitecount}}{2}
+ {\global\boolfalse{cbx:parens}%
+ \global\undef\cbx@lasthash
+ \global\undef\cbx@lastyear}
+ {\iffieldundef{prenote}
+ {}
+ {\global\undef\cbx@lasthash
+ \global\undef\cbx@lastyear}}}
+
+\newbibmacro*{cite:reinit}{%
+ \global\undef\cbx@lasthash
+ \global\undef\cbx@lastyear}
+
+\newbibmacro*{cite}{%
+ \iffieldundef{shorthand}
+ {\ifthenelse{\ifnameundef{labelname}\OR\iffieldundef{labelyear}}
+ {\usebibmacro{cite:label}%
+ \setunit{\addspace}%
+ \usebibmacro{cite:labelyear+extrayear}%
+ \usebibmacro{cite:reinit}}
+ {\iffieldequals{namehash}{\cbx@lasthash}
+ {\ifthenelse{\iffieldequals{labelyear}{\cbx@lastyear}\AND
+ \(\value{multicitecount}=0\OR\iffieldundef{postnote}\)}
+ {\setunit{\addcomma}%
+ \usebibmacro{cite:extrayear}}
+ {\setunit{\compcitedelim}%
+ \usebibmacro{cite:labelyear+extrayear}%
+ \savefield{labelyear}{\cbx@lastyear}}}
+ {\printnames{labelname}%
+ \setunit{\nameyeardelim}%
+ \usebibmacro{cite:labelyear+extrayear}%
+ \savefield{namehash}{\cbx@lasthash}%
+ \savefield{labelyear}{\cbx@lastyear}}}}
+ {\usebibmacro{cite:shorthand}%
+ \usebibmacro{cite:reinit}}%
+ \setunit{\multicitedelim}}
+
+\newbibmacro*{citeyear}{%
+ \iffieldundef{shorthand}
+ {\iffieldundef{labelyear}
+ {\usebibmacro{cite:label}%
+ \usebibmacro{cite:reinit}}
+ {\iffieldequals{namehash}{\cbx@lasthash}
+ {\ifthenelse{\iffieldequals{labelyear}{\cbx@lastyear}\AND
+ \(\value{multicitecount}=0\OR\iffieldundef{postnote}\)}
+ {\setunit{\addcomma}%
+ \usebibmacro{cite:extrayear}}
+ {\setunit{\compcitedelim}%
+ \usebibmacro{cite:labelyear+extrayear}%
+ \savefield{labelyear}{\cbx@lastyear}}}
+ {\usebibmacro{cite:labelyear+extrayear}%
+ \savefield{namehash}{\cbx@lasthash}%
+ \savefield{labelyear}{\cbx@lastyear}}}}
+ {\usebibmacro{cite:shorthand}%
+ \usebibmacro{cite:reinit}}%
+ \setunit{\multicitedelim}}
+
+\newbibmacro*{textcite}{%
+ \iffieldequals{namehash}{\cbx@lasthash}
+ {\iffieldundef{shorthand}
+ {\ifthenelse{\iffieldequals{labelyear}{\cbx@lastyear}\AND
+ \(\value{multicitecount}=0\OR\iffieldundef{postnote}\)}
+ {\setunit{\addcomma}%
+ \usebibmacro{cite:extrayear}}
+ {\setunit{\compcitedelim}%
+ \usebibmacro{cite:labelyear+extrayear}%
+ \savefield{labelyear}{\cbx@lastyear}}}
+ {\setunit{\compcitedelim}%
+ \usebibmacro{cite:shorthand}%
+ \global\undef\cbx@lastyear}}
+ {\ifnameundef{labelname}
+ {\iffieldundef{shorthand}
+ {\usebibmacro{cite:label}%
+ \setunit{%
+ \global\booltrue{cbx:parens}%
+ \addspace\bibleftparen}%
+ \usebibmacro{cite:labelyear+extrayear}}
+ {\usebibmacro{cite:shorthand}}}
+ {\printnames{labelname}%
+ \setunit{%
+ \global\booltrue{cbx:parens}%
+ \addspace\bibleftparen}%
+ \iffieldundef{shorthand}
+ {\iffieldundef{labelyear}
+ {\usebibmacro{cite:label}}
+ {\usebibmacro{cite:labelyear+extrayear}}%
+ \savefield{labelyear}{\cbx@lastyear}}
+ {\usebibmacro{cite:shorthand}%
+ \global\undef\cbx@lastyear}%
+ \savefield{namehash}{\cbx@lasthash}}}%
+ \setunit{%
+ \ifbool{cbx:parens}
+ {\bibrightparen\global\boolfalse{cbx:parens}}
+ {}%
+ \multicitedelim}}
+
+\newbibmacro*{cite:shorthand}{%
+ \printtext[bibhyperref]{\printfield{shorthand}}}
+
+\newbibmacro*{cite:label}{%
+ \iffieldundef{label}
+ {\printtext[bibhyperref]{\printfield[citetitle]{labeltitle}}}
+ {\printtext[bibhyperref]{\printfield{label}}}}
+
+\newbibmacro*{cite:labelyear+extrayear}{%
+ \iffieldundef{labelyear}
+ {}
+ {\printtext[bibhyperref]{%
+ \printfield{labelyear}%
+ \printfield{extrayear}}}}
+
+\newbibmacro*{cite:extrayear}{%
+ \iffieldundef{extrayear}
+ {}
+ {\printtext[bibhyperref]{\printfield{extrayear}}}}
+
+\DeclareCiteCommand{\cite}
+ {\usebibmacro{cite:init}%
+ \usebibmacro{prenote}}
+ {\usebibmacro{citeindex}%
+ \usebibmacro{cite}}
+ {}
+ {\usebibmacro{postnote}}
+
+\DeclareCiteCommand*{\cite}
+ {\usebibmacro{cite:init}%
+ \usebibmacro{prenote}}
+ {\usebibmacro{citeindex}%
+ \usebibmacro{citeyear}}
+ {}
+ {\usebibmacro{postnote}}
+
+\DeclareCiteCommand{\parencite}[\mkbibparens]
+ {\usebibmacro{cite:init}%
+ \usebibmacro{prenote}}
+ {\usebibmacro{citeindex}%
+ \usebibmacro{cite}}
+ {}
+ {\usebibmacro{postnote}}
+
+\DeclareCiteCommand*{\parencite}[\mkbibparens]
+ {\usebibmacro{cite:init}%
+ \usebibmacro{prenote}}
+ {\usebibmacro{citeindex}%
+ \usebibmacro{citeyear}}
+ {}
+ {\usebibmacro{postnote}}
+
+\DeclareCiteCommand{\footcite}[\mkbibfootnote]
+ {\usebibmacro{cite:init}%
+ \usebibmacro{prenote}}
+ {\usebibmacro{citeindex}%
+ \usebibmacro{cite}}
+ {}
+ {\usebibmacro{postnote}}
+
+\DeclareCiteCommand{\footcitetext}[\mkbibfootnotetext]
+ {\usebibmacro{cite:init}%
+ \usebibmacro{prenote}}
+ {\usebibmacro{citeindex}%
+ \usebibmacro{cite}}
+ {}
+ {\usebibmacro{postnote}}
+
+\DeclareCiteCommand{\textcite}
+ {\usebibmacro{cite:init}%
+ \usebibmacro{prenote}}
+ {\usebibmacro{citeindex}%
+ \usebibmacro{textcite}}
+ {}
+ {\setunit{\postnotedelim}%
+ \printfield{postnote}%
+ \ifthenelse{\value{multicitecount}=\value{multicitetotal}}
+ {\setunit{}%
+ \printtext{%
+ \ifbool{cbx:parens}
+ {\bibrightparen\global\boolfalse{cbx:parens}}
+ {}}}
+ {\setunit{%
+ \ifbool{cbx:parens}
+ {\bibrightparen\global\boolfalse{cbx:parens}}
+ {}%
+ \multicitedelim}}}
+
+\DeclareMultiCiteCommand{\cites}{\cite}{\setunit{\multicitedelim}}
+\DeclareMultiCiteCommand{\parencites}[\mkbibparens]{\parencite}{\setunit{\multicitedelim}}
+\DeclareMultiCiteCommand{\footcites}[\mkbibfootnote]{\footcite}{\setunit{\multicitedelim}}
+\DeclareMultiCiteCommand{\footcitetexts}[\mkbibfootnotetext]{\footcitetext}{\setunit{\multicitedelim}}
+\DeclareMultiCiteCommand{\textcites}{\textcite}{}
+
+\endinput