diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/biblatex-gost/gost-standard.bbx')
-rw-r--r-- | Master/texmf-dist/tex/latex/biblatex-gost/gost-standard.bbx | 395 |
1 files changed, 189 insertions, 206 deletions
diff --git a/Master/texmf-dist/tex/latex/biblatex-gost/gost-standard.bbx b/Master/texmf-dist/tex/latex/biblatex-gost/gost-standard.bbx index f379e08665b..9f40ac74e1b 100644 --- a/Master/texmf-dist/tex/latex/biblatex-gost/gost-standard.bbx +++ b/Master/texmf-dist/tex/latex/biblatex-gost/gost-standard.bbx @@ -1,14 +1,14 @@ \ProvidesFile{gost-standard.bbx} -[2013/04/03\space v0.8\space biblatex-gost styles] +[2013/07/17\space v0.9\space biblatex-gost styles] -\def\bbx@gost@date{2013/04/03} -\def\bbx@gost@version{0.8} +\def\bbx@gost@date{2013/07/17} +\def\bbx@gost@version{0.9} -\@ifpackagelater{biblatex}{2013/01/10} +\@ifpackagelater{biblatex}{2013/07/03} {} {\PackageError{biblatex} {Outdated 'biblatex' package} - {This version of 'biblatex-gost' requires biblatex v2.5 or later.\MessageBreak + {This version of 'biblatex-gost' requires biblatex v2.7 or later.\MessageBreak You are using: '\csuse{ver@biblatex.sty}'.\MessageBreak This is a fatal error. I'm aborting now.}% \endinput} @@ -123,7 +123,7 @@ movenames=true, firstinits, volsorder=vbpi, - related=bib} + related=true} \newbibmacro*{cbx:bookibid:check}[2]{#2} @@ -250,11 +250,12 @@ {\bibcpstring{\thefield{prcountry}}} {#1}} -\DeclareFieldFormat{relatedstring}{\select@language{\bbl@main@language}#1\relatedpunct} - \DeclareNameAlias{sortname}{last-first} -\DefineBibliographyExtras{french}{\protected\def\mkbibnamelast#1{#1}} +\DefineBibliographyExtras{french}{\restorecommand\mkbibnamelast} + +% format for author is defined separately, because \mkbibnamelast, etc. cannot be +% used, since they affect all names, not only headings \DeclareNameFormat{author}{% \iffirstinits {\usebibmacro{authorname:last-first}{#1}{#4}{#5}{#7}} @@ -309,20 +310,40 @@ \renewcommand*{\bibpagespunct}{\addperiod\space} \renewcommand*{\subtitlepunct}{\addcolon\space} \renewcommand*{\newblockpunct}{% - \addnbspace\textemdash\space\bibsentence}% block punctuation + \addperiod\addnbspace\textemdash\space\bibsentence}%block punct.,\bibsentence is for vol,etc. \newcommand*{\respdelim}{\addnbspace/\space}% delimiter before "credits" \newcommand*{\resppunct}{\addsemicolondelim}% punctuation between "credits" items +% auxillary macros for volsorder handling \newcounter{blx@gost@pointer}% \newcommand*{\blx@gost@endofstring}{\@\@\@\@\@} % end of string = \\\ \newcommand*{\blx@gost@setunit}{\newunit} \@ifpackageloaded{babel} - {\edef\gostmedialanguage{\bbl@main@language}% + {\edef\gostmedialanguage{\csname bbl@main@language\endcsname}% \newcommand*{\select@medialanguage}{\select@language{\gostmedialanguage}}} {\edef\gostmedialanguage{russian}% \newcommand*{\select@medialanguage}{}} +% macros and formats for printing origlanguage and bookoriglanguage. +% made special to simplify making them lists + +\DeclareFieldFormat{origlanguage}{% + \bibstring{from#1}} + +\newcommand*{\lbx@gost@lfromlang}[1]{% + \iffieldundef{#1} + {\unspace} + {\printfield[origlanguage]{#1}}} +\newcommand*{\lbx@gost@sfromlang}[1]{% + \iffieldundef{#1} + {\unspace} + {\printfield[origlanguage]{#1}}} +% \renewcommand*{\lbx@lfromlang}{\lbx@gost@lfromlang{origlanguage}} +% \renewcommand*{\lbx@sfromlang}{\lbx@gost@sfromlang{origlanguage}} +\newcommand*{\blx@gost@iflangundef}[3]{\iffieldundef{#1}{#2}{#3}} +\newcommand*{\blx@gost@iflangsequal}[4]{\iffieldsequal{#1}{#2}{#3}{#4}} + \newbibmacro*{begentry}{} \newbibmacro*{finentry}{\finentry} % @@ -344,34 +365,47 @@ \iffieldundef{journaltitle} % no journaltitle means electronic publication {\newunit} {\usebibmacro{//}% - \usebibmacro{journal}% - \setunit{\respdelim}% - \usebibmacro{credits}% - \setunit*{\resppunct}% - \usebibmacro{byeditor}% - \newunit\newblock - \printlist[semicolondelim]{specdata}% - \newunit\newblock - \printlist{location}% ??? - \setunit*{\addcomma\space}% - \usebibmacro{jour:date}% - \newunit\newblock - \usebibmacro{jour:volume+parts+issuetitle}% - \newunit\newblock - \printfield{pages}% - \newunit\newblock - \iffieldundef{series} - {} - {\printtext{(\printfield{series})}}% + \usebibmacro{cbx:bookibid:check} + {\bibsentence\printtext{% + \bibhyperlink{\csuse{% + cbx@\iffootnote{f}{t}@bookref@% + \iffieldundef{crossref} + {\iffieldundef{xref} + {} + {\thefield{xref}}} + {\thefield{crossref}}}} + {\bibstring[\mkibid]{ibidem}}}% + \newunit\newblock + \usebibmacro{chapter+pages}} + {\usebibmacro{journal}% + \setunit{\respdelim}% + \usebibmacro{credits}% + \setunit*{\resppunct}% + \usebibmacro{byeditor}% + \newunit\newblock + \printlist[semicolondelim]{specdata}% + \newunit\newblock + \printlist{location}% ??? + \setunit*{\addcomma\space}% + \usebibmacro{jour:date}% + \newunit\newblock + \usebibmacro{jour:volume+parts+issuetitle}% + \newunit\newblock + \printfield{pages}% + \newunit\newblock + \iffieldundef{series} + {} + {\printtext{(\printfield{series})}}% + \newunit\newblock + \usebibmacro{issn}% + \newunit\newblock}% + \usebibmacro{doi+eprint+url+note}% \newunit\newblock - \usebibmacro{issn}% - \newunit\newblock}% - \usebibmacro{doi+eprint+url+note}% - \newunit\newblock - \usebibmacro{addendum+pubstate}% - \setunit{\bibpagerefpunct}\newblock - \usebibmacro{pageref}% + \usebibmacro{addendum+pubstate}% + \setunit{\bibpagerefpunct}\newblock + \usebibmacro{pageref}}% \newunit\newblock + \usebibmacro{related:init}% \usebibmacro{related}% \usebibmacro{finentry}} @@ -416,6 +450,7 @@ \setunit{\bibpagerefpunct}\newblock \usebibmacro{pageref}% \newunit\newblock + \usebibmacro{related:init}% \usebibmacro{related}% \usebibmacro{finentry}} @@ -454,6 +489,7 @@ \setunit{\bibpagerefpunct}\newblock \usebibmacro{pageref}% \newunit\newblock + \usebibmacro{related:init}% \usebibmacro{related}% \usebibmacro{finentry}} @@ -494,6 +530,7 @@ \setunit{\bibpagerefpunct}\newblock \usebibmacro{pageref}% \newunit\newblock + \usebibmacro{related:init}% \usebibmacro{related}% \usebibmacro{finentry}} @@ -515,7 +552,14 @@ \usebibmacro{//}% \usebibmacro{cbx:bookibid:check} {\bibsentence\printtext{% - \bibhyperlink{\csuse{cbx@\iffootnote{f}{t}@bookref}}{\bibstring[\mkibid]{ibidem}}}% + \bibhyperlink{\csuse{% + cbx@\iffootnote{f}{t}@bookref@% + \iffieldundef{crossref} + {\iffieldundef{xref} + {} + {\thefield{xref}}} + {\thefield{crossref}}}} + {\bibstring[\mkibid]{ibidem}}}% \newunit\newblock \usebibmacro{chapter+pages}} {\usebibmacro{maintitle+volumes+parts+booktitle}% @@ -550,6 +594,7 @@ \setunit{\bibpagerefpunct}\newblock \usebibmacro{pageref}}% \newunit\newblock + \usebibmacro{related:init}% \usebibmacro{related}% \usebibmacro{finentry}} @@ -571,7 +616,14 @@ \usebibmacro{//}% \usebibmacro{cbx:bookibid:check} {\bibsentence\printtext{% - \bibhyperlink{\csuse{cbx@\iffootnote{f}{t}@bookref}}{\bibstring[\mkibid]{ibidem}}}% + \bibhyperlink{\csuse{% + cbx@\iffootnote{f}{t}@bookref@% + \iffieldundef{crossref} + {\iffieldundef{xref} + {} + {\thefield{xref}}} + {\thefield{crossref}}}} + {\bibstring[\mkibid]{ibidem}}}% \newunit\newblock \usebibmacro{chapter+pages}} {\usebibmacro{maintitle+volumes+parts+booktitle}% @@ -602,6 +654,7 @@ \setunit{\bibpagerefpunct}\newblock \usebibmacro{pageref}}% \newunit\newblock + \usebibmacro{related:init}% \usebibmacro{related}% \usebibmacro{finentry}} @@ -623,7 +676,14 @@ \usebibmacro{//}% \usebibmacro{cbx:bookibid:check} {\bibsentence\printtext{% - \bibhyperlink{\csuse{cbx@\iffootnote{f}{t}@bookref}}{\bibstring[\mkibid]{ibidem}}}% + \bibhyperlink{\csuse{% + cbx@\iffootnote{f}{t}@bookref@% + \iffieldundef{crossref} + {\iffieldundef{xref} + {} + {\thefield{xref}}} + {\thefield{crossref}}}} + {\bibstring[\mkibid]{ibidem}}}% \newunit\newblock \usebibmacro{chapter+pages}} {\usebibmacro{maintitle+volumes+parts+booktitle}% @@ -654,6 +714,7 @@ \setunit{\bibpagerefpunct}\newblock \usebibmacro{pageref}}% \newunit\newblock + \usebibmacro{related:init}% \usebibmacro{related}% \usebibmacro{finentry}} @@ -699,6 +760,7 @@ \setunit{\bibpagerefpunct}\newblock \usebibmacro{pageref}% \newunit\newblock + \usebibmacro{related:init}% \usebibmacro{related}% \usebibmacro{finentry}} @@ -733,6 +795,7 @@ \setunit{\bibpagerefpunct}\newblock \usebibmacro{pageref}% \newunit\newblock + \usebibmacro{related:init}% \usebibmacro{related}% \usebibmacro{finentry}} @@ -775,6 +838,7 @@ \setunit{\bibpagerefpunct}\newblock \usebibmacro{pageref}% \newunit\newblock + \usebibmacro{related:init}% \usebibmacro{related}% \usebibmacro{finentry}} @@ -831,6 +895,7 @@ \setunit{\bibpagerefpunct}\newblock \usebibmacro{pageref}% \newunit\newblock + \usebibmacro{related:init}% \usebibmacro{related}% \usebibmacro{finentry}} @@ -867,6 +932,7 @@ \setunit{\bibpagerefpunct}\newblock \usebibmacro{pageref}% \newunit\newblock + \usebibmacro{related:init}% \usebibmacro{related}% \usebibmacro{finentry}} @@ -907,6 +973,7 @@ \setunit{\bibpagerefpunct}\newblock \usebibmacro{pageref}% \newunit\newblock + \usebibmacro{related:init}% \usebibmacro{related}% \usebibmacro{finentry}} @@ -947,6 +1014,7 @@ \setunit{\bibpagerefpunct}\newblock \usebibmacro{pageref}% \newunit\newblock + \usebibmacro{related:init}% \usebibmacro{related}% \usebibmacro{finentry}} @@ -975,6 +1043,7 @@ \setunit{\bibpagerefpunct}\newblock \usebibmacro{pageref}% \newunit\newblock + \usebibmacro{related:init}% \usebibmacro{related}% \usebibmacro{finentry}} @@ -1005,6 +1074,7 @@ \setunit{\bibpagerefpunct}\newblock \usebibmacro{pageref}% \newunit\newblock + \usebibmacro{related:init}% \usebibmacro{related}% \usebibmacro{finentry}} @@ -1065,12 +1135,14 @@ } {} {\setunit{\addspace}% - \printtext{(% + \printtext[parens]{% \printfield{eventtitle}% - \setunit*{\addcomma\space}% + \setunit{\addcolondelim}% + \printfield{eventtitleaddon}% + \setunit{\addcomma\space}% \printfield{venue}% \setunit*{\addcomma\space}% - \printeventdate)}}% + \printeventdate}}% \newunit} \newbibmacro*{series+number}{% @@ -1235,6 +1307,7 @@ {#3}} % <name><true><false> +% similar check for names \newbibmacro*{checkbookname}[3]{% \ifboolexpr{ test {\ifnameundef{book#1}} @@ -1245,6 +1318,7 @@ {#3}} % <list><true><false> +% similar check for lists \newbibmacro*{checkbooklist}[3]{% \ifboolexpr{ test {\iflistundef{book#1}} @@ -1311,21 +1385,21 @@ or not test {\ifnamesequal{translator}{booktranslator}} or - ( not test {\iffieldundef{origlanguage}} + ( not test {\blx@gost@iflangundef{origlanguage}} and - test {\iffieldundef{bookoriglanguage}} + test {\blx@gost@iflangundef{bookoriglanguage}} ) or - ( test {\iffieldundef{origlanguage}} + ( test {\blx@gost@iflangundef{origlanguage}} and - not test {\iffieldundef{bookoriglanguage}} + not test {\blx@gost@iflangundef{bookoriglanguage}} ) or - ( not test {\iffieldundef{origlanguage}} + ( not test {\blx@gost@iflangundef{origlanguage}} and - not test {\iffieldundef{bookoriglanguage}} + not test {\blx@gost@iflangundef{bookoriglanguage}} and - not test {\iffieldsequal{origlanguage}{bookoriglanguage}} + not test {\blx@gost@iflangsequal{origlanguage}{bookoriglanguage}} ) } {\usebibmacro{bytranslator+othersstrg}% @@ -1474,14 +1548,8 @@ % temporarily redefining commands used in the bibstring \savecommand\lbx@lfromlang% \savecommand\lbx@sfromlang% - \renewcommand*{\lbx@lfromlang}{% - \iffielddundef{bookoriglanguage} - {\unspace} - {\biblstring{from\thefield{bookoriglanguage}}}} - \renewcommand*{\lbx@sfromlang}{% - \iffieldundef{bookoriglanguage} - {\unspace} - {\bibsstring{from\thefield{bookoriglanguage}}}} + \renewcommand*{\lbx@lfromlang}{\lbx@gost@lfromlang{bookoriglanguage}}% + \renewcommand*{\lbx@sfromlang}{\lbx@gost@sfromlang{bookoriglanguage}}% \bibstring{\abx@tempa}% \restorecommand\lbx@lfromlang% \restorecommand\lbx@sfromlang% @@ -1553,6 +1621,8 @@ \mkbibdatelong{}{endmonth}{endday}}}% } +% processing volumes, books, parts, issues in the specified order + \def\blx@gost@volsinorder#1#2{% \ifstrequal{#1}{v} {\printfield{volume}% @@ -1844,6 +1914,8 @@ \setunit*{\addsemicolondelim}% \printfield{note}} +% do I need this? + \gdef\ifmulticitation{% \ifnum\c@multicitetotal>0 \expandafter\@firstoftwo @@ -1873,150 +1945,23 @@ \newbibmacro*{heading}{% \printfield{heading}} -% Related - -\newbibmacro{rel:common}{% - \usebibmacro{author}% - \setunit*{\labelnamepunct}% - \ifboolexpr{ - test {\ifentrytype{book}} - or - test {\ifentrytype{collection}} - or - test {\ifentrytype{proceedings}} - } - {\usebibmacro{maintitle+volumes+parts+title}% - \ifentrytype{proceedings} - {\newunit - \usebibmacro{event+venue+date}} - {}} - {\usebibmacro{title}}% - \ifentrytype{article} - {\usebibmacro{//}% - \usebibmacro{journal}} - {}% - \ifboolexpr{ - test {\ifentrytype{inbook}} - or - test {\ifentrytype{incollection}} - or - test {\ifentrytype{inproceedings}} - } - {\usebibmacro{//}% - \usebibmacro{maintitle+volumes+parts+booktitle}% - \ifentrytype{proceedings} - {\newunit - \usebibmacro{event+venue+date}} - {}} - {}% - \ifboolexpr{ - test {\ifentrytype{article}} - or - test {\ifentrytype{periodical}} - } - {\printlist{location}% - \setunit*{\addcomma\space}% - \usebibmacro{jour:date}% - \newunit\newblock - \usebibmacro{jour:volume+parts+issuetitle}% - \ifentrytype{article} - {\newunit\newblock - \printfield{pages}} - {}} - {\ifboolexpr{ - test {\ifentrytype{booklet}} - or - test {\ifentrytype{unpublished}} - } - {\newunit\newblock - \usebibmacro{location+date}% - \newunit\newblock} - {\newunit\newblock - \printlist{organization}% - \newunit - \usebibmacro{publisher+location+date}}% - \newunit\newblock - \usebibmacro{chapter+pages}}} - -\renewbibmacro*{related:default}[1]{% - \entrydata*{#1}{% - \usebibmacro{rel:common}% - \newunit\newblock}} - -\renewbibmacro*{related:bytranslator}[1]{% - \entrydata{#1}{% - \printnames[bytranslator]{translator}% - \clearname{translatror}% - \setunit*{\addcolon\space}% - \usebibmacro{rel:common}% - \newunit\newblock}} - -\renewbibmacro*{related:multivolume}[1]{% - \entrydata*{#1}{% - \usebibmacro{volume+parts}{\newunit}% - \setunit{\addcolondelim}% - \ifboolexpr{ - test {\ifnamesequal{author}{savedauthor}} - or - test {\ifnameundef{author}} - } - {} - {\usebibmacro{author}% - \setunit*{\labelnamepunct}}% - \usebibmacro{title}% - \setunit{\respdelim}% - \iflistsequal{credits}{savedcredits} - {} - {\usebibmacro{credits}}% - \setunit*{\resppunct}% - \ifnamesequal{editor}{savededitor} - {} - {\usebibmacro{byeditor}}% - \setunit*{\resppunct}% - \ifnamesequal{translator}{savedtranslator} - {} - {\usebibmacro{bytranslator+others}}% - \newunit\newblock - \usebibmacro{date}% - \newunit\newblock - \printfield{pagetotal}% - \usebibmacro{finentry}}} - -\renewbibmacro*{related:origpubin}[1]{% - \entrydata*{#1}{% - \printfield{year}% - \ifboolexpr{ - test {\iflistsequal{publisher}{savedpublisher}} - or - test {\iflistundef{publisher}} - } - {} - {\setunit{\addspace\bibstring{bypublisher}\space}% - \printlist{publisher}% - \setunit{\addcomma\space}% - \iflistsequal{location}{savedlocation} - {} - {\printlist{location}}}}} +% Related field -\renewbibmacro*{related:origpubas}[1]{% - \entrydata*{#1}{% - \usebibmacro{title}% - \ifboolexpr{ - test {\iflistsequal{publisher}{savedpublisher}} - or - test {\iflistundef{publisher}} - } - {} - {\setunit{\addspace\bibstring{bypublisher}\space}% - \printlist{publisher}% - \setunit{\addcomma\space}% - \iflistsequal{location}{savedlocation} - {} - {\printlist{location}}}}} +\renewcommand*{\relatedpunct}{\setunit{\addspace}} \newcounter{bbx:relatedcount} \newcounter{bbx:relatedtotal} +\newbibmacro*{related:init}{% + \csundef{bbx:relatedloop}} + +\newbibmacro*{begrelated}{} +\newbibmacro*{endrelated}{} + +\def\ifrelatedloop{% + \ifboolexpr{ test {\xifinlistcs{\strfield{entrykey}}{bbx:relatedloop}} + or test {\xifinlistcs{\strfield{clonesourcekey}}{bbx:relatedloop}} }} + \newbibmacro*{related}{% \restorelist{credits}{\savedclearedcredits}% \restorename{editor}{\savedclearededitor}% @@ -2027,21 +1972,35 @@ \ifboolexpr{ ( test {\ifcitation} and - not test {\iftoggle{bbx:related:cite}} + not togl {bbx:related:cite} ) or ( not test {\ifcitation} and - not test {\iftoggle{bbx:related:bib}} + not togl {bbx:related:bib} ) or test {\iffieldundef{related}} + or + test {\ifrelatedloop} } {} - {\setcounter{bbx:relatedcount}{0}% + {\def\bbx@tempa{}% \setcounter{bbx:relatedtotal}{0}% - \def\do##1{\stepcounter{bbx:relatedtotal}}% + \def\do##1{% + \entrydata{##1}{% + \ifrelatedloop + {} + {\stepcounter{bbx:relatedtotal}% + \gappto{\bbx@tempa}{##1,}}}}% \docsvfield{related}% + \restorefield{related}{\bbx@tempa}% + \ifnumgreater{\value{bbx:relatedtotal}}{0} + {\listcsxadd{bbx:relatedloop}{\strfield{entrykey}}% + \iffieldundef{clonesourcekey} + {} + {\listcsxadd{bbx:relatedloop}{\strfield{clonesourcekey}}}% + \setcounter{bbx:relatedcount}{0}% \def\do{% \stepcounter{bbx:relatedcount}% \ifnumgreater{\value{bbx:relatedcount}}{1} @@ -2054,23 +2013,29 @@ {\def\bbx@tempa{related}} {\def\bbx@tempa{related:\strfield{relatedtype}}}% \iffieldformatundef{relatedstring:\strfield{relatedtype}} - {\def\bbx@tempb{relatedstring}} + {\def\bbx@tempb{relatedstring:default}} {\def\bbx@tempb{relatedstring:\strfield{relatedtype}}}% \printtext[\bbx@tempa]{% + \usebibmacro{begrelated}% \iffieldundef{relatedstring} {\ifboolexpr{ test {\ifnumgreater{\value{bbx:relatedtotal}}{1}} and test {\ifbibxstring{\thefield{relatedtype}s}} } - {\printtext[\bbx@tempb]{\bibstring{\thefield{relatedtype}s}}} + {\printtext[\bbx@tempb]{% + \bibstring[\mkrelatedstring]{\thefield{relatedtype}s}}} {\iffieldbibstring{relatedtype} - {\printtext[\bbx@tempb]{\bibstring{\thefield{relatedtype}}}} + {\printtext[\bbx@tempb]{% + \bibstring[\mkrelatedstring]{\thefield{relatedtype}}}} {}}} {\iffieldbibstring{relatedstring} - {\printtext[\bbx@tempb]{\bibstring{\thefield{relatedstring}}}} + {\printtext[\bbx@tempb]{% + \bibstring[\mkrelatedstring]{\thefield{relatedstring}}}} {\printfield[\bbx@tempb]{relatedstring}}}% - \docsvfield{related}}}} + \docsvfield{related}% + \usebibmacro{endrelated}}}% + {}}} \newbibmacro*{setup:min}{% \renewbibmacro*{series+number}{}% @@ -2109,4 +2074,22 @@ \DeclareAutoCiteCommand{footnote}{\smartcite}{\smartcites} \DeclareAutoCiteCommand{superscript}{\supercite}{\supercites} +% changing the language of citations + +\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}} + \endinput |