\ProvidesFile{gost-authoryear.cbx} [2023/04/25\space v1.24\space biblatex-gost styles] \ExecuteBibliographyOptions{dashed=false,citetracker=constrict,loccittracker=constrict, dropdates=false, labeldateparts,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:gost:parens} \newbool{cbx:gost: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}{\mknumalph{#1}} \DeclareFieldFormat{citeheading}{#1} \newbibmacro*{cite:init}{% \global\boolfalse{cbx:gost:loccit}% \ifnumless{\value{multicitecount}}{2} {\global\boolfalse{cbx:gost: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} {% no labelname \iffieldundef{label} {% no label, so print labeltitle (always present) \blx@gost@ifneedsdate {\printtext[citetitle]{\printfield[titlecase]{labeltitle}} \setunit{\nameyeardelim}% \usebibmacro{cite:labelyear+extras}{bibhyperref}} {\printtext[bibhyperref]{% \printtext[citetitle]{\printfield[titlecase]{labeltitle}}}}} {% label exists, print it \usebibmacro{cite:label+volume+parts}}}% {% labelname, no labelyear \usebibmacro{cite:labelname+volume+parts}{bibhyperref}% \usebibmacro{cite:reinit}}}% {% both labelname, labelyear exist \iffieldequals{namehash}{\cbx@lasthash} {\ifthenelse{\iffieldequals{labelyear}{\cbx@lastyear}\AND \(\value{multicitecount}=0\OR\iffieldundef{postnote}\)} {\setunit{\addcomma}% \usebibmacro{cite:extradate}} {\setunit{\compcitedelim}% \usebibmacro{cite:labelyear+extras}{bibhyperref}% \savefield{labelyear}{\cbx@lastyear}}} {\blx@gost@ifneedsdate {\usebibmacro{cite:labelname+volume+parts}{}% \setunit{\nameyeardelim}% \usebibmacro{cite:labelyear+extras}{bibhyperref}% \savefield{labelyear}{\cbx@lastyear}}% {\usebibmacro{cite:labelname+volume+parts}{bibhyperref}}% \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}{% \iffieldundef{label} {} {\printtext[bibhyperref]{\printfield{label}}}% \setunit*{\addcomma\space}% %\usebibmacro{volume+parts}{\setunit*{\addcomma\space}}% } \newbibmacro*{cite:labelyear+extras}[1]{% \iffieldundef{labelyear} {} {\printtext[#1]{% \usebibmacro{printyear}{label}% print 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:extradate}} {\setunit{\compcitedelim}% \usebibmacro{cite:labelyear+extradate}% \savefield{labelyear}{\cbx@lastyear}}} {\usebibmacro{cite:labelyear+extradate}% \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:extradate}} {\setunit{\compcitedelim}% \usebibmacro{cite:labelyear+extradate}% \savefield{labelyear}{\cbx@lastyear}}} {\setunit{\compcitedelim}% \usebibmacro{cite:shorthand}% \global\undef\cbx@lastyear}} {\ifnameundef{labelname} {\iffieldundef{shorthand} {\usebibmacro{cite:label}% \setunit{% \global\booltrue{cbx:gost:parens}% \addspace\bibopenparen}% \ifnumequal{\value{citecount}}{1} {\usebibmacro{prenote}} {}% \ifthenelse{\ifciteibid\AND\NOT\iffirstonpage} {\usebibmacro{cite:ibid}} {\usebibmacro{cite:labelyear+extradate}}} {\usebibmacro{cite:shorthand}}} {\printnames{labelname}% \setunit{% \global\booltrue{cbx:gost: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+extradate}}}% \savefield{labelyear}{\cbx@lastyear}} {\usebibmacro{cite:shorthand}% \global\undef\cbx@lastyear}}% \stepcounter{textcitecount}% \savefield{namehash}{\cbx@lasthash}}% \setunit{% \ifbool{cbx:gost:parens} {\bibcloseparen\global\boolfalse{cbx:gost: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]{\printtext[citetitle]{\printfield[titlecase]{labeltitle}}}} {\printtext[bibhyperref]{\printfield{label}}}} \newbibmacro*{cite:labelyear+extradate}{% \iffieldundef{labelyear} {} {\printtext[bibhyperref]{% \usebibmacro{printyear}{label}% \printfield{extradate}}}} \newbibmacro*{cite:extradate}{% \iffieldundef{extradate} {} {\printtext[bibhyperref]{\printfield{extradate}}}} \newbibmacro*{cite:ibid}{% \printtext[bibhyperref]{\bibstring[\mkibid]{ibidem}}% \ifloccit {\global\booltrue{cbx:gost:loccit}} {}} \newbibmacro*{cite:postnote}{% \ifbool{cbx:gost:loccit} {} {\usebibmacro{postnote}}} \newbibmacro*{textcite:postnote}{% \ifbool{cbx:gost:loccit} {} {\usebibmacro{postnote}}% \ifthenelse{\value{multicitecount}=\value{multicitetotal}} {\setunit{}% \printtext{% \ifbool{cbx:gost:parens} {\bibcloseparen\global\boolfalse{cbx:gost:parens}} {}}} {\setunit{% \ifbool{cbx:gost:parens} {\bibcloseparen\global\boolfalse{cbx:gost: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