%% Released under the LaTeX Project Public License v1.3c or later
%% See http://www.latex-project.org/lppl.txt
%% --------------------------------------------------------------
%% Based on the gost package styles by
%% Maksym Polyakov      © 1996-2005, 
%% Leonid Sinev         © 2017,
%% Igor A. Kotelnikov   © 2012-2021.
%% --------------------------------------------------------------
%% Alexey V. Kuznetsov: mailtokuznetsov@gmail.com
%% Concise citation style
%% Version 1
%% --------------------------------------------------------------

ENTRY{
  address         % alias for location
  archivePrefix   % alias for eprinttype
  author
  booktitle
  chapter
  compiler
  date
  doi
  edition
  editor
  eid
  eprint
  eprinttype      % alias for archivePrefix
  eprintclass     % alias for primaryClass
  howpublished
  institution     % alias for organization and school
  ipc
  isbn
  issn
  journal
  key
  language        % alias for langid
  langid          % alias for language
  location        % alias for address
  media
  note
  number
  organization    % alias for institution and school
  origlanguage
  pages
  primaryClass    % alias for eprintclass
  prioritycountry
  publisher
  school          % alias for institution and organization
  series
  title
  translator
  type
  url
  urldate
  volume
  year
  }{}{label}

INTEGERS{
  output.state
  before.all
  mid.sentence
  after.sentence
  after.block
  after.dblslash
  after.slash
  after.colon
  after.semicolon }

STRINGS{curlanguage}
STRINGS{s t}
STRINGS{y m d}

FUNCTION{init.state.consts}{
  #0 'before.all :=
  #1 'mid.sentence :=
  #2 'after.sentence :=
  #3 'after.block :=
  #4 'after.dblslash :=
  #5 'after.slash :=
  #6 'after.colon :=
  #7 'after.semicolon := }

FUNCTION {set.language}{
  langid empty$
    {language empty$ {"english" 'curlanguage :=} {language  'curlanguage :=} if$}
    {langid  'curlanguage :=}
  if$}

FUNCTION{output.nonnull}{
  swap$
  output.state mid.sentence    = {", " * write$}
 {output.state after.block     = {add.period$ write$ "~\BibDash " write$ newline$ "\newblock " write$}
 {output.state before.all      = 'write$
 {output.state after.dblslash  = {"~/\!/ " * write$}
 {output.state after.slash     = {"~/ " * write$}
 {output.state after.colon     = {"~: " * write$}
 {output.state after.semicolon = {"~; " * write$} {add.period$ " " * write$}
  if$}if$}if$}if$}if$}if$
  mid.sentence 'output.state := }
  if$}

FUNCTION{output}{duplicate$ empty$ 'pop$ 'output.nonnull if$}

FUNCTION{output.check}{
  't :=
  duplicate$ empty$
    { pop$ "empty " t * " in " * cite$ * warning$ }
    'output.nonnull
  if$}

FUNCTION{fin.entry}{add.period$ "\endgroup" * write$ newline$}
FUNCTION{add.blank}    {" " * before.all 'output.state :=}
FUNCTION{new.block}    {output.state before.all  = 'skip$ {after.block     'output.state :=} if$}
FUNCTION{new.dblslash} {output.state before.all  = 'skip$ {after.dblslash  'output.state :=} if$}
FUNCTION{new.slash}    {output.state before.all  = 'skip$ {after.slash     'output.state :=} if$}
FUNCTION{new.colon}    {output.state before.all  = 'skip$ {after.colon     'output.state :=} if$}
FUNCTION{new.semicolon}{output.state before.all  = 'skip$ {after.semicolon 'output.state :=} if$}
FUNCTION {new.sentence}{output.state after.block = 'skip$
  {output.state before.all = 'skip$ {after.sentence 'output.state :=} if$} if$}


