diff options
author | Karl Berry <karl@freefriends.org> | 2013-07-11 23:36:27 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2013-07-11 23:36:27 +0000 |
commit | 275a02abde664ff395868e975c7c06d89276ac0b (patch) | |
tree | c315179a8d6f30c65f89152a70176afa828cc7e7 /Master/texmf-dist/tex/latex/biblatex/cbx/authoryear-comp.cbx | |
parent | 40e239851e66f62ec8d3092c746e61151b445b6f (diff) |
biblatex (10jul13)
git-svn-id: svn://tug.org/texlive/trunk@31176 c570f23f-e606-0410-a88d-b1316a301751
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.cbx | 60 |
1 files changed, 49 insertions, 11 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 index 5936fe16d88..a290293d0ae 100644 --- a/Master/texmf-dist/tex/latex/biblatex/cbx/authoryear-comp.cbx +++ b/Master/texmf-dist/tex/latex/biblatex/cbx/authoryear-comp.cbx @@ -1,7 +1,12 @@ \ProvidesFile{authoryear-comp.cbx} [\abx@cbxid] -\ExecuteBibliographyOptions{labeldate,uniquename,uniquelist,sortcites,autocite=inline} +\ExecuteBibliographyOptions{labeldate,uniquename,uniquelist,sortcites, + autocite=inline} + +\renewcommand*{\iffinalcitedelim}{% + \ifnumequal{\value{textcitecount}}{\value{textcitetotal}-1}} + \newbool{cbx:parens} \newbibmacro*{cite:init}{% @@ -100,12 +105,13 @@ \savefield{labelyear}{\cbx@lastyear}} {\usebibmacro{cite:shorthand}% \global\undef\cbx@lastyear}}% - \savefield{namehash}{\cbx@lasthash}}% + \stepcounter{textcitecount}% + \savefield{namehash}{\cbx@lasthash}}% \setunit{% \ifbool{cbx:parens} {\bibcloseparen\global\boolfalse{cbx:parens}} {}% - \multicitedelim}} + \textcitedelim}} \newbibmacro*{cite:shorthand}{% \printtext[bibhyperref]{\printfield{shorthand}}} @@ -139,7 +145,7 @@ \ifbool{cbx:parens} {\bibcloseparen\global\boolfalse{cbx:parens}} {}% - \multicitedelim}}} + \textcitedelim}}} \DeclareCiteCommand{\cite} {\usebibmacro{cite:init}% @@ -197,19 +203,51 @@ {} {\usebibmacro{postnote}} -\DeclareCiteCommand{\textcite} +\DeclareCiteCommand{\cbx@textcite} {\usebibmacro{cite:init}} {\usebibmacro{citeindex}% \usebibmacro{textcite}} {} {\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}}} + +\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}{}{} + \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}} -\DeclareMultiCiteCommand{\textcites}{\textcite}{} +\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}} \endinput |