summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/biblatex-gost/gost-authoryear.cbx
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2013-07-18 23:29:16 +0000
committerKarl Berry <karl@freefriends.org>2013-07-18 23:29:16 +0000
commit549f87a2032890440c9d3fc9faa568628588e2b3 (patch)
treea3f51974b1e68ac611e7a047d82c369e5ad8a64e /Master/texmf-dist/tex/latex/biblatex-gost/gost-authoryear.cbx
parent16369bdd3c6726591b6196400880febbfb529a2e (diff)
biblatex-gost (18jul13)
git-svn-id: svn://tug.org/texlive/trunk@31233 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/biblatex-gost/gost-authoryear.cbx')
-rw-r--r--Master/texmf-dist/tex/latex/biblatex-gost/gost-authoryear.cbx113
1 files changed, 67 insertions, 46 deletions
diff --git a/Master/texmf-dist/tex/latex/biblatex-gost/gost-authoryear.cbx b/Master/texmf-dist/tex/latex/biblatex-gost/gost-authoryear.cbx
index 4c7dcd74c49..3546d7a9b5a 100644
--- a/Master/texmf-dist/tex/latex/biblatex-gost/gost-authoryear.cbx
+++ b/Master/texmf-dist/tex/latex/biblatex-gost/gost-authoryear.cbx
@@ -1,12 +1,14 @@
\ProvidesFile{gost-authoryear.cbx}
-[2013/04/03\space v0.8\space biblatex-gost styles]
+[2013/07/17\space v0.9\space biblatex-gost styles]
\ExecuteBibliographyOptions{dashed=false,citetracker=constrict,loccittracker=constrict,
- singletitle=false,labelyear,labeltitleyear,uniquename=init,
+ singletitle=false,labeldate,labeltitleyear,uniquename=init,
uniquelist,ibidtracker=constrict,pagetracker,sortcites,autocite=inline,
citeisbn,citeurl,citedoi,citeeprint}
\providecommand*{\mkibid}[1]{#1}
+\renewcommand*{\iffinalcitedelim}{%
+ \ifnumequal{\value{textcitecount}}{\value{textcitetotal}-1}}
\newbool{cbx:parens}
\newbool{cbx:loccit}
@@ -21,27 +23,28 @@
\renewcommand*{\bibleftparen}{\blx@postpunct\ifcitation{[\bibsentence}{(}}
\renewcommand*{\bibrightparen}{\blx@postpunct\ifcitation{]}{)}\midsentence}
-% changing the language of citation
-\gpreto\blx@hook@citekey{%
- \ifdef\abx@field@hyphenation
- {\ifdef\blx@thelangenv
- {\edef\blx@temp@langenv{\noexpand\csname\blx@thelangenv\endcsname%
- {\abx@field@hyphenation}}%
- \blx@temp@langenv}
- {}}%
- {}}
-\apptocmd{\blx@citeprint}{%
- \ifdef\abx@field@hyphenation
- {\ifdef\blx@thelangenv
- {\csname end\blx@thelangenv\endcsname}
- {}}%
- {}%
-}{}{\blx@err@patch{citeprint command}}
-
\DeclareFieldFormat*{citetitle}{\mkbibemph{#1}}
-\DeclareFieldFormat{extratitleyear}{\mknumalph{#1}}
+\DeclareFieldFormat{extratitleyear}{%
+ \iffieldnums{labelyear}
+ {\mknumalph{#1}}
+ {\printtext{(}\mknumalph{#1}\printtext{)}}}
\DeclareFieldFormat{citeheading}{#1}
+\newbibmacro*{cite:init}{%
+ \global\boolfalse{cbx:loccit}%
+ \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{\ifciteibid\AND\NOT\iffirstonpage}
@@ -104,21 +107,6 @@
\printfield{labelyear}%
\usebibmacro{cite:extras}}}}}
-\newbibmacro*{cite:init}{%
- \global\boolfalse{cbx:loccit}%
- \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*{citeyear}{%
\iffieldundef{shorthand}
{\ifthenelse{\ifciteibid\AND\NOT\iffirstonpage}
@@ -182,13 +170,14 @@
{\usebibmacro{cite:labelyear+extrayear}}}%
\savefield{labelyear}{\cbx@lastyear}}
{\usebibmacro{cite:shorthand}%
- \global\undef\cbx@lastyear}%
- \savefield{namehash}{\cbx@lasthash}}}%
+ \global\undef\cbx@lastyear}}%
+ \stepcounter{textcitecount}%
+ \savefield{namehash}{\cbx@lasthash}}%
\setunit{%
\ifbool{cbx:parens}
{\bibcloseparen\global\boolfalse{cbx:parens}}
{}%
- \multicitedelim}}
+ \textcitedelim}}
\newbibmacro*{cite:heading}[1]{%
\printtext[#1]{\printfield[citeheading]{heading}}}
@@ -238,7 +227,7 @@
\ifbool{cbx:parens}
{\bibcloseparen\global\boolfalse{cbx:parens}}
{}%
- \multicitedelim}}}
+ \textcitedelim}}}
\DeclareCiteCommand{\cite}
{\usebibmacro{cite:init}%
@@ -296,19 +285,51 @@
{}
{\usebibmacro{cite: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