FUNCTION{not}{{#0} {#1} if$}
FUNCTION{and}{'skip$ {pop$ #0} if$}
FUNCTION{or} {{pop$ #1} 'skip$ if$}

FUNCTION{bracify}      {duplicate$ empty$ {pop$ ""} {"{" swap$ * "}" *}      if$}
FUNCTION{bracketise}   {duplicate$ empty$ {pop$ ""} {"[" swap$ * "]" *}      if$}
FUNCTION{paranthesify} {duplicate$ empty$ {pop$ ""} {"(" swap$ * ")" *}      if$}
FUNCTION{emphasize}    {duplicate$ empty$ 'skip$ {"\emph{" swap$ * "}" *} if$}

FUNCTION{thinspace.connect}{"\," swap$ * *}

FUNCTION{n.dashify}{
  't := ""
  {t empty$ not}
    {t #1 #1 substring$ "-" =
       {t #1 #2 substring$ "--" = not
          {"--" * t #2 global.max$ substring$ 't :=}
          {{t #1 #1 substring$ "-" =}
              {"-" * t #2 global.max$ substring$ 't :=}
           while$}
        if$}
       {t #1 #1 substring$ * t #2 global.max$ substring$ 't :=}
     if$}
  while$}

INTEGERS{multiresult nameptr namesleft numnames}

FUNCTION{bbl.and}{
  curlanguage "english"   = {" and "}
 {curlanguage "german"    = {" und "}
 {curlanguage "ukrainian" = {"~i "}
 {curlanguage "russian"   = {author empty$ {"~и "} {s author = not {"~и "} {", "} if$} if$}
 {"language is not defined: " curlanguage  " in bbl.and" * * warning$ " and "}
 if$}if$}if$}if$}

FUNCTION{format.names}{
  's :=
  #1 'nameptr :=
  s num.names$ 'namesleft :=
  {namesleft #0 >}
     {s nameptr "{vv~}{ll}{~jj}{~ff}"
      format.name$ 't :=
      nameptr #1 > not 't {namesleft #1 > {", " * t *} {bbl.and t * *} if$} if$
      nameptr #1 + 'nameptr :=
      namesleft #1 - 'namesleft :=}
  while$}

FUNCTION{format.authors}{author empty$ {""} {author format.names  emphasize} if$}

FUNCTION{output.bibitem}{
  set.language
  newline$ "\bibitem" write$
  cite$ bracify write$
  newline$ "\begingroup\selectlanguageifdefined" curlanguage bracify * write$
  newline$ ""
  before.all 'output.state :=}

FUNCTION{format.date}{
  year empty$ not 'year
    {date empty$ {""}
       {date text.length$ #4 < 
         {"wrong format of date in " cite$ * ": date=" * date * warning$ ""}
         {curlanguage "russian" = 
            {date date text.length$ #3 - date text.length$ substring$}
            {date #1 #4 substring$}
  if$}if$}if$}if$}
  
FUNCTION{volume.number}{
  volume empty$ 
   {number empty$ {""} {"\textbf{" number "}" * *} if$}  
   {"\textbf{"  volume "}" * *
    number empty$ 'skip$ {number paranthesify *} if$}
  if$}

FUNCTION{bbl.chapter}{
  curlanguage "english" = {"ch."}
 {curlanguage "german"  = {"kap."}
 {curlanguage "russian" = curlanguage "ukrainian" = or {"гл."}
 {"language is not defined: " curlanguage " in bbl.chapter" * * warning$ "ch."}
 if$}if$}if$}

FUNCTION{chapter.type}{
  chapter empty$ {""}
    {type empty$ 'bbl.chapter 'type if$ chapter thinspace.connect}
  if$}

FUNCTION{bbl.pages}{
  curlanguage "english" = {"p."} 
 {curlanguage "german"  = {"s."}
 {curlanguage "russian" = curlanguage "ukrainian" = or {"с."}
 {"language is not defined: " curlanguage " in bbl.pages" * * warning$ "p."}
 if$}if$}if$}

FUNCTION{multi.page.check}{
  't :=
  #0 'multiresult :=
  {multiresult not t empty$ not and}
     {t #1 #1 substring$
      duplicate$ "-" = swap$ duplicate$ "," = swap$ "+" = or or
        {#1 'multiresult :=} {t #2 global.max$ substring$ 't :=} if$}
  while$
  multiresult}

FUNCTION{format.pages}{
  pages empty$
    {type$ "inbook" = type$ "incollection" = or 'chapter.type {""} if$}
    {pages multi.page.check {pages n.dashify} 'pages if$
     type$ "article" = 'skip$ {bbl.pages swap$  thinspace.connect}
  if$}if$}

FUNCTION{format.eid.pages}{
  eid empty$ not 'eid {pages empty$ {""} 'format.pages if$} if$}

INTEGERS{link.exists}
  
FUNCTION{open.link}{
  #0 'link.exists :=
  doi  empty$ not {#1 'link.exists := "\href{https://doi.org/" doi "}{" * *}
 {url  empty$ not {#1 'link.exists := "\href{" url "}{" * *}
 {type$ "book" = type$ "inbook" = type$ "incollection" = type$ "booklet" =
  type$ "proceedings" = type$ "inproceedings" = or or or or or isbn empty$ not and
    {#1 'link.exists := "\href{https://isbnsearch.org/isbn/" isbn "}{" * *}
 {type$ "article" = type$ "proceedings" = type$ "inproceedings" = or or issn empty$ not and
    {#1 'link.exists := "\href{https://portal.issn.org/search?search=" issn "}{" * *} {""}
 if$}if$}if$}if$}

FUNCTION{close.link}{link.exists #0 > {"}"} {""} if$}

FUNCTION{author.or.title}{
  author empty$ title empty$ and {""}
    {author empty$ {title emphasize 's :=} {format.authors 's :=} if$
     type$ "article" = {open.link s close.link * *} 's if$}
  if$}

FUNCTION{add.year}{format.date empty$ {""} {add.blank format.date paranthesify} if$}

FUNCTION{check.author}   {author      empty$ {"empty author in "    cite$ * warning$} 'skip$ if$}
FUNCTION{check.title}    {title       empty$ {"empty title in "     cite$ * warning$} 'skip$ if$}
FUNCTION{check.year}     {format.date empty$ {"empty year in "      cite$ * warning$} 'skip$ if$}
FUNCTION{check.publisher}{publisher   empty$ {"empty publisher in " cite$ * warning$} 'skip$ if$}  
FUNCTION{check.booktitle}{booktitle   empty$ {"empty booktitle in " cite$ * warning$} 'skip$ if$}
FUNCTION{check.type}     {type        empty$ {"empty type in "      cite$ * warning$} 'skip$ if$}

FUNCTION{check.journal}{
  journal empty$ {"empty journal in " cite$ * warning$} 'skip$ if$
  check.author check.year} 

FUNCTION{article}{
  output.bibitem   check.journal
  author.or.title  output
  journal          output
  series           output add.blank
  volume.number    output       
  format.eid.pages output
  add.year         output fin.entry}

FUNCTION{org.inst.school}{
  organization empty$ {institution empty$ 'school 'institution if$} 'organization if$}

FUNCTION{bbl.compiler}{
  curlanguage "english"   = {"comp. "}
 {curlanguage "german"    = {"hrsg. "}
 {curlanguage "ukrainian" = {"укл. "}
 {curlanguage "russian"   = {"сост. "}
 {"language is not defined: " curlanguage  " in bbl.compiler" * * warning$  {"comp. "}
 if$}if$}if$}if$}if$}

FUNCTION{bbl.trans}{
  curlanguage "english" = {"transl. "}
 {curlanguage "german"  = {"übersetz. "}
 {curlanguage "ukrainian" = curlanguage "russian" = or {"пер. "}
 {"language is not defined: " curlanguage  " in bbl.trans" * * warning$ {"transl. "}
 if$}if$}if$}if$
 origlanguage empty$ 'skip$ {origlanguage *} if$}

FUNCTION{bbl.edby}{
  curlanguage "english"   = {"ed.~by "}
 {curlanguage "german"    = {"ed.~"}
 {curlanguage "ukrainian" = {"за~ред. "}
 {curlanguage "russian"   = {"под ред. "}
 {"language is not defined: " curlanguage " in bbl.edby" * * warning$ {"ed.~by "}
 if$}if$}if$}if$}if$}

FUNCTION{format.compiler}  {compiler empty$ {""} {bbl.compiler compiler format.names *} if$}
FUNCTION{format.editor}    {editor   empty$ {""} {bbl.edby     editor   format.names *} if$}
FUNCTION{format.translator}{
  translator empty$ 'bbl.trans {bbl.trans " " translator format.names * *} if$}

FUNCTION{comp.trans.edit}{
  author empty$ not type$ "book" = type$ "inbook" = or and {"" 's :=}
    {compiler empty$ {"" 's :=} {format.compiler 's :=} if$
     translator empty$ 'skip$ 
       {s empty$ {format.translator 's :=} {s "~; " format.translator * * 's :=} if$} if$
     editor empty$ 'skip$ 
      {s empty$ {format.editor 's :=} {s "~; " format.editor * * 's :=} if$}
     if$}
  if$ s empty$ {""} {add.blank s paranthesify} if$}

FUNCTION{address.or.location}{
  address empty$ {location empty$ {""} 'location if$} 'address if$}

FUNCTION{address.publisher}{
  publisher empty$ 'address.or.location 
    {address.or.location empty$ 'publisher {address.or.location ": " publisher * *} if$}
  if$}

FUNCTION{bbl.vol}{
  curlanguage "english" = {"v."}
 {curlanguage "german"  = {"bd."} 
 {curlanguage "russian" = curlanguage "ukrainian" = or {"т."}
 {"language is not defined: " curlanguage " in bbl.vol" * * warning$ "v."}
 if$}if$}if$}

FUNCTION {bbl.No}{
  curlanguage "english" = curlanguage "german"    = or {"no."}
 {curlanguage "russian" = curlanguage "ukrainian" = or {"№"}
 {"language is not defined: " curlanguage " in bbl.No" * * warning$ "no."}
 if$}if$}

FUNCTION{bbl.of}{
  curlanguage "english" = {" of "}
 {curlanguage "german"  = {" von "}
 {curlanguage "russian" = curlanguage "ukrainian" = or {", "}
 {"language is not defined: " curlanguage " in bbl.of" * * warning$ " of "}
  if$}if$}if$}

FUNCTION{volume.num.series}{
  volume empty$
    {number empty$ {""}
       {series empty$ not {new.sentence series ", " number * *}
          {"there's a number but no series in " cite$ * warning$ 
            bbl.No number thinspace.connect}
     if$}if$}
    {bbl.vol volume thinspace.connect
      series empty$ 'skip$ {bbl.of series * *} if$
      number empty$ 'skip$ {"can't use both volume and number fields in " * cite$ * warning$}
  if$}if$}

FUNCTION{format.title}{
  title empty$ {""}
    {title 's :=
     media      empty$ 'skip$ {s " " * media bracketise * 's :=} if$
     type$ "online" = type$ "patent" = or {s} {open.link s close.link * *} if$}
  if$}

FUNCTION{author.title}{
  author empty$ 'format.title
    {format.authors title empty$ 'skip$ {add.period$ " " format.title * *} if$}
  if$}

FUNCTION{block.or.blank}{duplicate$ empty$ {output new.block} {output add.blank} if$}

FUNCTION{check.book}{
  author empty$ editor empty$ compiler empty$ translator empty$ and and and
    {"empty author, compiler, editor and translator in " cite$ * warning$} 'skip$ if$
  check.title check.publisher check.year}

FUNCTION{book}{
  output.bibitem    check.book
  author.title      output
  comp.trans.edit   block.or.blank
  address.publisher output  
  format.date       output
  volume.num.series output fin.entry}

FUNCTION{check.inbook}{
  pages empty$ chapter empty$ and not 'skip$
    {"empty pages and chapter in " cite$ * warning$} if$
  check.book}

FUNCTION{inbook}{
  output.bibitem    check.inbook
  author.title      output
  comp.trans.edit   block.or.blank
  address.publisher output  
  format.date       output
  volume.num.series output
  format.pages      output fin.entry}

FUNCTION {bbl.in}{
  curlanguage "english"   = curlanguage "german"  = or {"in "}
 {curlanguage "ukrainian" = curlanguage "russian" = or {"в~кн. "}
 {"language is not defined: " curlanguage " in bbl.in" * * warning$ "in "}
 if$}if$}

FUNCTION{format.booktitle}{
  booktitle empty$ {""}
    {booktitle 's :=
     media      empty$ 'skip$ {s " " * media bracketise * 's :=} if$
     type$ "incollection" = {bbl.in s * 's :=} 'skip$ if$
     open.link s close.link * *}
  if$}

FUNCTION{check.incollection}{
  editor empty$ compiler empty$ translator empty$ and and not 'skip$
    {"empty compiler, editor and translator in " cite$ * warning$} if$
  check.booktitle check.author check.publisher check.year}

FUNCTION{incollection}{
  output.bibitem    check.incollection
  author.or.title   output
  format.booktitle  output
  comp.trans.edit   block.or.blank
  address.publisher output   
  format.date       output
  volume.num.series output
  format.pages      output fin.entry}

FUNCTION{creator}{
  publisher   empty$ not {format.editor 's :=}
 {org.inst.school empty$ {format.editor 's :=}
 {org.inst.school 's :=
  editor empty$ 'skip$ {s ", " format.editor * * 's :=}
  if$}if$}
  if$ s empty$ {""} {add.blank s paranthesify} if$}

FUNCTION{check.proceedings}{check.title check.year} 

FUNCTION{proceedings}{
  output.bibitem    check.proceedings
  format.title      output
  creator           block.or.blank
  address.publisher output         
  format.date       output
  volume.num.series output fin.entry}

FUNCTION{check.inproceedings}{check.proceedings check.booktitle check.author} 

FUNCTION{inproceedings}{
  output.bibitem    check.inproceedings
  author.or.title   output
  format.booktitle  output
  creator           block.or.blank
  address.publisher output   
  format.date       output
  volume.num.series output
  format.pages      output fin.entry}

FUNCTION{conference}{inproceedings}

FUNCTION{address.howpublished}{
  howpublished empty$ 'address.or.location 
    {address.or.location empty$ 'howpublished {address.or.location ": " howpublished * *} if$}
  if$}

FUNCTION{booklet.creator}{author empty$ 'creator {""} if$}

FUNCTION{booklet}{
  output.bibitem       check.title
  author.title         output
  booklet.creator      block.or.blank
  address.howpublished output
  format.date          output fin.entry}

FUNCTION{org.address.year}{
  org.inst.school empty$ 
    {format.date empty$ {"" 's :=} {format.date 's :=} if$}
    {org.inst.school 's :=
     address.or.location empty$ 'skip$ {s ", " address.or.location * * 's :=} if$
     format.date empty$ 'skip$ {s ", " format.date * * 's :=} if$}
  if$ s empty$ {""} {add.blank s paranthesify} if$}

FUNCTION{manual}{
  output.bibitem check.title
  author.title     output
  edition          output
  org.address.year output fin.entry}

FUNCTION{eprintclass.or.primaryClass}{
  eprintclass empty$ {primaryClass empty$ {""} 'primaryClass if$} 'eprintclass if$}

FUNCTION{eprinttype.or.archivePrefix}{
  eprinttype empty$ {archivePrefix empty$ {""} 'archivePrefix if$} 'eprinttype if$}

FUNCTION{format.eprint}{
  eprint empty$ {""}
    {eprint 's :=
     eprintclass.or.primaryClass empty$ 'skip$ {eprintclass.or.primaryClass "\,/ " s * * 's :=} if$
     eprinttype.or.archivePrefix  empty$ 'skip$  {eprinttype  "\,: " s * * 's :=} if$
     eprinttype.or.archivePrefix "arXiv" = eprinttype.or.archivePrefix "arxiv" = or 
       {"\href{https://arxiv.org/abs/" eprint "}{" s "}" * * * *}
    {doi empty$ not {"\href{https://doi.org/" doi "}{" s "}" * * * *}
    {url empty$ 's  {"\href{" url "}{" s "}" * * * *}
  if$}if$}if$}if$}

FUNCTION{eprint.or.howpublished}{eprint empty$ 'howpublished 'format.eprint if$}

FUNCTION{check.misc}{
  author        empty$ title empty$ date empty$ and and 
  howpublished  empty$ year  empty$ note empty$ and and and
    {"all relevant fields are empty in " cite$ * warning$} 'skip$
  if$}

FUNCTION{misc}{
  output.bibitem         check.misc
  author.title           output
  add.year               block.or.blank
  eprint.or.howpublished output new.sentence
  note                   output fin.entry}

FUNCTION{check.unpublished}{
  note empty$ {"empty note in " cite$ * warning$} 'skip$ if$
  check.author} 

FUNCTION{unpublished}{
  output.bibitem check.unpublished
  author.title   output
  format.date    output new.sentence
  note           output fin.entry}

FUNCTION{bbl.urldate}{
  curlanguage "english"   = {"online; accessed "}
 {curlanguage "german"    = {"online; abgerufen "}
 {curlanguage "ukrainian" = {"дата звернення: "}
 {curlanguage "russian"   = {"дата обращения: "}
 {"language is not defined: " curlanguage " in bbl.urldate" * * warning$ "online; accessed "}
 if$}if$}if$}if$}

FUNCTION{doi.url}{
  doi empty$
    {url empty$ {""}
       {urldate empty$
          {"URL: \url{" url "}" * *}
          {"URL: \url{" url "} (" bbl.urldate urldate ")" * * * * *}
     if$}if$}
    {"DOI: \href{https://doi.org/" doi "}{" doi "}" * * * *}
  if$}

FUNCTION{doi.url.eprint}{
  doi empty$ url empty$ eprint empty$ and and {""}
    {doi empty$ url empty$ and 'format.eprint 'doi.url if$}
  if$}

FUNCTION{check.online}{
  doi empty$ url empty$ eprint empty$ and and not 'skip$ 
    {"empty doi, url and eprint in " cite$ * warning$}
  if$}

FUNCTION{online}{
  output.bibitem check.online
  author.title   output new.block
  doi.url.eprint output fin.entry}

FUNCTION{internet}  {online}
FUNCTION{www}       {online}
FUNCTION{webpage}   {online}
FUNCTION{electronic}{online}

FUNCTION{format.patent}{
  type            empty$  {"" 's :=}  {type 's :=} if$
  number          empty$ 'skip$ {s " " number * * 's :=} if$
  prioritycountry empty$ 'skip$ {s " " prioritycountry * * 's :=} if$
  open.link s close.link * *}

FUNCTION{check.patent}{
  number          empty$ {"empty number in "           cite$ * warning$} 'skip$ if$
  prioritycountry empty$ {"empty priority country in " cite$ * warning$} 'skip$ if$
  check.type}

FUNCTION{patent}{
  output.bibitem check.patent
  format.patent  output
  ipc            output new.sentence
  format.title   output fin.entry}

FUNCTION{bbl.techreport}{
  curlanguage "english"   = {"Rep. "}
 {curlanguage "german"    = {"Bericht "}
 {curlanguage "ukrainian" = {"Звіт "}
 {curlanguage "russian"   = {"Отчет "}
 {"language is not defined: " curlanguage " in bbl.techreport" * * warning$ "Rep. "}
 if$}if$}if$}if$}

FUNCTION{techreport.type}{type empty$ 'bbl.techreport 'type if$}

FUNCTION{check.report}{
  org.inst.school empty$ {"empty institution in " cite$ * warning$} 'skip$ if$
  check.type check.title check.year}

FUNCTION{report}{
  output.bibitem check.report
  format.title     output new.sentence
  techreport.type  output add.blank
  number           output
  org.address.year output fin.entry}

FUNCTION{techreport}{report}

FUNCTION{check.thesis}{
  school empty$ publisher empty$ and
    {"empty school and publisher in " cite$ * warning$} 'skip$ if$
  check.author check.title check.type check.year}

FUNCTION{thesis}{
  output.bibitem   check.thesis
  format.authors   output new.sentence
  format.title     output new.colon
  type             output
  org.address.year output fin.entry}

FUNCTION{mastersthesis}{thesis}
FUNCTION{phdthesis}    {thesis}
FUNCTION{docthesis}    {thesis}

FUNCTION{default.type}{misc}

READ

STRINGS{longest.label}
INTEGERS{number.label longest.label.width}
FUNCTION{initialize.longest.label}{
  "" 'longest.label :=
  #1 'number.label :=
  #0 'longest.label.width :=}

EXECUTE{initialize.longest.label}

FUNCTION{forward.pass}{
  number.label int.to.str$ 'label :=
  number.label #1 + 'number.label :=
  label width$ longest.label.width >
    {label 'longest.label :=
     label width$ 'longest.label.width :=}
    'skip$
  if$}

ITERATE{forward.pass}

FUNCTION{begin.bib}{
  "\begin{thebibliography}{"  longest.label  * "}" *            write$ newline$
  "\providecommand*{\href}[2]{{\small #2}}"                     write$ newline$
  "\providecommand*{\url}[1]{{\small #1}}"                      write$ newline$
  "\let\newblock\ignorespaces"                                  write$ newline$
  "\def\selectlanguageifdefined#1{%"                            write$ newline$
  "\expandafter\ifx\csname date#1\endcsname\relax"              write$ newline$
  "\else\selectlanguage{#1}\fi}"                                write$ newline$
  "\ProvideTextCommandDefault{\cyrdash}{%"                      write$ newline$
  "\iflanguage{russian}{\hbox to.8em{--\hss--}}{\textemdash}}"  write$ newline$
  "\providecommand*{\BibDash}{%"                                write$ newline$
  "\ifdim\lastskip>0pt\unskip\nobreak\hskip.2em plus 0.1em\fi%" write$ newline$
  "\cyrdash\hskip.2em plus 0.1em\ignorespaces}"                 write$ newline$
  preamble$ empty$ 'skip$ {preamble$ write$ newline$}  if$ }

FUNCTION{end.bib}{newline$ "\end{thebibliography}" write$ newline$}

EXECUTE{begin.bib}
EXECUTE{init.state.consts}
ITERATE{call.type$}
EXECUTE{end.bib}

%% End of file `book2-ru.bst'.
