\ProvidesFile{gost-authoryear.cbx} [2016/07/18\space v1.7\space biblatex-gost styles] \ExecuteBibliographyOptions{dashed=false,citetracker=constrict,loccittracker=constrict, 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} \DeclareBibliographyOption{ibidpage}[true]{% \ifstrequal{#1}{true} {\ExecuteBibliographyOptions{loccittracker=constrict}} {\ExecuteBibliographyOptions{loccittracker=false}}} \renewcommand*{\postnotedelim}{\addcomma\addspace} \renewcommand*{\nameyeardelim}{\addcomma\addspace} \renewcommand*{\compcitedelim}{\addsemicolon\space} \newcommand{\mkbibbracketssentence}[1]{\bibsentence\mkbibbrackets{#1}\midsentence} \DeclareFieldFormat*{citetitle}{\mkbibemph{#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} {\usebibmacro{cite:ibid}} {\iffieldundef{heading} {\ifthenelse{\ifnameundef{labelname}\OR\iffieldundef{labelyear}} {\ifnameundef{labelname} {\usebibmacro{cite:label+volume+parts}{bibhyperref}% \setunit{\nameyeardelim}% \usebibmacro{cite:labelyear+extras}{bibhyperref}} {\usebibmacro{cite:labelname+volume+parts}{bibhyperref}}% \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+extras}{bibhyperref}% \savefield{labelyear}{\cbx@lastyear}}} {\ifsingletitle {\usebibmacro{cite:labelname+volume+parts}{bibhyperref}} {\usebibmacro{cite:labelname+volume+parts}{}% \setunit{\nameyeardelim}% \usebibmacro{cite:labelyear+extras}{bibhyperref}% \savefield{labelyear}{\cbx@lastyear}}% \savefield{namehash}{\cbx@lasthash}}}} {\usebibmacro{cite:heading}{bibhyperref}% % \iffieldundef{labelyear} % {} % {\setunit{\nameyeardelim}% % \usebibmacro{cite:labelyear+extras}{bibhyperref}} \usebibmacro{cite:reinit}}}}% {\usebibmacro{cite:shorthand}% \usebibmacro{cite:reinit}}% \setunit{\multicitedelim}} \newbibmacro*{cite:labelname+volume+parts}[1]{% \printtext[#1]{\printnames{labelname}}% \setunit*{\addcomma\space}% %\usebibmacro{volume+parts}{\setunit*{\addcomma\space}}% } \newbibmacro*{cite:label+volume+parts}[1]{% \iffieldundef{label} {\ifsingletitle {\printtext[#1]{\printfield[citetitle]{labeltitle}}} {\printfield[citetitle]{labeltitle}}} {\printtext[#1]{\printfield{label}}}% \setunit*{\addcomma\space}% %\usebibmacro{volume+parts}{\setunit*{\addcomma\space}}% } \newbibmacro*{cite:labelyear+extras}[1]{% \ifsingletitle {} {\iffieldundef{labelyear} {} {\printtext[#1]{% \printfield{labelyear}% \usebibmacro{cite:extras}}}}} \newbibmacro*{citeyear}{% \iffieldundef{shorthand} {\ifthenelse{\ifciteibid\AND\NOT\iffirstonpage} {\usebibmacro{cite:ibid}} {\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\bibopenparen}% \ifnumequal{\value{citecount}}{1} {\usebibmacro{prenote}} {}% \ifthenelse{\ifciteibid\AND\NOT\iffirstonpage} {\usebibmacro{cite:ibid}} {\usebibmacro{cite:labelyear+extrayear}}} {\usebibmacro{cite:shorthand}}} {\printnames{labelname}% \setunit{% \global\booltrue{cbx:parens}% \addspace\bibopenparen}% \ifnumequal{\value{citecount}}{1} {\usebibmacro{prenote}} {}% \iffieldundef{shorthand} {\iffieldundef{labelyear} {\usebibmacro{cite:label}} {\ifthenelse{\ifciteibid\AND\NOT\iffirstonpage} {\usebibmacro{cite:ibid}} {\usebibmacro{cite:labelyear+extrayear}}}% \savefield{labelyear}{\cbx@lastyear}} {\usebibmacro{cite:shorthand}% \global\undef\cbx@lastyear}}% \stepcounter{textcitecount}% \savefield{namehash}{\cbx@lasthash}}% \setunit{% \ifbool{cbx:parens} {\bibcloseparen\global\boolfalse{cbx:parens}} {}% \textcitedelim}} \newbibmacro*{cite:heading}[1]{% \printtext[#1]{\printfield[citeheading]{heading}}} \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}}}} \newbibmacro*{cite:ibid}{% \printtext[bibhyperref]{\bibstring[\mkibid]{ibidem}}% \ifloccit {\global\booltrue{cbx:loccit}} {}} \newbibmacro*{cite:postnote}{% \ifbool{cbx:loccit} {} {\usebibmacro{postnote}}} \newbibmacro*{textcite:postnote}{% \ifbool{cbx:loccit} {} {\usebibmacro{postnote}}% \ifthenelse{\value{multicitecount}=\value{multicitetotal}} {\setunit{}% \printtext{% \ifbool{cbx:parens} {\bibcloseparen\global\boolfalse{cbx:parens}} {}}} {\setunit{% \ifbool{cbx:parens} {\bibcloseparen\global\boolfalse{cbx:parens}} {}% \textcitedelim}}} \DeclareCiteCommand{\cite} {\usebibmacro{cite:init}% \usebibmacro{prenote}} {\usebibmacro{citeindex}% \usebibmacro{cite}} {} {\usebibmacro{cite:postnote}} \DeclareCiteCommand*{\cite} {\usebibmacro{cite:init}% \usebibmacro{prenote}} {\usebibmacro{citeindex}% \usebibmacro{citeyear}} {} {\usebibmacro{cite:postnote}} \DeclareCiteCommand{\parencite}[\mkbibbracketssentence] {\usebibmacro{cite:init}% \usebibmacro{prenote}} {\usebibmacro{citeindex}% \usebibmacro{cite}} {} {\usebibmacro{cite:postnote}} \DeclareCiteCommand*{\parencite}[\mkbibbracketssentence] {\usebibmacro{cite:init}% \usebibmacro{prenote}} {\usebibmacro{citeindex}% \usebibmacro{citeyear}} {} {\usebibmacro{cite:postnote}} \DeclareCiteCommand{\footcite}[\mkbibfootnote] {\usebibmacro{cite:init}% \usebibmacro{prenote}} {\usebibmacro{citeindex}% \usebibmacro{cite}} {} {\usebibmacro{cite:postnote}} \DeclareCiteCommand{\footcitetext}[\mkbibfootnotetext] {\usebibmacro{cite:init}% \usebibmacro{prenote}} {\usebibmacro{citeindex}% \usebibmacro{cite}} {} {\usebibmacro{cite:postnote}} \DeclareCiteCommand{\smartcite}[\iffootnote\mkbibbracketssentence\mkbibfootnote] {\usebibmacro{cite:init}% \usebibmacro{prenote}} {\usebibmacro{citeindex}% \usebibmacro{cite}} {} {\usebibmacro{cite:postnote}} \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}[\mkbibbracketssentence] {\parencite}{\setunit{\multicitedelim}} \DeclareMultiCiteCommand{\footcites}[\mkbibfootnote] {\footcite}{\setunit{\multicitedelim}} \DeclareMultiCiteCommand{\footcitetexts}[\mkbibfootnotetext] {\footcitetext}{\setunit{\multicitedelim}} \DeclareMultiCiteCommand{\smartcites}[\iffootnote\mkbibbracketssentence\mkbibfootnote] {\smartcite}{\setunit{\multicitedelim}} \endinput